summaryrefslogtreecommitdiff
path: root/storage/mroonga/vendor
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-11-18 22:27:03 +0100
committerSergei Golubchik <sergii@pisem.net>2014-11-18 22:27:03 +0100
commit95a8587b6eb6bdb4257c44ca348a63a20918ed86 (patch)
treecc0c685e25b3a33f76a2e107fa2e572f186436d2 /storage/mroonga/vendor
parent4ec0799fe5f9f696e79d238f9013d0fcc5093ee3 (diff)
downloadmariadb-git-95a8587b6eb6bdb4257c44ca348a63a20918ed86.tar.gz
mroonga/groonga: remove unused packaging data and bundled software
Diffstat (limited to 'storage/mroonga/vendor')
-rw-r--r--storage/mroonga/vendor/groonga/data/CMakeLists.txt20
-rw-r--r--storage/mroonga/vendor/groonga/data/Makefile.am20
-rw-r--r--storage/mroonga/vendor/groonga/data/account/conoha.gpg.koubin671 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/account/twitter.gpg.hayashibin657 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/account/twitter.gpg.koubin657 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/account/twitter.gpg.yukibin662 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/groonga-httpd.conf.in57
-rw-r--r--storage/mroonga/vendor/groonga/data/groonga.conf11
-rw-r--r--storage/mroonga/vendor/groonga/data/html/CMakeLists.txt18
-rw-r--r--storage/mroonga/vendor/groonga/data/html/Makefile.am9
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/groonga-admin.css120
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.pngbin180 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_55_fbec88_40x100.pngbin182 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.pngbin124 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.pngbin123 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.pngbin119 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.pngbin4033 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.pngbin104 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.pngbin88 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_217bc0_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_2e83ff_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_469bdd_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_6da8d5_256x240.pngbin5355 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_cd0a0a_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_d8e7f3_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_f9bd01_256x240.pngbin5355 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/css/redmond/jquery-ui-1.8.18.custom.css565
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/favicon.icobin1406 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/favicon.pngbin682 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/favicon.svg121
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/images/groonga.pngbin6064 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/images/groonga.svg121
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/images/loading.gifbin673 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/index.html297
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/index.ja.html301
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.ja.js1372
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.js1372
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/js/jquery-1.7.2.min.js4
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/js/jquery-ui-1.8.18.custom.min.js356
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot-0.7.min.js6
-rw-r--r--storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot.license.txt22
-rw-r--r--storage/mroonga/vendor/groonga/data/html/files.am34
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/html/update-files.sh17
-rw-r--r--storage/mroonga/vendor/groonga/data/images/Makefile.am2
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/Makefile.am22
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/files.am53
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.pngbin2266 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.svg118
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.pngbin6841 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.svg97
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.pngbin2281 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.svg93
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.pngbin7393 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.svg108
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.pngbin7311 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.svg118
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.pngbin4752 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.svg170
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.pngbin4680 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.svg186
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.pngbin3245 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.svg183
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.pngbin5900 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.svg179
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.pngbin3038 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.svg201
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.pngbin2119 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.svg106
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.pngbin6682 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.svg97
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.pngbin2090 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.svg93
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.pngbin2692 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.svg122
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.ai243
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.pngbin6494 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.svg106
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.pngbin2357 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.svg106
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.pngbin6741 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.svg107
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.pngbin2350 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.svg93
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.pngbin2974 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.svg122
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.pngbin6732 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.svg117
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.pngbin2306 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.svg106
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.pngbin6162 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.svg107
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.pngbin2306 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.svg93
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.pngbin3008 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.svg122
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.pngbin6291 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.svg117
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/images/logo/update-files.sh17
-rw-r--r--storage/mroonga/vendor/groonga/data/munin/Makefile.am12
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/munin/groonga_cpu_load_100
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/munin/groonga_cpu_time_122
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/munin/groonga_disk_246
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/munin/groonga_memory_104
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/munin/groonga_n_records_256
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/munin/groonga_query_performance_198
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/munin/groonga_status_176
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/munin/groonga_throughput_176
-rw-r--r--storage/mroonga/vendor/groonga/data/scripts/Makefile.am1
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/scripts/groonga-httpd-restart.in106
-rw-r--r--storage/mroonga/vendor/groonga/data/synonyms.tsv5
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/Makefile.am1
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/Makefile.am13
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service15
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-gqtp.service13
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-http.service13
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/Makefile.am8
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp8
-rw-r--r--storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http8
-rwxr-xr-xstorage/mroonga/vendor/groonga/data/travis/setup.sh55
-rw-r--r--storage/mroonga/vendor/groonga/examples/Makefile.am1
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/Makefile.am34
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/edict/Makefile.am4
-rwxr-xr-xstorage/mroonga/vendor/groonga/examples/dictionary/edict/edict-import.sh21
-rwxr-xr-xstorage/mroonga/vendor/groonga/examples/dictionary/edict/edict2grn.rb56
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/eijiro/Makefile.am4
-rwxr-xr-xstorage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro-import.sh12
-rwxr-xr-xstorage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro2grn.rb61
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/gene95/Makefile.am4
-rwxr-xr-xstorage/mroonga/vendor/groonga/examples/dictionary/gene95/gene-import.sh26
-rwxr-xr-xstorage/mroonga/vendor/groonga/examples/dictionary/gene95/gene2grn.rb46
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/dictionary.css3
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.pngbin180 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.pngbin178 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.pngbin120 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.pngbin105 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_dadada_1x400.pngbin111 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.pngbin110 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.pngbin119 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.pngbin101 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_222222_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_2e83ff_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_454545_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_888888_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_cd0a0a_256x240.pngbin4369 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/jquery-ui-1.8.12.custom.css578
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/index.html28
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/js/dictionary.js82
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.min.js4
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.min.js356
-rwxr-xr-xstorage/mroonga/vendor/groonga/examples/dictionary/init-db.sh10
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/jmdict/Makefile.am3
-rwxr-xr-xstorage/mroonga/vendor/groonga/examples/dictionary/jmdict/jmdict.rb42
-rw-r--r--storage/mroonga/vendor/groonga/examples/dictionary/readme.txt71
-rw-r--r--storage/mroonga/vendor/groonga/packages/Makefile.am7
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/Makefile.am98
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/Vagrantfile33
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/apt/build-deb.sh51
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/debian/changelog11
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/debian/compat1
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/debian/control18
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/debian/copyright34
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.install1
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postinst22
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postrm.in26
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/apt/debian/rules17
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/debian/source/format1
-rw-r--r--storage/mroonga/vendor/groonga/packages/apt/env.sh.in13
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/apt/sign-packages.sh42
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/apt/sign-repository.sh46
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/apt/update-repository.sh130
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/check-utility.sh538
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/changelog424
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/compat1
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/control210
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/copyright141
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-bin.install6
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-doc.install1
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-doc.links4
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-examples.install1
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default5
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.dirs3
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init162
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.install3
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.logrotate17
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postinst26
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postrm12
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.conf24
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.install2
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.links8
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postinst27
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postrm9
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-plugin-suggest.install2
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postinst42
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postrm13
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.default15
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.dirs2
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.init235
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.logrotate17
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.default16
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.dirs2
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/groonga-server-http.init250
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.logrotate17
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/groonga-tokenizer-mecab.install1
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/libgroonga-dev.install3
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install5
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-1.7.2.js9404
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-ui-1.8.18.custom.js11802
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.flot-0.7.js2599
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.js9472
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/missing-sources/underscore.js999
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/patches/series0
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/debian/rules31
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/source/format1
-rw-r--r--storage/mroonga/vendor/groonga/packages/debian/watch3
-rw-r--r--storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.hayashibin1458 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.koubin1457 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.yoshiharabin1457 -> 0 bytes
-rw-r--r--storage/mroonga/vendor/groonga/packages/rpm/Makefile.am1
-rw-r--r--storage/mroonga/vendor/groonga/packages/rpm/centos/Makefile.am2
-rw-r--r--storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in578
-rw-r--r--storage/mroonga/vendor/groonga/packages/rpm/fedora/Makefile.am3
-rw-r--r--storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in646
-rw-r--r--storage/mroonga/vendor/groonga/packages/source/Makefile.am25
-rw-r--r--storage/mroonga/vendor/groonga/packages/ubuntu/Makefile.am24
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/ubuntu/upload.rb135
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/Makefile.am130
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/Rakefile270
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/create-setup.bat2
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/language-files/Makefile.am3
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/language-files/english.nsi2
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/language-files/japanese.nsi2
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/patches/Makefile.am3
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-add-missing-dll-export.diff11
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-mingw-w64.diff13
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-not-use-locale-on-mingw.diff15
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-cflags.diff12
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-externc.diff12
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-ltmain-wmain.diff11
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-yieldprocessor-macro.diff11
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/patches/mecab-mingw-unsigned-long-long-int.diff24
-rw-r--r--storage/mroonga/vendor/groonga/packages/windows/setup-x64.nsi.in112
-rw-r--r--storage/mroonga/vendor/groonga/packages/yum/Makefile.am82
-rw-r--r--storage/mroonga/vendor/groonga/packages/yum/Vagrantfile44
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/yum/build-release-rpm.sh99
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/yum/build-rpm.sh129
-rw-r--r--storage/mroonga/vendor/groonga/packages/yum/env.sh.in19
-rw-r--r--storage/mroonga/vendor/groonga/packages/yum/patches/mecab-ipadic-provides-mecab-dic.diff10
-rw-r--r--storage/mroonga/vendor/groonga/packages/yum/patches/mecab-jumandic-provides-mecab-dic.diff10
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh52
-rwxr-xr-xstorage/mroonga/vendor/groonga/packages/yum/update-repository.sh33
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES6822
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES.ru6933
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/LICENSE26
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/README3
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/acc15
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/bcc72
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/ccc46
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/clang104
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/conf218
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/gcc186
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/icc121
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/msvc136
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/name89
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/owc104
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/sunc158
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/define12
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/endianness45
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/feature123
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have12
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have_headers12
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/headers13
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/include61
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/init51
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/conf83
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/geoip/conf94
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/google-perftools/conf61
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/conf43
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/make16
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libgd/conf83
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libxslt/conf156
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/make32
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/conf103
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/make96
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.bcc22
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.msvc22
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.owc11
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/conf78
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/make67
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.bcc18
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.msvc14
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/conf203
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/make64
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.bcc27
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.msvc23
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.owc25
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/conf78
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/make41
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/conf79
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/make96
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.bcc22
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.msvc22
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.owc11
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/test40
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/conf79
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/make135
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.bcc17
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.msvc17
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.owc14
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/make417
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/modules534
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/nohave12
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/options527
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/conf107
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/darwin116
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/freebsd144
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/linux185
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/solaris61
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/win3240
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/sources557
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/stubs8
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/summary116
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/sizeof84
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/typedef77
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/uintptr_t45
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/value12
-rwxr-xr-xstorage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/unix827
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi.conf25
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi_params24
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-utf109
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-win103
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/mime.types89
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/nginx.conf117
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/scgi_params16
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/uwsgi_params16
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/win-utf126
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/README21
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/geo2nginx.pl58
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/koi-utf131
-rwxr-xr-xstorage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/unicode-to-nginx.pl45
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/win-utf130
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/ftdetect/nginx.vim4
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/indent/nginx.vim11
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/syntax/nginx.vim703
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/50x.html21
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/index.html25
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/man/nginx.8202
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_aio_module.c171
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_devpoll_module.c560
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_epoll_module.c832
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_eventport_module.c618
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_kqueue_module.c765
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_poll_module.c427
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_rtsig_module.c735
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_select_module.c433
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_win32_select_module.c398
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.c1315
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.h541
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_accept.c508
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.c286
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.h65
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.c247
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.h77
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_mutex.c70
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.c3455
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.h215
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl_stapling.c1762
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.c1006
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.h94
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.c35
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.h48
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.c128
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.h102
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_access_module.c469
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_addition_filter_module.c251
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_basic_module.c467
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_request_module.c444
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_autoindex_module.c705
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_browser_module.c715
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_charset_filter_module.c1685
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_chunked_filter_module.c243
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_dav_module.c1156
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_degradation_module.c243
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_empty_gif_module.c140
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_fastcgi_module.c3307
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_flv_module.c266
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geo_module.c1644
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geoip_module.c925
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gunzip_filter_module.c681
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_filter_module.c1229
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_static_module.c331
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_headers_filter_module.c663
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_image_filter_module.c1521
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_index_module.c540
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_conn_module.c670
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_req_module.c975
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_log_module.c1786
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_map_module.c567
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_memcached_module.c722
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_mp4_module.c3500
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_not_modified_filter_module.c266
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_proxy_module.c3942
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_random_index_module.c317
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_range_filter_module.c890
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_realip_module.c442
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_referer_module.c671
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_rewrite_module.c1029
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_scgi_module.c1838
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_secure_link_module.c368
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_split_clients_module.c246
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.c2930
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.h114
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.c962
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.h65
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_static_module.c290
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_stub_status_module.c236
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_sub_filter_module.c764
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_hash_module.c631
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_ip_hash_module.c279
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_keepalive_module.c518
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_least_conn_module.c403
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_userid_filter_module.c842
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_uwsgi_module.c2149
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_xslt_filter_module.c1147
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/Makefile.PL33
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.pm138
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.xs1038
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.c1077
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.h67
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/typemap3
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.c2122
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.h186
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.c307
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.h54
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_cache.h169
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_config.h75
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_copy_filter_module.c303
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.c5284
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.h589
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_file_cache.c2019
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_header_filter_module.c633
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse.c2359
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse_time.c277
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_postpone_filter_module.c176
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.c3656
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.h598
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request_body.c1099
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.c1754
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.h257
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.c3647
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.h261
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_filter_module.c1218
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.c408
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.h41
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_special_response.c792
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.c5587
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.h398
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.c696
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.h90
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.c2616
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.h112
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_write_filter_module.c318
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.c567
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.h421
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_auth_http_module.c1461
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_core_module.c653
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_handler.c790
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_handler.c457
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.c253
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.h39
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_parse.c918
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_handler.c500
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.c264
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.h38
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_proxy_module.c1136
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_handler.c857
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.c307
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.h45
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.c568
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.h57
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_cpp_test_module.cpp29
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_google_perftools_module.c126
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read.c109
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read_chain.c78
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write.c109
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write_chain.c100
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.c90
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.h45
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_atomic.h313
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.c253
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.h34
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_daemon.c70
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin.h23
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_config.h95
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_init.c196
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_sendfile_chain.c323
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.c87
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.h78
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_file_aio_read.c208
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.c564
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.h386
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd.h25
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_config.h127
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_init.c260
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.c756
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.h122
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_sendfile_chain.c393
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_amd64.h82
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_ppc.h155
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_sparc64.h82
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_x86.h127
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux.h18
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_aio_read.c137
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_config.h127
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_init.c91
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_sendfile_chain.c331
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_os.h90
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_config.h158
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_init.c130
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.c630
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.h88
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.c1412
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.h61
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_pthread_thread.c278
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_readv_chain.c174
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_recv.c183
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_send.c73
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.c69
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.h23
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.c135
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.h52
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.c126
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.h29
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.c116
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.h64
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris.h16
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_config.h110
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_init.c75
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_sendfilev_chain.c215
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_amd64.il43
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_atomic_sparc64.h61
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_sparc64.il36
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_x86.il44
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_thread.h128
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.c104
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.h66
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_udp_recv.c115
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.c108
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.h24
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_writev_chain.c149
-rw-r--r--storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/rfork_thread.S73
550 files changed, 0 insertions, 197431 deletions
diff --git a/storage/mroonga/vendor/groonga/data/CMakeLists.txt b/storage/mroonga/vendor/groonga/data/CMakeLists.txt
deleted file mode 100644
index 003445a27f5..00000000000
--- a/storage/mroonga/vendor/groonga/data/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright(C) 2012 Brazil
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-add_subdirectory(html)
-
-if(NOT MRN_GROONGA_BUNDLED)
- install(FILES groonga.conf DESTINATION "${GRN_CONFIG_DIR}/")
-endif()
diff --git a/storage/mroonga/vendor/groonga/data/Makefile.am b/storage/mroonga/vendor/groonga/data/Makefile.am
deleted file mode 100644
index 96d1452ba1b..00000000000
--- a/storage/mroonga/vendor/groonga/data/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-SUBDIRS = \
- images \
- html \
- munin \
- init.d \
- logrotate.d \
- systemd \
- scripts
-
-pkgsysconfdir = $(sysconfdir)/$(PACKAGE)
-dist_pkgsysconf_DATA = \
- groonga.conf \
- synonyms.tsv
-
-httpdconfdir = $(pkgsysconfdir)/httpd
-dist_httpdconf_DATA = \
- groonga-httpd.conf
-
-EXTRA_DIST = \
- CMakeLists.txt
diff --git a/storage/mroonga/vendor/groonga/data/account/conoha.gpg.kou b/storage/mroonga/vendor/groonga/data/account/conoha.gpg.kou
deleted file mode 100644
index 15cdec60fe6..00000000000
--- a/storage/mroonga/vendor/groonga/data/account/conoha.gpg.kou
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/account/twitter.gpg.hayashi b/storage/mroonga/vendor/groonga/data/account/twitter.gpg.hayashi
deleted file mode 100644
index 900e7f6a789..00000000000
--- a/storage/mroonga/vendor/groonga/data/account/twitter.gpg.hayashi
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/account/twitter.gpg.kou b/storage/mroonga/vendor/groonga/data/account/twitter.gpg.kou
deleted file mode 100644
index 8d4abde7f82..00000000000
--- a/storage/mroonga/vendor/groonga/data/account/twitter.gpg.kou
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/account/twitter.gpg.yuki b/storage/mroonga/vendor/groonga/data/account/twitter.gpg.yuki
deleted file mode 100644
index af7f1aefa4e..00000000000
--- a/storage/mroonga/vendor/groonga/data/account/twitter.gpg.yuki
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/groonga-httpd.conf.in b/storage/mroonga/vendor/groonga/data/groonga-httpd.conf.in
deleted file mode 100644
index fb3c816be6e..00000000000
--- a/storage/mroonga/vendor/groonga/data/groonga-httpd.conf.in
+++ /dev/null
@@ -1,57 +0,0 @@
-worker_processes 1;
-
-# Match this to the file owner of groonga database files if groonga-httpd is
-# run as root.
-user groonga groonga;
-
-events {
- worker_connections 1024;
-}
-
-http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
-
- # The default groonga database path.
- groonga_database @GROONGA_HTTPD_DEFAULT_DATABASE_PATH@;
-
- # Create a groonga database automatically if the groonga database doesn't
- # exist.
- #
- # Note that this option is danger when worker_processes is greater than 1.
- # Because one or more worker processes may create the same groonga database
- # at the same time. If you can create a groonga database before running
- # groonga-httpd, you should do it.
- groonga_database_auto_create on;
-
- # The default groonga cache limit. The cache limit can be set
- # for each worker. It can't be set for each groonga database.
- # groonga_cache_limit 100;
-
- server {
- listen 10041;
- server_name localhost;
-
- location /d/ {
- groonga on;
- # You can disable log for groonga.
- # groonga_log_path off;
- # You can disable query log for groonga.
- # groonga_query_log_path off;
- # You can custom database path.
- # groonga_database /path/to/groonga/db;
- }
-
- location / {
- root @GROONGA_HTTPD_DOCUMENT_ROOT@;
- index index.html;
- }
-
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/data/groonga.conf b/storage/mroonga/vendor/groonga/data/groonga.conf
deleted file mode 100644
index e4b538dd7ca..00000000000
--- a/storage/mroonga/vendor/groonga/data/groonga.conf
+++ /dev/null
@@ -1,11 +0,0 @@
-# encoding = utf-8
-# log-level = 1
-# address = 0.0.0.0
-# port = 10041
-# server-id = groonga.example.com
-# max-threads = 2
-# admin-html-path = /usr/share/groonga/admin_html
-# protocol = http
-# log-path = /var/log/groonga/groonga.log
-# query-log-path = /var/log/groonga/query.log
-# cache-limit = 100
diff --git a/storage/mroonga/vendor/groonga/data/html/CMakeLists.txt b/storage/mroonga/vendor/groonga/data/html/CMakeLists.txt
deleted file mode 100644
index 1c96d8915ae..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright(C) 2012 Brazil
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-if(NOT MRN_GROONGA_BUNDLED)
- install(DIRECTORY admin DESTINATION "${GRN_DATA_DIR}/html")
-endif()
diff --git a/storage/mroonga/vendor/groonga/data/html/Makefile.am b/storage/mroonga/vendor/groonga/data/html/Makefile.am
deleted file mode 100644
index c6274225d77..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-htmldir = $(pkgdatadir)/html
-
-include files.am
-
-EXTRA_DIST = \
- CMakeLists.txt
-
-update-files:
- cd $(srcdir); ./update-files.sh > files.am
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/groonga-admin.css b/storage/mroonga/vendor/groonga/data/html/admin/css/groonga-admin.css
deleted file mode 100644
index 1b092eb4a96..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/groonga-admin.css
+++ /dev/null
@@ -1,120 +0,0 @@
-body {
- margin: 0;
- padding: 0;
- background: white;
- color: #333;
- font-size:11px;
-}
-
-form {
- margin: 0;
- padding: 0;
-}
-
-img {
- border: none;
-}
-
-a {
- color: #2e6e9e;
- text-decoration: none;
-}
-
-a:hover {
- text-decoration: underline;
-}
-
-input {
- border: 1px solid;
-}
-
-input[type="text"] {
- width: 12em;
-}
-
-#header {
- height: 80px;
- background: url(../images/groonga.png) no-repeat left center;
-}
-
-#locale-list {
- float: right;
- width: 4em;
- list-style: none;
-}
-
-#locale-list li {
- float: left;
- width: 2em;
-}
-
-#side-menu {
- width: 12em;
-}
-
-#side-menu ul {
- padding-left: 1.5em;
-}
-
-#left-column {
- height: 100%;
- vertical-align: top;
-}
-
-#right-column {
- width: 100%;
- height: 100%;
- vertical-align: top;
-}
-
-#database-tabs {
-}
-
-#table-tabs {
- display: none;
-}
-
-table.records {
- border: #333 1px solid;
- border-collapse: collapse;
- border-spacing: 0;
- margin: 0.2em;
-}
-
-table.records th {
- color: white;
- background-color: #5c9ccc;
- border: #333 solid;
- border-width: 0 0 1px 1px;
- text-align: center;
- white-space: nowrap;
- padding: 0.3em;
-}
-
-table.records td {
- background-color: white;
- border: #333 solid;
- border-width: 0 0 1px 1px;
- padding: 0.3em;
-}
-
-span.pager {
- display: inline-block;
- border: #333 1px solid;
- padding: 0.1em;
- margin: 0.1em;
- background-color: white;
-}
-
-span.pager-current {
- display: inline-block;
- border: #333 1px solid;
- padding: 0.1em;
- margin: 0.1em;
- background-color: #333;
-}
-
-span.pager-current a {
- color: white;
- font-weight: bold;
-}
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png
deleted file mode 100644
index 5b5dab2ab7b..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png
deleted file mode 100644
index 47acaadd737..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png
deleted file mode 100644
index 9fb564f8d0a..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png
deleted file mode 100644
index 014951529c3..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png
deleted file mode 100644
index 4443fdc1a15..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png
deleted file mode 100644
index 0cdbda36a55..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png
deleted file mode 100644
index 4f3faf8aa8b..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png
deleted file mode 100644
index 38c38335d09..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_217bc0_256x240.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_217bc0_256x240.png
deleted file mode 100644
index 6f4bd87c041..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_217bc0_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_2e83ff_256x240.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_2e83ff_256x240.png
deleted file mode 100644
index 09d1cdc856c..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_2e83ff_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_469bdd_256x240.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_469bdd_256x240.png
deleted file mode 100644
index bd2cf079add..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_469bdd_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_6da8d5_256x240.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_6da8d5_256x240.png
deleted file mode 100644
index 3d6f567f4d3..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_6da8d5_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_cd0a0a_256x240.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_cd0a0a_256x240.png
deleted file mode 100644
index 2ab019b73ec..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_cd0a0a_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_d8e7f3_256x240.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_d8e7f3_256x240.png
deleted file mode 100644
index ad2dc6f9dbe..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_d8e7f3_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_f9bd01_256x240.png b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_f9bd01_256x240.png
deleted file mode 100644
index c7c53cb1190..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/images/ui-icons_f9bd01_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/jquery-ui-1.8.18.custom.css b/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/jquery-ui-1.8.18.custom.css
deleted file mode 100644
index 8015f1d654d..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/css/redmond/jquery-ui-1.8.18.custom.css
+++ /dev/null
@@ -1,565 +0,0 @@
-/*
- * jQuery UI CSS Framework 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
-.ui-helper-clearfix:after { clear: both; }
-.ui-helper-clearfix { zoom: 1; }
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
-
-
-/*
- * jQuery UI CSS Framework 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- *
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=02_glass.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColorHover=217bc0&bgColorActive=f5f8f9&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=79b7e7&fcActive=e17009&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=fad42e&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
- */
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
-.ui-widget .ui-widget { font-size: 1em; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
-.ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; }
-.ui-widget-content a { color: #222222; }
-.ui-widget-header { border: 1px solid #4297d7; background: #5c9ccc url(images/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
-.ui-widget-header a { color: #ffffff; }
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #c5dbec; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2e6e9e; text-decoration: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #79b7e7; background: #d0e5f5 url(images/ui-bg_glass_75_d0e5f5_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1d5987; }
-.ui-state-hover a, .ui-state-hover a:hover { color: #1d5987; text-decoration: none; }
-.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #79b7e7; background: #f5f8f9 url(images/ui-bg_inset-hard_100_f5f8f9_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #e17009; }
-.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; text-decoration: none; }
-.ui-widget :active { outline: none; }
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fad42e; background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x; color: #363636; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
-.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_469bdd_256x240.png); }
-.ui-widget-content .ui-icon {background-image: url(images/ui-icons_469bdd_256x240.png); }
-.ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); }
-.ui-state-default .ui-icon { background-image: url(images/ui-icons_6da8d5_256x240.png); }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_217bc0_256x240.png); }
-.ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); }
-.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
-
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-off { background-position: -96px -144px; }
-.ui-icon-radio-on { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -khtml-border-top-left-radius: 5px; border-top-left-radius: 5px; }
-.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -khtml-border-top-right-radius: 5px; border-top-right-radius: 5px; }
-.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -khtml-border-bottom-left-radius: 5px; border-bottom-left-radius: 5px; }
-.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; -khtml-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; }
-
-/* Overlays */
-.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
-.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
- * jQuery UI Resizable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Resizable#theming
- */
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
- * jQuery UI Selectable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Selectable#theming
- */
-.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
-/*
- * jQuery UI Accordion 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Accordion#theming
- */
-/* IE/Win - Fix animation bug - #4615 */
-.ui-accordion { width: 100%; }
-.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
-.ui-accordion .ui-accordion-li-fix { display: inline; }
-.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
-.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
-.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
-.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
-.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
-.ui-accordion .ui-accordion-content-active { display: block; }
-/*
- * jQuery UI Autocomplete 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Autocomplete#theming
- */
-.ui-autocomplete { position: absolute; cursor: default; }
-
-/* workarounds */
-* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
-
-/*
- * jQuery UI Menu 1.8.18
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Menu#theming
- */
-.ui-menu {
- list-style:none;
- padding: 2px;
- margin: 0;
- display:block;
- float: left;
-}
-.ui-menu .ui-menu {
- margin-top: -3px;
-}
-.ui-menu .ui-menu-item {
- margin:0;
- padding: 0;
- zoom: 1;
- float: left;
- clear: left;
- width: 100%;
-}
-.ui-menu .ui-menu-item a {
- text-decoration:none;
- display:block;
- padding:.2em .4em;
- line-height:1.5;
- zoom:1;
-}
-.ui-menu .ui-menu-item a.ui-state-hover,
-.ui-menu .ui-menu-item a.ui-state-active {
- font-weight: normal;
- margin: -1px;
-}
-/*
- * jQuery UI Button 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Button#theming
- */
-.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: hidden; *overflow: visible; } /* the overflow property removes extra width in IE */
-.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
-button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
-.ui-button-icons-only { width: 3.4em; }
-button.ui-button-icons-only { width: 3.7em; }
-
-/*button text element */
-.ui-button .ui-button-text { display: block; line-height: 1.4; }
-.ui-button-text-only .ui-button-text { padding: .4em 1em; }
-.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
-.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
-.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
-.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
-/* no icon support for input elements, provide padding by default */
-input.ui-button { padding: .4em 1em; }
-
-/*button icon element(s) */
-.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
-.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
-.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
-.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
-.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
-
-/*button sets*/
-.ui-buttonset { margin-right: 7px; }
-.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
-
-/* workarounds */
-button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
-/*
- * jQuery UI Dialog 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Dialog#theming
- */
-.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
-.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
-.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
-.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
-.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
-.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
-.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
-.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
-.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
-.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
-/*
- * jQuery UI Slider 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Slider#theming
- */
-.ui-slider { position: relative; text-align: left; }
-.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
-.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
-
-.ui-slider-horizontal { height: .8em; }
-.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
-.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
-.ui-slider-horizontal .ui-slider-range-min { left: 0; }
-.ui-slider-horizontal .ui-slider-range-max { right: 0; }
-
-.ui-slider-vertical { width: .8em; height: 100px; }
-.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
-.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
-.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
-.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
- * jQuery UI Tabs 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Tabs#theming
- */
-.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
-.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
-.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
-.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
-.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
-.ui-tabs .ui-tabs-hide { display: none !important; }
-/*
- * jQuery UI Datepicker 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Datepicker#theming
- */
-.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
-.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
-.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
-.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
-.ui-datepicker .ui-datepicker-prev { left:2px; }
-.ui-datepicker .ui-datepicker-next { right:2px; }
-.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
-.ui-datepicker .ui-datepicker-next-hover { right:1px; }
-.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
-.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
-.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
-.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
-.ui-datepicker select.ui-datepicker-month,
-.ui-datepicker select.ui-datepicker-year { width: 49%;}
-.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
-.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
-.ui-datepicker td { border: 0; padding: 1px; }
-.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
-.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
-.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi { width:auto; }
-.ui-datepicker-multi .ui-datepicker-group { float:left; }
-.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
-.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
-.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
-.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
-.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
-
-/* RTL support */
-.ui-datepicker-rtl { direction: rtl; }
-.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-
-/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
-.ui-datepicker-cover {
- display: none; /*sorry for IE5*/
- display/**/: block; /*sorry for IE5*/
- position: absolute; /*must have*/
- z-index: -1; /*must have*/
- filter: mask(); /*must have*/
- top: -4px; /*must have*/
- left: -4px; /*must have*/
- width: 200px; /*must have*/
- height: 200px; /*must have*/
-}/*
- * jQuery UI Progressbar 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Progressbar#theming
- */
-.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
-.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/favicon.ico b/storage/mroonga/vendor/groonga/data/html/admin/favicon.ico
deleted file mode 100644
index 5fd703b998f..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/favicon.ico
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/favicon.png b/storage/mroonga/vendor/groonga/data/html/admin/favicon.png
deleted file mode 100644
index 1ec3555a100..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/favicon.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/favicon.svg b/storage/mroonga/vendor/groonga/data/html/admin/favicon.svg
deleted file mode 100644
index 81cbbb68997..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/favicon.svg
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="60.000706"
- height="60.001022"
- id="svg5342"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="favicon.svg"
- inkscape:export-filename="favicon.png"
- inkscape:export-xdpi="24"
- inkscape:export-ydpi="24">
- <defs
- id="defs5344">
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_9_"
- id="linearGradient5521"
- gradientUnits="userSpaceOnUse"
- x1="470.15039"
- y1="437.05859"
- x2="470.15039"
- y2="497.05859" />
- <linearGradient
- id="SVGID_9_"
- gradientUnits="userSpaceOnUse"
- x1="470.15039"
- y1="437.05859"
- x2="470.15039"
- y2="497.05859">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop4050" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop4052" />
- </linearGradient>
- <linearGradient
- y2="497.05859"
- x2="470.15039"
- y1="437.05859"
- x1="470.15039"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5566"
- xlink:href="#SVGID_9_"
- inkscape:collect="always" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_9_"
- id="linearGradient5599"
- gradientUnits="userSpaceOnUse"
- x1="470.15039"
- y1="437.05859"
- x2="470.15039"
- y2="497.05859" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="61.872887"
- inkscape:cy="42.401151"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2773"
- inkscape:window-y="302"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5347">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-343.75609,-530.41738)">
- <g
- id="g5587">
- <polygon
- style="fill:url(#linearGradient5599)"
- id="polygon4054"
- points="440.15,437.059 440.15,497.059 466.012,497.059 500.15,497.059 500.15,462.92 500.15,437.059 "
- transform="translate(-96.393911,93.359403)" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- id="path4107"
- d="m 397.29009,567.3004 c 7.502,-7.505 9.8,-20.401 -0.335,-30.538 -4.224,-4.222 -9.514,-6.337 -14.8,-6.345 h -0.005 c -5.286,-0.007 -10.567,2.093 -14.774,6.299 -2.522,2.52 -4.434,5.76 -5.428,9.33 -6.49,-0.099 -13.001,2.411 -18.191,7.53 v 36.479 c 0.114,0.121 0.227,0.242 0.344,0.361 h 25.518 11.027 c 4.434,-4.717 7.233,-11.018 7.295,-17.672 3.385,-0.898 6.606,-2.7 9.349,-5.444 z m -13.748,-2.759 c -1.121,1.873 -0.997,2.089 -0.949,5.602 0.062,3.979 -1.437,8.102 -5.189,11.854 -5.736,5.737 -16.326,7.017 -24.119,-0.776 -6.139,-6.14 -9.021,-16.475 -0.84,-24.658 3.038,-3.034 7.406,-4.827 11.998,-4.745 3.193,0.055 3.564,0.174 5.621,-0.76 2.058,-0.938 1.166,-3.019 2.396,-6.692 0.6,-1.792 1.666,-3.551 3.332,-5.224 4.451,-4.448 12.643,-5.469 18.643,0.531 4.887,4.887 6.96,12.677 0.572,19.065 -1.441,1.444 -3.284,2.509 -5.319,3.087 -3.266,0.937 -5.023,0.838 -6.146,2.716 z" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/images/groonga.png b/storage/mroonga/vendor/groonga/data/html/admin/images/groonga.png
deleted file mode 100644
index 39a05b7e9e4..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/images/groonga.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/images/groonga.svg b/storage/mroonga/vendor/groonga/data/html/admin/images/groonga.svg
deleted file mode 100644
index cecc4e0ee59..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/images/groonga.svg
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="232.17999"
- height="73.112274"
- id="svg3635"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="groonga.svg"
- inkscape:export-filename="groonga.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <defs
- id="defs3637">
- <linearGradient
- gradientTransform="translate(-419.62671,208.8676)"
- id="SVGID_1_"
- gradientUnits="userSpaceOnUse"
- x1="223.6167"
- y1="76.3564"
- x2="223.6167"
- y2="137.38029">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop160" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop162" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_1_"
- id="linearGradient3693"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(-419.62671,208.8676)"
- x1="223.6167"
- y1="76.3564"
- x2="223.6167"
- y2="137.38029" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="202.10766"
- inkscape:cy="3.8593771"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-right="5"
- fit-margin-bottom="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2411"
- inkscape:window-y="568"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata3640">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-229.62429,-318.66319)">
- <g
- id="g3685"
- transform="translate(520,37.142857)">
- <path
- id="path149"
- d="m -228.72771,306.3346 c -1.336,-0.29 -2.281,-0.448 -3.442,-0.448 -2.847,0 -5.33,0.831 -7.391,2.468 -0.091,0.06 -0.192,0.14 -0.303,0.245 -0.231,0.197 -0.452,0.406 -0.668,0.621 -1.478,1.314 -2.76,1.952 -2.76,-1.235 v -0.666 c 0,-0.404 -0.327,-0.732 -0.732,-0.732 h -2.101 c -0.198,0 -0.388,0.081 -0.525,0.223 -0.139,0.143 -0.212,0.335 -0.206,0.532 0.105,3.333 0.215,6.778 0.215,9.621 v 18.75 c 0,0.404 0.328,0.731 0.732,0.731 h 2.209 c 0.404,0 0.732,-0.328 0.732,-0.731 v -9.914 c 0,-1.37 0.107,-3.805 0.309,-4.813 1.569,-7.797 4.982,-11.588 10.435,-11.588 0.979,0 1.881,0.165 2.874,0.363 0.048,0.011 0.096,0.015 0.144,0.015 0.148,0 0.294,-0.045 0.417,-0.131 0.163,-0.113 0.273,-0.288 0.306,-0.484 l 0.323,-1.994 c 0.062,-0.384 -0.187,-0.752 -0.568,-0.833 z"
- inkscape:connector-curvature="0" />
- <path
- id="path151"
- d="m -139.68071,307.9266 c -2.512,-1.774 -5.292,-2.04 -6.726,-2.04 -2.91,0 -5.648,0.912 -7.822,2.495 -0.005,0.004 -0.01,0.005 -0.014,0.009 -1.004,0.648 -2.627,0.909 -2.618,-0.625 l 0,-0.021 c 0.002,-0.107 -0.003,-0.199 -0.013,-0.277 l -0.008,-0.182 c -0.019,-0.391 -0.34,-0.698 -0.731,-0.698 h -2.102 c -0.203,0 -0.396,0.084 -0.535,0.232 -0.138,0.148 -0.209,0.347 -0.195,0.549 0.152,2.28 0.214,4.171 0.214,6.524 v 21.821 c 0,0.404 0.328,0.731 0.731,0.731 h 2.209 c 0.404,0 0.732,-0.328 0.732,-0.731 v -17.511 c 0,-0.813 0.253,-1.761 0.49,-2.377 0.004,-0.008 0.006,-0.018 0.01,-0.026 1.043,-3.042 4.224,-6.12 8.417,-6.475 3.236,0.002 8.327,2.358 9.024,8.226 0.016,0.15 0.03,0.299 0.042,0.444 0.004,0.049 0.008,0.099 0.011,0.149 0.005,0.07 0.009,0.139 0.014,0.209 0.009,0.19 0.015,0.384 0.015,0.582 0,0.335 0.006,0.638 0.017,0.911 v 15.869 c 0,0.404 0.328,0.731 0.733,0.731 h 2.208 c 0.404,0 0.732,-0.328 0.732,-0.731 v -16.272 c 0,-5.375 -1.627,-9.248 -4.835,-11.516 z"
- inkscape:connector-curvature="0" />
- <path
- id="path153"
- d="m -63.456714,333.2686 c -0.133,-0.113 -0.301,-0.174 -0.473,-0.174 -0.04,0 -0.08,0.003 -0.12,0.01 -0.587,0.098 -0.965,0.098 -1.442,0.098 -1.147,0 -2.177,-0.335 -2.177,-4.387 v -9.913 c 0,-2.343 -0.179,-5.368 -1.583,-7.972 -1.822,-3.382 -5.181,-5.098 -9.978,-5.098 -2.475,0 -6.217,0.516 -9.99,2.974 -0.315,0.205 -0.422,0.615 -0.25,0.949 l 0.861,1.67 c 0.098,0.189 0.272,0.326 0.478,0.375 0.058,0.014 0.116,0.021 0.173,0.021 0.151,0 0.299,-0.047 0.424,-0.135 2.314,-1.639 5.186,-2.504 8.305,-2.504 3.995,0 6.004,1.854 7,3.939 l 0,0 c 1.004,2.221 -0.561,4.404 -2.285,4.584 -0.085,0.005 -0.17,0.008 -0.254,0.013 -0.014,0 -0.028,0.001 -0.042,0 -0.055,-10e-4 -0.101,0.003 -0.143,0.009 -10.978,0.626 -16.538,4.313 -16.538,10.98 0,2.027 0.803,4.057 2.202,5.569 1.233,1.333 3.56,2.921 7.635,2.921 3.471,0 6.271,-1.112 8.325,-2.472 0.061,-0.031 0.13,-0.076 0.211,-0.141 0.023,-0.017 0.042,-0.031 0.064,-0.048 0.128,-0.088 0.256,-0.177 0.378,-0.268 1.275,-0.825 1.969,-0.351 2.623,0.504 0.002,0.002 0.006,0.005 0.008,0.007 0.84,1.14 2.161,1.718 3.962,1.718 0.846,0 1.591,-0.094 2.344,-0.294 0.32,-0.085 0.543,-0.375 0.543,-0.707 v -1.67 c -0.002,-0.214 -0.097,-0.419 -0.261,-0.558 z m -18.252,0.527 c -3.042,0 -6.111,-1.723 -6.111,-5.572 0,-4.863 5.936,-6.58 12.167,-7.043 2.32,-0.043 4.097,2.162 4.311,4.575 v 0.989 c -0.062,0.647 -0.246,1.289 -0.568,1.888 -0.162,0.263 -0.356,0.556 -0.589,0.864 -0.04,0.047 -0.075,0.093 -0.103,0.134 -1.442,1.848 -4.223,4.165 -9.107,4.165 z"
- inkscape:connector-curvature="0" />
- <path
- id="path155"
- d="m -257.43671,306.5866 h -2.047 c -0.392,0 -0.715,0.311 -0.731,0.703 -0.065,1.618 -0.892,1.836 -2.704,0.766 -0.01,-0.006 -0.018,-0.014 -0.026,-0.019 -0.178,-0.119 -0.361,-0.231 -0.545,-0.339 -0.011,-0.007 -0.021,-0.012 -0.032,-0.02 -0.088,-0.059 -0.169,-0.104 -0.245,-0.14 -1.982,-1.096 -4.306,-1.65 -6.923,-1.65 -3.739,0 -7.428,1.548 -10.122,4.25 -2.083,2.087 -4.564,5.826 -4.564,11.784 0,3.818 1.347,7.413 3.792,10.122 2.594,2.875 6.234,4.458 10.249,4.458 3.11,0 5.514,-0.819 7.334,-1.897 0.004,-0.002 0.008,-0.003 0.012,-0.005 1.953,-0.873 3.601,-2.182 3.135,2.232 -0.875,5.678 -4.519,8.765 -10.482,8.765 -4.175,0 -7.31,-1.404 -9.204,-2.583 -0.117,-0.072 -0.251,-0.11 -0.387,-0.11 -0.061,0 -0.122,0.008 -0.182,0.023 -0.193,0.049 -0.358,0.176 -0.456,0.35 l -0.969,1.725 c -0.189,0.336 -0.085,0.761 0.237,0.972 2.852,1.863 6.909,2.975 10.853,2.975 2.691,0 9.293,-0.625 12.494,-6.412 1.384,-2.481 2.03,-5.968 2.03,-10.968 v -17.457 c 0,-2.474 0.07,-4.679 0.214,-6.738 0.014,-0.202 -0.057,-0.402 -0.195,-0.549 -0.139,-0.153 -0.333,-0.238 -0.536,-0.238 z m -16.892,26.028 c -0.605,-0.24 -7.609,-3.216 -7.013,-11.811 0.551,-7.946 5.723,-10.459 6.518,-10.798 1.278,-0.5 2.7,-0.769 4.241,-0.769 1.664,0 3.112,0.327 4.354,0.873 6.846,3.871 7.696,16.453 0.885,21.467 -1.592,0.999 -3.437,1.573 -5.346,1.573 -1.342,0 -2.552,-0.194 -3.639,-0.535 z"
- inkscape:connector-curvature="0" />
- <path
- id="path157"
- d="m -99.588714,306.5866 h -2.046996 c -0.393,0 -0.716,0.311 -0.731,0.703 -0.066,1.618 -0.892,1.836 -2.703,0.766 -0.009,-0.005 -0.018,-0.014 -0.027,-0.019 -0.178,-0.119 -0.362,-0.231 -0.546,-0.339 -0.011,-0.008 -0.02,-0.014 -0.031,-0.02 -0.087,-0.059 -0.168,-0.104 -0.244,-0.139 -1.982,-1.097 -4.307,-1.651 -6.924,-1.651 -3.739,0 -7.429,1.548 -10.122,4.25 -2.082,2.087 -4.564,5.826 -4.564,11.784 0,3.818 1.346,7.413 3.792,10.122 2.595,2.875 6.234,4.458 10.248,4.458 3.111,0 5.514,-0.819 7.335,-1.897 0.004,-0.002 0.007,-0.003 0.012,-0.005 1.954,-0.874 3.603,-2.183 3.135,2.233 -0.875,5.678 -4.519,8.764 -10.482,8.764 -4.175,0 -7.31,-1.404 -9.204,-2.583 -0.118,-0.072 -0.251,-0.11 -0.387,-0.11 -0.06,0 -0.122,0.008 -0.182,0.023 -0.193,0.049 -0.358,0.176 -0.456,0.35 l -0.97,1.725 c -0.189,0.336 -0.085,0.761 0.237,0.972 2.853,1.863 6.91,2.975 10.854,2.975 2.689,0 9.293,-0.625 12.493,-6.412 1.384996,-2.481 2.030996,-5.968 2.030996,-10.968 v -17.457 c 0,-2.474 0.07,-4.679 0.214,-6.738 0.014,-0.202 -0.057,-0.402 -0.195,-0.549 -0.139,-0.153 -0.332,-0.238 -0.536,-0.238 z m -16.891996,26.028 c -0.605,-0.24 -7.609,-3.216 -7.013,-11.811 0.551,-7.94 5.716,-10.455 6.517,-10.798 1.278,-0.5 2.701,-0.769 4.242,-0.769 1.665,0 3.113,0.327 4.354,0.873 6.845,3.871 7.696,16.453 0.884,21.467 -1.592,1 -3.436,1.573 -5.345,1.573 -1.343,0 -2.553,-0.194 -3.639,-0.535 z"
- inkscape:connector-curvature="0" />
- <path
- id="path164"
- d="m -198.36371,292.3616 c -2.337,2.336 -4.109,5.342 -5.032,8.654 -6.076,-0.093 -12.171,2.273 -17.007,7.11 -8.142,8.141 -10.674,22.913 0.667,34.253 9.542,9.543 23.793,9.687 33.145,0.333 4.421,-4.424 7.236,-10.506 7.297,-16.94 3.14,-0.835 6.125,-2.507 8.67,-5.049 6.956,-6.959 9.086,-18.919 -0.311,-28.318 -7.833,-7.83 -19.626,-7.847 -27.429,-0.043 z m 25.622,20.422 c -1.335,1.338 -3.045,2.324 -4.932,2.864 -3.027,0.867 -4.657,0.777 -5.698,2.515 -1.041,1.735 -0.926,1.94 -0.88,5.194 0.056,3.689 -1.333,7.513 -4.813,10.995 -5.32,5.318 -15.14,6.504 -22.366,-0.721 -5.693,-5.694 -8.365,-15.278 -0.778,-22.865 2.816,-2.813 6.866,-4.477 11.124,-4.402 2.961,0.053 3.306,0.161 5.212,-0.704 1.909,-0.869 1.082,-2.799 2.222,-6.205 0.556,-1.66 1.545,-3.294 3.092,-4.844 4.126,-4.126 11.721,-5.072 17.285,0.491 4.533,4.535 6.455,11.759 0.532,17.682 z"
- inkscape:connector-curvature="0"
- style="fill:url(#linearGradient3693)" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/images/loading.gif b/storage/mroonga/vendor/groonga/data/html/admin/images/loading.gif
deleted file mode 100644
index 2ce2ac5f59d..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/images/loading.gif
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/index.html b/storage/mroonga/vendor/groonga/data/html/admin/index.html
deleted file mode 100644
index 7f9cc8740f6..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/index.html
+++ /dev/null
@@ -1,297 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html lang="ja">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta http-equiv="Content-Style-Type" content="text/css">
-<meta http-equiv="Content-Script-Type" content="text/javascript">
-<meta name="robots" content="noindex,nofollow,noarchive">
-<title>groonga admin</title>
-<link rel="shortcut icon" href="favicon.ico">
-<link rel="icon" href="favicon.png">
-<link rel="stylesheet" type="text/css" href="css/groonga-admin.css">
-<link rel="stylesheet" type="text/css" href="css/redmond/jquery-ui-1.8.18.custom.css">
-<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
-<script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
-<script type="text/javascript" src="js/jquery.flot-0.7.min.js"></script>
-<script type="text/javascript" src="js/groonga-admin.js"></script>
-</head>
-<body>
-<div id="header">
- <ul id="locale-list">
- <li>en</li>
- <li><a href="index.ja.html">ja</a>
- </ul>
-</div>
-<div id="body">
- <table>
- <tr>
- <td id="left-column">
- <div id="side-menu">
- <h2>List of view</h2>
- <ul id="side-menu-view-list">
- <li><a href="#side-menu-summary" id="side-menu-summary">Summary</a></li>
- <li><a href="#side-menu-suggest" id="side-menu-suggest">Suggest</a></li>
- </ul>
- <h2>List of table</h2>
- <ul id="side-menu-tablelist" />
- </div>
- </td>
-
- <td id="right-column">
- <!-- database view -->
- <div id="database-tabs">
- <ul>
- <li><a href="#database-tab-summary">Summary</a></li>
- <li><a href="#database-tab-tablelist" id="tab-tablelist-link">List table</a></li>
- <li><a href="#database-tab-createtable">Create table</a></li>
- </ul>
- <div id="database-tab-summary">
- <p>
- Groonga administration tool.
- </p>
- <ul>
- <li>Start time: <span id="status-starttime"></span></li>
- <li>Uptime: <span id="status-uptime"></span></li>
- <li>Number of query: <span id="status-n-queries"></span></li>
- <li>Cache hit rate: <span id="status-cache-hit-rate"></span></li>
- </ul>
- <div id="throughput-chart" style="height: 300px; max-width: 500px;">
- </div>
- </div>
- <div id="database-tab-tablelist">
- <div id="tab-tablelist-table">
- </div>
- <input type="button" id="tablelist-remove-table" value="Remove table">
- </div>
- <div id="database-tab-createtable">
- <table>
- <tr>
- <td>
- <label for="createtable-name">Table name</label>
- </td>
- <td>
- <input type="text" id="createtable-name">
- </td>
- </tr>
- <tr>
- <td>
- Primary key
- </td>
- <td>
- <label for="createtable-key-type">Key type:</label>
- <select id="createtable-key-type">
- <optgroup label="Built-in types" id="createtable-key-type-builtin">
- </optgroup>
- <optgroup label="Key of Table" id="createtable-key-type-table">
- </optgroup>
- </select>
- <label for="createtable-key-index">Key index types:</label>
- <select id="createtable-key-index">
- <option value="GRN_OBJ_TABLE_PAT_KEY">Patricia trie</option>
- <option value="GRN_OBJ_TABLE_HASH_KEY">Hash table</option>
- <option value="GRN_OBJ_TABLE_NO_KEY">No key</option>
- </select>
- </td>
- </tr>
- <tr>
- <td>
- Flags
- </td>
- <td id="createtable-flags">
- <input type="checkbox" value="GRN_OBJ_PERSISTENT" checked>Persistent</input>
- <input type="checkbox" value="GRN_OBJ_KEY_NORMALIZE">Normalize key</input>
- <input type="checkbox" value="GRN_OBJ_KEY_WITH_SIS">Key with suffix</input>
- </td>
- </tr>
- <tr>
- <td>
- Value types
- </td>
- <td>
- <select id="createtable-value-type">
- <optgroup label="Built-in types" id="createtable-value-type-builtin">
- </optgroup>
- <optgroup label="Use table as value type" id="createtable-value-type-table">
- </optgroup>
- </select>
- </td>
- </tr>
- <tr>
- <td>
- Default tokenizer
- </td>
- <td>
- <select id="createtable-default-tokenizer">
- <optgroup label="Built-in tokenizer" id="createtable-default-tokenizer-builtin">
- </optgroup>
- </select>
- </td>
- </tr>
- </table>
- <input type="button" id="createtable-add-table" value="Create table">
- </div>
- </div>
-
- <!-- table view -->
- <div id="table-tabs">
- <ul>
- <li><a href="#table-tab-recordlist" id="tab-recordlist-link">List records</a></li>
- <li><a href="#table-tab-columnlist" id="tab-columnlist-link">List columns</a></li>
- <li><a href="#table-tab-createrecord" id="tab-createrecord-link">Create record</a></li>
- <li><a href="#table-tab-createcolumn">Create columns</a></li>
- </ul>
- <div id="table-tab-recordlist">
- <input type="checkbox" id="table-tab-recordlist-full-checkbox" /><label for="table-tab-recordlist-full-checkbox">Advanced search</label>
- <form id="tab-recordlist-form">
- <div id="table-tab-recordlist-form-simple">
- <label for="tab-recordlist-simplequery">Query: </label><input type="text" id="tab-recordlist-simplequery">
- <select id="tab-recordlist-simplequerytype">
- <option value="query" data-placeholder="e.g.)column:@value">query</option>
- <option value="filter" data-placeholder="e.g.)column == &quot;value&quot;">filter</option>
- </select>
- <input type="checkbox" id="tab-recordlist-incremental" /><label for="tab-recordlist-incremental" id="tab-recordlist-incremental-label">Incremental search</label>
- </div>
- <div id="table-tab-recordlist-form-full">
- <table>
- <tr><td>match_columns</td><td><input type="text" id="tab-recordlist-match_columns" /></td></tr>
- <tr><td>query</td><td><input type="text" id="tab-recordlist-query" /></td></tr>
- <tr><td>filter</td><td><input type="text" id="tab-recordlist-filter" /></td></tr>
- <tr><td>scorer</td><td><input type="text" id="tab-recordlist-scorer" /></td></tr>
- <tr><td>sortby</td><td><input type="text" id="tab-recordlist-sortby" /></td></tr>
- <tr><td>output_columns</td><td><input type="text" id="tab-recordlist-output_columns" /></td></tr>
- <tr><td>offset</td><td><input type="text" id="tab-recordlist-offset" /></td></tr>
- <tr><td>limit</td><td><input type="text" id="tab-recordlist-limit" /></td></tr>
- <tr><td>drilldown</td><td><input type="text" id="tab-recordlist-drilldown" /></td></tr>
- <tr><td>drilldown_sortby</td><td><input type="text" id="tab-recordlist-drilldown_sortby" /></td></tr>
- <tr><td>drilldown_output_columns</td><td><input type="text" id="tab-recordlist-drilldown_output_columns" /></td></tr>
- <tr><td>drilldown_offset</td><td><input type="text" id="tab-recordlist-drilldown_offset" /></td></tr>
- <tr><td>drilldown_limit</td><td><input type="text" id="tab-recordlist-drilldown_limit" /></td></tr>
- </table>
- </div>
- <input type="submit" id="tab-recordlist-submit" value="Search"/>
- </form>
- <div id="tab-recordlist-table">
- </div>
- <input type="button" id="recordlist-remove-record" value="Remove records">
- </div>
- <div id="table-tab-columnlist">
- <div id="tab-columnlist-table">
- </div>
- <input type="button" id="columnlist-remove-column" value="Remove columns">
- </div>
- <div id="table-tab-createrecord">
- <table id="table-createrecord">
- </table>
- <input type="button" id="createrecord-add-record" value="Create record">
- </div>
- <div id="table-tab-createcolumn">
- <table>
- <tr>
- <td>
- <label for="createcolumn-name">Column name</label>
- </td>
- <td>
- <input type="text" id="createcolumn-name">
- </td>
- </tr>
- <tr>
- <td>
- Column types
- </td>
- <td>
- <label for="createcolumn-type">Types:</label>
- <select id="createcolumn-type">
- <optgroup label="Built-in types" id="createcolumn-type-builtin">
- </optgroup>
- <optgroup label="Table" id="createcolumn-type-table">
- </optgroup>
- </select>
-
- <label for="createcolumn-column-type">Column stores:</label>
- <select id="createcolumn-column-type">
- <option value="GRN_OBJ_COLUMN_SCALAR">Scalar</option>
- <option value="GRN_OBJ_COLUMN_VECTOR">Vector</option>
- <option value="GRN_OBJ_COLUMN_INDEX">Inverted index</option>
- </select>
-
- <label for="createcolumn-compress">Compression:</label>
- <select id="createcolumn-compress" disabled>
- <option value="GRN_OBJ_COMPRESS_NONE">No compression</option>
- <option value="GRN_OBJ_COMPRESS_ZLIB">zlib</option>
- <option value="GRN_OBJ_COMPRESS_LZO">lzo</option>
- </select>
- </td>
- </tr>
- <tr>
- <td>
- Flags
- </td>
- <td id="createcolumn-flags">
- <input type="checkbox" value="GRN_OBJ_PERSISTENT" checked>Persistent</input>
- </td>
- </tr>
- <tr>
- <td>
- Flags for inverted index
- </td>
- <td id="createcolumn-ii-flags">
- <input type="checkbox" value="GRN_OBJ_WITH_SECTION">With section information</input>
- <input type="checkbox" value="GRN_OBJ_WITH_WEIGHT">With weight information</input>
- <input type="checkbox" value="GRN_OBJ_WITH_POSITION">With position information</input>
- </td>
- </tr>
- </table>
- <input type="button" id="createcolumn-add-column" value="Create column">
- </div>
- </div>
-
- <!-- suggest view -->
- <div id="suggest-tabs">
- <ul>
- <li><a href="#suggest-tab-search">Search</a></li>
- </ul>
- <div id="suggest-tab-search">
- <form id="suggest-tab-search-form">
- <p>
- <label for="suggest-dataset">Dataset: </label>
- <input type="text" id="suggest-dataset">
- </p>
- <label for="suggest-query">Suggest query: </label>
- <input type="text" id="suggest-query">
- <input type="button" id="suggest-submit" value="Search" />
- </form>
- <div id="suggest-result-tabs">
- <ul>
- <li><a href="#suggest-result-tab-suggest">Suggestion</a></li>
- <li><a href="#suggest-result-tab-complete">Completion</a></li>
- <li><a href="#suggest-result-tab-correct">Correction</a></li>
- </ul>
- <div id="suggest-result-tab-suggest">
- </div>
- <div id="suggest-result-tab-complete">
- </div>
- <div id="suggest-result-tab-correct">
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
-</div>
-<div id="footer">
-Powered by <a href="http://jquery.com/">jQuery</a> and <a href="http://jqueryui.com/">jQuery UI</a>.
-</div>
-<script type="text/javascript">
-$(function() {
- var admin = new GroongaAdmin();
- $(location.hash).click();
- $.ajaxSetup({
- timeout: 10000,
- cache: false
- });
-});
-</script>
-</body>
-</html>
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/index.ja.html b/storage/mroonga/vendor/groonga/data/html/admin/index.ja.html
deleted file mode 100644
index f9bc42ad530..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/index.ja.html
+++ /dev/null
@@ -1,301 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-<html lang="ja">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<meta http-equiv="Content-Style-Type" content="text/css">
-<meta http-equiv="Content-Script-Type" content="text/javascript">
-<meta name="robots" content="noindex,nofollow,noarchive">
-<title>groonga admin</title>
-<link rel="shortcut icon" href="favicon.ico">
-<link rel="icon" href="favicon.png">
-<link rel="stylesheet" type="text/css" href="css/groonga-admin.css">
-<link rel="stylesheet" type="text/css" href="css/redmond/jquery-ui-1.8.18.custom.css">
-<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
-<script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
-<script type="text/javascript" src="js/jquery.flot-0.7.min.js"></script>
-<script type="text/javascript" src="js/groonga-admin.js"></script>
-</head>
-<body>
-<div id="header">
- <ul id="locale-list">
- <li><a href="index.html">en</a></li>
- <li>ja</a>
- </ul>
-</div>
-<div id="body">
- <table>
- <tr>
- <td id="left-column">
- <div id="side-menu">
- <h2>ç”»é¢ä¸€è¦§</h2>
- <ul id="side-menu-view-list">
- <li><a href="#side-menu-summary" id="side-menu-summary">サマリー</a></li>
- <li><a href="#side-menu-suggest" id="side-menu-suggest">サジェスト</a></li>
- </ul>
- <h2>テーブル一覧</h2>
- <ul id="side-menu-tablelist" />
- </div>
- </td>
-
- <td id="right-column">
- <!-- database view -->
- <div id="database-tabs">
- <ul>
- <li><a href="#database-tab-summary">サマリー</a></li>
- <li><a href="#database-tab-tablelist" id="tab-tablelist-link">テーブル一覧</a></li>
- <li><a href="#database-tab-createtable">テーブル作æˆ</a></li>
- </ul>
- <div id="database-tab-summary">
- <p>
- groongaã®ç®¡ç†ãƒ„ールã§ã™ã€‚
- </p>
- <ul>
- <li>開始時間: <span id="status-starttime"></span></li>
- <li>uptime: <span id="status-uptime"></span></li>
- <li>クエリ数: <span id="status-n-queries"></span></li>
- <li>キャッシュヒット率: <span id="status-cache-hit-rate"></span></li>
- </ul>
- <div id="throughput-chart" style="height: 300px; max-width: 500px;">
- </div>
- </div>
- <div id="database-tab-tablelist">
- <div id="tab-tablelist-table">
- </div>
- <input type="button" id="tablelist-remove-table" value="é¸æŠžãƒ†ãƒ¼ãƒ–ル削除">
- </div>
- <div id="database-tab-createtable">
- <table>
- <tr>
- <td>
- <label for="createtable-name">テーブルå</label>
- </td>
- <td>
- <input type="text" id="createtable-name">
- </td>
- </tr>
- <tr>
- <td>
- 主キー
- </td>
- <td>
- <label for="createtable-key-type">keyã®åž‹:</label>
- <select id="createtable-key-type">
- <optgroup label="組ã¿è¾¼ã¿åž‹" id="createtable-key-type-builtin">
- </optgroup>
- <optgroup label="テーブル" id="createtable-key-type-table">
- </optgroup>
- </select>
- <label for="createtable-key-index">keyã®ã‚¤ãƒ³ãƒ‡ãƒƒã‚¯ã‚¹ç¨®é¡ž:</label>
- <select id="createtable-key-index">
- <option value="GRN_OBJ_TABLE_PAT_KEY">パトリシア木</option>
- <option value="GRN_OBJ_TABLE_HASH_KEY">ãƒãƒƒã‚·ãƒ¥ãƒ†ãƒ¼ãƒ–ル</option>
- <option value="GRN_OBJ_TABLE_NO_KEY">キーãªã—</option>
- </select>
- </td>
- </tr>
- <tr>
- <td>
- フラグ
- </td>
- <td id="createtable-flags">
- <input type="checkbox" value="GRN_OBJ_PERSISTENT" checked>永続化</input>
- <input type="checkbox" value="GRN_OBJ_KEY_NORMALIZE">key文字列ã®æ­£è¦åŒ–</input>
- <input type="checkbox" value="GRN_OBJ_KEY_WITH_SIS">key文字列ã®suffix登録</input>
- </td>
- </tr>
- <tr>
- <td>
- valueã®åž‹
- </td>
- <td>
- <select id="createtable-value-type">
- <optgroup label="組ã¿è¾¼ã¿åž‹" id="createtable-value-type-builtin">
- </optgroup>
- <optgroup label="テーブル" id="createtable-value-type-table">
- </optgroup>
- </select>
- </td>
- </tr>
- <tr>
- <td>
- デフォルトトークナイザ
- </td>
- <td>
- <select id="createtable-default-tokenizer">
- <optgroup label="組ã¿è¾¼ã¿" id="createtable-default-tokenizer-builtin">
- </optgroup>
- </select>
- </td>
- </tr>
- </table>
- <input type="button" id="createtable-add-table" value="テーブル追加">
- </div>
- </div>
-
- <!-- table view -->
- <div id="table-tabs">
- <ul>
- <li><a href="#table-tab-recordlist" id="tab-recordlist-link">レコード一覧</a></li>
- <li><a href="#table-tab-columnlist" id="tab-columnlist-link">カラム一覧</a></li>
- <li><a href="#table-tab-createrecord" id="tab-createrecord-link">レコード作æˆ</a></li>
- <li><a href="#table-tab-createcolumn">カラム作æˆ</a></li>
- </ul>
- <div id="table-tab-recordlist">
- <input type="checkbox" id="table-tab-recordlist-full-checkbox" /><label for="table-tab-recordlist-full-checkbox">管ç†ãƒ¢ãƒ¼ãƒ‰</label>
- <form id="tab-recordlist-form">
- <div id="table-tab-recordlist-form-simple">
- <label for="tab-recordlist-simplequery">検索クエリ: </label><input type="text" id="tab-recordlist-simplequery">
- <select id="tab-recordlist-simplequerytype">
- <option value="query" data-placeholder="例)column:@value">query</option>
- <option value="filter" data-placeholder="例)column == &quot;value&quot;">filter</option>
- </select>
- <input type="checkbox" id="tab-recordlist-incremental" /><label for="tab-recordlist-incremental" id="tab-recordlist-incremental-label">インクリメンタル検索</label>
- </div>
- <div id="table-tab-recordlist-form-full">
- <table>
- <tr><td>match_columns</td><td><input type="text" id="tab-recordlist-match_columns" /></td></tr>
- <tr><td>query</td><td><input type="text" id="tab-recordlist-query" /></td></tr>
- <tr><td>filter</td><td><input type="text" id="tab-recordlist-filter" /></td></tr>
- <tr><td>scorer</td><td><input type="text" id="tab-recordlist-scorer" /></td></tr>
- <tr><td>sortby</td><td><input type="text" id="tab-recordlist-sortby" /></td></tr>
- <tr><td>output_columns</td><td><input type="text" id="tab-recordlist-output_columns" /></td></tr>
- <tr><td>offset</td><td><input type="text" id="tab-recordlist-offset" /></td></tr>
- <tr><td>limit</td><td><input type="text" id="tab-recordlist-limit" /></td></tr>
- <tr><td>drilldown</td><td><input type="text" id="tab-recordlist-drilldown" /></td></tr>
- <tr><td>drilldown_sortby</td><td><input type="text" id="tab-recordlist-drilldown_sortby" /></td></tr>
- <tr><td>drilldown_output_columns</td><td><input type="text" id="tab-recordlist-drilldown_output_columns" /></td></tr>
- <tr><td>drilldown_offset</td><td><input type="text" id="tab-recordlist-drilldown_offset" /></td></tr>
- <tr><td>drilldown_limit</td><td><input type="text" id="tab-recordlist-drilldown_limit" /></td></tr>
- </table>
- </div>
- <input type="submit" id="tab-recordlist-submit" value="検索"/>
- </form>
- <div id="tab-recordlist-table">
- </div>
- <input type="button" id="recordlist-remove-record" value="é¸æŠžãƒ¬ã‚³ãƒ¼ãƒ‰å‰Šé™¤">
- </div>
- <div id="table-tab-columnlist">
- <div id="tab-columnlist-table">
- </div>
- <input type="button" id="columnlist-remove-column" value="é¸æŠžã‚«ãƒ©ãƒ å‰Šé™¤">
- </div>
- <div id="table-tab-createrecord">
- <table id="table-createrecord">
- </table>
- <input type="button" id="createrecord-add-record" value="レコード追加">
- </div>
- <div id="table-tab-createcolumn">
- <table>
- <tr>
- <td>
- <label for="createcolumn-name">カラムå</label>
- </td>
- <td>
- <input type="text" id="createcolumn-name">
- </td>
- </tr>
- <tr>
- <td>
- 設定
- </td>
- <td>
- <label for="createcolumn-type">åž‹:</label>
- <select id="createcolumn-type">
- <optgroup label="組ã¿è¾¼ã¿åž‹" id="createcolumn-type-builtin">
- </optgroup>
- <optgroup label="テーブル" id="createcolumn-type-table">
- </optgroup>
- </select>
-
- <label for="createcolumn-source">テーブル型ã®å ´åˆã‚«ãƒ©ãƒ </label>
- <select id="createcolumn-source" disabled>
- </select>
-
- <label for="createcolumn-column-type">カラム種別:</label>
- <select id="createcolumn-column-type">
- <option value="GRN_OBJ_COLUMN_SCALAR">スカラ</option>
- <option value="GRN_OBJ_COLUMN_VECTOR">ベクタ</option>
- <option value="GRN_OBJ_COLUMN_INDEX">転置インデックス</option>
- </select>
-
- <label for="createcolumn-compress">圧縮:</label>
- <select id="createcolumn-compress">
- <option value="GRN_OBJ_COMPRESS_NONE">圧縮ãªã—</option>
- <option value="GRN_OBJ_COMPRESS_ZLIB">zlib</option>
- <option value="GRN_OBJ_COMPRESS_LZO">lzo</option>
- </select>
- </td>
- </tr>
- <tr>
- <td>
- フラグ
- </td>
- <td id="createcolumn-flags">
- <input type="checkbox" value="GRN_OBJ_PERSISTENT" checked>永続化</input>
- </td>
- </tr>
- <tr>
- <td>
- 転置インデックス用フラグ
- </td>
- <td id="createcolumn-ii-flags">
- <input type="checkbox" value="GRN_OBJ_WITH_SECTION">段è½æƒ…報をå«ã‚ã‚‹</input>
- <input type="checkbox" value="GRN_OBJ_WITH_WEIGHT">é‡ã¿ã‚’å«ã‚ã‚‹</input>
- <input type="checkbox" value="GRN_OBJ_WITH_POSITION">ä½ç½®æƒ…報をå«ã‚ã‚‹</input>
- </td>
- </tr>
- </table>
- <input type="button" id="createcolumn-add-column" value="カラム追加">
- </div>
- </div>
-
- <!-- suggest view -->
- <div id="suggest-tabs">
- <ul>
- <li><a href="#suggest-tab-search">検索</a></li>
- </ul>
- <div id="suggest-tab-search">
- <form id="suggest-tab-search-form">
- <p>
- <label for="suggest-dataset">データセット: </label>
- <input type="text" id="suggest-dataset">
- </p>
- <label for="suggest-query">検索クエリ: </label>
- <input type="text" id="suggest-query">
- <input type="button" id="suggest-submit" value="検索" />
- </form>
- <div id="suggest-result-tabs">
- <ul>
- <li><a href="#suggest-result-tab-suggest">æ案</a></li>
- <li><a href="#suggest-result-tab-complete">補完</a></li>
- <li><a href="#suggest-result-tab-correct">補正</a></li>
- </ul>
- <div id="suggest-result-tab-suggest">
- </div>
- <div id="suggest-result-tab-complete">
- </div>
- <div id="suggest-result-tab-correct">
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
-</div>
-<div id="footer">
-Powered by <a href="http://jquery.com/">jQuery</a> and <a href="http://jqueryui.com/">jQuery UI</a>.
-</div>
-<script type="text/javascript">
-$(function() {
- var admin = new GroongaAdmin();
- $(location.hash).click();
- $.ajaxSetup({
- timeout: 10000,
- cache: false
- });
-});
-</script>
-</body>
-</html>
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.ja.js b/storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.ja.js
deleted file mode 100644
index c9d11f5080b..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.ja.js
+++ /dev/null
@@ -1,1372 +0,0 @@
-// -*- js2-basic-offset: 2; indent-tabs-mode: nil -*-
-
-"use strict";
-
-function prim2html(prim, limit) {
- switch(typeof prim) {
- case 'undefined':
- return 'undefined';
- case 'boolean':
- return prim ? 'true' : 'false';
- case 'number':
- return String(prim);
- case 'string':
- if (prim.length > limit) {
- prim = prim.substring(0, limit) + '...';
- }
- return escapeHTML(prim);
- case 'array':
- case 'object':
- if (prim == null) {
- return 'null';
- } else if ($.isArray(prim)) {
- return 'array'; /* TODO: implement */
- } else {
- return 'object'; /* TODO: implement */
- }
- default:
- return 'ERROR';
- }
-}
-
-function escapeHTML(str) {
- return str.replace(/&/g, "&amp;")
- .replace(/"/g, "&quot;")
- .replace(/</g, "&lt;")
- .replace(/>/g, "&gt;");
-}
-var Groonga = {
- key_type_list: ['Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
- 'Int64', 'UInt64', 'Float', 'Time', 'ShortText',
- 'TokyoGeoPoint', 'WGS84GeoPoint'],
- value_type_list: ['Object', 'Bool',
- 'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
- 'Int64', 'UInt64', 'Float', 'Time'],
- column_type_list: ['Object', 'Bool',
- 'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
- 'Int64', 'UInt64', 'Float', 'Time', 'ShortText',
- 'Text', 'LongText', 'TokyoGeoPoint', 'WGS84GeoPoint'],
- tokenizer_list: ['TokenDelimit', 'TokenUnigram', 'TokenBigram', 'TokenTrigram', 'TokenMecab'],
- GRN_OBJ_PERSISTENT: (0x01<<15),
-
- GRN_OBJ_TABLE_TYPE_MASK: (0x07),
- GRN_OBJ_TABLE_HASH_KEY: (0x00),
- GRN_OBJ_TABLE_PAT_KEY: (0x01),
- GRN_OBJ_TABLE_NO_KEY: (0x03),
-
- GRN_OBJ_KEY_WITH_SIS: (0x01<<6),
- GRN_OBJ_KEY_NORMALIZE: (0x01<<7),
-
- GRN_OBJ_COLUMN_TYPE_MASK: (0x07),
- GRN_OBJ_COLUMN_SCALAR: (0x00),
- GRN_OBJ_COLUMN_VECTOR: (0x01),
- GRN_OBJ_COLUMN_INDEX: (0x02),
-
- GRN_OBJ_COMPRESS_MASK: (0x07<<4),
- GRN_OBJ_COMPRESS_NONE: (0x00<<4),
- GRN_OBJ_COMPRESS_ZLIB: (0x01<<4),
- GRN_OBJ_COMPRESS_LZO: (0x02<<4),
-
- GRN_OBJ_WITH_SECTION: (0x01<<7),
- GRN_OBJ_WITH_WEIGHT: (0x01<<8),
- GRN_OBJ_WITH_POSITION: (0x01<<9)
-};
-
-$.widget("ui.paginate", {
- version: "1.0",
- options: {
- total: 0,
- nItemsPerPage: 10,
- currentPage: 0,
- nShowLinks: 10,
- callback: null
- },
- _create: function() {
- var that = this;
- var element = this.element;
- element.addClass("pager");
-
- var total = this.options.total;
- var nItemsPerPage = this.options.nItemsPerPage;
- var currentPage = this.options.currentPage;
- var nShowLinks = this.options.nShowLinks;
- var lastPage = Math.floor((total - 1) / nItemsPerPage) + 1;
- var start = currentPage - Math.floor(nShowLinks / 2);
- start = (start < 1) ? 1 : start;
- var end = start + nShowLinks - 1;
- end = (end > lastPage) ? lastPage : end;
-
- var callback = this.options.callback;
- if (start > 1) {
- element.append($('<span />')
- .addClass('pager')
- .append($('<a />')
- .attr('href', '#')
- .text('1')
- .click(function () {callback(0)})));
- element.append($('<span />').text('....'));
- }
- for (var i = start; i <= end; i++) {
- var page = $('<span />').append($('<a />')
- .attr('href', '#')
- .text(String(i))
- .click(function () {
- callback(Number($(this).text()) - 1);
- }));
- if (i == currentPage) {
- page.addClass('pager-current');
- } else {
- page.addClass('pager');
- }
- element.append(page);
- }
- if (end < lastPage) {
- element.append($('<span />')
- .text('....'));
- element.append($('<span />')
- .addClass('pager')
- .append($('<a />')
- .attr('href', '#')
- .text(String(lastPage))
- .click(function () {callback(lastPage - 1);})));
- }
- }
-});
-
-function GroongaAdmin() {
- this.current_table = null;
- this.statusTimer = null;
- this.semaphore = new Array();
- this.current_status = 0;
- this.reload_record_func = function(){};
-
- var that = this;
- this._initializeTabs();
-
- $('#tab-tablelist-link').click(function() {
- that.tablelist();
- });
- $('#tab-columnlist-link').click(function() {
- that.columnlist(that.current_table);
- });
- $('#tab-createrecord-link').click(function() {
- that.update_createrecord(that.current_table);
- });
- $('#tab-recordlist-link').click(function() {
- that.reload_record_func();
- });
- $('#createtable-add-table').click(function() {
- that.createtable();
- });
- $('#createrecord-add-record').click(function() {
- that.createrecord();
- });
- $('#createcolumn-add-column').click(function() {
- that.createcolumn();
- });
- $('#recordlist-remove-record').click(function() {
- that.removerecord();
- });
- $('#columnlist-remove-column').click(function() {
- that.removecolumn();
- });
- $('#tablelist-remove-table').click(function() {
- that.removetable();
- });
- $('#tab-recordlist-form').submit(function() {
- if ($('#table-tab-recordlist-full-checkbox').attr('checked')) {
- // full
- var d = {
- 'table': that.current_table
- }
- $.each(that.SELECT_PARAMS, function(i, val) {
- var e = $('#tab-recordlist-' + val);
- if (e.val()) {
- d[val] = e.val();
- }
- });
- that.recordlist(d, true);
- } else {
- // simple
- that.recordlist_simple(
- that.current_table,
- $('#tab-recordlist-simplequery').val(),
- $('#tab-recordlist-simplequerytype').val(),
- 1);
- }
- return false;
- });
- this._initializeSideMenu();
- this.update_tablelist();
-
- var e1 = $('#createtable-key-type-builtin');
- $.each(Groonga.key_type_list, function(i, val) {
- e1.append($('<option />').val(val).text(val));
- });
-
- e1 = $('#createtable-value-type-builtin');
- e1.append($('<option />').val('').text('ãªã—'));
- $.each(Groonga.value_type_list, function(i, val) {
- e1.append($('<option />').val(val).text(val));
- });
-
- e1 = $('#createtable-default-tokenizer-builtin');
- e1.append($('<option />').val('').text('ãªã—'));
- $.each(Groonga.tokenizer_list, function(i, val) {
- e1.append($('<option />').val(val).text(val));
- });
-
- e1 = $('#createcolumn-type-builtin');
- $.each(Groonga.column_type_list, function(i, val) {
- e1.append($('<option />').val(val).text(val));
- });
-
- $('#tab-recordlist-simplequerytype').change(function() {
- if ($(this).val() == 'scorer') {
- $('#tab-recordlist-incremental').hide();
- $('#tab-recordlist-incremental-label').hide();
- } else {
- $('#tab-recordlist-incremental').show();
- $('#tab-recordlist-incremental-label').show();
- }
- $('#tab-recordlist-incremental').change();
-
- var selectedOption = $(this).find(':selected');
- $('#tab-recordlist-simplequery').attr(
- 'placeholder', selectedOption.data('placeholder')
- );
- }).change();
-
- $('#table-tab-recordlist-full-checkbox').change(function() {
- if ($(this).attr('checked')) {
- $('#table-tab-recordlist-form-simple').hide();
- $('#table-tab-recordlist-form-full').show();
- } else {
- $('#table-tab-recordlist-form-simple').show();
- $('#table-tab-recordlist-form-full').hide();
- }
- }).change();
-
- $('#tab-recordlist-incremental').change(function() {
- $('#tab-recordlist-simplequery').unbind('keyup');
- if ($(this).attr('checked') &&
- $('#tab-recordlist-simplequerytype').val() != 'scorer') {
- $('#tab-recordlist-simplequery').keyup(function(e) {
- that.recordlist_simple(
- that.current_table,
- $('#tab-recordlist-simplequery').val(),
- $('#tab-recordlist-simplequerytype').val(),
- 1,
- true);
- });
- }
- }).change();
-
- $('#createcolumn-type').change(function(e) {
- var s = $('#createcolumn-type-table option:selected');
- var cs = $('#createcolumn-source');
- if (s.length > 0) {
- cs.empty().removeAttr('disabled');
- that.showloading(
- $.ajax({
- url: '/d/column_list',
- data: {'table': s.val()},
- dataType: 'json',
- success: function(d) {
- if(that.validateajax(d) < 0) { return; }
- var idx;
- var b = d[1];
- $.each(b[0], function(i, val) {
- if (val[0] == 'name') { idx = i; }
- });
- if (idx) {
- b.shift();
- $.each(b, function(i, val) {
- cs.append($('<option />').val(val[idx]).text(val[idx]));
- });
- }
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- } else {
- cs.empty().attr('disabled', 'disabled');
- }
- });
-
- this.recordlist_count = 30;
-};
-
-jQuery.extend(GroongaAdmin.prototype, {
- SELECT_PARAMS: [
- 'match_columns', 'query', 'filter',
- 'scorer',
- 'output_columns',
- 'sortby', 'offset', 'limit',
- 'drilldown',
- 'drilldown_output_columns',
- 'drilldown_sortby', 'drilldown_offset', 'drilldown_limit'
- ],
- _initializeTabs: function() {
- this._initializeDatabaseTab();
- this._initializeTableTab();
- this._initializeSuggestTab();
- this._selectTab("database");
- },
- _initializeDatabaseTab: function() {
- var that = this;
-
- this._$databaseTabs = $('#database-tabs').tabs({
- show: function(e, ui) {
- that.stop_status_timer();
- if (ui.panel.id == 'database-tab-summary') {
- that.start_status_timer();
- }
- }
- });
- },
- _initializeTableTab: function() {
- this._$tableTabs = $('#table-tabs').tabs({
- show: function(e, ui) {
- }
- });
- },
- _initializeSuggestTab: function() {
- var that = this;
-
- this._$suggestTabs = $('#suggest-tabs').tabs({
- show: function(e, ui) {
- }
- });
-
- this._initializeSuggestDatasetComplete();
- this._initializeSuggestQueryComplete();
- this._initializeSuggestSubmit();
- this._initializeSuggestResult();
- },
- _initializeSuggestDatasetComplete: function() {
- var that = this;
- var $dataset = $("#suggest-dataset");
- this._$suggestDataset = $dataset;
- $dataset.autocomplete({
- minLength: 0,
- source: function (request, response) {
- var datasets = [];
- $.each(that._tables, function(i, table_name) {
- var suggestTableMatch = /^item_(.+)$/.exec(table_name);
- if (suggestTableMatch) {
- var dataset = suggestTableMatch[1];
- datasets.push(dataset);
- }
- });
-
- datasets = $.ui.autocomplete.filter(datasets, request.term);
- response(datasets);
- }
- });
- $dataset.focus(function (event) {
- $dataset.autocomplete("search", $dataset.val());
- });
- },
- _suggestParameters: function(query, dataset, type) {
- var nItemsPerPage = 30;
- return {
- query: query,
- types: type,
- table: "item_" + dataset,
- column: "kana",
- offset: 0,
- limit: nItemsPerPage,
- };
- },
- _initializeSuggestQueryComplete: function() {
- var that = this;
- this._$suggestQuery = $("#suggest-query").autocomplete({
- source: function (request, response) {
- var $dataset = $("#suggest-dataset");
- var dataset = $dataset.val();
- $("#suggest-submit").click();
- $.ajax({
- url: "/d/suggest",
- data: that._suggestParameters(request.term, dataset, "complete"),
- dataType: "jsonp",
- success: function (data, textStatus, jqXHR) {
- var completions = data[1]["complete"];
- var items = [];
- if (completions && completions.length > 2) {
- completions.shift();
- completions.shift();
- $.each(completions, function(i, item) {
- var key = item[0];
- items.push(key);
- if (items.length >= 3) {
- return false;
- }
- return true;
- });
- }
- response(items);
- },
- error: function(jqXHR, textStatus, errorThrown) {
- }
- });
- }
- });
- },
- _initializeSuggestSubmit: function() {
- var that = this;
- $("#suggest-submit").click(function (event) {
- var dataset = $("#suggest-dataset").val();
- var query = $("#suggest-query").val();
- var type = that._suggestResultType;
- var parameters = that._suggestParameters(query, dataset, type);
- $.ajax({
- url: "/d/suggest",
- data: parameters,
- dataType: "jsonp",
- success: function (data, textStatus, jqXHR) {
- var response = data[1][type];
- response.shift();
- var $result = $("#suggest-result-tab-" + type);
- $result
- .empty()
- .append($("<div/>").append(that._createResultTable(response)));
- },
- error: function(jqXHR, textStatus, errorThrown) {
- }
- });
- });
- },
- _initializeSuggestResult: function() {
- var that = this;
- $("#suggest-result-tabs").tabs({
- show: function (event, ui) {
- that._suggestResultType = ui.panel.id.replace(/^suggest-result-tab-/, "");
- $("#suggest-submit").click();
- }
- });
- },
- _selectTab: function(name) {
- this.stop_status_timer();
- this._$databaseTabs.hide();
- this._$tableTabs.hide();
- this._$suggestTabs.hide();
- switch (name) {
- case "table":
- this._$tableTabs.show();
- break;
- case "suggest":
- this._$suggestTabs.show();
- break;
- case "database":
- default:
- this._$databaseTabs.show();
- break;
- }
- },
- _initializeSideMenu: function () {
- var that = this;
- $('#side-menu-summary').click(function() {
- that.current_table = null;
- that._selectTab("database");
- that._$databaseTabs.tabs("select", "#database-tab-summary");
- });
- $('#side-menu-suggest').click(function() {
- that.current_table = null;
- that._selectTab("suggest");
- });
- },
- start_status_timer: function() {
- var that = this;
- this.stop_status_timer();
- this.status();
- this.statusTimer = setInterval(function() {that.status()}, 1000);
- },
- change_status_timer: function(time) {
- var that = this;
- this.stop_status_timer();
- this.statusTimer = setInterval(function() {that.status()}, time);
- },
- stop_status_timer: function() {
- if (this.statusTimer) {
- clearInterval(this.statusTimer);
- this.statusTimer = null;
- }
- },
- _createResultTable: function (result, options) {
- var that = this;
- if (!options) {
- options = {};
- }
- var table = $('<table class="records"/>');
- if ($.isArray(result)) {
- var nEntries = result.length;
- if (nEntries >= 1) {
- var thead = $('<thead/>');
- table.append(thead);
- var line = result[0];
- if ($.isArray(line)) {
- var tr = $('<tr/>');
- thead.append(tr);
- var m = line.length;
- if (options.check) {
- tr.append($('<th/>'));
- }
- for (var j = 0; j < m; j++) {
- var th = $('<th/>');
- tr.append(th);
- th.append(prim2html(line[j][0], 128));
- th.append($('<br />'));
- th.append(prim2html(line[j][1], 128));
- }
- if (options.button) {
- tr.append($('<th/>'));
- }
- }
- var tbody = $('<tbody>');
- table.append(tbody);
- for (var i = 1; i < nEntries; i++) {
- line = result[i];
- if ($.isArray(line)) {
- var tr = $('<tr>');
- table.append(tr);
- var m = line.length;
- switch(options.check) {// ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã®å€¤ã‚’何ã«ã™ã‚‹ã‹
- case 1: // 1番目ã®è¦ç´ (レコード一覧ã®_idç­‰)
- case 2: // 2番目ã®è¦ç´ (テーブル・カラム一覧ã®nameç­‰)
- var td = $('<td/>');
- tr.append(td);
- td.append($('<input/>')
- .attr("type", "checkbox")
- .attr("value", line[options.check-1]));
- break;
- }
- for (var j = 0; j < m; j++) {
- var td = $('<td/>');
- tr.append(td);
- td.append(prim2html(line[j], 128));
- }
- switch(options.button) {
- case 1: // Edit record
- var td = $('<td/>');
- tr.append(td);
- td.append($('<input/>')
- .attr("type", "button")
- .attr("value", "編集")
- .attr("data-record-id", line[0])
- .click(function () {
- that.show_edit_record($(this).attr("data-record-id"));
- }));
- break;
- case 2: // Table
- var td = $('<td/>');
- tr.append(td);
- td.append($('<input/>')
- .attr("type", "button")
- .attr("value", "詳細")
- .attr("data-table-name", line[1])
- .click(function () {
- var tableName = $(this).attr("data-table-name");
- $("#side-menu-tablelist-link-" + tableName).click();
- }));
- break;
- }
- }
- }
- }
- }
- return table;
- },
- show_edit_record: function(id) {
- $('#table-tabs').tabs('select', 2);
- this.update_createrecord(this.current_table, id);
- },
- format_unix_time: function(unix_time) {
- var date = new Date();
- date.setTime(unix_time * 1000);
- return date.toLocaleString();
- },
- format_duration: function(duration_in_seconds) {
- var duration = "";
- var days = Math.floor(duration_in_seconds / 3600 / 24);
- var hours = Math.floor(duration_in_seconds / 3600 % 24);
- var minutes = Math.floor(duration_in_seconds / 60 % 60);
- var seconds = Math.floor(duration_in_seconds % 60);
-
- if (days > 0) {
- duration += days;
- if (days == 1) {
- duration += " day, ";
- } else {
- duration += " days, ";
- }
- }
- if (days > 0 || hours > 0) {
- duration += hours + ":" + minutes + ":" + seconds;
- } else if (minutes > 0) {
- duration += minutes + ":" + seconds;
- } else {
- duration += seconds;
- }
-
- return duration;
- },
- maxThroughput: 0,
- lastNQueries: -1,
- keepLastNData: 100,
- throughputData: [],
- throughputChart: null,
- updateThroughputChart: function(statusData) {
- var maxThroughputUpdated = false;
- if (this.lastNQueries >= 0) {
- var throughput = statusData.n_queries - this.lastNQueries;
- this.throughputData.push(throughput);
- if (this.maxThroughput < throughput) {
- this.maxThroughput = throughput;
- maxThroughputUpdated = true;
- }
- }
- if (this.throughputData.length > this.keepLastNData) {
- this.throughputData.shift();
- }
- if (!this.throughputChart) {
- this.throughputChart = $.plot($("#throughput-chart"),
- [[]],
- {xaxis: {min: -(this.keepLastNData - 1),
- max: 0},
- yaxis: {min: 0}});
- }
- var that = this;
- var chartSeries = $.map(this.throughputData, function(n, i) {
- return [[-(that.throughputData.length - i) + 1, n]];
- });
- this.throughputChart.setData([chartSeries]);
- if (maxThroughputUpdated) {
- this.throughputChart.setupGrid();
- }
- this.throughputChart.draw();
- this.lastNQueries = statusData.n_queries;
- },
- status: function() {
- if (this.current_status > 0) { return; }
- this.current_status++;
- var that = this;
- $.ajax({
- url: '/d/status',
- data: {},
- dataType: 'json',
- success: function(b) {
- that.current_status--;
- if (!b) {
- that.change_status_timer(10000);
- return;
- }
- var d = b[1];
- $('#status-starttime').text(that.format_unix_time(d.starttime));
- $('#status-uptime').text(that.format_duration(d.uptime));
- $('#status-n-queries').text(d.n_queries);
- $('#status-cache-hit-rate').text(d.cache_hit_rate);
- that.updateThroughputChart(d);
- that.change_status_timer(1000);
- },
- error: function() {
- that.current_status--;
- that.change_status_timer(10000);
- }
- });
- },
- update_tablelist: function() {
- var that = this;
- this._tables = [];
- this.showloading(
- $.ajax({
- url: '/d/table_list',
- data: {},
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- d.shift();
- var tl = $('#side-menu-tablelist').empty();
- var tt = $('#createtable-key-type-table').empty();
- var vt = $('#createtable-value-type-table').empty();
- var ct = $('#createcolumn-type-table').empty();
- var b = d.shift();
- b.shift();
- $.each(b, function(i, val) {
- var table_name = val[1];
- that._tables.push(table_name);
- tl.append(
- $('<li />').append(
- $('<a />')
- .attr('id', 'side-menu-tablelist-link-' + table_name)
- .attr('href', '#side-menu-tablelist-' + table_name)
- .text(table_name)
- .click(function() {
- that.current_table = table_name;
- $('#database-tabs').hide();
- $('#suggest-tabs').hide();
- that.stop_status_timer();
- $('#table-tabs').show();
- that.columnlist(table_name);
- $('#tab-recordlist-simplequery').val('');
- that.recordlist_simple(table_name, null, null, 1);
- that.update_createrecord(that.current_table);
- })
- )
- );
- tt.append($('<option />').val(val[1]).text(val[1]));
- vt.append($('<option />').val(val[1]).text(val[1]));
- ct.append($('<option />').val(val[1]).text(val[1]));
- });
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- tablelist: function() {
- $('#tab-tablelist-table').empty();
- var that = this;
- this.showloading(
- $.ajax({
- url: '/d/table_list',
- data: {},
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- var b = d[1];
- var table = that._createResultTable(b, {check: 2, button: 2});
- $('#tab-tablelist-table').append($('<h1 />').text('テーブル一覧')).append(table);
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- recordlist_simple: function(table_name, simplequery, simplequery_type, page, hide_dialog) {
- var d = {
- 'table': table_name,
- 'offset': (page - 1) * this.recordlist_count,
- 'limit': this.recordlist_count
- }
- switch (simplequery_type) {
- case 'query':
- case 'filter':
- case null:
- if (simplequery) {
- d[simplequery_type] = simplequery;
- }
- this.recordlist(d, true, hide_dialog);
- break;
- }
- },
- recordlist: function(params, show_pager, hide_dialog) {
- var that = this;
- this.reload_record_func = function(){
- that.recordlist(params, show_pager, hide_dialog);
- };
- this.showloading(
- $.ajax({
- url: '/d/select',
- data: params,
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d, hide_dialog) < 0) { return; }
- var rc = d.shift();
- if (rc[0] != 0) {
- alert('error: ' + rc[3]);
- that.hideloading();
- return false;
- }
- var body = d.shift();
- var recs = body.shift();
- var all_count = recs.shift()[0];
- var pager;
- if (show_pager) {
- var offset = params['offset'] || 0;
- var rows = params['limit'] || 10;
- if (rows < 0){
- rows = all_count + parseInt(rows) + 1;
- }
- if (rows != '' && !parseInt(rows)) {
- pager = $('<span />');
- } else {
- pager = $("<div/>");
- pager.paginate({
- total: all_count,
- nItemsPerPage: rows,
- currentPage: Math.floor(offset/rows)+1,
- callback: function(page) {
- params['offset'] = page * rows;
- that.recordlist(params, true, false);
- return false;
- }
- });
- }
- } else {
- pager = $('<span />');
- }
- $('#tab-recordlist-table')
- .empty()
- .append($('<h1 />').text('レコード一覧: ' + params['table']))
- .append($('<p />').text('ç·ä»¶æ•°: ' + all_count))
- .append(pager.clone(true))
- .append($('<div />').append(that._createResultTable(recs, {check: 1, button: 1})))
- .append(pager);
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest, hide_dialog);
- }
- })
- ,hide_dialog);
- },
- columnlist: function(table_name) {
- var that = this;
- $('#tab-columnlist-table').empty();
- this.showloading(
- $.ajax({
- url: '/d/column_list',
- data: {'table': table_name},
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- var b = d[1];
- var table = that._createResultTable(b, {check: 2});
- $('#tab-columnlist-table')
- .append($('<h1 />').text('カラム一覧: ' + table_name))
- .append(table);
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- add_record_inputbox: function(type, value) {
- var inputbox = null;
- switch(type){
- case "Bool":
- inputbox = $('<input />')
- .attr("type","checkbox")
- .attr("value","true");
- if (value) {
- inputbox.attr("checked","");
- }
- break;
- case "UInt8":
- case "UInt16":
- case "UInt32":
- case "UInt64":
- case "Int8":
- case "Int16":
- case "Int32":
- case "Int64":
- case "Float":
- inputbox = $('<input />')
- .attr("type", "text")
- .val(isNaN(value) ? "" : value);
- break;
- case "Text":
- case "ShortText":
- case "LongText":
- inputbox = $('<textarea />')
- .attr("cols", "50")
- .attr("rows", "2")
- .text(value ? value : "");
- break;
- case "TokyoGeoPoint":
- case "WGS84GeoPoint":
- case "Time":
- inputbox = $('<input />')
- .attr("type", "text")
- .attr("size", "40")
- .val(value ? value : "");
- break;
- case "Object":
- inputbox = $('<input />')
- .attr("type", "text")
- .attr("disabled", "disabled");
- break;
- default:
- inputbox = $('<input />')
- .attr("type", "text")
- .val(value ? value : "");
- }
- inputbox.addClass('column_values');
- return inputbox;
- },
- add_record_deletebutton: function(){
- var ret =
- $('<span />')
- .append("[×]")
- .css('cursor', 'pointer')
- .click(function() {
- $(this).prev().remove();
- $(this).next().remove();
- $(this).remove();
- });
- return ret;
- },
- update_createrecord_loadcomplete: function(d_sel, d_col) {
- var that = this;
- var b = d_sel[1][0];
- var columns = $('<tbody />');
- var listofs = b[1].length - (d_col[1].length - 1);
- for (var i = 1; i < b[1].length; i++) {
- var line = b[1][i];
- var value = null;
- if (b[2]) value = b[2][i];
- if ($.isArray(line)) {
- var tr = $('<tr/ >')
- .addClass('create-record-columns')
- .append(
- $('<td />')
- .addClass('columnname')
- .append(prim2html(line[0], 128))
- )
- .append(
- $('<td />')
- .addClass('columntype')
- .append("(")
- .append($('<span />')
- .append(prim2html(line[1], 128))
- )
- .append(")")
- );
- var inputtd = $('<td />').addClass('columnval');
- if (i >= listofs && d_col[1][i - listofs + 1][4].indexOf("COLUMN_VECTOR") >= 0){
- var type = line[1];
- if (value != null) {
- for (var j = 0; j < value.length; j++) {
- inputtd
- .append(this.add_record_inputbox(line[1], value[j]))
- .append(this.add_record_deletebutton())
- .append('<br />');
- }
- }
- inputtd
- .append($('<span />')
- .append("[値を追加]")
- .css('cursor', 'pointer')
- .click(function() {
- var target = $(this).parent();
- target
- .append(that.add_record_inputbox($(this).parent().prev().children().text()))
- .append(that.add_record_deletebutton())
- .append("<br />");
- $(this).appendTo(target);
- })
- );
- } else {
- inputtd.append(this.add_record_inputbox(line[1], value));
- if (line[0] == "_key" && value != null) {
- inputtd.children().attr("disabled", "disabled");
- }
- }
- tr.append(inputtd);
- columns.append(tr);
- }
- }
- $("#table-createrecord").append(columns);
- this.hideloading();
- },
- update_createrecord: function(table_name, id) {
- var that = this;
- var d_sel = null;
- var d_col = null;
- $('#table-createrecord').empty();
- this.showloading(
- $.ajax({
- url: '/d/select',
- data: {
- 'table' : table_name,
- 'limit' : 1,
- 'query' : '_id:' + id
- },
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- d_sel = d;
- if (d_col) {
- that.update_createrecord_loadcomplete(d_sel, d_col);
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- this.showloading(
- $.ajax({
- url: '/d/column_list',
- data: {
- 'table' : table_name
- },
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- d_col = d;
- if (d_sel) {
- that.update_createrecord_loadcomplete(d_sel, d_col);
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- createtable: function() {
- var that = this;
- var flags = 0;
- $('#createtable-flags>input:checked').each(function() {
- flags |= Groonga[$(this).val()];
- });
- flags |= Groonga[$('#createtable-key-index').val()];
- this.showloading(
- $.ajax({
- url: '/d/table_create',
- data: {
- name: $('#createtable-name').val(),
- 'flags': flags,
- key_type: $('#createtable-key-type').val(),
- value_type: $('#createtable-value-type').val(),
- default_tokenizer: $('#createtable-default-tokenizer').val()
- },
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- that.hideloading();
- alert('テーブルを作æˆã—ã¾ã—ãŸã€‚');
- that.update_tablelist();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- createcolumn: function() {
- var that = this;
- var flags = 0;
- $('#createcolumn-flags>input:checked').each(function() {
- flags |= Groonga[$(this).val()];
- });
- $('#createcolumn-ii-flags>input:checked').each(function() {
- flags |= Groonga[$(this).val()];
- });
- flags |= Groonga[$('#createcolumn-column-type').val()];
- flags |= Groonga[$('#createcolumn-column-compress').val()];
- var d = {
- table: this.current_table,
- name: $('#createcolumn-name').val(),
- 'flags': flags,
- type: $('#createcolumn-type').val()
- };
- if ($('#createcolumn-source').val()) {
- d['source'] = $('#createcolumn-source').val();
- }
- this.showloading(
- $.ajax({
- url: '/d/column_create',
- data: d,
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- that.hideloading();
- alert('カラムを作æˆã—ã¾ã—ãŸã€‚');
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- createrecord_getvalue: function(type, inputbox) {
- switch(type){
- case "Bool":
- if (inputbox.is('input:checked')) {
- return true;
- } else {
- return false;
- }
- default:
- return inputbox.val();
- }
- },
- createrecord: function() {
- var that = this;
- var d = {};
- $('.create-record-columns').each(function() {
- if (!$(this).children('.columnval').children().attr('disabled')
- || $(this).children('.columnname').text() == "_key") {
- var type = $(this).children('.columntype').children().text();
- if ($(this).children('.columnval').children('span').length) {
- var arr = [];
- $(this).children('.columnval').children('.column_values').each(function() {
- arr.push(that.createrecord_getvalue(type, $(this)));
- });
- d[$(this).children('.columnname').text()] = arr;
- } else {
- d[$(this).children('.columnname').text()] =
- that.createrecord_getvalue(type, $(this).children('.columnval').children());
- }
- }
- });
- this.showloading(
- $.ajax({
- url: '/d/load',
- data: {
- "table" : this.current_table,
- "input_type" : "json",
- "output_type" : "json",
- "values" : JSON.stringify([d])
- },
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- that.hideloading();
- alert('レコードを作æˆã—ã¾ã—ãŸã€‚');
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- removerecord: function() {
- var that = this;
- var checklist = $("#tab-recordlist-table").find("input:checked");
- var completecount = checklist.length;
- if (completecount > 0) {
- $('<div />')
- .append("é¸æŠžã—ãŸ" + completecount + "件ã®ãƒ¬ã‚³ãƒ¼ãƒ‰ã‚’削除ã—ã¾ã™ã‹ï¼Ÿ")
- .dialog({
- modal: true,
- buttons: {
- 'ã„ã„ãˆ': function() {
- $(this).dialog('close');
- },
- 'ã¯ã„': function() {
- $(this).dialog('close');
- checklist.each(function(i, val) {
- that.showloading(
- $.ajax({
- url: '/d/delete',
- data: {
- "table" : that.current_table,
- "id" : val.value
- },
- dataType: 'json',
- success: function() {
- if (--completecount == 0) {
- $('#tab-recordlist-form').submit();
- alert('レコードを削除ã—ã¾ã—ãŸã€‚');
- } else if (completecount < 0){
- that.hideloading();
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- completecount = 0;
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- });
- }
- }
- });
- }
- },
- removecolumn: function() {
- var that = this;
- var checklist = $("#tab-columnlist-table").find("input:checked");
- var completecount = checklist.length;
- if (completecount) {
- $('<div />')
- .append("é¸æŠžã—ãŸ" + completecount + "件ã®ã‚«ãƒ©ãƒ ã‚’削除ã—ã¾ã™ã‹ï¼Ÿ")
- .dialog({
- modal: true,
- buttons: {
- 'ã„ã„ãˆ': function() {
- $(this).dialog('close');
- },
- 'ã¯ã„': function() {
- $(this).dialog('close');
- checklist.each(function(i, val) {
- that.showloading(
- $.ajax({
- url: '/d/column_remove',
- data: {
- "table" : that.current_table,
- "name" : val.value
- },
- dataType: 'json',
- success: function() {
- if (!(--completecount)) {
- that.columnlist(that.current_table);
- alert('カラムを削除ã—ã¾ã—ãŸã€‚');
- } else if (completecount < 0){
- that.hideloading();
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- completecount = 0;
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- });
- }
- }
- });
- }
- },
- removetable: function() {
- var that = this;
- var checklist = $("#tab-tablelist-table").find("input:checked");
- var completecount = checklist.length;
- if (completecount > 0) {
- $('<div />')
- .append("é¸æŠžã—ãŸ" + completecount + "件ã®ãƒ†ãƒ¼ãƒ–ルを削除ã—ã¾ã™ã‹ï¼Ÿ")
- .dialog({
- modal: true,
- buttons: {
- 'ã„ã„ãˆ': function() {
- $(this).dialog('close');
- },
- 'ã¯ã„': function() {
- $(this).dialog('close');
- checklist.each(function(i, val) {
- that.showloading(
- $.ajax({
- url: '/d/table_remove',
- data: {
- "name" : val.value
- },
- dataType: 'json',
- success: function() {
- if (--completecount == 0) {
- that.tablelist();
- that.update_tablelist();
- alert('テーブルを削除ã—ã¾ã—ãŸã€‚');
- } else if (completecount < 0){
- that.hideloading();
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- completecount = 0;
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- });
- }
- }
- });
- }
- },
- showloading: function(obj, hide_dialog) {
- var that = this;
- if (obj == null) { return; }
- this.semaphore[this.semaphore.length] = obj;
- if ( $("#loadingdialog").size() > 0 || hide_dialog) { return; }
- $("<div />")
- .attr("id", "loadingdialog")
- .attr("style", "text-align: center;")
- .append($("<img />").attr("src", "images/loading.gif"))
- .append(" Loading...")
- .dialog({
- title: "",
- width: 200,
- height: 110,
- minHeight: 110,
- modal: true,
- resizable: false,
- draggable: false,
- position: ["right", "bottom"],
- autoOpen: false,
- buttons: {
- '中止': function() {
- if (obj) { obj.abort(); }
- that.hideloading();
- }
- }
- });
- $("#loadingdialog").parents(".ui-dialog").children(".ui-dialog-titlebar").remove();
- $("#loadingdialog").dialog("open");
- $(".ui-widget-overlay").css("opacity", "0.0");
- },
- hideloading: function() {
- for (var i = 0; i < this.semaphore.length; i++) {
- if ( this.semaphore[i].readyState == 4) {
- this.semaphore.splice(i, 1);
- i--;
- }
- }
- if ( this.semaphore.length == 0) {
- $("#loadingdialog").dialog("close");
- $("#loadingdialog").remove();
- }
- },
- errorloading: function(ajax, hide_dialog) {
- var that = this;
- var json = null;
- if (ajax) {
- json = JSON.parse(ajax.responseText);
- }
- this.hideloading();
- for (var i = 0; i < this.semaphore.length; i++) {
- this.semaphore[i].abort();
- this.semaphore.splice(i, 1);
- i--;
- }
- if ( $("#loadingdialog").size() == 0 && !hide_dialog) {
- var error_label;
- var error_message;
- if (json){
- error_label = "groongaã§ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚";
- error_message = json[0][3] + "(" + json[0][0] + ")";
- } else if (ajax) {
- error_label = "通信エラーãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚";
- error_message = "" + ajax.status + ": " + ajax.statusText;
- } else {
- error_label = "通信エラーãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚";
- error_message = "";
- }
- $("<div />")
- .append($("<div />").text(error_label))
- .append($("<div />").text(error_message))
- .attr("id", "loadingdialog")
- .dialog({
- title: "",
- width: 340,
- height: 160,
- minHeight: 160,
- modal: true,
- resizable: false,
- draggable: false,
- open: function() {
- $(this).parents(".ui-dialog").children(".ui-dialog-titlebar").remove();
- },
- buttons: { OK: function() { that.hideloading(); } }
- });
- }
- },
- validateajax: function(d, hide_dialog) {
- if (!d) {
- this.errorloading(null, hide_dialog);
- return -1;
- }
- return 0;
- }
-});
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.js b/storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.js
deleted file mode 100644
index 8d07beadc52..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/js/groonga-admin.js
+++ /dev/null
@@ -1,1372 +0,0 @@
-// -*- js2-basic-offset: 2; indent-tabs-mode: nil -*-
-
-"use strict";
-
-function prim2html(prim, limit) {
- switch(typeof prim) {
- case 'undefined':
- return 'undefined';
- case 'boolean':
- return prim ? 'true' : 'false';
- case 'number':
- return String(prim);
- case 'string':
- if (prim.length > limit) {
- prim = prim.substring(0, limit) + '...';
- }
- return escapeHTML(prim);
- case 'array':
- case 'object':
- if (prim == null) {
- return 'null';
- } else if ($.isArray(prim)) {
- return 'array'; /* TODO: implement */
- } else {
- return 'object'; /* TODO: implement */
- }
- default:
- return 'ERROR';
- }
-}
-
-function escapeHTML(str) {
- return str.replace(/&/g, "&amp;")
- .replace(/"/g, "&quot;")
- .replace(/</g, "&lt;")
- .replace(/>/g, "&gt;");
-}
-var Groonga = {
- key_type_list: ['Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
- 'Int64', 'UInt64', 'Float', 'Time', 'ShortText',
- 'TokyoGeoPoint', 'WGS84GeoPoint'],
- value_type_list: ['Object', 'Bool',
- 'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
- 'Int64', 'UInt64', 'Float', 'Time'],
- column_type_list: ['Object', 'Bool',
- 'Int8', 'UInt8', 'Int16', 'UInt16', 'Int32', 'UInt32',
- 'Int64', 'UInt64', 'Float', 'Time', 'ShortText',
- 'Text', 'LongText', 'TokyoGeoPoint', 'WGS84GeoPoint'],
- tokenizer_list: ['TokenDelimit', 'TokenUnigram', 'TokenBigram', 'TokenTrigram', 'TokenMecab'],
- GRN_OBJ_PERSISTENT: (0x01<<15),
-
- GRN_OBJ_TABLE_TYPE_MASK: (0x07),
- GRN_OBJ_TABLE_HASH_KEY: (0x00),
- GRN_OBJ_TABLE_PAT_KEY: (0x01),
- GRN_OBJ_TABLE_NO_KEY: (0x03),
-
- GRN_OBJ_KEY_WITH_SIS: (0x01<<6),
- GRN_OBJ_KEY_NORMALIZE: (0x01<<7),
-
- GRN_OBJ_COLUMN_TYPE_MASK: (0x07),
- GRN_OBJ_COLUMN_SCALAR: (0x00),
- GRN_OBJ_COLUMN_VECTOR: (0x01),
- GRN_OBJ_COLUMN_INDEX: (0x02),
-
- GRN_OBJ_COMPRESS_MASK: (0x07<<4),
- GRN_OBJ_COMPRESS_NONE: (0x00<<4),
- GRN_OBJ_COMPRESS_ZLIB: (0x01<<4),
- GRN_OBJ_COMPRESS_LZO: (0x02<<4),
-
- GRN_OBJ_WITH_SECTION: (0x01<<7),
- GRN_OBJ_WITH_WEIGHT: (0x01<<8),
- GRN_OBJ_WITH_POSITION: (0x01<<9)
-};
-
-$.widget("ui.paginate", {
- version: "1.0",
- options: {
- total: 0,
- nItemsPerPage: 10,
- currentPage: 0,
- nShowLinks: 10,
- callback: null
- },
- _create: function() {
- var that = this;
- var element = this.element;
- element.addClass("pager");
-
- var total = this.options.total;
- var nItemsPerPage = this.options.nItemsPerPage;
- var currentPage = this.options.currentPage;
- var nShowLinks = this.options.nShowLinks;
- var lastPage = Math.floor((total - 1) / nItemsPerPage) + 1;
- var start = currentPage - Math.floor(nShowLinks / 2);
- start = (start < 1) ? 1 : start;
- var end = start + nShowLinks - 1;
- end = (end > lastPage) ? lastPage : end;
-
- var callback = this.options.callback;
- if (start > 1) {
- element.append($('<span />')
- .addClass('pager')
- .append($('<a />')
- .attr('href', '#')
- .text('1')
- .click(function () {callback(0)})));
- element.append($('<span />').text('....'));
- }
- for (var i = start; i <= end; i++) {
- var page = $('<span />').append($('<a />')
- .attr('href', '#')
- .text(String(i))
- .click(function () {
- callback(Number($(this).text()) - 1);
- }));
- if (i == currentPage) {
- page.addClass('pager-current');
- } else {
- page.addClass('pager');
- }
- element.append(page);
- }
- if (end < lastPage) {
- element.append($('<span />')
- .text('....'));
- element.append($('<span />')
- .addClass('pager')
- .append($('<a />')
- .attr('href', '#')
- .text(String(lastPage))
- .click(function () {callback(lastPage - 1);})));
- }
- }
-});
-
-function GroongaAdmin() {
- this.current_table = null;
- this.statusTimer = null;
- this.semaphore = new Array();
- this.current_status = 0;
- this.reload_record_func = function(){};
-
- var that = this;
- this._initializeTabs();
-
- $('#tab-tablelist-link').click(function() {
- that.tablelist();
- });
- $('#tab-columnlist-link').click(function() {
- that.columnlist(that.current_table);
- });
- $('#tab-createrecord-link').click(function() {
- that.update_createrecord(that.current_table);
- });
- $('#tab-recordlist-link').click(function() {
- that.reload_record_func();
- });
- $('#createtable-add-table').click(function() {
- that.createtable();
- });
- $('#createrecord-add-record').click(function() {
- that.createrecord();
- });
- $('#createcolumn-add-column').click(function() {
- that.createcolumn();
- });
- $('#recordlist-remove-record').click(function() {
- that.removerecord();
- });
- $('#columnlist-remove-column').click(function() {
- that.removecolumn();
- });
- $('#tablelist-remove-table').click(function() {
- that.removetable();
- });
- $('#tab-recordlist-form').submit(function() {
- if ($('#table-tab-recordlist-full-checkbox').attr('checked')) {
- // full
- var d = {
- 'table': that.current_table
- }
- $.each(that.SELECT_PARAMS, function(i, val) {
- var e = $('#tab-recordlist-' + val);
- if (e.val()) {
- d[val] = e.val();
- }
- });
- that.recordlist(d, true);
- } else {
- // simple
- that.recordlist_simple(
- that.current_table,
- $('#tab-recordlist-simplequery').val(),
- $('#tab-recordlist-simplequerytype').val(),
- 1);
- }
- return false;
- });
- this._initializeSideMenu();
- this.update_tablelist();
-
- var e1 = $('#createtable-key-type-builtin');
- $.each(Groonga.key_type_list, function(i, val) {
- e1.append($('<option />').val(val).text(val));
- });
-
- e1 = $('#createtable-value-type-builtin');
- e1.append($('<option />').val('').text('None'));
- $.each(Groonga.value_type_list, function(i, val) {
- e1.append($('<option />').val(val).text(val));
- });
-
- e1 = $('#createtable-default-tokenizer-builtin');
- e1.append($('<option />').val('').text('None'));
- $.each(Groonga.tokenizer_list, function(i, val) {
- e1.append($('<option />').val(val).text(val));
- });
-
- e1 = $('#createcolumn-type-builtin');
- $.each(Groonga.column_type_list, function(i, val) {
- e1.append($('<option />').val(val).text(val));
- });
-
- $('#tab-recordlist-simplequerytype').change(function() {
- if ($(this).val() == 'scorer') {
- $('#tab-recordlist-incremental').hide();
- $('#tab-recordlist-incremental-label').hide();
- } else {
- $('#tab-recordlist-incremental').show();
- $('#tab-recordlist-incremental-label').show();
- }
- $('#tab-recordlist-incremental').change();
-
- var selectedOption = $(this).find(':selected');
- $('#tab-recordlist-simplequery').attr(
- 'placeholder', selectedOption.data('placeholder')
- );
- }).change();
-
- $('#table-tab-recordlist-full-checkbox').change(function() {
- if ($(this).attr('checked')) {
- $('#table-tab-recordlist-form-simple').hide();
- $('#table-tab-recordlist-form-full').show();
- } else {
- $('#table-tab-recordlist-form-simple').show();
- $('#table-tab-recordlist-form-full').hide();
- }
- }).change();
-
- $('#tab-recordlist-incremental').change(function() {
- $('#tab-recordlist-simplequery').unbind('keyup');
- if ($(this).attr('checked') &&
- $('#tab-recordlist-simplequerytype').val() != 'scorer') {
- $('#tab-recordlist-simplequery').keyup(function(e) {
- that.recordlist_simple(
- that.current_table,
- $('#tab-recordlist-simplequery').val(),
- $('#tab-recordlist-simplequerytype').val(),
- 1,
- true);
- });
- }
- }).change();
-
- $('#createcolumn-type').change(function(e) {
- var s = $('#createcolumn-type-table option:selected');
- var cs = $('#createcolumn-source');
- if (s.length > 0) {
- cs.empty().removeAttr('disabled');
- that.showloading(
- $.ajax({
- url: '/d/column_list',
- data: {'table': s.val()},
- dataType: 'json',
- success: function(d) {
- if(that.validateajax(d) < 0) { return; }
- var idx;
- var b = d[1];
- $.each(b[0], function(i, val) {
- if (val[0] == 'name') { idx = i; }
- });
- if (idx) {
- b.shift();
- $.each(b, function(i, val) {
- cs.append($('<option />').val(val[idx]).text(val[idx]));
- });
- }
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- } else {
- cs.empty().attr('disabled', 'disabled');
- }
- });
-
- this.recordlist_count = 30;
-};
-
-jQuery.extend(GroongaAdmin.prototype, {
- SELECT_PARAMS: [
- 'match_columns', 'query', 'filter',
- 'scorer',
- 'output_columns',
- 'sortby', 'offset', 'limit',
- 'drilldown',
- 'drilldown_output_columns',
- 'drilldown_sortby', 'drilldown_offset', 'drilldown_limit'
- ],
- _initializeTabs: function() {
- this._initializeDatabaseTab();
- this._initializeTableTab();
- this._initializeSuggestTab();
- this._selectTab("database");
- },
- _initializeDatabaseTab: function() {
- var that = this;
-
- this._$databaseTabs = $('#database-tabs').tabs({
- show: function(e, ui) {
- that.stop_status_timer();
- if (ui.panel.id == 'database-tab-summary') {
- that.start_status_timer();
- }
- }
- });
- },
- _initializeTableTab: function() {
- this._$tableTabs = $('#table-tabs').tabs({
- show: function(e, ui) {
- }
- });
- },
- _initializeSuggestTab: function() {
- var that = this;
-
- this._$suggestTabs = $('#suggest-tabs').tabs({
- show: function(e, ui) {
- }
- });
-
- this._initializeSuggestDatasetComplete();
- this._initializeSuggestQueryComplete();
- this._initializeSuggestSubmit();
- this._initializeSuggestResult();
- },
- _initializeSuggestDatasetComplete: function() {
- var that = this;
- var $dataset = $("#suggest-dataset");
- this._$suggestDataset = $dataset;
- $dataset.autocomplete({
- minLength: 0,
- source: function (request, response) {
- var datasets = [];
- $.each(that._tables, function(i, table_name) {
- var suggestTableMatch = /^item_(.+)$/.exec(table_name);
- if (suggestTableMatch) {
- var dataset = suggestTableMatch[1];
- datasets.push(dataset);
- }
- });
-
- datasets = $.ui.autocomplete.filter(datasets, request.term);
- response(datasets);
- }
- });
- $dataset.focus(function (event) {
- $dataset.autocomplete("search", $dataset.val());
- });
- },
- _suggestParameters: function(query, dataset, type) {
- var nItemsPerPage = 30;
- return {
- query: query,
- types: type,
- table: "item_" + dataset,
- column: "kana",
- offset: 0,
- limit: nItemsPerPage,
- };
- },
- _initializeSuggestQueryComplete: function() {
- var that = this;
- this._$suggestQuery = $("#suggest-query").autocomplete({
- source: function (request, response) {
- var $dataset = $("#suggest-dataset");
- var dataset = $dataset.val();
- $("#suggest-submit").click();
- $.ajax({
- url: "/d/suggest",
- data: that._suggestParameters(request.term, dataset, "complete"),
- dataType: "jsonp",
- success: function (data, textStatus, jqXHR) {
- var completions = data[1]["complete"];
- var items = [];
- if (completions && completions.length > 2) {
- completions.shift();
- completions.shift();
- $.each(completions, function(i, item) {
- var key = item[0];
- items.push(key);
- if (items.length >= 3) {
- return false;
- }
- return true;
- });
- }
- response(items);
- },
- error: function(jqXHR, textStatus, errorThrown) {
- }
- });
- }
- });
- },
- _initializeSuggestSubmit: function() {
- var that = this;
- $("#suggest-submit").click(function (event) {
- var dataset = $("#suggest-dataset").val();
- var query = $("#suggest-query").val();
- var type = that._suggestResultType;
- var parameters = that._suggestParameters(query, dataset, type);
- $.ajax({
- url: "/d/suggest",
- data: parameters,
- dataType: "jsonp",
- success: function (data, textStatus, jqXHR) {
- var response = data[1][type];
- response.shift();
- var $result = $("#suggest-result-tab-" + type);
- $result
- .empty()
- .append($("<div/>").append(that._createResultTable(response)));
- },
- error: function(jqXHR, textStatus, errorThrown) {
- }
- });
- });
- },
- _initializeSuggestResult: function() {
- var that = this;
- $("#suggest-result-tabs").tabs({
- show: function (event, ui) {
- that._suggestResultType = ui.panel.id.replace(/^suggest-result-tab-/, "");
- $("#suggest-submit").click();
- }
- });
- },
- _selectTab: function(name) {
- this.stop_status_timer();
- this._$databaseTabs.hide();
- this._$tableTabs.hide();
- this._$suggestTabs.hide();
- switch (name) {
- case "table":
- this._$tableTabs.show();
- break;
- case "suggest":
- this._$suggestTabs.show();
- break;
- case "database":
- default:
- this._$databaseTabs.show();
- break;
- }
- },
- _initializeSideMenu: function () {
- var that = this;
- $('#side-menu-summary').click(function() {
- that.current_table = null;
- that._selectTab("database");
- that._$databaseTabs.tabs("select", "#database-tab-summary");
- });
- $('#side-menu-suggest').click(function() {
- that.current_table = null;
- that._selectTab("suggest");
- });
- },
- start_status_timer: function() {
- var that = this;
- this.stop_status_timer();
- this.status();
- this.statusTimer = setInterval(function() {that.status()}, 1000);
- },
- change_status_timer: function(time) {
- var that = this;
- this.stop_status_timer();
- this.statusTimer = setInterval(function() {that.status()}, time);
- },
- stop_status_timer: function() {
- if (this.statusTimer) {
- clearInterval(this.statusTimer);
- this.statusTimer = null;
- }
- },
- _createResultTable: function (result, options) {
- var that = this;
- if (!options) {
- options = {};
- }
- var table = $('<table class="records"/>');
- if ($.isArray(result)) {
- var nEntries = result.length;
- if (nEntries >= 1) {
- var thead = $('<thead/>');
- table.append(thead);
- var line = result[0];
- if ($.isArray(line)) {
- var tr = $('<tr/>');
- thead.append(tr);
- var m = line.length;
- if (options.check) {
- tr.append($('<th/>'));
- }
- for (var j = 0; j < m; j++) {
- var th = $('<th/>');
- tr.append(th);
- th.append(prim2html(line[j][0], 128));
- th.append($('<br />'));
- th.append(prim2html(line[j][1], 128));
- }
- if (options.button) {
- tr.append($('<th/>'));
- }
- }
- var tbody = $('<tbody>');
- table.append(tbody);
- for (var i = 1; i < nEntries; i++) {
- line = result[i];
- if ($.isArray(line)) {
- var tr = $('<tr>');
- table.append(tr);
- var m = line.length;
- switch(options.check) {// ãƒã‚§ãƒƒã‚¯ãƒœãƒƒã‚¯ã‚¹ã®å€¤ã‚’何ã«ã™ã‚‹ã‹
- case 1: // 1番目ã®è¦ç´ (レコード一覧ã®_idç­‰)
- case 2: // 2番目ã®è¦ç´ (テーブル・カラム一覧ã®nameç­‰)
- var td = $('<td/>');
- tr.append(td);
- td.append($('<input/>')
- .attr("type", "checkbox")
- .attr("value", line[options.check-1]));
- break;
- }
- for (var j = 0; j < m; j++) {
- var td = $('<td/>');
- tr.append(td);
- td.append(prim2html(line[j], 128));
- }
- switch(options.button) {
- case 1: // Edit record
- var td = $('<td/>');
- tr.append(td);
- td.append($('<input/>')
- .attr("type", "button")
- .attr("value", "Edit")
- .attr("data-record-id", line[0])
- .click(function () {
- that.show_edit_record($(this).attr("data-record-id"));
- }));
- break;
- case 2: // Table
- var td = $('<td/>');
- tr.append(td);
- td.append($('<input/>')
- .attr("type", "button")
- .attr("value", "Detail")
- .attr("data-table-name", line[1])
- .click(function () {
- var tableName = $(this).attr("data-table-name");
- $("#side-menu-tablelist-link-" + tableName).click();
- }));
- break;
- }
- }
- }
- }
- }
- return table;
- },
- show_edit_record: function(id) {
- $('#table-tabs').tabs('select', 2);
- this.update_createrecord(this.current_table, id);
- },
- format_unix_time: function(unix_time) {
- var date = new Date();
- date.setTime(unix_time * 1000);
- return date.toLocaleString();
- },
- format_duration: function(duration_in_seconds) {
- var duration = "";
- var days = Math.floor(duration_in_seconds / 3600 / 24);
- var hours = Math.floor(duration_in_seconds / 3600 % 24);
- var minutes = Math.floor(duration_in_seconds / 60 % 60);
- var seconds = Math.floor(duration_in_seconds % 60);
-
- if (days > 0) {
- duration += days;
- if (days == 1) {
- duration += " day, ";
- } else {
- duration += " days, ";
- }
- }
- if (days > 0 || hours > 0) {
- duration += hours + ":" + minutes + ":" + seconds;
- } else if (minutes > 0) {
- duration += minutes + ":" + seconds;
- } else {
- duration += seconds;
- }
-
- return duration;
- },
- maxThroughput: 0,
- lastNQueries: -1,
- keepLastNData: 100,
- throughputData: [],
- throughputChart: null,
- updateThroughputChart: function(statusData) {
- var maxThroughputUpdated = false;
- if (this.lastNQueries >= 0) {
- var throughput = statusData.n_queries - this.lastNQueries;
- this.throughputData.push(throughput);
- if (this.maxThroughput < throughput) {
- this.maxThroughput = throughput;
- maxThroughputUpdated = true;
- }
- }
- if (this.throughputData.length > this.keepLastNData) {
- this.throughputData.shift();
- }
- if (!this.throughputChart) {
- this.throughputChart = $.plot($("#throughput-chart"),
- [[]],
- {xaxis: {min: -(this.keepLastNData - 1),
- max: 0},
- yaxis: {min: 0}});
- }
- var that = this;
- var chartSeries = $.map(this.throughputData, function(n, i) {
- return [[-(that.throughputData.length - i) + 1, n]];
- });
- this.throughputChart.setData([chartSeries]);
- if (maxThroughputUpdated) {
- this.throughputChart.setupGrid();
- }
- this.throughputChart.draw();
- this.lastNQueries = statusData.n_queries;
- },
- status: function() {
- if (this.current_status > 0) { return; }
- this.current_status++;
- var that = this;
- $.ajax({
- url: '/d/status',
- data: {},
- dataType: 'json',
- success: function(b) {
- that.current_status--;
- if (!b) {
- that.change_status_timer(10000);
- return;
- }
- var d = b[1];
- $('#status-starttime').text(that.format_unix_time(d.starttime));
- $('#status-uptime').text(that.format_duration(d.uptime));
- $('#status-n-queries').text(d.n_queries);
- $('#status-cache-hit-rate').text(d.cache_hit_rate);
- that.updateThroughputChart(d);
- that.change_status_timer(1000);
- },
- error: function() {
- that.current_status--;
- that.change_status_timer(10000);
- }
- });
- },
- update_tablelist: function() {
- var that = this;
- this._tables = [];
- this.showloading(
- $.ajax({
- url: '/d/table_list',
- data: {},
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- d.shift();
- var tl = $('#side-menu-tablelist').empty();
- var tt = $('#createtable-key-type-table').empty();
- var vt = $('#createtable-value-type-table').empty();
- var ct = $('#createcolumn-type-table').empty();
- var b = d.shift();
- b.shift();
- $.each(b, function(i, val) {
- var table_name = val[1];
- that._tables.push(table_name);
- tl.append(
- $('<li />').append(
- $('<a />')
- .attr('id', 'side-menu-tablelist-link-' + table_name)
- .attr('href', '#side-menu-tablelist-' + table_name)
- .text(table_name)
- .click(function() {
- that.current_table = table_name;
- $('#database-tabs').hide();
- $('#suggest-tabs').hide();
- that.stop_status_timer();
- $('#table-tabs').show();
- that.columnlist(table_name);
- $('#tab-recordlist-simplequery').val('');
- that.recordlist_simple(table_name, null, null, 1);
- that.update_createrecord(that.current_table);
- })
- )
- );
- tt.append($('<option />').val(val[1]).text(val[1]));
- vt.append($('<option />').val(val[1]).text(val[1]));
- ct.append($('<option />').val(val[1]).text(val[1]));
- });
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- tablelist: function() {
- $('#tab-tablelist-table').empty();
- var that = this;
- this.showloading(
- $.ajax({
- url: '/d/table_list',
- data: {},
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- var b = d[1];
- var table = that._createResultTable(b, {check: 2, button: 2});
- $('#tab-tablelist-table').append($('<h1 />').text('List of table')).append(table);
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- recordlist_simple: function(table_name, simplequery, simplequery_type, page, hide_dialog) {
- var d = {
- 'table': table_name,
- 'offset': (page - 1) * this.recordlist_count,
- 'limit': this.recordlist_count
- }
- switch (simplequery_type) {
- case 'query':
- case 'filter':
- case null:
- if (simplequery) {
- d[simplequery_type] = simplequery;
- }
- this.recordlist(d, true, hide_dialog);
- break;
- }
- },
- recordlist: function(params, show_pager, hide_dialog) {
- var that = this;
- this.reload_record_func = function(){
- that.recordlist(params, show_pager, hide_dialog);
- };
- this.showloading(
- $.ajax({
- url: '/d/select',
- data: params,
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d, hide_dialog) < 0) { return; }
- var rc = d.shift();
- if (rc[0] != 0) {
- alert('error: ' + rc[3]);
- that.hideloading();
- return false;
- }
- var body = d.shift();
- var recs = body.shift();
- var all_count = recs.shift()[0];
- var pager;
- if (show_pager) {
- var offset = params['offset'] || 0;
- var rows = params['limit'] || 10;
- if (rows < 0){
- rows = all_count + parseInt(rows) + 1;
- }
- if (rows != '' && !parseInt(rows)) {
- pager = $('<span />');
- } else {
- pager = $("<div/>");
- pager.paginate({
- total: all_count,
- nItemsPerPage: rows,
- currentPage: Math.floor(offset/rows)+1,
- callback: function(page) {
- params['offset'] = page * rows;
- that.recordlist(params, true, false);
- return false;
- }
- });
- }
- } else {
- pager = $('<span />');
- }
- $('#tab-recordlist-table')
- .empty()
- .append($('<h1 />').text('List of records: ' + params['table']))
- .append($('<p />').text('Total count: ' + all_count))
- .append(pager.clone(true))
- .append($('<div />').append(that._createResultTable(recs, {check: 1, button: 1})))
- .append(pager);
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest, hide_dialog);
- }
- })
- ,hide_dialog);
- },
- columnlist: function(table_name) {
- var that = this;
- $('#tab-columnlist-table').empty();
- this.showloading(
- $.ajax({
- url: '/d/column_list',
- data: {'table': table_name},
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- var b = d[1];
- var table = that._createResultTable(b, {check: 2});
- $('#tab-columnlist-table')
- .append($('<h1 />').text('List of columns: ' + table_name))
- .append(table);
- that.hideloading();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- add_record_inputbox: function(type, value) {
- var inputbox = null;
- switch(type){
- case "Bool":
- inputbox = $('<input />')
- .attr("type","checkbox")
- .attr("value","true");
- if (value) {
- inputbox.attr("checked","");
- }
- break;
- case "UInt8":
- case "UInt16":
- case "UInt32":
- case "UInt64":
- case "Int8":
- case "Int16":
- case "Int32":
- case "Int64":
- case "Float":
- inputbox = $('<input />')
- .attr("type", "text")
- .val(isNaN(value) ? "" : value);
- break;
- case "Text":
- case "ShortText":
- case "LongText":
- inputbox = $('<textarea />')
- .attr("cols", "50")
- .attr("rows", "2")
- .text(value ? value : "");
- break;
- case "TokyoGeoPoint":
- case "WGS84GeoPoint":
- case "Time":
- inputbox = $('<input />')
- .attr("type", "text")
- .attr("size", "40")
- .val(value ? value : "");
- break;
- case "Object":
- inputbox = $('<input />')
- .attr("type", "text")
- .attr("disabled", "disabled");
- break;
- default:
- inputbox = $('<input />')
- .attr("type", "text")
- .val(value ? value : "");
- }
- inputbox.addClass('column_values');
- return inputbox;
- },
- add_record_deletebutton: function(){
- var ret =
- $('<span />')
- .append("[×]")
- .css('cursor', 'pointer')
- .click(function() {
- $(this).prev().remove();
- $(this).next().remove();
- $(this).remove();
- });
- return ret;
- },
- update_createrecord_loadcomplete: function(d_sel, d_col) {
- var that = this;
- var b = d_sel[1][0];
- var columns = $('<tbody />');
- var listofs = b[1].length - (d_col[1].length - 1);
- for (var i = 1; i < b[1].length; i++) {
- var line = b[1][i];
- var value = null;
- if (b[2]) value = b[2][i];
- if ($.isArray(line)) {
- var tr = $('<tr/ >')
- .addClass('create-record-columns')
- .append(
- $('<td />')
- .addClass('columnname')
- .append(prim2html(line[0], 128))
- )
- .append(
- $('<td />')
- .addClass('columntype')
- .append("(")
- .append($('<span />')
- .append(prim2html(line[1], 128))
- )
- .append(")")
- );
- var inputtd = $('<td />').addClass('columnval');
- if (i >= listofs && d_col[1][i - listofs + 1][4].indexOf("COLUMN_VECTOR") >= 0){
- var type = line[1];
- if (value != null) {
- for (var j = 0; j < value.length; j++) {
- inputtd
- .append(this.add_record_inputbox(line[1], value[j]))
- .append(this.add_record_deletebutton())
- .append('<br />');
- }
- }
- inputtd
- .append($('<span />')
- .append("[Add value]")
- .css('cursor', 'pointer')
- .click(function() {
- var target = $(this).parent();
- target
- .append(that.add_record_inputbox($(this).parent().prev().children().text()))
- .append(that.add_record_deletebutton())
- .append("<br />");
- $(this).appendTo(target);
- })
- );
- } else {
- inputtd.append(this.add_record_inputbox(line[1], value));
- if (line[0] == "_key" && value != null) {
- inputtd.children().attr("disabled", "disabled");
- }
- }
- tr.append(inputtd);
- columns.append(tr);
- }
- }
- $("#table-createrecord").append(columns);
- this.hideloading();
- },
- update_createrecord: function(table_name, id) {
- var that = this;
- var d_sel = null;
- var d_col = null;
- $('#table-createrecord').empty();
- this.showloading(
- $.ajax({
- url: '/d/select',
- data: {
- 'table' : table_name,
- 'limit' : 1,
- 'query' : '_id:' + id
- },
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- d_sel = d;
- if (d_col) {
- that.update_createrecord_loadcomplete(d_sel, d_col);
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- this.showloading(
- $.ajax({
- url: '/d/column_list',
- data: {
- 'table' : table_name
- },
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- d_col = d;
- if (d_sel) {
- that.update_createrecord_loadcomplete(d_sel, d_col);
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- createtable: function() {
- var that = this;
- var flags = 0;
- $('#createtable-flags>input:checked').each(function() {
- flags |= Groonga[$(this).val()];
- });
- flags |= Groonga[$('#createtable-key-index').val()];
- this.showloading(
- $.ajax({
- url: '/d/table_create',
- data: {
- name: $('#createtable-name').val(),
- 'flags': flags,
- key_type: $('#createtable-key-type').val(),
- value_type: $('#createtable-value-type').val(),
- default_tokenizer: $('#createtable-default-tokenizer').val()
- },
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- that.hideloading();
- alert('Table is created.');
- that.update_tablelist();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- createcolumn: function() {
- var that = this;
- var flags = 0;
- $('#createcolumn-flags>input:checked').each(function() {
- flags |= Groonga[$(this).val()];
- });
- $('#createcolumn-ii-flags>input:checked').each(function() {
- flags |= Groonga[$(this).val()];
- });
- flags |= Groonga[$('#createcolumn-column-type').val()];
- flags |= Groonga[$('#createcolumn-column-compress').val()];
- var d = {
- table: this.current_table,
- name: $('#createcolumn-name').val(),
- 'flags': flags,
- type: $('#createcolumn-type').val()
- };
- if ($('#createcolumn-source').val()) {
- d['source'] = $('#createcolumn-source').val();
- }
- this.showloading(
- $.ajax({
- url: '/d/column_create',
- data: d,
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- that.hideloading();
- alert('Column is created.');
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- createrecord_getvalue: function(type, inputbox) {
- switch(type){
- case "Bool":
- if (inputbox.is('input:checked')) {
- return true;
- } else {
- return false;
- }
- default:
- return inputbox.val();
- }
- },
- createrecord: function() {
- var that = this;
- var d = {};
- $('.create-record-columns').each(function() {
- if (!$(this).children('.columnval').children().attr('disabled')
- || $(this).children('.columnname').text() == "_key") {
- var type = $(this).children('.columntype').children().text();
- if ($(this).children('.columnval').children('span').length) {
- var arr = [];
- $(this).children('.columnval').children('.column_values').each(function() {
- arr.push(that.createrecord_getvalue(type, $(this)));
- });
- d[$(this).children('.columnname').text()] = arr;
- } else {
- d[$(this).children('.columnname').text()] =
- that.createrecord_getvalue(type, $(this).children('.columnval').children());
- }
- }
- });
- this.showloading(
- $.ajax({
- url: '/d/load',
- data: {
- "table" : this.current_table,
- "input_type" : "json",
- "output_type" : "json",
- "values" : JSON.stringify([d])
- },
- dataType: 'json',
- success: function(d) {
- if (that.validateajax(d) < 0) { return; }
- that.hideloading();
- alert('Record is created.');
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- },
- removerecord: function() {
- var that = this;
- var checklist = $("#tab-recordlist-table").find("input:checked");
- var completecount = checklist.length;
- if (completecount > 0) {
- $('<div />')
- .append("Delete selected " + completecount + " records?")
- .dialog({
- modal: true,
- buttons: {
- 'No': function() {
- $(this).dialog('close');
- },
- 'Yes': function() {
- $(this).dialog('close');
- checklist.each(function(i, val) {
- that.showloading(
- $.ajax({
- url: '/d/delete',
- data: {
- "table" : that.current_table,
- "id" : val.value
- },
- dataType: 'json',
- success: function() {
- if (--completecount == 0) {
- $('#tab-recordlist-form').submit();
- alert('Records are deleted.');
- } else if (completecount < 0){
- that.hideloading();
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- completecount = 0;
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- });
- }
- }
- });
- }
- },
- removecolumn: function() {
- var that = this;
- var checklist = $("#tab-columnlist-table").find("input:checked");
- var completecount = checklist.length;
- if (completecount) {
- $('<div />')
- .append("Delete selected " + completecount + " columns?")
- .dialog({
- modal: true,
- buttons: {
- 'No': function() {
- $(this).dialog('close');
- },
- 'Yes': function() {
- $(this).dialog('close');
- checklist.each(function(i, val) {
- that.showloading(
- $.ajax({
- url: '/d/column_remove',
- data: {
- "table" : that.current_table,
- "name" : val.value
- },
- dataType: 'json',
- success: function() {
- if (!(--completecount)) {
- that.columnlist(that.current_table);
- alert('Columns are deleted.');
- } else if (completecount < 0){
- that.hideloading();
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- completecount = 0;
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- });
- }
- }
- });
- }
- },
- removetable: function() {
- var that = this;
- var checklist = $("#tab-tablelist-table").find("input:checked");
- var completecount = checklist.length;
- if (completecount > 0) {
- $('<div />')
- .append("Delete selected " + completecount + " tables?")
- .dialog({
- modal: true,
- buttons: {
- 'No': function() {
- $(this).dialog('close');
- },
- 'Yes': function() {
- $(this).dialog('close');
- checklist.each(function(i, val) {
- that.showloading(
- $.ajax({
- url: '/d/table_remove',
- data: {
- "name" : val.value
- },
- dataType: 'json',
- success: function() {
- if (--completecount == 0) {
- that.tablelist();
- that.update_tablelist();
- alert('Table are deleted.');
- } else if (completecount < 0){
- that.hideloading();
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- completecount = 0;
- that.errorloading(XMLHttpRequest);
- }
- })
- );
- });
- }
- }
- });
- }
- },
- showloading: function(obj, hide_dialog) {
- var that = this;
- if (obj == null) { return; }
- this.semaphore[this.semaphore.length] = obj;
- if ( $("#loadingdialog").size() > 0 || hide_dialog) { return; }
- $("<div />")
- .attr("id", "loadingdialog")
- .attr("style", "text-align: center;")
- .append($("<img />").attr("src", "images/loading.gif"))
- .append(" Loading...")
- .dialog({
- title: "",
- width: 200,
- height: 110,
- minHeight: 110,
- modal: true,
- resizable: false,
- draggable: false,
- position: ["right", "bottom"],
- autoOpen: false,
- buttons: {
- 'Abort': function() {
- if (obj) { obj.abort(); }
- that.hideloading();
- }
- }
- });
- $("#loadingdialog").parents(".ui-dialog").children(".ui-dialog-titlebar").remove();
- $("#loadingdialog").dialog("open");
- $(".ui-widget-overlay").css("opacity", "0.0");
- },
- hideloading: function() {
- for (var i = 0; i < this.semaphore.length; i++) {
- if ( this.semaphore[i].readyState == 4) {
- this.semaphore.splice(i, 1);
- i--;
- }
- }
- if ( this.semaphore.length == 0) {
- $("#loadingdialog").dialog("close");
- $("#loadingdialog").remove();
- }
- },
- errorloading: function(ajax, hide_dialog) {
- var that = this;
- var json = null;
- if (ajax) {
- json = JSON.parse(ajax.responseText);
- }
- this.hideloading();
- for (var i = 0; i < this.semaphore.length; i++) {
- this.semaphore[i].abort();
- this.semaphore.splice(i, 1);
- i--;
- }
- if ( $("#loadingdialog").size() == 0 && !hide_dialog) {
- var error_label;
- var error_message;
- if (json){
- error_label = "Groonga reports error.";
- error_message = json[0][3] + "(" + json[0][0] + ")";
- } else if (ajax) {
- error_label = "Connection error is occured.";
- error_message = "" + ajax.status + ": " + ajax.statusText;
- } else {
- error_label = "Connection error is occured.";
- error_message = "";
- }
- $("<div />")
- .append($("<div />").text(error_label))
- .append($("<div />").text(error_message))
- .attr("id", "loadingdialog")
- .dialog({
- title: "",
- width: 340,
- height: 160,
- minHeight: 160,
- modal: true,
- resizable: false,
- draggable: false,
- open: function() {
- $(this).parents(".ui-dialog").children(".ui-dialog-titlebar").remove();
- },
- buttons: { OK: function() { that.hideloading(); } }
- });
- }
- },
- validateajax: function(d, hide_dialog) {
- if (!d) {
- this.errorloading(null, hide_dialog);
- return -1;
- }
- return 0;
- }
-});
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/js/jquery-1.7.2.min.js b/storage/mroonga/vendor/groonga/data/html/admin/js/jquery-1.7.2.min.js
deleted file mode 100644
index 16ad06c5aca..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/js/jquery-1.7.2.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v1.7.2 jquery.com | jquery.org/license */
-(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
-a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
-.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/js/jquery-ui-1.8.18.custom.min.js b/storage/mroonga/vendor/groonga/data/html/admin/js/jquery-ui-1.8.18.custom.min.js
deleted file mode 100644
index f00a62f133f..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/js/jquery-ui-1.8.18.custom.min.js
+++ /dev/null
@@ -1,356 +0,0 @@
-/*!
- * jQuery UI 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI
- */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*!
- * jQuery UI Widget 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e;if(f&&e.charAt(0)==="_")return h;f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b){h=f;return!1}}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))});return h}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);this.element.trigger(c,d);return!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);/*!
- * jQuery UI Mouse 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Mouse
- *
- * Depends:
- * jquery.ui.widget.js
- */(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation();return!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(!c){this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted){b.preventDefault();return!0}}!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0;return!0}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/*
- * jQuery UI Position 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Position
- */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/*
- * jQuery UI Draggable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute"));return a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.18"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!!e.length){var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);/*
- * jQuery UI Droppable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Droppables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * jquery.ui.mouse.js
- * jquery.ui.draggable.js
- */(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance)){e=!0;return!1}});if(e)return!1;if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d));return this.element}return!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.18"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g<d.length;g++){if(d[g].options.disabled||b&&!d[g].accept.call(d[g].element[0],b.currentItem||b.element))continue;for(var h=0;h<f.length;h++)if(f[h]==d[g].element[0]){d[g].proportions.height=0;continue droppablesLoop}d[g].visible=d[g].element.css("display")!="none";if(!d[g].visible)continue;e=="mousedown"&&d[g]._activate.call(d[g],c),d[g].offset=d[g].element.offset(),d[g].proportions={width:d[g].element[0].offsetWidth,height:d[g].element[0].offsetHeight}}},drop:function(b,c){var d=!1;a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){!this.options||(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c)))});return d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))}})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);/*
- * jQuery UI Resizable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width));return a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(a.browser.msie&&(!!a(c).is(":hidden")||!!a(c).parents(":hidden").length))continue;e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/*
- * jQuery UI Selectable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Selectables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}});return!1}},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove();return!1}}),a.extend(a.ui.selectable,{version:"1.8.18"})})(jQuery);/*
- * jQuery UI Sortable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Sortables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!e)return!1;return this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1)},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i])}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.18"})})(jQuery);/*
- * jQuery UI Accordion 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Accordion
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.18",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/*
- * jQuery UI Autocomplete 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Autocomplete
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * jquery.ui.position.js
- */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",context:{autocompleteRequest:++c},success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==!1)return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this.response)},_response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close(),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){if(b.length&&b[0].label&&b[0].value)return b;return a.map(b,function(b){if(typeof b=="string")return{label:b,value:b};return a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);/*
- * jQuery UI Button 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Button
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form}));return e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){h.disabled||(a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active"))}).bind("mouseleave.button",function(){h.disabled||a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){f||b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){h.disabled||(f=!1,d=a.pageX,e=a.pageY)}).bind("mouseup.button",function(a){!h.disabled&&(d!==a.pageX||e!==a.pageY)&&(f=!0)})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed","true");var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);b==="disabled"?c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1):this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass(i),c=a("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/*
- * jQuery UI Dialog 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * jquery.ui.button.js
- * jquery.ui.draggable.js
- * jquery.ui.mouse.js
- * jquery.ui.position.js
- * jquery.ui.resizable.js
- */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||"&#160;",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||"&#160;"))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}),a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize));var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b<c?a(window).height()+"px":b+"px"}return a(document).height()+"px"},width:function(){var b,c;if(a.browser.msie){b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return b<c?a(window).width()+"px":b+"px"}return a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)}),b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}}),a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);/*
- * jQuery UI Slider 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Slider
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=a(this).data("index.ui-slider-handle"),f,g,h,i;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:d.preventDefault();if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),f=b._start(d,e);if(f===!1)return}}i=b.options.step,b.options.values&&b.options.values.length?g=h=b.values(e):g=h=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:h=b._valueMin();break;case a.ui.keyCode.END:h=b._valueMax();break;case a.ui.keyCode.PAGE_UP:h=b._trimAlignValue(g+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(g-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g===b._valueMax())return;h=b._trimAlignValue(g+i);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g===b._valueMin())return;h=b._trimAlignValue(g-i)}b._slide(d,e,h)}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/*
- * jQuery UI Tabs 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Tabs
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){t=d.selected,e()}:function(a){a.clientX&&c.rotate(null)});a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate);return this}})})(jQuery);/*
- * jQuery UI Datepicker 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Datepicker
- *
- * Depends:
- * jquery.ui.core.js
- */(function($,undefined){function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);!c.length||c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);!$.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])&&!!d.length&&(d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover"))})}function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;c&&s++;return c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;r+=f[0].length;return parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){f=c[0],r+=d.length;return!1}});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;c&&m++;return c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;c&&e++;return c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0));return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),
-a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;e=d&&e>d?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/*
- * jQuery UI Progressbar 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Progressbar
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/*
- * jQuery UI Effects 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/
- */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){b=="toggle"&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);if((c/=f/2)<1)return e/2*c*c*(((g*=1.525)+1)*c-g)+d;return e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){if(c<f/2)return a.easing.easeInBounce(b,c*2,0,e,f)*.5+d;return a.easing.easeOutBounce(b,c*2-f,0,e,f)*.5+e*.5+d}})}(jQuery);/*
- * jQuery UI Effects Blind 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Blind
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/*
- * jQuery UI Effects Bounce 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Bounce
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight({margin:!0})/3:c.outerWidth({margin:!0})/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing),g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g,c.animate(l,i/2,b.options.easing,function(){c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/*
- * jQuery UI Effects Clip 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Clip
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();e=="show"&&(h.css(i.size,0),h.css(i.position,j/2));var k={};k[i.size]=e=="show"?j:0,k[i.position]=e=="show"?0:j/2,h.animate(k,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Drop 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Drop
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0})/2:c.outerWidth({margin:!0})/2);e=="show"&&c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Explode 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Explode
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3,d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);for(var i=0;i<c;i++)for(var j=0;j<d;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/*
- * jQuery UI Effects Fade 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Fade
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Fold 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Fold
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/*
- * jQuery UI Effects Highlight 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Highlight
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Pulsate 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Pulsate
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&&times--;for(var e=0;e<times;e++)c.animate({opacity:animateTo},duration,b.options.easing),animateTo=(animateTo+1)%2;c.animate({opacity:animateTo},duration,b.options.easing,function(){animateTo==0&&c.hide(),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);/*
- * jQuery UI Effects Scale 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Scale
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:!0,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}}),c.effect("scale",b.options,b.duration,b.callback),c.dequeue()})},a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),e=="hide"&&(c.from.opacity=1,c.to.opacity=0)),d.from=c.from,d.to=c.to,d.mode=e,c.effect("size",d,b.duration,b.callback),c.dequeue()})},a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,n={height:c.height(),width:c.width()};c.from=b.options.from||n,c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y,c.from.left=(n.width-c.from.width)*p.x,c.to.top=(n.height-c.to.height)*p.y,c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both")q.from.y!=q.to.y&&(d=d.concat(h),c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(d=d.concat(i),c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to));(l=="content"||l=="both")&&q.from.y!=q.to.y&&(d=d.concat(g),c.from=a.effects.setTransition(c,g,q.from.y,c.from),c.to=a.effects.setTransition(c,g,q.to.y,c.to)),a.effects.save(c,k?d:e),c.show(),a.effects.createWrapper(c),c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both")h=h.concat(["marginTop","marginBottom"]).concat(g),i=i.concat(["marginLeft","marginRight"]),f=d.concat(h).concat(i),c.find("*[width]").each(function(){child=a(this),k&&a.effects.save(child,f);var c={height:child.height(),width:child.width()};child.from={height:c.height*q.from.y,width:c.width*q.from.x},child.to={height:c.height*q.to.y,width:c.width*q.to.x},q.from.y!=q.to.y&&(child.from=a.effects.setTransition(child,h,q.from.y,child.from),child.to=a.effects.setTransition(child,h,q.to.y,child.to)),q.from.x!=q.to.x&&(child.from=a.effects.setTransition(child,i,q.from.x,child.from),child.to=a.effects.setTransition(child,i,q.to.x,child.to)),child.css(child.from),child.animate(child.to,b.duration,b.options.easing,function(){k&&a.effects.restore(child,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Shake 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Shake
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,i=b.duration||b.options.duration||140;a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g,m[j]=(k=="pos"?"+=":"-=")+g*2,n[j]=(k=="pos"?"-=":"+=")+g*2,c.animate(l,i,b.options.easing);for(var p=1;p<h;p++)c.animate(m,i,b.options.easing).animate(n,i,b.options.easing);c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/*
- * jQuery UI Effects Slide 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Slide
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"show"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0}):c.outerWidth({margin:!0}));e=="show"&&c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Transfer 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Transfer
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot-0.7.min.js b/storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot-0.7.min.js
deleted file mode 100644
index 4467fc5d8cd..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot-0.7.min.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Javascript plotting library for jQuery, v. 0.7.
- *
- * Released under the MIT license by IOLA, December 2007.
- *
- */
-(function(b){b.color={};b.color.make=function(d,e,g,f){var c={};c.r=d||0;c.g=e||0;c.b=g||0;c.a=f!=null?f:1;c.add=function(h,j){for(var k=0;k<h.length;++k){c[h.charAt(k)]+=j}return c.normalize()};c.scale=function(h,j){for(var k=0;k<h.length;++k){c[h.charAt(k)]*=j}return c.normalize()};c.toString=function(){if(c.a>=1){return"rgb("+[c.r,c.g,c.b].join(",")+")"}else{return"rgba("+[c.r,c.g,c.b,c.a].join(",")+")"}};c.normalize=function(){function h(k,j,l){return j<k?k:(j>l?l:j)}c.r=h(0,parseInt(c.r),255);c.g=h(0,parseInt(c.g),255);c.b=h(0,parseInt(c.b),255);c.a=h(0,c.a,1);return c};c.clone=function(){return b.color.make(c.r,c.b,c.g,c.a)};return c.normalize()};b.color.extract=function(d,e){var c;do{c=d.css(e).toLowerCase();if(c!=""&&c!="transparent"){break}d=d.parent()}while(!b.nodeName(d.get(0),"body"));if(c=="rgba(0, 0, 0, 0)"){c="transparent"}return b.color.parse(c)};b.color.parse=function(c){var d,f=b.color.make;if(d=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c)){return f(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10))}if(d=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c)){return f(parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10),parseFloat(d[4]))}if(d=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c)){return f(parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55)}if(d=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(c)){return f(parseFloat(d[1])*2.55,parseFloat(d[2])*2.55,parseFloat(d[3])*2.55,parseFloat(d[4]))}if(d=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c)){return f(parseInt(d[1],16),parseInt(d[2],16),parseInt(d[3],16))}if(d=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c)){return f(parseInt(d[1]+d[1],16),parseInt(d[2]+d[2],16),parseInt(d[3]+d[3],16))}var e=b.trim(c).toLowerCase();if(e=="transparent"){return f(255,255,255,0)}else{d=a[e]||[0,0,0];return f(d[0],d[1],d[2])}};var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);(function(c){function b(av,ai,J,af){var Q=[],O={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:true,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:0.85},xaxis:{show:null,position:"bottom",mode:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null,monthNames:null,timeformat:null,twelveHourClock:false},yaxis:{autoscaleMargin:0.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:false,radius:3,lineWidth:2,fill:true,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:false,fillColor:null,steps:false},bars:{show:false,lineWidth:2,barWidth:1,fill:true,fillColor:null,align:"left",horizontal:false},shadowSize:3},grid:{show:true,aboveData:false,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:false,hoverable:false,autoHighlight:true,mouseActiveRadius:10},hooks:{}},az=null,ad=null,y=null,H=null,A=null,p=[],aw=[],q={left:0,right:0,top:0,bottom:0},G=0,I=0,h=0,w=0,ak={processOptions:[],processRawData:[],processDatapoints:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},aq=this;aq.setData=aj;aq.setupGrid=t;aq.draw=W;aq.getPlaceholder=function(){return av};aq.getCanvas=function(){return az};aq.getPlotOffset=function(){return q};aq.width=function(){return h};aq.height=function(){return w};aq.offset=function(){var aB=y.offset();aB.left+=q.left;aB.top+=q.top;return aB};aq.getData=function(){return Q};aq.getAxes=function(){var aC={},aB;c.each(p.concat(aw),function(aD,aE){if(aE){aC[aE.direction+(aE.n!=1?aE.n:"")+"axis"]=aE}});return aC};aq.getXAxes=function(){return p};aq.getYAxes=function(){return aw};aq.c2p=C;aq.p2c=ar;aq.getOptions=function(){return O};aq.highlight=x;aq.unhighlight=T;aq.triggerRedrawOverlay=f;aq.pointOffset=function(aB){return{left:parseInt(p[aA(aB,"x")-1].p2c(+aB.x)+q.left),top:parseInt(aw[aA(aB,"y")-1].p2c(+aB.y)+q.top)}};aq.shutdown=ag;aq.resize=function(){B();g(az);g(ad)};aq.hooks=ak;F(aq);Z(J);X();aj(ai);t();W();ah();function an(aD,aB){aB=[aq].concat(aB);for(var aC=0;aC<aD.length;++aC){aD[aC].apply(this,aB)}}function F(){for(var aB=0;aB<af.length;++aB){var aC=af[aB];aC.init(aq);if(aC.options){c.extend(true,O,aC.options)}}}function Z(aC){var aB;c.extend(true,O,aC);if(O.xaxis.color==null){O.xaxis.color=O.grid.color}if(O.yaxis.color==null){O.yaxis.color=O.grid.color}if(O.xaxis.tickColor==null){O.xaxis.tickColor=O.grid.tickColor}if(O.yaxis.tickColor==null){O.yaxis.tickColor=O.grid.tickColor}if(O.grid.borderColor==null){O.grid.borderColor=O.grid.color}if(O.grid.tickColor==null){O.grid.tickColor=c.color.parse(O.grid.color).scale("a",0.22).toString()}for(aB=0;aB<Math.max(1,O.xaxes.length);++aB){O.xaxes[aB]=c.extend(true,{},O.xaxis,O.xaxes[aB])}for(aB=0;aB<Math.max(1,O.yaxes.length);++aB){O.yaxes[aB]=c.extend(true,{},O.yaxis,O.yaxes[aB])}if(O.xaxis.noTicks&&O.xaxis.ticks==null){O.xaxis.ticks=O.xaxis.noTicks}if(O.yaxis.noTicks&&O.yaxis.ticks==null){O.yaxis.ticks=O.yaxis.noTicks}if(O.x2axis){O.xaxes[1]=c.extend(true,{},O.xaxis,O.x2axis);O.xaxes[1].position="top"}if(O.y2axis){O.yaxes[1]=c.extend(true,{},O.yaxis,O.y2axis);O.yaxes[1].position="right"}if(O.grid.coloredAreas){O.grid.markings=O.grid.coloredAreas}if(O.grid.coloredAreasColor){O.grid.markingsColor=O.grid.coloredAreasColor}if(O.lines){c.extend(true,O.series.lines,O.lines)}if(O.points){c.extend(true,O.series.points,O.points)}if(O.bars){c.extend(true,O.series.bars,O.bars)}if(O.shadowSize!=null){O.series.shadowSize=O.shadowSize}for(aB=0;aB<O.xaxes.length;++aB){V(p,aB+1).options=O.xaxes[aB]}for(aB=0;aB<O.yaxes.length;++aB){V(aw,aB+1).options=O.yaxes[aB]}for(var aD in ak){if(O.hooks[aD]&&O.hooks[aD].length){ak[aD]=ak[aD].concat(O.hooks[aD])}}an(ak.processOptions,[O])}function aj(aB){Q=Y(aB);ax();z()}function Y(aE){var aC=[];for(var aB=0;aB<aE.length;++aB){var aD=c.extend(true,{},O.series);if(aE[aB].data!=null){aD.data=aE[aB].data;delete aE[aB].data;c.extend(true,aD,aE[aB]);aE[aB].data=aD.data}else{aD.data=aE[aB]}aC.push(aD)}return aC}function aA(aC,aD){var aB=aC[aD+"axis"];if(typeof aB=="object"){aB=aB.n}if(typeof aB!="number"){aB=1}return aB}function m(){return c.grep(p.concat(aw),function(aB){return aB})}function C(aE){var aC={},aB,aD;for(aB=0;aB<p.length;++aB){aD=p[aB];if(aD&&aD.used){aC["x"+aD.n]=aD.c2p(aE.left)}}for(aB=0;aB<aw.length;++aB){aD=aw[aB];if(aD&&aD.used){aC["y"+aD.n]=aD.c2p(aE.top)}}if(aC.x1!==undefined){aC.x=aC.x1}if(aC.y1!==undefined){aC.y=aC.y1}return aC}function ar(aF){var aD={},aC,aE,aB;for(aC=0;aC<p.length;++aC){aE=p[aC];if(aE&&aE.used){aB="x"+aE.n;if(aF[aB]==null&&aE.n==1){aB="x"}if(aF[aB]!=null){aD.left=aE.p2c(aF[aB]);break}}}for(aC=0;aC<aw.length;++aC){aE=aw[aC];if(aE&&aE.used){aB="y"+aE.n;if(aF[aB]==null&&aE.n==1){aB="y"}if(aF[aB]!=null){aD.top=aE.p2c(aF[aB]);break}}}return aD}function V(aC,aB){if(!aC[aB-1]){aC[aB-1]={n:aB,direction:aC==p?"x":"y",options:c.extend(true,{},aC==p?O.xaxis:O.yaxis)}}return aC[aB-1]}function ax(){var aG;var aM=Q.length,aB=[],aE=[];for(aG=0;aG<Q.length;++aG){var aJ=Q[aG].color;if(aJ!=null){--aM;if(typeof aJ=="number"){aE.push(aJ)}else{aB.push(c.color.parse(Q[aG].color))}}}for(aG=0;aG<aE.length;++aG){aM=Math.max(aM,aE[aG]+1)}var aC=[],aF=0;aG=0;while(aC.length<aM){var aI;if(O.colors.length==aG){aI=c.color.make(100,100,100)}else{aI=c.color.parse(O.colors[aG])}var aD=aF%2==1?-1:1;aI.scale("rgb",1+aD*Math.ceil(aF/2)*0.2);aC.push(aI);++aG;if(aG>=O.colors.length){aG=0;++aF}}var aH=0,aN;for(aG=0;aG<Q.length;++aG){aN=Q[aG];if(aN.color==null){aN.color=aC[aH].toString();++aH}else{if(typeof aN.color=="number"){aN.color=aC[aN.color].toString()}}if(aN.lines.show==null){var aL,aK=true;for(aL in aN){if(aN[aL]&&aN[aL].show){aK=false;break}}if(aK){aN.lines.show=true}}aN.xaxis=V(p,aA(aN,"x"));aN.yaxis=V(aw,aA(aN,"y"))}}function z(){var aO=Number.POSITIVE_INFINITY,aI=Number.NEGATIVE_INFINITY,aB=Number.MAX_VALUE,aU,aS,aR,aN,aD,aJ,aT,aP,aH,aG,aC,a0,aX,aL;function aF(a3,a2,a1){if(a2<a3.datamin&&a2!=-aB){a3.datamin=a2}if(a1>a3.datamax&&a1!=aB){a3.datamax=a1}}c.each(m(),function(a1,a2){a2.datamin=aO;a2.datamax=aI;a2.used=false});for(aU=0;aU<Q.length;++aU){aJ=Q[aU];aJ.datapoints={points:[]};an(ak.processRawData,[aJ,aJ.data,aJ.datapoints])}for(aU=0;aU<Q.length;++aU){aJ=Q[aU];var aZ=aJ.data,aW=aJ.datapoints.format;if(!aW){aW=[];aW.push({x:true,number:true,required:true});aW.push({y:true,number:true,required:true});if(aJ.bars.show||(aJ.lines.show&&aJ.lines.fill)){aW.push({y:true,number:true,required:false,defaultValue:0});if(aJ.bars.horizontal){delete aW[aW.length-1].y;aW[aW.length-1].x=true}}aJ.datapoints.format=aW}if(aJ.datapoints.pointsize!=null){continue}aJ.datapoints.pointsize=aW.length;aP=aJ.datapoints.pointsize;aT=aJ.datapoints.points;insertSteps=aJ.lines.show&&aJ.lines.steps;aJ.xaxis.used=aJ.yaxis.used=true;for(aS=aR=0;aS<aZ.length;++aS,aR+=aP){aL=aZ[aS];var aE=aL==null;if(!aE){for(aN=0;aN<aP;++aN){a0=aL[aN];aX=aW[aN];if(aX){if(aX.number&&a0!=null){a0=+a0;if(isNaN(a0)){a0=null}else{if(a0==Infinity){a0=aB}else{if(a0==-Infinity){a0=-aB}}}}if(a0==null){if(aX.required){aE=true}if(aX.defaultValue!=null){a0=aX.defaultValue}}}aT[aR+aN]=a0}}if(aE){for(aN=0;aN<aP;++aN){a0=aT[aR+aN];if(a0!=null){aX=aW[aN];if(aX.x){aF(aJ.xaxis,a0,a0)}if(aX.y){aF(aJ.yaxis,a0,a0)}}aT[aR+aN]=null}}else{if(insertSteps&&aR>0&&aT[aR-aP]!=null&&aT[aR-aP]!=aT[aR]&&aT[aR-aP+1]!=aT[aR+1]){for(aN=0;aN<aP;++aN){aT[aR+aP+aN]=aT[aR+aN]}aT[aR+1]=aT[aR-aP+1];aR+=aP}}}}for(aU=0;aU<Q.length;++aU){aJ=Q[aU];an(ak.processDatapoints,[aJ,aJ.datapoints])}for(aU=0;aU<Q.length;++aU){aJ=Q[aU];aT=aJ.datapoints.points,aP=aJ.datapoints.pointsize;var aK=aO,aQ=aO,aM=aI,aV=aI;for(aS=0;aS<aT.length;aS+=aP){if(aT[aS]==null){continue}for(aN=0;aN<aP;++aN){a0=aT[aS+aN];aX=aW[aN];if(!aX||a0==aB||a0==-aB){continue}if(aX.x){if(a0<aK){aK=a0}if(a0>aM){aM=a0}}if(aX.y){if(a0<aQ){aQ=a0}if(a0>aV){aV=a0}}}}if(aJ.bars.show){var aY=aJ.bars.align=="left"?0:-aJ.bars.barWidth/2;if(aJ.bars.horizontal){aQ+=aY;aV+=aY+aJ.bars.barWidth}else{aK+=aY;aM+=aY+aJ.bars.barWidth}}aF(aJ.xaxis,aK,aM);aF(aJ.yaxis,aQ,aV)}c.each(m(),function(a1,a2){if(a2.datamin==aO){a2.datamin=null}if(a2.datamax==aI){a2.datamax=null}})}function j(aB,aC){var aD=document.createElement("canvas");aD.className=aC;aD.width=G;aD.height=I;if(!aB){c(aD).css({position:"absolute",left:0,top:0})}c(aD).appendTo(av);if(!aD.getContext){aD=window.G_vmlCanvasManager.initElement(aD)}aD.getContext("2d").save();return aD}function B(){G=av.width();I=av.height();if(G<=0||I<=0){throw"Invalid dimensions for plot, width = "+G+", height = "+I}}function g(aC){if(aC.width!=G){aC.width=G}if(aC.height!=I){aC.height=I}var aB=aC.getContext("2d");aB.restore();aB.save()}function X(){var aC,aB=av.children("canvas.base"),aD=av.children("canvas.overlay");if(aB.length==0||aD==0){av.html("");av.css({padding:0});if(av.css("position")=="static"){av.css("position","relative")}B();az=j(true,"base");ad=j(false,"overlay");aC=false}else{az=aB.get(0);ad=aD.get(0);aC=true}H=az.getContext("2d");A=ad.getContext("2d");y=c([ad,az]);if(aC){av.data("plot").shutdown();aq.resize();A.clearRect(0,0,G,I);y.unbind();av.children().not([az,ad]).remove()}av.data("plot",aq)}function ah(){if(O.grid.hoverable){y.mousemove(aa);y.mouseleave(l)}if(O.grid.clickable){y.click(R)}an(ak.bindEvents,[y])}function ag(){if(M){clearTimeout(M)}y.unbind("mousemove",aa);y.unbind("mouseleave",l);y.unbind("click",R);an(ak.shutdown,[y])}function r(aG){function aC(aH){return aH}var aF,aB,aD=aG.options.transform||aC,aE=aG.options.inverseTransform;if(aG.direction=="x"){aF=aG.scale=h/Math.abs(aD(aG.max)-aD(aG.min));aB=Math.min(aD(aG.max),aD(aG.min))}else{aF=aG.scale=w/Math.abs(aD(aG.max)-aD(aG.min));aF=-aF;aB=Math.max(aD(aG.max),aD(aG.min))}if(aD==aC){aG.p2c=function(aH){return(aH-aB)*aF}}else{aG.p2c=function(aH){return(aD(aH)-aB)*aF}}if(!aE){aG.c2p=function(aH){return aB+aH/aF}}else{aG.c2p=function(aH){return aE(aB+aH/aF)}}}function L(aD){var aB=aD.options,aF,aJ=aD.ticks||[],aI=[],aE,aK=aB.labelWidth,aG=aB.labelHeight,aC;function aH(aM,aL){return c('<div style="position:absolute;top:-10000px;'+aL+'font-size:smaller"><div class="'+aD.direction+"Axis "+aD.direction+aD.n+'Axis">'+aM.join("")+"</div></div>").appendTo(av)}if(aD.direction=="x"){if(aK==null){aK=Math.floor(G/(aJ.length>0?aJ.length:1))}if(aG==null){aI=[];for(aF=0;aF<aJ.length;++aF){aE=aJ[aF].label;if(aE){aI.push('<div class="tickLabel" style="float:left;width:'+aK+'px">'+aE+"</div>")}}if(aI.length>0){aI.push('<div style="clear:left"></div>');aC=aH(aI,"width:10000px;");aG=aC.height();aC.remove()}}}else{if(aK==null||aG==null){for(aF=0;aF<aJ.length;++aF){aE=aJ[aF].label;if(aE){aI.push('<div class="tickLabel">'+aE+"</div>")}}if(aI.length>0){aC=aH(aI,"");if(aK==null){aK=aC.children().width()}if(aG==null){aG=aC.find("div.tickLabel").height()}aC.remove()}}}if(aK==null){aK=0}if(aG==null){aG=0}aD.labelWidth=aK;aD.labelHeight=aG}function au(aD){var aC=aD.labelWidth,aL=aD.labelHeight,aH=aD.options.position,aF=aD.options.tickLength,aG=O.grid.axisMargin,aJ=O.grid.labelMargin,aK=aD.direction=="x"?p:aw,aE;var aB=c.grep(aK,function(aN){return aN&&aN.options.position==aH&&aN.reserveSpace});if(c.inArray(aD,aB)==aB.length-1){aG=0}if(aF==null){aF="full"}var aI=c.grep(aK,function(aN){return aN&&aN.reserveSpace});var aM=c.inArray(aD,aI)==0;if(!aM&&aF=="full"){aF=5}if(!isNaN(+aF)){aJ+=+aF}if(aD.direction=="x"){aL+=aJ;if(aH=="bottom"){q.bottom+=aL+aG;aD.box={top:I-q.bottom,height:aL}}else{aD.box={top:q.top+aG,height:aL};q.top+=aL+aG}}else{aC+=aJ;if(aH=="left"){aD.box={left:q.left+aG,width:aC};q.left+=aC+aG}else{q.right+=aC+aG;aD.box={left:G-q.right,width:aC}}}aD.position=aH;aD.tickLength=aF;aD.box.padding=aJ;aD.innermost=aM}function U(aB){if(aB.direction=="x"){aB.box.left=q.left;aB.box.width=h}else{aB.box.top=q.top;aB.box.height=w}}function t(){var aC,aE=m();c.each(aE,function(aF,aG){aG.show=aG.options.show;if(aG.show==null){aG.show=aG.used}aG.reserveSpace=aG.show||aG.options.reserveSpace;n(aG)});allocatedAxes=c.grep(aE,function(aF){return aF.reserveSpace});q.left=q.right=q.top=q.bottom=0;if(O.grid.show){c.each(allocatedAxes,function(aF,aG){S(aG);P(aG);ap(aG,aG.ticks);L(aG)});for(aC=allocatedAxes.length-1;aC>=0;--aC){au(allocatedAxes[aC])}var aD=O.grid.minBorderMargin;if(aD==null){aD=0;for(aC=0;aC<Q.length;++aC){aD=Math.max(aD,Q[aC].points.radius+Q[aC].points.lineWidth/2)}}for(var aB in q){q[aB]+=O.grid.borderWidth;q[aB]=Math.max(aD,q[aB])}}h=G-q.left-q.right;w=I-q.bottom-q.top;c.each(aE,function(aF,aG){r(aG)});if(O.grid.show){c.each(allocatedAxes,function(aF,aG){U(aG)});k()}o()}function n(aE){var aF=aE.options,aD=+(aF.min!=null?aF.min:aE.datamin),aB=+(aF.max!=null?aF.max:aE.datamax),aH=aB-aD;if(aH==0){var aC=aB==0?1:0.01;if(aF.min==null){aD-=aC}if(aF.max==null||aF.min!=null){aB+=aC}}else{var aG=aF.autoscaleMargin;if(aG!=null){if(aF.min==null){aD-=aH*aG;if(aD<0&&aE.datamin!=null&&aE.datamin>=0){aD=0}}if(aF.max==null){aB+=aH*aG;if(aB>0&&aE.datamax!=null&&aE.datamax<=0){aB=0}}}}aE.min=aD;aE.max=aB}function S(aG){var aM=aG.options;var aH;if(typeof aM.ticks=="number"&&aM.ticks>0){aH=aM.ticks}else{aH=0.3*Math.sqrt(aG.direction=="x"?G:I)}var aT=(aG.max-aG.min)/aH,aO,aB,aN,aR,aS,aQ,aI;if(aM.mode=="time"){var aJ={second:1000,minute:60*1000,hour:60*60*1000,day:24*60*60*1000,month:30*24*60*60*1000,year:365.2425*24*60*60*1000};var aK=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[0.25,"month"],[0.5,"month"],[1,"month"],[2,"month"],[3,"month"],[6,"month"],[1,"year"]];var aC=0;if(aM.minTickSize!=null){if(typeof aM.tickSize=="number"){aC=aM.tickSize}else{aC=aM.minTickSize[0]*aJ[aM.minTickSize[1]]}}for(var aS=0;aS<aK.length-1;++aS){if(aT<(aK[aS][0]*aJ[aK[aS][1]]+aK[aS+1][0]*aJ[aK[aS+1][1]])/2&&aK[aS][0]*aJ[aK[aS][1]]>=aC){break}}aO=aK[aS][0];aN=aK[aS][1];if(aN=="year"){aQ=Math.pow(10,Math.floor(Math.log(aT/aJ.year)/Math.LN10));aI=(aT/aJ.year)/aQ;if(aI<1.5){aO=1}else{if(aI<3){aO=2}else{if(aI<7.5){aO=5}else{aO=10}}}aO*=aQ}aG.tickSize=aM.tickSize||[aO,aN];aB=function(aX){var a2=[],a0=aX.tickSize[0],a3=aX.tickSize[1],a1=new Date(aX.min);var aW=a0*aJ[a3];if(a3=="second"){a1.setUTCSeconds(a(a1.getUTCSeconds(),a0))}if(a3=="minute"){a1.setUTCMinutes(a(a1.getUTCMinutes(),a0))}if(a3=="hour"){a1.setUTCHours(a(a1.getUTCHours(),a0))}if(a3=="month"){a1.setUTCMonth(a(a1.getUTCMonth(),a0))}if(a3=="year"){a1.setUTCFullYear(a(a1.getUTCFullYear(),a0))}a1.setUTCMilliseconds(0);if(aW>=aJ.minute){a1.setUTCSeconds(0)}if(aW>=aJ.hour){a1.setUTCMinutes(0)}if(aW>=aJ.day){a1.setUTCHours(0)}if(aW>=aJ.day*4){a1.setUTCDate(1)}if(aW>=aJ.year){a1.setUTCMonth(0)}var a5=0,a4=Number.NaN,aY;do{aY=a4;a4=a1.getTime();a2.push(a4);if(a3=="month"){if(a0<1){a1.setUTCDate(1);var aV=a1.getTime();a1.setUTCMonth(a1.getUTCMonth()+1);var aZ=a1.getTime();a1.setTime(a4+a5*aJ.hour+(aZ-aV)*a0);a5=a1.getUTCHours();a1.setUTCHours(0)}else{a1.setUTCMonth(a1.getUTCMonth()+a0)}}else{if(a3=="year"){a1.setUTCFullYear(a1.getUTCFullYear()+a0)}else{a1.setTime(a4+aW)}}}while(a4<aX.max&&a4!=aY);return a2};aR=function(aV,aY){var a0=new Date(aV);if(aM.timeformat!=null){return c.plot.formatDate(a0,aM.timeformat,aM.monthNames)}var aW=aY.tickSize[0]*aJ[aY.tickSize[1]];var aX=aY.max-aY.min;var aZ=(aM.twelveHourClock)?" %p":"";if(aW<aJ.minute){fmt="%h:%M:%S"+aZ}else{if(aW<aJ.day){if(aX<2*aJ.day){fmt="%h:%M"+aZ}else{fmt="%b %d %h:%M"+aZ}}else{if(aW<aJ.month){fmt="%b %d"}else{if(aW<aJ.year){if(aX<aJ.year){fmt="%b"}else{fmt="%b %y"}}else{fmt="%y"}}}}return c.plot.formatDate(a0,fmt,aM.monthNames)}}else{var aU=aM.tickDecimals;var aP=-Math.floor(Math.log(aT)/Math.LN10);if(aU!=null&&aP>aU){aP=aU}aQ=Math.pow(10,-aP);aI=aT/aQ;if(aI<1.5){aO=1}else{if(aI<3){aO=2;if(aI>2.25&&(aU==null||aP+1<=aU)){aO=2.5;++aP}}else{if(aI<7.5){aO=5}else{aO=10}}}aO*=aQ;if(aM.minTickSize!=null&&aO<aM.minTickSize){aO=aM.minTickSize}aG.tickDecimals=Math.max(0,aU!=null?aU:aP);aG.tickSize=aM.tickSize||aO;aB=function(aX){var aZ=[];var a0=a(aX.min,aX.tickSize),aW=0,aV=Number.NaN,aY;do{aY=aV;aV=a0+aW*aX.tickSize;aZ.push(aV);++aW}while(aV<aX.max&&aV!=aY);return aZ};aR=function(aV,aW){return aV.toFixed(aW.tickDecimals)}}if(aM.alignTicksWithAxis!=null){var aF=(aG.direction=="x"?p:aw)[aM.alignTicksWithAxis-1];if(aF&&aF.used&&aF!=aG){var aL=aB(aG);if(aL.length>0){if(aM.min==null){aG.min=Math.min(aG.min,aL[0])}if(aM.max==null&&aL.length>1){aG.max=Math.max(aG.max,aL[aL.length-1])}}aB=function(aX){var aY=[],aV,aW;for(aW=0;aW<aF.ticks.length;++aW){aV=(aF.ticks[aW].v-aF.min)/(aF.max-aF.min);aV=aX.min+aV*(aX.max-aX.min);aY.push(aV)}return aY};if(aG.mode!="time"&&aM.tickDecimals==null){var aE=Math.max(0,-Math.floor(Math.log(aT)/Math.LN10)+1),aD=aB(aG);if(!(aD.length>1&&/\..*0$/.test((aD[1]-aD[0]).toFixed(aE)))){aG.tickDecimals=aE}}}}aG.tickGenerator=aB;if(c.isFunction(aM.tickFormatter)){aG.tickFormatter=function(aV,aW){return""+aM.tickFormatter(aV,aW)}}else{aG.tickFormatter=aR}}function P(aF){var aH=aF.options.ticks,aG=[];if(aH==null||(typeof aH=="number"&&aH>0)){aG=aF.tickGenerator(aF)}else{if(aH){if(c.isFunction(aH)){aG=aH({min:aF.min,max:aF.max})}else{aG=aH}}}var aE,aB;aF.ticks=[];for(aE=0;aE<aG.length;++aE){var aC=null;var aD=aG[aE];if(typeof aD=="object"){aB=+aD[0];if(aD.length>1){aC=aD[1]}}else{aB=+aD}if(aC==null){aC=aF.tickFormatter(aB,aF)}if(!isNaN(aB)){aF.ticks.push({v:aB,label:aC})}}}function ap(aB,aC){if(aB.options.autoscaleMargin&&aC.length>0){if(aB.options.min==null){aB.min=Math.min(aB.min,aC[0].v)}if(aB.options.max==null&&aC.length>1){aB.max=Math.max(aB.max,aC[aC.length-1].v)}}}function W(){H.clearRect(0,0,G,I);var aC=O.grid;if(aC.show&&aC.backgroundColor){N()}if(aC.show&&!aC.aboveData){ac()}for(var aB=0;aB<Q.length;++aB){an(ak.drawSeries,[H,Q[aB]]);d(Q[aB])}an(ak.draw,[H]);if(aC.show&&aC.aboveData){ac()}}function D(aB,aI){var aE,aH,aG,aD,aF=m();for(i=0;i<aF.length;++i){aE=aF[i];if(aE.direction==aI){aD=aI+aE.n+"axis";if(!aB[aD]&&aE.n==1){aD=aI+"axis"}if(aB[aD]){aH=aB[aD].from;aG=aB[aD].to;break}}}if(!aB[aD]){aE=aI=="x"?p[0]:aw[0];aH=aB[aI+"1"];aG=aB[aI+"2"]}if(aH!=null&&aG!=null&&aH>aG){var aC=aH;aH=aG;aG=aC}return{from:aH,to:aG,axis:aE}}function N(){H.save();H.translate(q.left,q.top);H.fillStyle=am(O.grid.backgroundColor,w,0,"rgba(255, 255, 255, 0)");H.fillRect(0,0,h,w);H.restore()}function ac(){var aF;H.save();H.translate(q.left,q.top);var aH=O.grid.markings;if(aH){if(c.isFunction(aH)){var aK=aq.getAxes();aK.xmin=aK.xaxis.min;aK.xmax=aK.xaxis.max;aK.ymin=aK.yaxis.min;aK.ymax=aK.yaxis.max;aH=aH(aK)}for(aF=0;aF<aH.length;++aF){var aD=aH[aF],aC=D(aD,"x"),aI=D(aD,"y");if(aC.from==null){aC.from=aC.axis.min}if(aC.to==null){aC.to=aC.axis.max}if(aI.from==null){aI.from=aI.axis.min}if(aI.to==null){aI.to=aI.axis.max}if(aC.to<aC.axis.min||aC.from>aC.axis.max||aI.to<aI.axis.min||aI.from>aI.axis.max){continue}aC.from=Math.max(aC.from,aC.axis.min);aC.to=Math.min(aC.to,aC.axis.max);aI.from=Math.max(aI.from,aI.axis.min);aI.to=Math.min(aI.to,aI.axis.max);if(aC.from==aC.to&&aI.from==aI.to){continue}aC.from=aC.axis.p2c(aC.from);aC.to=aC.axis.p2c(aC.to);aI.from=aI.axis.p2c(aI.from);aI.to=aI.axis.p2c(aI.to);if(aC.from==aC.to||aI.from==aI.to){H.beginPath();H.strokeStyle=aD.color||O.grid.markingsColor;H.lineWidth=aD.lineWidth||O.grid.markingsLineWidth;H.moveTo(aC.from,aI.from);H.lineTo(aC.to,aI.to);H.stroke()}else{H.fillStyle=aD.color||O.grid.markingsColor;H.fillRect(aC.from,aI.to,aC.to-aC.from,aI.from-aI.to)}}}var aK=m(),aM=O.grid.borderWidth;for(var aE=0;aE<aK.length;++aE){var aB=aK[aE],aG=aB.box,aQ=aB.tickLength,aN,aL,aP,aJ;if(!aB.show||aB.ticks.length==0){continue}H.strokeStyle=aB.options.tickColor||c.color.parse(aB.options.color).scale("a",0.22).toString();H.lineWidth=1;if(aB.direction=="x"){aN=0;if(aQ=="full"){aL=(aB.position=="top"?0:w)}else{aL=aG.top-q.top+(aB.position=="top"?aG.height:0)}}else{aL=0;if(aQ=="full"){aN=(aB.position=="left"?0:h)}else{aN=aG.left-q.left+(aB.position=="left"?aG.width:0)}}if(!aB.innermost){H.beginPath();aP=aJ=0;if(aB.direction=="x"){aP=h}else{aJ=w}if(H.lineWidth==1){aN=Math.floor(aN)+0.5;aL=Math.floor(aL)+0.5}H.moveTo(aN,aL);H.lineTo(aN+aP,aL+aJ);H.stroke()}H.beginPath();for(aF=0;aF<aB.ticks.length;++aF){var aO=aB.ticks[aF].v;aP=aJ=0;if(aO<aB.min||aO>aB.max||(aQ=="full"&&aM>0&&(aO==aB.min||aO==aB.max))){continue}if(aB.direction=="x"){aN=aB.p2c(aO);aJ=aQ=="full"?-w:aQ;if(aB.position=="top"){aJ=-aJ}}else{aL=aB.p2c(aO);aP=aQ=="full"?-h:aQ;if(aB.position=="left"){aP=-aP}}if(H.lineWidth==1){if(aB.direction=="x"){aN=Math.floor(aN)+0.5}else{aL=Math.floor(aL)+0.5}}H.moveTo(aN,aL);H.lineTo(aN+aP,aL+aJ)}H.stroke()}if(aM){H.lineWidth=aM;H.strokeStyle=O.grid.borderColor;H.strokeRect(-aM/2,-aM/2,h+aM,w+aM)}H.restore()}function k(){av.find(".tickLabels").remove();var aG=['<div class="tickLabels" style="font-size:smaller">'];var aJ=m();for(var aD=0;aD<aJ.length;++aD){var aC=aJ[aD],aF=aC.box;if(!aC.show){continue}aG.push('<div class="'+aC.direction+"Axis "+aC.direction+aC.n+'Axis" style="color:'+aC.options.color+'">');for(var aE=0;aE<aC.ticks.length;++aE){var aH=aC.ticks[aE];if(!aH.label||aH.v<aC.min||aH.v>aC.max){continue}var aK={},aI;if(aC.direction=="x"){aI="center";aK.left=Math.round(q.left+aC.p2c(aH.v)-aC.labelWidth/2);if(aC.position=="bottom"){aK.top=aF.top+aF.padding}else{aK.bottom=I-(aF.top+aF.height-aF.padding)}}else{aK.top=Math.round(q.top+aC.p2c(aH.v)-aC.labelHeight/2);if(aC.position=="left"){aK.right=G-(aF.left+aF.width-aF.padding);aI="right"}else{aK.left=aF.left+aF.padding;aI="left"}}aK.width=aC.labelWidth;var aB=["position:absolute","text-align:"+aI];for(var aL in aK){aB.push(aL+":"+aK[aL]+"px")}aG.push('<div class="tickLabel" style="'+aB.join(";")+'">'+aH.label+"</div>")}aG.push("</div>")}aG.push("</div>");av.append(aG.join(""))}function d(aB){if(aB.lines.show){at(aB)}if(aB.bars.show){e(aB)}if(aB.points.show){ao(aB)}}function at(aE){function aD(aP,aQ,aI,aU,aT){var aV=aP.points,aJ=aP.pointsize,aN=null,aM=null;H.beginPath();for(var aO=aJ;aO<aV.length;aO+=aJ){var aL=aV[aO-aJ],aS=aV[aO-aJ+1],aK=aV[aO],aR=aV[aO+1];if(aL==null||aK==null){continue}if(aS<=aR&&aS<aT.min){if(aR<aT.min){continue}aL=(aT.min-aS)/(aR-aS)*(aK-aL)+aL;aS=aT.min}else{if(aR<=aS&&aR<aT.min){if(aS<aT.min){continue}aK=(aT.min-aS)/(aR-aS)*(aK-aL)+aL;aR=aT.min}}if(aS>=aR&&aS>aT.max){if(aR>aT.max){continue}aL=(aT.max-aS)/(aR-aS)*(aK-aL)+aL;aS=aT.max}else{if(aR>=aS&&aR>aT.max){if(aS>aT.max){continue}aK=(aT.max-aS)/(aR-aS)*(aK-aL)+aL;aR=aT.max}}if(aL<=aK&&aL<aU.min){if(aK<aU.min){continue}aS=(aU.min-aL)/(aK-aL)*(aR-aS)+aS;aL=aU.min}else{if(aK<=aL&&aK<aU.min){if(aL<aU.min){continue}aR=(aU.min-aL)/(aK-aL)*(aR-aS)+aS;aK=aU.min}}if(aL>=aK&&aL>aU.max){if(aK>aU.max){continue}aS=(aU.max-aL)/(aK-aL)*(aR-aS)+aS;aL=aU.max}else{if(aK>=aL&&aK>aU.max){if(aL>aU.max){continue}aR=(aU.max-aL)/(aK-aL)*(aR-aS)+aS;aK=aU.max}}if(aL!=aN||aS!=aM){H.moveTo(aU.p2c(aL)+aQ,aT.p2c(aS)+aI)}aN=aK;aM=aR;H.lineTo(aU.p2c(aK)+aQ,aT.p2c(aR)+aI)}H.stroke()}function aF(aI,aQ,aP){var aW=aI.points,aV=aI.pointsize,aN=Math.min(Math.max(0,aP.min),aP.max),aX=0,aU,aT=false,aM=1,aL=0,aR=0;while(true){if(aV>0&&aX>aW.length+aV){break}aX+=aV;var aZ=aW[aX-aV],aK=aW[aX-aV+aM],aY=aW[aX],aJ=aW[aX+aM];if(aT){if(aV>0&&aZ!=null&&aY==null){aR=aX;aV=-aV;aM=2;continue}if(aV<0&&aX==aL+aV){H.fill();aT=false;aV=-aV;aM=1;aX=aL=aR+aV;continue}}if(aZ==null||aY==null){continue}if(aZ<=aY&&aZ<aQ.min){if(aY<aQ.min){continue}aK=(aQ.min-aZ)/(aY-aZ)*(aJ-aK)+aK;aZ=aQ.min}else{if(aY<=aZ&&aY<aQ.min){if(aZ<aQ.min){continue}aJ=(aQ.min-aZ)/(aY-aZ)*(aJ-aK)+aK;aY=aQ.min}}if(aZ>=aY&&aZ>aQ.max){if(aY>aQ.max){continue}aK=(aQ.max-aZ)/(aY-aZ)*(aJ-aK)+aK;aZ=aQ.max}else{if(aY>=aZ&&aY>aQ.max){if(aZ>aQ.max){continue}aJ=(aQ.max-aZ)/(aY-aZ)*(aJ-aK)+aK;aY=aQ.max}}if(!aT){H.beginPath();H.moveTo(aQ.p2c(aZ),aP.p2c(aN));aT=true}if(aK>=aP.max&&aJ>=aP.max){H.lineTo(aQ.p2c(aZ),aP.p2c(aP.max));H.lineTo(aQ.p2c(aY),aP.p2c(aP.max));continue}else{if(aK<=aP.min&&aJ<=aP.min){H.lineTo(aQ.p2c(aZ),aP.p2c(aP.min));H.lineTo(aQ.p2c(aY),aP.p2c(aP.min));continue}}var aO=aZ,aS=aY;if(aK<=aJ&&aK<aP.min&&aJ>=aP.min){aZ=(aP.min-aK)/(aJ-aK)*(aY-aZ)+aZ;aK=aP.min}else{if(aJ<=aK&&aJ<aP.min&&aK>=aP.min){aY=(aP.min-aK)/(aJ-aK)*(aY-aZ)+aZ;aJ=aP.min}}if(aK>=aJ&&aK>aP.max&&aJ<=aP.max){aZ=(aP.max-aK)/(aJ-aK)*(aY-aZ)+aZ;aK=aP.max}else{if(aJ>=aK&&aJ>aP.max&&aK<=aP.max){aY=(aP.max-aK)/(aJ-aK)*(aY-aZ)+aZ;aJ=aP.max}}if(aZ!=aO){H.lineTo(aQ.p2c(aO),aP.p2c(aK))}H.lineTo(aQ.p2c(aZ),aP.p2c(aK));H.lineTo(aQ.p2c(aY),aP.p2c(aJ));if(aY!=aS){H.lineTo(aQ.p2c(aY),aP.p2c(aJ));H.lineTo(aQ.p2c(aS),aP.p2c(aJ))}}}H.save();H.translate(q.left,q.top);H.lineJoin="round";var aG=aE.lines.lineWidth,aB=aE.shadowSize;if(aG>0&&aB>0){H.lineWidth=aB;H.strokeStyle="rgba(0,0,0,0.1)";var aH=Math.PI/18;aD(aE.datapoints,Math.sin(aH)*(aG/2+aB/2),Math.cos(aH)*(aG/2+aB/2),aE.xaxis,aE.yaxis);H.lineWidth=aB/2;aD(aE.datapoints,Math.sin(aH)*(aG/2+aB/4),Math.cos(aH)*(aG/2+aB/4),aE.xaxis,aE.yaxis)}H.lineWidth=aG;H.strokeStyle=aE.color;var aC=ae(aE.lines,aE.color,0,w);if(aC){H.fillStyle=aC;aF(aE.datapoints,aE.xaxis,aE.yaxis)}if(aG>0){aD(aE.datapoints,0,0,aE.xaxis,aE.yaxis)}H.restore()}function ao(aE){function aH(aN,aM,aU,aK,aS,aT,aQ,aJ){var aR=aN.points,aI=aN.pointsize;for(var aL=0;aL<aR.length;aL+=aI){var aP=aR[aL],aO=aR[aL+1];if(aP==null||aP<aT.min||aP>aT.max||aO<aQ.min||aO>aQ.max){continue}H.beginPath();aP=aT.p2c(aP);aO=aQ.p2c(aO)+aK;if(aJ=="circle"){H.arc(aP,aO,aM,0,aS?Math.PI:Math.PI*2,false)}else{aJ(H,aP,aO,aM,aS)}H.closePath();if(aU){H.fillStyle=aU;H.fill()}H.stroke()}}H.save();H.translate(q.left,q.top);var aG=aE.points.lineWidth,aC=aE.shadowSize,aB=aE.points.radius,aF=aE.points.symbol;if(aG>0&&aC>0){var aD=aC/2;H.lineWidth=aD;H.strokeStyle="rgba(0,0,0,0.1)";aH(aE.datapoints,aB,null,aD+aD/2,true,aE.xaxis,aE.yaxis,aF);H.strokeStyle="rgba(0,0,0,0.2)";aH(aE.datapoints,aB,null,aD/2,true,aE.xaxis,aE.yaxis,aF)}H.lineWidth=aG;H.strokeStyle=aE.color;aH(aE.datapoints,aB,ae(aE.points,aE.color),0,false,aE.xaxis,aE.yaxis,aF);H.restore()}function E(aN,aM,aV,aI,aQ,aF,aD,aL,aK,aU,aR,aC){var aE,aT,aJ,aP,aG,aB,aO,aH,aS;if(aR){aH=aB=aO=true;aG=false;aE=aV;aT=aN;aP=aM+aI;aJ=aM+aQ;if(aT<aE){aS=aT;aT=aE;aE=aS;aG=true;aB=false}}else{aG=aB=aO=true;aH=false;aE=aN+aI;aT=aN+aQ;aJ=aV;aP=aM;if(aP<aJ){aS=aP;aP=aJ;aJ=aS;aH=true;aO=false}}if(aT<aL.min||aE>aL.max||aP<aK.min||aJ>aK.max){return}if(aE<aL.min){aE=aL.min;aG=false}if(aT>aL.max){aT=aL.max;aB=false}if(aJ<aK.min){aJ=aK.min;aH=false}if(aP>aK.max){aP=aK.max;aO=false}aE=aL.p2c(aE);aJ=aK.p2c(aJ);aT=aL.p2c(aT);aP=aK.p2c(aP);if(aD){aU.beginPath();aU.moveTo(aE,aJ);aU.lineTo(aE,aP);aU.lineTo(aT,aP);aU.lineTo(aT,aJ);aU.fillStyle=aD(aJ,aP);aU.fill()}if(aC>0&&(aG||aB||aO||aH)){aU.beginPath();aU.moveTo(aE,aJ+aF);if(aG){aU.lineTo(aE,aP+aF)}else{aU.moveTo(aE,aP+aF)}if(aO){aU.lineTo(aT,aP+aF)}else{aU.moveTo(aT,aP+aF)}if(aB){aU.lineTo(aT,aJ+aF)}else{aU.moveTo(aT,aJ+aF)}if(aH){aU.lineTo(aE,aJ+aF)}else{aU.moveTo(aE,aJ+aF)}aU.stroke()}}function e(aD){function aC(aJ,aI,aL,aG,aK,aN,aM){var aO=aJ.points,aF=aJ.pointsize;for(var aH=0;aH<aO.length;aH+=aF){if(aO[aH]==null){continue}E(aO[aH],aO[aH+1],aO[aH+2],aI,aL,aG,aK,aN,aM,H,aD.bars.horizontal,aD.bars.lineWidth)}}H.save();H.translate(q.left,q.top);H.lineWidth=aD.bars.lineWidth;H.strokeStyle=aD.color;var aB=aD.bars.align=="left"?0:-aD.bars.barWidth/2;var aE=aD.bars.fill?function(aF,aG){return ae(aD.bars,aD.color,aF,aG)}:null;aC(aD.datapoints,aB,aB+aD.bars.barWidth,0,aE,aD.xaxis,aD.yaxis);H.restore()}function ae(aD,aB,aC,aF){var aE=aD.fill;if(!aE){return null}if(aD.fillColor){return am(aD.fillColor,aC,aF,aB)}var aG=c.color.parse(aB);aG.a=typeof aE=="number"?aE:0.4;aG.normalize();return aG.toString()}function o(){av.find(".legend").remove();if(!O.legend.show){return}var aH=[],aF=false,aN=O.legend.labelFormatter,aM,aJ;for(var aE=0;aE<Q.length;++aE){aM=Q[aE];aJ=aM.label;if(!aJ){continue}if(aE%O.legend.noColumns==0){if(aF){aH.push("</tr>")}aH.push("<tr>");aF=true}if(aN){aJ=aN(aJ,aM)}aH.push('<td class="legendColorBox"><div style="border:1px solid '+O.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+aM.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+aJ+"</td>")}if(aF){aH.push("</tr>")}if(aH.length==0){return}var aL='<table style="font-size:smaller;color:'+O.grid.color+'">'+aH.join("")+"</table>";if(O.legend.container!=null){c(O.legend.container).html(aL)}else{var aI="",aC=O.legend.position,aD=O.legend.margin;if(aD[0]==null){aD=[aD,aD]}if(aC.charAt(0)=="n"){aI+="top:"+(aD[1]+q.top)+"px;"}else{if(aC.charAt(0)=="s"){aI+="bottom:"+(aD[1]+q.bottom)+"px;"}}if(aC.charAt(1)=="e"){aI+="right:"+(aD[0]+q.right)+"px;"}else{if(aC.charAt(1)=="w"){aI+="left:"+(aD[0]+q.left)+"px;"}}var aK=c('<div class="legend">'+aL.replace('style="','style="position:absolute;'+aI+";")+"</div>").appendTo(av);if(O.legend.backgroundOpacity!=0){var aG=O.legend.backgroundColor;if(aG==null){aG=O.grid.backgroundColor;if(aG&&typeof aG=="string"){aG=c.color.parse(aG)}else{aG=c.color.extract(aK,"background-color")}aG.a=1;aG=aG.toString()}var aB=aK.children();c('<div style="position:absolute;width:'+aB.width()+"px;height:"+aB.height()+"px;"+aI+"background-color:"+aG+';"> </div>').prependTo(aK).css("opacity",O.legend.backgroundOpacity)}}}var ab=[],M=null;function K(aI,aG,aD){var aO=O.grid.mouseActiveRadius,a0=aO*aO+1,aY=null,aR=false,aW,aU;for(aW=Q.length-1;aW>=0;--aW){if(!aD(Q[aW])){continue}var aP=Q[aW],aH=aP.xaxis,aF=aP.yaxis,aV=aP.datapoints.points,aT=aP.datapoints.pointsize,aQ=aH.c2p(aI),aN=aF.c2p(aG),aC=aO/aH.scale,aB=aO/aF.scale;if(aH.options.inverseTransform){aC=Number.MAX_VALUE}if(aF.options.inverseTransform){aB=Number.MAX_VALUE}if(aP.lines.show||aP.points.show){for(aU=0;aU<aV.length;aU+=aT){var aK=aV[aU],aJ=aV[aU+1];if(aK==null){continue}if(aK-aQ>aC||aK-aQ<-aC||aJ-aN>aB||aJ-aN<-aB){continue}var aM=Math.abs(aH.p2c(aK)-aI),aL=Math.abs(aF.p2c(aJ)-aG),aS=aM*aM+aL*aL;if(aS<a0){a0=aS;aY=[aW,aU/aT]}}}if(aP.bars.show&&!aY){var aE=aP.bars.align=="left"?0:-aP.bars.barWidth/2,aX=aE+aP.bars.barWidth;for(aU=0;aU<aV.length;aU+=aT){var aK=aV[aU],aJ=aV[aU+1],aZ=aV[aU+2];if(aK==null){continue}if(Q[aW].bars.horizontal?(aQ<=Math.max(aZ,aK)&&aQ>=Math.min(aZ,aK)&&aN>=aJ+aE&&aN<=aJ+aX):(aQ>=aK+aE&&aQ<=aK+aX&&aN>=Math.min(aZ,aJ)&&aN<=Math.max(aZ,aJ))){aY=[aW,aU/aT]}}}}if(aY){aW=aY[0];aU=aY[1];aT=Q[aW].datapoints.pointsize;return{datapoint:Q[aW].datapoints.points.slice(aU*aT,(aU+1)*aT),dataIndex:aU,series:Q[aW],seriesIndex:aW}}return null}function aa(aB){if(O.grid.hoverable){u("plothover",aB,function(aC){return aC.hoverable!=false})}}function l(aB){if(O.grid.hoverable){u("plothover",aB,function(aC){return false})}}function R(aB){u("plotclick",aB,function(aC){return aC.clickable!=false})}function u(aC,aB,aD){var aE=y.offset(),aH=aB.pageX-aE.left-q.left,aF=aB.pageY-aE.top-q.top,aJ=C({left:aH,top:aF});aJ.pageX=aB.pageX;aJ.pageY=aB.pageY;var aK=K(aH,aF,aD);if(aK){aK.pageX=parseInt(aK.series.xaxis.p2c(aK.datapoint[0])+aE.left+q.left);aK.pageY=parseInt(aK.series.yaxis.p2c(aK.datapoint[1])+aE.top+q.top)}if(O.grid.autoHighlight){for(var aG=0;aG<ab.length;++aG){var aI=ab[aG];if(aI.auto==aC&&!(aK&&aI.series==aK.series&&aI.point[0]==aK.datapoint[0]&&aI.point[1]==aK.datapoint[1])){T(aI.series,aI.point)}}if(aK){x(aK.series,aK.datapoint,aC)}}av.trigger(aC,[aJ,aK])}function f(){if(!M){M=setTimeout(s,30)}}function s(){M=null;A.save();A.clearRect(0,0,G,I);A.translate(q.left,q.top);var aC,aB;for(aC=0;aC<ab.length;++aC){aB=ab[aC];if(aB.series.bars.show){v(aB.series,aB.point)}else{ay(aB.series,aB.point)}}A.restore();an(ak.drawOverlay,[A])}function x(aD,aB,aF){if(typeof aD=="number"){aD=Q[aD]}if(typeof aB=="number"){var aE=aD.datapoints.pointsize;aB=aD.datapoints.points.slice(aE*aB,aE*(aB+1))}var aC=al(aD,aB);if(aC==-1){ab.push({series:aD,point:aB,auto:aF});f()}else{if(!aF){ab[aC].auto=false}}}function T(aD,aB){if(aD==null&&aB==null){ab=[];f()}if(typeof aD=="number"){aD=Q[aD]}if(typeof aB=="number"){aB=aD.data[aB]}var aC=al(aD,aB);if(aC!=-1){ab.splice(aC,1);f()}}function al(aD,aE){for(var aB=0;aB<ab.length;++aB){var aC=ab[aB];if(aC.series==aD&&aC.point[0]==aE[0]&&aC.point[1]==aE[1]){return aB}}return -1}function ay(aE,aD){var aC=aD[0],aI=aD[1],aH=aE.xaxis,aG=aE.yaxis;if(aC<aH.min||aC>aH.max||aI<aG.min||aI>aG.max){return}var aF=aE.points.radius+aE.points.lineWidth/2;A.lineWidth=aF;A.strokeStyle=c.color.parse(aE.color).scale("a",0.5).toString();var aB=1.5*aF,aC=aH.p2c(aC),aI=aG.p2c(aI);A.beginPath();if(aE.points.symbol=="circle"){A.arc(aC,aI,aB,0,2*Math.PI,false)}else{aE.points.symbol(A,aC,aI,aB,false)}A.closePath();A.stroke()}function v(aE,aB){A.lineWidth=aE.bars.lineWidth;A.strokeStyle=c.color.parse(aE.color).scale("a",0.5).toString();var aD=c.color.parse(aE.color).scale("a",0.5).toString();var aC=aE.bars.align=="left"?0:-aE.bars.barWidth/2;E(aB[0],aB[1],aB[2]||0,aC,aC+aE.bars.barWidth,0,function(){return aD},aE.xaxis,aE.yaxis,A,aE.bars.horizontal,aE.bars.lineWidth)}function am(aJ,aB,aH,aC){if(typeof aJ=="string"){return aJ}else{var aI=H.createLinearGradient(0,aH,0,aB);for(var aE=0,aD=aJ.colors.length;aE<aD;++aE){var aF=aJ.colors[aE];if(typeof aF!="string"){var aG=c.color.parse(aC);if(aF.brightness!=null){aG=aG.scale("rgb",aF.brightness)}if(aF.opacity!=null){aG.a*=aF.opacity}aF=aG.toString()}aI.addColorStop(aE/(aD-1),aF)}return aI}}}c.plot=function(g,e,d){var f=new b(c(g),e,d,c.plot.plugins);return f};c.plot.version="0.7";c.plot.plugins=[];c.plot.formatDate=function(l,f,h){var o=function(d){d=""+d;return d.length==1?"0"+d:d};var e=[];var p=false,j=false;var n=l.getUTCHours();var k=n<12;if(h==null){h=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}if(f.search(/%p|%P/)!=-1){if(n>12){n=n-12}else{if(n==0){n=12}}}for(var g=0;g<f.length;++g){var m=f.charAt(g);if(p){switch(m){case"h":m=""+n;break;case"H":m=o(n);break;case"M":m=o(l.getUTCMinutes());break;case"S":m=o(l.getUTCSeconds());break;case"d":m=""+l.getUTCDate();break;case"m":m=""+(l.getUTCMonth()+1);break;case"y":m=""+l.getUTCFullYear();break;case"b":m=""+h[l.getUTCMonth()];break;case"p":m=(k)?("am"):("pm");break;case"P":m=(k)?("AM"):("PM");break;case"0":m="";j=true;break}if(m&&j){m=o(m);j=false}e.push(m);if(!j){p=false}}else{if(m=="%"){p=true}else{e.push(m)}}}return e.join("")};function a(e,d){return d*Math.floor(e/d)}})(jQuery); \ No newline at end of file
diff --git a/storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot.license.txt b/storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot.license.txt
deleted file mode 100644
index 07d5b2094d1..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/admin/js/jquery.flot.license.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2007-2009 IOLA and Ole Laursen
-
-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/storage/mroonga/vendor/groonga/data/html/files.am b/storage/mroonga/vendor/groonga/data/html/files.am
deleted file mode 100644
index 401b98c46fd..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/files.am
+++ /dev/null
@@ -1,34 +0,0 @@
-nobase_dist_html_DATA = \
- admin/css/groonga-admin.css \
- admin/css/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png \
- admin/css/redmond/images/ui-bg_flat_55_fbec88_40x100.png \
- admin/css/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png \
- admin/css/redmond/images/ui-bg_glass_85_dfeffc_1x400.png \
- admin/css/redmond/images/ui-bg_glass_95_fef1ec_1x400.png \
- admin/css/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png \
- admin/css/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png \
- admin/css/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png \
- admin/css/redmond/images/ui-icons_217bc0_256x240.png \
- admin/css/redmond/images/ui-icons_2e83ff_256x240.png \
- admin/css/redmond/images/ui-icons_469bdd_256x240.png \
- admin/css/redmond/images/ui-icons_6da8d5_256x240.png \
- admin/css/redmond/images/ui-icons_cd0a0a_256x240.png \
- admin/css/redmond/images/ui-icons_d8e7f3_256x240.png \
- admin/css/redmond/images/ui-icons_f9bd01_256x240.png \
- admin/css/redmond/jquery-ui-1.8.18.custom.css \
- admin/favicon.ico \
- admin/favicon.png \
- admin/favicon.svg \
- admin/images/groonga.png \
- admin/images/groonga.svg \
- admin/images/loading.gif \
- admin/index.html \
- admin/index.ja.html \
- admin/js/groonga-admin.ja.js \
- admin/js/groonga-admin.js \
- admin/js/jquery-1.7.2.min.js \
- admin/js/jquery-ui-1.8.18.custom.min.js \
- admin/js/jquery.flot-0.7.min.js \
- admin/js/jquery.flot.license.txt \
- $(NULL)
-
diff --git a/storage/mroonga/vendor/groonga/data/html/update-files.sh b/storage/mroonga/vendor/groonga/data/html/update-files.sh
deleted file mode 100755
index 7d72fe2fe19..00000000000
--- a/storage/mroonga/vendor/groonga/data/html/update-files.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-list_paths()
-{
- variable_name=$1
- echo "$variable_name = \\"
- sort | \
- sed \
- -e 's,^,\t,' \
- -e 's,$, \\,'
- echo "\t\$(NULL)"
- echo
-}
-
-find "admin" -type f | \
- sort | \
- list_paths "nobase_dist_html_DATA"
diff --git a/storage/mroonga/vendor/groonga/data/images/Makefile.am b/storage/mroonga/vendor/groonga/data/images/Makefile.am
deleted file mode 100644
index 615d8f93fc4..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-SUBDIRS = \
- logo
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/Makefile.am b/storage/mroonga/vendor/groonga/data/images/logo/Makefile.am
deleted file mode 100644
index d5c97b03ab3..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/Makefile.am
+++ /dev/null
@@ -1,22 +0,0 @@
-include files.am
-
-logodir = $(pkgdatadir)/images/logo
-logo_DATA = $(image_files)
-
-EXTRA_DIST = \
- $(logo_DATA) \
- update-files.sh
-
-SUFFIXES =
-if WITH_INKSCAPE
-SUFFIXES += .svg .png
-.svg.png:
- $(INKSCAPE) --export-dpi 90 --export-png $@ $<
-endif
-
-$(srcdir)/files.am: $(srcdir)/update-files.sh
- (cd $(srcdir) && ./update-files.sh) > $(srcdir)/files.am
-
-update-files:
- rm $(srcdir)/files.am
- $(MAKE) $(srcdir)/files.am
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/files.am b/storage/mroonga/vendor/groonga/data/images/logo/files.am
deleted file mode 100644
index 841ac55f2f5..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/files.am
+++ /dev/null
@@ -1,53 +0,0 @@
-image_files = \
- groonga-icon-foreground-white.png \
- groonga-icon-foreground-white.svg \
- groonga-icon-full-size.png \
- groonga-icon-full-size.svg \
- groonga-icon.png \
- groonga-icon.svg \
- groonga-logo-foreground-white.png \
- groonga-logo-foreground-white.svg \
- groonga-logo.png \
- groonga-logo.svg \
- groonga-powered-by-banner-bar-foreground-white.png \
- groonga-powered-by-banner-bar-foreground-white.svg \
- groonga-powered-by-banner-bar.png \
- groonga-powered-by-banner-bar.svg \
- groonga-powered-by-banner-foreground-white.png \
- groonga-powered-by-banner-foreground-white.svg \
- groonga-powered-by-banner-large.png \
- groonga-powered-by-banner-large.svg \
- groonga-powered-by-banner.png \
- groonga-powered-by-banner.svg \
- mroonga-icon-foreground-white.png \
- mroonga-icon-foreground-white.svg \
- mroonga-icon-full-size.png \
- mroonga-icon-full-size.svg \
- mroonga-icon.png \
- mroonga-icon.svg \
- mroonga-logo-foreground-white.png \
- mroonga-logo-foreground-white.svg \
- mroonga-logo.png \
- mroonga-logo.svg \
- nroonga-icon-foreground-white.png \
- nroonga-icon-foreground-white.svg \
- nroonga-icon-full-size.png \
- nroonga-icon-full-size.svg \
- nroonga-icon.png \
- nroonga-icon.svg \
- nroonga-logo-foreground-white.png \
- nroonga-logo-foreground-white.svg \
- nroonga-logo.png \
- nroonga-logo.svg \
- rroonga-icon-foreground-white.png \
- rroonga-icon-foreground-white.svg \
- rroonga-icon-full-size.png \
- rroonga-icon-full-size.svg \
- rroonga-icon.png \
- rroonga-icon.svg \
- rroonga-logo-foreground-white.png \
- rroonga-logo-foreground-white.svg \
- rroonga-logo.png \
- rroonga-logo.svg \
- $(NULL)
-
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.png
deleted file mode 100644
index 31ee95ba5be..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.svg
deleted file mode 100644
index 9981e64df19..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-foreground-white.svg
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="60.000706"
- height="60.001022"
- id="svg5342"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 41">
- <defs
- id="defs5344">
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_9_"
- id="linearGradient5521"
- gradientUnits="userSpaceOnUse"
- x1="470.15039"
- y1="437.05859"
- x2="470.15039"
- y2="497.05859" />
- <linearGradient
- id="SVGID_9_"
- gradientUnits="userSpaceOnUse"
- x1="470.15039"
- y1="437.05859"
- x2="470.15039"
- y2="497.05859">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop4050" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop4052" />
- </linearGradient>
- <linearGradient
- y2="497.05859"
- x2="470.15039"
- y1="437.05859"
- x1="470.15039"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5566"
- xlink:href="#SVGID_9_"
- inkscape:collect="always" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_9_"
- id="linearGradient5599"
- gradientUnits="userSpaceOnUse"
- x1="470.15039"
- y1="437.05859"
- x2="470.15039"
- y2="497.05859" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="61.872887"
- inkscape:cy="42.401151"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2773"
- inkscape:window-y="302"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5347">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-343.75609,-530.41738)">
- <g
- id="g5587">
- <polygon
- style="fill:url(#linearGradient5599)"
- id="polygon4054"
- points="440.15,437.059 440.15,497.059 466.012,497.059 500.15,497.059 500.15,462.92 500.15,437.059 "
- transform="translate(-96.393911,93.359403)" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- id="path4107"
- d="m 397.29009,567.3004 c 7.502,-7.505 9.8,-20.401 -0.335,-30.538 -4.224,-4.222 -9.514,-6.337 -14.8,-6.345 h -0.005 c -5.286,-0.007 -10.567,2.093 -14.774,6.299 -2.522,2.52 -4.434,5.76 -5.428,9.33 -6.49,-0.099 -13.001,2.411 -18.191,7.53 v 36.479 c 0.114,0.121 0.227,0.242 0.344,0.361 h 25.518 11.027 c 4.434,-4.717 7.233,-11.018 7.295,-17.672 3.385,-0.898 6.606,-2.7 9.349,-5.444 z m -13.748,-2.759 c -1.121,1.873 -0.997,2.089 -0.949,5.602 0.062,3.979 -1.437,8.102 -5.189,11.854 -5.736,5.737 -16.326,7.017 -24.119,-0.776 -6.139,-6.14 -9.021,-16.475 -0.84,-24.658 3.038,-3.034 7.406,-4.827 11.998,-4.745 3.193,0.055 3.564,0.174 5.621,-0.76 2.058,-0.938 1.166,-3.019 2.396,-6.692 0.6,-1.792 1.666,-3.551 3.332,-5.224 4.451,-4.448 12.643,-5.469 18.643,0.531 4.887,4.887 6.96,12.677 0.572,19.065 -1.441,1.444 -3.284,2.509 -5.319,3.087 -3.266,0.937 -5.023,0.838 -6.146,2.716 z" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.png
deleted file mode 100644
index a1e60fca5b1..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.svg
deleted file mode 100644
index 1aea95e737f..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon-full-size.svg
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="199.804"
- height="200.85736"
- id="svg3635"
- version="1.1"
- inkscape:version="0.48.3.1 r9886"
- sodipodi:docname="groonga-icon-full-size.svg"
- inkscape:export-filename="groonga-icon-full-size.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <defs
- id="defs3637">
- <linearGradient
- gradientTransform="translate(-419.62671,208.8676)"
- id="SVGID_1_"
- gradientUnits="userSpaceOnUse"
- x1="223.6167"
- y1="76.3564"
- x2="223.6167"
- y2="137.38029">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop160" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop162" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_1_"
- id="linearGradient2994"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(3.0240925,0,0,3.0240925,-289.39052,88.167588)"
- x1="223.6167"
- y1="76.3564"
- x2="223.6167"
- y2="137.38029" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="144.78679"
- inkscape:cy="33.072478"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-right="5"
- fit-margin-bottom="5"
- inkscape:window-width="902"
- inkscape:window-height="705"
- inkscape:window-x="2174"
- inkscape:window-y="122"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata3640">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-286.94516,-317.99663)">
- <path
- style="fill:url(#linearGradient2994)"
- inkscape:connector-curvature="0"
- d="m 379.72928,340.66117 c -7.06731,7.06429 -12.426,16.1547 -15.21724,26.1705 -18.37438,-0.28124 -36.80623,6.87377 -51.43075,21.5013 -24.62215,24.61914 -32.27916,69.29104 2.01708,103.58424 28.8559,28.85891 71.95223,29.29438 100.23355,1.00702 13.36951,-13.37859 21.88233,-31.77111 22.0668,-51.22813 9.49565,-2.52511 18.52257,-7.58139 26.21888,-15.26864 21.03559,-21.04466 27.47691,-57.2128 -0.94049,-85.63625 -23.68772,-23.67865 -59.35084,-23.73005 -82.94783,-0.13004 z m 77.4833,61.75802 c -4.03716,4.04623 -9.20837,7.028 -14.91483,8.66101 -9.15393,2.62188 -14.0832,2.34972 -17.23128,7.60558 -3.14808,5.24681 -2.80031,5.86675 -2.66121,15.70714 0.16935,11.15588 -4.03111,22.72001 -14.55495,33.2499 -16.08818,16.08212 -45.78476,19.6687 -67.63685,-2.18037 -17.21617,-17.21918 -25.29654,-46.20209 -2.35275,-69.14587 8.51585,-8.50678 20.76342,-13.53887 33.64001,-13.31207 8.95434,0.16028 9.99765,0.48689 15.76156,-2.12895 5.773,-2.62794 3.27207,-8.46443 6.71955,-18.7645 1.68139,-5.01999 4.67221,-9.96136 9.35049,-14.6487 12.4774,-12.47741 35.44539,-15.33821 52.27144,1.48483 13.70821,13.71425 19.52052,35.5603 1.60882,53.472 z"
- id="path164" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.png
deleted file mode 100644
index 8e73658dfd2..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.svg
deleted file mode 100644
index 24dcf178c3b..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-icon.svg
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="59.99931"
- height="59.999016"
- id="svg5041"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 28">
- <defs
- id="defs5043">
- <linearGradient
- id="SVGID_13_"
- gradientUnits="userSpaceOnUse"
- x1="147.7168"
- y1="437.05859"
- x2="147.7168"
- y2="505.11819">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop4080" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop4082" />
- </linearGradient>
- <linearGradient
- gradientTransform="translate(283.71192,-26.123877)"
- y2="505.11819"
- x2="147.7168"
- y1="437.05859"
- x1="147.7168"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5070"
- xlink:href="#SVGID_13_"
- inkscape:collect="always" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="-109.40067"
- inkscape:cy="43.539451"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="1928"
- inkscape:window-y="52"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5046">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-401.42892,-410.9341)">
- <path
- style="fill:url(#linearGradient5070)"
- inkscape:connector-curvature="0"
- d="m 454.96192,447.81712 c 7.502,-7.505 9.799,-20.401 -0.335,-30.538 -4.223,-4.222 -9.513,-6.337 -14.799,-6.345 h -0.005 c -5.286,-0.007 -10.568,2.093 -14.775,6.299 -2.522,2.52 -4.433,5.76 -5.428,9.33 -6.49,-0.099 -13.001,2.411 -18.191,7.53 v 36.48 c 0.114,0.12 0.227,0.241 0.344,0.36 h 25.518 11.027 c 4.434,-4.717 7.234,-11.018 7.295,-17.672 3.385,-0.898 6.606,-2.7 9.349,-5.444 z m -13.748,-2.759 c -1.122,1.873 -0.998,2.089 -0.95,5.602 0.062,3.979 -1.436,8.102 -5.188,11.854 -5.737,5.737 -16.327,7.017 -24.119,-0.776 -6.14,-6.14 -9.021,-16.475 -0.84,-24.658 3.038,-3.034 7.405,-4.827 11.998,-4.745 3.193,0.055 3.564,0.174 5.621,-0.76 2.058,-0.938 1.166,-3.019 2.396,-6.692 0.6,-1.792 1.667,-3.551 3.333,-5.224 4.451,-4.448 12.642,-5.469 18.642,0.531 4.887,4.887 6.96,12.677 0.573,19.065 -1.442,1.444 -3.285,2.509 -5.32,3.087 -3.265,0.937 -5.023,0.838 -6.146,2.716 z"
- id="path4084" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.png
deleted file mode 100644
index a9281780fbf..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.svg
deleted file mode 100644
index ad82462a218..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo-foreground-white.svg
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="232.18001"
- height="73.112274"
- id="svg4711"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 16">
- <defs
- id="defs4713">
- <linearGradient
- gradientTransform="translate(-433.94514,340.29617)"
- id="SVGID_5_"
- gradientUnits="userSpaceOnUse"
- x1="589.36517"
- y1="78"
- x2="589.36517"
- y2="143.0079">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop3978" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop3980" />
- </linearGradient>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#000000"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="1"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="249.78391"
- inkscape:cy="36.547406"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-right="5"
- fit-margin-bottom="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2119"
- inkscape:window-y="331"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4716">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-61.052857,-412.9489)">
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 122.70286,437.76317 c -1.337,-0.29 -2.28,-0.448 -3.441,-0.448 -2.848,0 -5.33,0.831 -7.393,2.468 -0.09,0.06 -0.191,0.14 -0.302,0.245 -0.23,0.197 -0.452,0.406 -0.669,0.621 -1.477,1.314 -2.759,1.952 -2.759,-1.235 v -0.666 c 0,-0.404 -0.327,-0.732 -0.732,-0.732 h -2.1 c -0.2,0 -0.389,0.081 -0.527,0.223 -0.138,0.143 -0.212,0.335 -0.206,0.532 0.106,3.333 0.215,6.778 0.215,9.621 v 18.75 c 0,0.404 0.328,0.731 0.732,0.731 h 2.209 c 0.403,0 0.732,-0.328 0.732,-0.731 v -9.914 c 0,-1.37 0.107,-3.805 0.31,-4.813 1.568,-7.797 4.982,-11.588 10.435,-11.588 0.979,0 1.88,0.165 2.874,0.363 0.047,0.011 0.095,0.015 0.143,0.015 0.148,0 0.294,-0.045 0.417,-0.131 0.162,-0.113 0.273,-0.288 0.307,-0.484 l 0.322,-1.994 c 0.062,-0.384 -0.187,-0.752 -0.567,-0.833 z"
- id="path3967" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 211.74986,439.35517 c -2.513,-1.774 -5.294,-2.04 -6.727,-2.04 -2.911,0 -5.648,0.912 -7.821,2.495 -0.005,0.004 -0.011,0.005 -0.015,0.009 -1.006,0.648 -2.627,0.909 -2.617,-0.625 v -0.021 c 0,-0.107 -0.005,-0.199 -0.014,-0.277 l -0.009,-0.182 c -0.018,-0.391 -0.341,-0.698 -0.731,-0.698 h -2.102 c -0.202,0 -0.396,0.084 -0.534,0.232 -0.139,0.148 -0.21,0.347 -0.195,0.549 0.152,2.28 0.212,4.171 0.212,6.524 v 21.821 c 0,0.404 0.33,0.731 0.733,0.731 h 2.209 c 0.404,0 0.731,-0.328 0.731,-0.731 v -17.511 c 0,-0.813 0.253,-1.761 0.49,-2.377 0.005,-0.008 0.007,-0.018 0.01,-0.026 1.044,-3.042 4.223,-6.12 8.417,-6.475 3.236,0.002 8.326,2.358 9.024,8.226 0.016,0.15 0.03,0.299 0.041,0.444 0.005,0.049 0.008,0.099 0.013,0.149 0.005,0.07 0.009,0.139 0.014,0.209 0.009,0.19 0.015,0.384 0.015,0.582 0,0.335 0.005,0.638 0.018,0.911 v 15.869 c 0,0.404 0.326,0.731 0.73,0.731 h 2.21 c 0.403,0 0.732,-0.328 0.732,-0.731 v -16.272 c 0.001,-5.375 -1.627,-9.248 -4.834,-11.516 z"
- id="path3969" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 287.97386,464.69717 c -0.133,-0.113 -0.301,-0.174 -0.474,-0.174 -0.039,0 -0.079,0.003 -0.118,0.01 -0.588,0.098 -0.964,0.098 -1.444,0.098 -1.147,0 -2.177,-0.335 -2.177,-4.387 v -9.913 c 0,-2.343 -0.18,-5.368 -1.583,-7.972 -1.824,-3.382 -5.181,-5.098 -9.979,-5.098 -2.475,0 -6.218,0.516 -9.99,2.974 -0.313,0.205 -0.424,0.615 -0.252,0.949 l 0.862,1.67 c 0.098,0.189 0.272,0.326 0.479,0.375 0.058,0.014 0.116,0.021 0.174,0.021 0.15,0 0.296,-0.047 0.422,-0.135 2.314,-1.639 5.188,-2.504 8.306,-2.504 3.995,0 6.004,1.854 7,3.939 l 0,0 c 1.002,2.221 -0.563,4.404 -2.286,4.584 -0.084,0.005 -0.169,0.008 -0.253,0.013 -0.015,0 -0.027,10e-4 -0.043,0 -0.055,-0.001 -0.101,0.003 -0.143,0.009 -10.979,0.626 -16.537,4.313 -16.537,10.98 0,2.027 0.801,4.057 2.201,5.569 1.235,1.333 3.56,2.921 7.637,2.921 3.471,0 6.27,-1.112 8.324,-2.472 0.061,-0.031 0.131,-0.076 0.211,-0.141 0.021,-0.017 0.044,-0.031 0.064,-0.048 0.127,-0.088 0.257,-0.177 0.377,-0.268 1.277,-0.825 1.97,-0.351 2.623,0.504 0.002,0.002 0.006,0.005 0.008,0.007 0.839,1.14 2.162,1.718 3.963,1.718 0.847,0 1.59,-0.094 2.343,-0.294 0.322,-0.085 0.544,-0.375 0.544,-0.707 v -1.67 c 0,-0.214 -0.096,-0.419 -0.259,-0.558 z m -18.252,0.527 c -3.042,0 -6.111,-1.723 -6.111,-5.572 0,-4.863 5.936,-6.58 12.166,-7.043 2.32,-0.043 4.098,2.162 4.313,4.575 v 0.989 c -0.063,0.647 -0.246,1.289 -0.569,1.888 -0.161,0.263 -0.354,0.556 -0.588,0.864 -0.04,0.047 -0.076,0.093 -0.104,0.134 -1.442,1.848 -4.223,4.165 -9.107,4.165 z"
- id="path3971" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 93.993857,438.01517 h -2.048 c -0.393,0 -0.716,0.311 -0.731,0.703 -0.066,1.618 -0.892,1.836 -2.703,0.766 -0.01,-0.006 -0.017,-0.014 -0.026,-0.019 -0.179,-0.119 -0.362,-0.231 -0.546,-0.339 -0.011,-0.007 -0.021,-0.012 -0.032,-0.02 -0.087,-0.059 -0.17,-0.104 -0.245,-0.14 -1.981,-1.096 -4.305,-1.65 -6.922,-1.65 -3.739,0 -7.429,1.548 -10.123,4.25 -2.083,2.087 -4.565,5.826 -4.565,11.784 0,3.818 1.349,7.413 3.793,10.122 2.595,2.875 6.234,4.458 10.248,4.458 3.111,0 5.514,-0.819 7.336,-1.897 0.003,-0.002 0.008,-0.003 0.011,-0.005 1.953,-0.873 3.603,-2.182 3.136,2.232 -0.876,5.678 -4.518,8.765 -10.482,8.765 -4.176,0 -7.309,-1.404 -9.202,-2.583 -0.118,-0.072 -0.253,-0.11 -0.388,-0.11 -0.061,0 -0.122,0.008 -0.183,0.023 -0.192,0.049 -0.357,0.176 -0.456,0.35 l -0.971,1.725 c -0.188,0.336 -0.084,0.761 0.238,0.972 2.853,1.863 6.908,2.975 10.854,2.975 2.69,0 9.293,-0.625 12.494,-6.412 1.385,-2.481 2.03,-5.968 2.03,-10.968 v -17.457 c 0,-2.474 0.069,-4.679 0.214,-6.738 0.015,-0.202 -0.055,-0.402 -0.194,-0.549 -0.141,-0.153 -0.334,-0.238 -0.537,-0.238 z m -16.892,26.028 c -0.605,-0.24 -7.608,-3.216 -7.015,-11.811 0.554,-7.946 5.725,-10.459 6.519,-10.798 1.279,-0.5 2.702,-0.769 4.241,-0.769 1.665,0 3.113,0.327 4.354,0.873 6.848,3.871 7.696,16.453 0.886,21.467 -1.592,0.999 -3.438,1.573 -5.346,1.573 -1.343,0 -2.553,-0.194 -3.639,-0.535 z"
- id="path3973" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 251.84086,438.01517 h -2.047 c -0.392,0 -0.716,0.311 -0.731,0.703 -0.064,1.618 -0.892,1.836 -2.701,0.766 -0.011,-0.005 -0.02,-0.014 -0.028,-0.019 -0.179,-0.119 -0.362,-0.231 -0.547,-0.339 -0.01,-0.008 -0.02,-0.014 -0.031,-0.02 -0.087,-0.059 -0.168,-0.104 -0.243,-0.139 -1.982,-1.097 -4.308,-1.651 -6.925,-1.651 -3.739,0 -7.428,1.548 -10.121,4.25 -2.082,2.087 -4.564,5.826 -4.564,11.784 0,3.818 1.347,7.413 3.791,10.122 2.597,2.875 6.233,4.458 10.249,4.458 3.11,0 5.514,-0.819 7.335,-1.897 0.004,-0.002 0.007,-0.003 0.012,-0.005 1.953,-0.874 3.602,-2.183 3.134,2.233 -0.875,5.678 -4.518,8.764 -10.48,8.764 -4.176,0 -7.31,-1.404 -9.204,-2.583 -0.116,-0.072 -0.251,-0.11 -0.388,-0.11 -0.06,0 -0.123,0.008 -0.182,0.023 -0.192,0.049 -0.356,0.176 -0.456,0.35 l -0.968,1.725 c -0.19,0.336 -0.086,0.761 0.237,0.972 2.853,1.863 6.909,2.975 10.852,2.975 2.689,0 9.294,-0.625 12.493,-6.412 1.385,-2.481 2.031,-5.968 2.031,-10.968 v -17.457 c 0,-2.474 0.07,-4.679 0.216,-6.738 0.013,-0.202 -0.058,-0.402 -0.196,-0.549 -0.14,-0.153 -0.334,-0.238 -0.538,-0.238 z m -16.892,26.028 c -0.604,-0.24 -7.607,-3.216 -7.011,-11.811 0.549,-7.94 5.715,-10.455 6.518,-10.798 1.276,-0.5 2.698,-0.769 4.24,-0.769 1.663,0 3.112,0.327 4.354,0.873 6.845,3.871 7.696,16.453 0.883,21.467 -1.592,1 -3.437,1.573 -5.346,1.573 -1.341,0 -2.551,-0.194 -3.638,-0.535 z"
- id="path3975" />
- <path
- style="fill:url(#SVGID_5_)"
- inkscape:connector-curvature="0"
- d="m 153.06686,423.79017 c -2.338,2.336 -4.11,5.342 -5.031,8.654 -6.076,-0.093 -12.172,2.273 -17.008,7.11 -8.143,8.141 -10.674,22.913 0.668,34.253 9.542,9.543 23.793,9.687 33.144,0.333 4.422,-4.424 7.237,-10.506 7.298,-16.94 3.14,-0.835 6.125,-2.507 8.67,-5.049 6.957,-6.959 9.085,-18.919 -0.311,-28.318 -7.835,-7.83 -19.628,-7.847 -27.43,-0.043 z m 25.622,20.422 c -1.335,1.338 -3.046,2.324 -4.934,2.864 -3.026,0.867 -4.655,0.777 -5.696,2.515 -1.042,1.735 -0.925,1.94 -0.881,5.194 0.056,3.689 -1.332,7.513 -4.813,10.995 -5.319,5.318 -15.139,6.504 -22.366,-0.721 -5.692,-5.694 -8.363,-15.278 -0.776,-22.865 2.816,-2.813 6.867,-4.477 11.123,-4.402 2.961,0.053 3.306,0.161 5.213,-0.704 1.907,-0.869 1.082,-2.799 2.222,-6.205 0.557,-1.66 1.544,-3.294 3.093,-4.844 4.125,-4.126 11.721,-5.072 17.284,0.491 4.532,4.535 6.456,11.759 0.531,17.682 z"
- id="path3982" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.png
deleted file mode 100644
index 2dfa328e6cf..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.svg
deleted file mode 100644
index d0243133111..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-logo.svg
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="232.17999"
- height="73.112274"
- id="svg3635"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 1">
- <defs
- id="defs3637">
- <linearGradient
- gradientTransform="translate(-419.62671,208.8676)"
- id="SVGID_1_"
- gradientUnits="userSpaceOnUse"
- x1="223.6167"
- y1="76.3564"
- x2="223.6167"
- y2="137.38029">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop160" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop162" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_1_"
- id="linearGradient3693"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(-419.62671,208.8676)"
- x1="223.6167"
- y1="76.3564"
- x2="223.6167"
- y2="137.38029" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="202.10766"
- inkscape:cy="3.8593771"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-right="5"
- fit-margin-bottom="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2411"
- inkscape:window-y="568"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata3640">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-229.62429,-318.66319)">
- <g
- id="g3685"
- transform="translate(520,37.142857)">
- <path
- id="path149"
- d="m -228.72771,306.3346 c -1.336,-0.29 -2.281,-0.448 -3.442,-0.448 -2.847,0 -5.33,0.831 -7.391,2.468 -0.091,0.06 -0.192,0.14 -0.303,0.245 -0.231,0.197 -0.452,0.406 -0.668,0.621 -1.478,1.314 -2.76,1.952 -2.76,-1.235 v -0.666 c 0,-0.404 -0.327,-0.732 -0.732,-0.732 h -2.101 c -0.198,0 -0.388,0.081 -0.525,0.223 -0.139,0.143 -0.212,0.335 -0.206,0.532 0.105,3.333 0.215,6.778 0.215,9.621 v 18.75 c 0,0.404 0.328,0.731 0.732,0.731 h 2.209 c 0.404,0 0.732,-0.328 0.732,-0.731 v -9.914 c 0,-1.37 0.107,-3.805 0.309,-4.813 1.569,-7.797 4.982,-11.588 10.435,-11.588 0.979,0 1.881,0.165 2.874,0.363 0.048,0.011 0.096,0.015 0.144,0.015 0.148,0 0.294,-0.045 0.417,-0.131 0.163,-0.113 0.273,-0.288 0.306,-0.484 l 0.323,-1.994 c 0.062,-0.384 -0.187,-0.752 -0.568,-0.833 z"
- inkscape:connector-curvature="0" />
- <path
- id="path151"
- d="m -139.68071,307.9266 c -2.512,-1.774 -5.292,-2.04 -6.726,-2.04 -2.91,0 -5.648,0.912 -7.822,2.495 -0.005,0.004 -0.01,0.005 -0.014,0.009 -1.004,0.648 -2.627,0.909 -2.618,-0.625 l 0,-0.021 c 0.002,-0.107 -0.003,-0.199 -0.013,-0.277 l -0.008,-0.182 c -0.019,-0.391 -0.34,-0.698 -0.731,-0.698 h -2.102 c -0.203,0 -0.396,0.084 -0.535,0.232 -0.138,0.148 -0.209,0.347 -0.195,0.549 0.152,2.28 0.214,4.171 0.214,6.524 v 21.821 c 0,0.404 0.328,0.731 0.731,0.731 h 2.209 c 0.404,0 0.732,-0.328 0.732,-0.731 v -17.511 c 0,-0.813 0.253,-1.761 0.49,-2.377 0.004,-0.008 0.006,-0.018 0.01,-0.026 1.043,-3.042 4.224,-6.12 8.417,-6.475 3.236,0.002 8.327,2.358 9.024,8.226 0.016,0.15 0.03,0.299 0.042,0.444 0.004,0.049 0.008,0.099 0.011,0.149 0.005,0.07 0.009,0.139 0.014,0.209 0.009,0.19 0.015,0.384 0.015,0.582 0,0.335 0.006,0.638 0.017,0.911 v 15.869 c 0,0.404 0.328,0.731 0.733,0.731 h 2.208 c 0.404,0 0.732,-0.328 0.732,-0.731 v -16.272 c 0,-5.375 -1.627,-9.248 -4.835,-11.516 z"
- inkscape:connector-curvature="0" />
- <path
- id="path153"
- d="m -63.456714,333.2686 c -0.133,-0.113 -0.301,-0.174 -0.473,-0.174 -0.04,0 -0.08,0.003 -0.12,0.01 -0.587,0.098 -0.965,0.098 -1.442,0.098 -1.147,0 -2.177,-0.335 -2.177,-4.387 v -9.913 c 0,-2.343 -0.179,-5.368 -1.583,-7.972 -1.822,-3.382 -5.181,-5.098 -9.978,-5.098 -2.475,0 -6.217,0.516 -9.99,2.974 -0.315,0.205 -0.422,0.615 -0.25,0.949 l 0.861,1.67 c 0.098,0.189 0.272,0.326 0.478,0.375 0.058,0.014 0.116,0.021 0.173,0.021 0.151,0 0.299,-0.047 0.424,-0.135 2.314,-1.639 5.186,-2.504 8.305,-2.504 3.995,0 6.004,1.854 7,3.939 l 0,0 c 1.004,2.221 -0.561,4.404 -2.285,4.584 -0.085,0.005 -0.17,0.008 -0.254,0.013 -0.014,0 -0.028,0.001 -0.042,0 -0.055,-10e-4 -0.101,0.003 -0.143,0.009 -10.978,0.626 -16.538,4.313 -16.538,10.98 0,2.027 0.803,4.057 2.202,5.569 1.233,1.333 3.56,2.921 7.635,2.921 3.471,0 6.271,-1.112 8.325,-2.472 0.061,-0.031 0.13,-0.076 0.211,-0.141 0.023,-0.017 0.042,-0.031 0.064,-0.048 0.128,-0.088 0.256,-0.177 0.378,-0.268 1.275,-0.825 1.969,-0.351 2.623,0.504 0.002,0.002 0.006,0.005 0.008,0.007 0.84,1.14 2.161,1.718 3.962,1.718 0.846,0 1.591,-0.094 2.344,-0.294 0.32,-0.085 0.543,-0.375 0.543,-0.707 v -1.67 c -0.002,-0.214 -0.097,-0.419 -0.261,-0.558 z m -18.252,0.527 c -3.042,0 -6.111,-1.723 -6.111,-5.572 0,-4.863 5.936,-6.58 12.167,-7.043 2.32,-0.043 4.097,2.162 4.311,4.575 v 0.989 c -0.062,0.647 -0.246,1.289 -0.568,1.888 -0.162,0.263 -0.356,0.556 -0.589,0.864 -0.04,0.047 -0.075,0.093 -0.103,0.134 -1.442,1.848 -4.223,4.165 -9.107,4.165 z"
- inkscape:connector-curvature="0" />
- <path
- id="path155"
- d="m -257.43671,306.5866 h -2.047 c -0.392,0 -0.715,0.311 -0.731,0.703 -0.065,1.618 -0.892,1.836 -2.704,0.766 -0.01,-0.006 -0.018,-0.014 -0.026,-0.019 -0.178,-0.119 -0.361,-0.231 -0.545,-0.339 -0.011,-0.007 -0.021,-0.012 -0.032,-0.02 -0.088,-0.059 -0.169,-0.104 -0.245,-0.14 -1.982,-1.096 -4.306,-1.65 -6.923,-1.65 -3.739,0 -7.428,1.548 -10.122,4.25 -2.083,2.087 -4.564,5.826 -4.564,11.784 0,3.818 1.347,7.413 3.792,10.122 2.594,2.875 6.234,4.458 10.249,4.458 3.11,0 5.514,-0.819 7.334,-1.897 0.004,-0.002 0.008,-0.003 0.012,-0.005 1.953,-0.873 3.601,-2.182 3.135,2.232 -0.875,5.678 -4.519,8.765 -10.482,8.765 -4.175,0 -7.31,-1.404 -9.204,-2.583 -0.117,-0.072 -0.251,-0.11 -0.387,-0.11 -0.061,0 -0.122,0.008 -0.182,0.023 -0.193,0.049 -0.358,0.176 -0.456,0.35 l -0.969,1.725 c -0.189,0.336 -0.085,0.761 0.237,0.972 2.852,1.863 6.909,2.975 10.853,2.975 2.691,0 9.293,-0.625 12.494,-6.412 1.384,-2.481 2.03,-5.968 2.03,-10.968 v -17.457 c 0,-2.474 0.07,-4.679 0.214,-6.738 0.014,-0.202 -0.057,-0.402 -0.195,-0.549 -0.139,-0.153 -0.333,-0.238 -0.536,-0.238 z m -16.892,26.028 c -0.605,-0.24 -7.609,-3.216 -7.013,-11.811 0.551,-7.946 5.723,-10.459 6.518,-10.798 1.278,-0.5 2.7,-0.769 4.241,-0.769 1.664,0 3.112,0.327 4.354,0.873 6.846,3.871 7.696,16.453 0.885,21.467 -1.592,0.999 -3.437,1.573 -5.346,1.573 -1.342,0 -2.552,-0.194 -3.639,-0.535 z"
- inkscape:connector-curvature="0" />
- <path
- id="path157"
- d="m -99.588714,306.5866 h -2.046996 c -0.393,0 -0.716,0.311 -0.731,0.703 -0.066,1.618 -0.892,1.836 -2.703,0.766 -0.009,-0.005 -0.018,-0.014 -0.027,-0.019 -0.178,-0.119 -0.362,-0.231 -0.546,-0.339 -0.011,-0.008 -0.02,-0.014 -0.031,-0.02 -0.087,-0.059 -0.168,-0.104 -0.244,-0.139 -1.982,-1.097 -4.307,-1.651 -6.924,-1.651 -3.739,0 -7.429,1.548 -10.122,4.25 -2.082,2.087 -4.564,5.826 -4.564,11.784 0,3.818 1.346,7.413 3.792,10.122 2.595,2.875 6.234,4.458 10.248,4.458 3.111,0 5.514,-0.819 7.335,-1.897 0.004,-0.002 0.007,-0.003 0.012,-0.005 1.954,-0.874 3.603,-2.183 3.135,2.233 -0.875,5.678 -4.519,8.764 -10.482,8.764 -4.175,0 -7.31,-1.404 -9.204,-2.583 -0.118,-0.072 -0.251,-0.11 -0.387,-0.11 -0.06,0 -0.122,0.008 -0.182,0.023 -0.193,0.049 -0.358,0.176 -0.456,0.35 l -0.97,1.725 c -0.189,0.336 -0.085,0.761 0.237,0.972 2.853,1.863 6.91,2.975 10.854,2.975 2.689,0 9.293,-0.625 12.493,-6.412 1.384996,-2.481 2.030996,-5.968 2.030996,-10.968 v -17.457 c 0,-2.474 0.07,-4.679 0.214,-6.738 0.014,-0.202 -0.057,-0.402 -0.195,-0.549 -0.139,-0.153 -0.332,-0.238 -0.536,-0.238 z m -16.891996,26.028 c -0.605,-0.24 -7.609,-3.216 -7.013,-11.811 0.551,-7.94 5.716,-10.455 6.517,-10.798 1.278,-0.5 2.701,-0.769 4.242,-0.769 1.665,0 3.113,0.327 4.354,0.873 6.845,3.871 7.696,16.453 0.884,21.467 -1.592,1 -3.436,1.573 -5.345,1.573 -1.343,0 -2.553,-0.194 -3.639,-0.535 z"
- inkscape:connector-curvature="0" />
- <path
- id="path164"
- d="m -198.36371,292.3616 c -2.337,2.336 -4.109,5.342 -5.032,8.654 -6.076,-0.093 -12.171,2.273 -17.007,7.11 -8.142,8.141 -10.674,22.913 0.667,34.253 9.542,9.543 23.793,9.687 33.145,0.333 4.421,-4.424 7.236,-10.506 7.297,-16.94 3.14,-0.835 6.125,-2.507 8.67,-5.049 6.956,-6.959 9.086,-18.919 -0.311,-28.318 -7.833,-7.83 -19.626,-7.847 -27.429,-0.043 z m 25.622,20.422 c -1.335,1.338 -3.045,2.324 -4.932,2.864 -3.027,0.867 -4.657,0.777 -5.698,2.515 -1.041,1.735 -0.926,1.94 -0.88,5.194 0.056,3.689 -1.333,7.513 -4.813,10.995 -5.32,5.318 -15.14,6.504 -22.366,-0.721 -5.693,-5.694 -8.365,-15.278 -0.778,-22.865 2.816,-2.813 6.866,-4.477 11.124,-4.402 2.961,0.053 3.306,0.161 5.212,-0.704 1.909,-0.869 1.082,-2.799 2.222,-6.205 0.556,-1.66 1.545,-3.294 3.092,-4.844 4.126,-4.126 11.721,-5.072 17.285,0.491 4.533,4.535 6.455,11.759 0.532,17.682 z"
- inkscape:connector-curvature="0"
- style="fill:url(#linearGradient3693)" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.png
deleted file mode 100644
index 5f065e9c1b4..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.svg
deleted file mode 100644
index 777f19f6f1b..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar-foreground-white.svg
+++ /dev/null
@@ -1,170 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="120"
- height="60"
- id="svg7234"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 71">
- <defs
- id="defs7236">
- <linearGradient
- gradientTransform="translate(-170,-202.49496)"
- id="SVGID_21_"
- gradientUnits="userSpaceOnUse"
- x1="459.35349"
- y1="540.44342"
- x2="459.35349"
- y2="570.87878">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop4296" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop4298" />
- </linearGradient>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="135"
- inkscape:cy="-132.85715"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="1928"
- inkscape:window-y="52"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7239">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-240,-319.50504)">
- <rect
- style="fill:#00293f"
- x="240"
- y="319.50504"
- width="120"
- height="60"
- id="rect4240" />
- <rect
- x="240"
- y="319.50504"
- width="120"
- height="14"
- id="rect4283" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 273.035,348.47704 c -0.666,-0.145 -1.137,-0.223 -1.716,-0.223 -1.421,0 -2.659,0.414 -3.687,1.229 -0.045,0.031 -0.096,0.071 -0.15,0.123 -0.115,0.099 -0.227,0.202 -0.334,0.309 -0.737,0.656 -1.377,0.975 -1.377,-0.614 v -0.333 c 0,-0.201 -0.162,-0.365 -0.365,-0.365 h -1.047 c -0.1,0 -0.193,0.04 -0.262,0.112 -0.07,0.07 -0.106,0.167 -0.104,0.265 0.053,1.661 0.107,3.38 0.107,4.798 v 9.352 c 0,0.202 0.164,0.366 0.365,0.366 h 1.102 c 0.201,0 0.365,-0.164 0.365,-0.366 v -4.944 c 0,-0.684 0.053,-1.896 0.154,-2.4 0.781,-3.89 2.484,-5.779 5.204,-5.779 0.488,0 0.938,0.082 1.433,0.181 0.023,0.006 0.049,0.008 0.072,0.008 0.073,0 0.146,-0.022 0.208,-0.065 0.081,-0.056 0.137,-0.144 0.152,-0.242 l 0.161,-0.993 c 0.034,-0.196 -0.091,-0.377 -0.281,-0.419 z"
- id="path4285" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 317.447,349.27104 c -1.253,-0.885 -2.64,-1.017 -3.354,-1.017 -1.452,0 -2.817,0.455 -3.901,1.244 -0.002,0.002 -0.005,0.002 -0.007,0.005 -0.501,0.322 -1.311,0.452 -1.306,-0.313 v -0.009 c 0,-0.055 -0.002,-0.101 -0.008,-0.139 l -0.004,-0.091 c -0.008,-0.194 -0.169,-0.349 -0.364,-0.349 h -1.048 c -0.102,0 -0.197,0.041 -0.266,0.115 -0.069,0.074 -0.105,0.173 -0.098,0.274 0.075,1.138 0.105,2.08 0.105,3.254 v 10.883 c 0,0.202 0.164,0.366 0.365,0.366 h 1.102 c 0.201,0 0.365,-0.164 0.365,-0.366 v -8.732 c 0,-0.406 0.127,-0.879 0.244,-1.186 0.002,-0.005 0.004,-0.01 0.006,-0.013 0.52,-1.518 2.105,-3.053 4.197,-3.229 1.613,0.001 4.152,1.176 4.5,4.102 0.008,0.075 0.016,0.149 0.021,0.223 0.002,0.023 0.004,0.048 0.006,0.074 0.003,0.034 0.004,0.068 0.008,0.104 0.004,0.095 0.007,0.191 0.007,0.29 0,0.167 0.003,0.317 0.009,0.454 v 7.914 c 0,0.202 0.162,0.366 0.365,0.366 h 1.102 c 0.201,0 0.365,-0.164 0.365,-0.366 v -8.115 c 10e-4,-2.68 -0.811,-4.612 -2.411,-5.743 z"
- id="path4287" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 356.461,361.91004 c -0.066,-0.056 -0.15,-0.087 -0.235,-0.087 -0.021,0 -0.04,0.002 -0.06,0.006 -0.293,0.049 -0.481,0.049 -0.72,0.049 -0.573,0 -1.086,-0.167 -1.086,-2.189 v -4.942 c 0,-1.169 -0.089,-2.677 -0.79,-3.977 -0.908,-1.687 -2.584,-2.543 -4.977,-2.543 -1.234,0 -3.101,0.258 -4.982,1.483 -0.157,0.102 -0.211,0.307 -0.125,0.474 l 0.43,0.833 c 0.049,0.094 0.136,0.162 0.238,0.187 0.028,0.007 0.057,0.011 0.086,0.011 0.076,0 0.149,-0.023 0.211,-0.067 1.154,-0.817 2.588,-1.249 4.143,-1.249 1.992,0 2.995,0.925 3.491,1.965 l 0,0 c 0.501,1.107 -0.28,2.196 -1.14,2.287 -0.042,0.002 -0.084,0.004 -0.127,0.006 -0.006,0 -0.014,0.001 -0.021,0 -0.028,0 -0.051,0.001 -0.071,0.005 -5.475,0.312 -8.248,2.151 -8.248,5.476 0,1.012 0.4,2.024 1.098,2.778 0.615,0.664 1.776,1.456 3.809,1.456 1.731,0 3.127,-0.554 4.152,-1.232 0.029,-0.016 0.064,-0.038 0.105,-0.069 0.011,-0.01 0.021,-0.017 0.031,-0.025 0.064,-0.043 0.129,-0.088 0.188,-0.134 0.636,-0.41 0.981,-0.175 1.309,0.252 10e-4,10e-4 0.003,0.002 0.004,0.003 0.419,0.569 1.077,0.857 1.976,0.857 0.422,0 0.793,-0.047 1.17,-0.146 0.158,-0.042 0.271,-0.188 0.271,-0.353 v -0.833 c 0,-0.111 -0.048,-0.211 -0.13,-0.282 z m -9.103,0.263 c -1.517,0 -3.048,-0.858 -3.048,-2.778 0,-2.426 2.96,-3.281 6.068,-3.514 1.157,-0.021 2.043,1.078 2.149,2.282 v 0.493 c -0.03,0.323 -0.122,0.644 -0.283,0.942 -0.081,0.13 -0.177,0.277 -0.294,0.431 -0.02,0.023 -0.037,0.047 -0.051,0.066 -0.717,0.923 -2.105,2.078 -4.541,2.078 z"
- id="path4289" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 258.717,348.60304 h -1.021 c -0.195,0 -0.355,0.154 -0.364,0.351 -0.032,0.807 -0.444,0.915 -1.349,0.383 -0.004,-0.004 -0.009,-0.008 -0.013,-0.011 -0.089,-0.059 -0.181,-0.114 -0.272,-0.168 -0.006,-0.004 -0.011,-0.006 -0.016,-0.011 -0.043,-0.029 -0.084,-0.052 -0.123,-0.069 -0.988,-0.547 -2.146,-0.823 -3.453,-0.823 -1.864,0 -3.703,0.772 -5.047,2.119 -1.039,1.041 -2.277,2.906 -2.277,5.877 0,1.905 0.672,3.697 1.892,5.048 1.294,1.435 3.109,2.224 5.111,2.224 1.551,0 2.75,-0.409 3.658,-0.946 0.002,-0.001 0.004,-0.001 0.007,-0.001 0.973,-0.437 1.795,-1.09 1.563,1.112 -0.436,2.832 -2.254,4.372 -5.228,4.372 -2.082,0 -3.646,-0.701 -4.591,-1.288 -0.059,-0.037 -0.125,-0.057 -0.193,-0.057 -0.029,0 -0.061,0.005 -0.09,0.012 -0.097,0.024 -0.179,0.088 -0.228,0.175 l -0.483,0.86 c -0.095,0.167 -0.043,0.38 0.118,0.484 1.423,0.929 3.446,1.483 5.413,1.483 1.342,0 4.635,-0.312 6.231,-3.198 0.69,-1.237 1.013,-2.976 1.013,-5.47 v -8.707 c 0,-1.233 0.035,-2.332 0.107,-3.36 0.006,-0.1 -0.029,-0.2 -0.098,-0.273 -0.07,-0.075 -0.166,-0.118 -0.267,-0.118 z m -8.425,12.981 c -0.302,-0.12 -3.795,-1.604 -3.498,-5.891 0.275,-3.963 2.854,-5.217 3.251,-5.387 0.638,-0.248 1.348,-0.382 2.115,-0.382 0.83,0 1.553,0.162 2.171,0.436 3.415,1.93 3.839,8.205 0.442,10.706 -0.795,0.498 -1.715,0.784 -2.668,0.784 -0.667,0.001 -1.271,-0.096 -1.813,-0.266 z"
- id="path4291" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 337.443,348.60304 h -1.021 c -0.195,0 -0.356,0.154 -0.364,0.351 -0.034,0.807 -0.445,0.915 -1.349,0.383 -0.004,-0.004 -0.009,-0.008 -0.014,-0.011 -0.088,-0.059 -0.18,-0.114 -0.272,-0.168 -0.005,-0.004 -0.01,-0.008 -0.015,-0.011 -0.043,-0.029 -0.084,-0.052 -0.123,-0.069 -0.988,-0.547 -2.146,-0.823 -3.452,-0.823 -1.864,0 -3.706,0.772 -5.049,2.119 -1.038,1.041 -2.276,2.906 -2.276,5.877 0,1.905 0.672,3.697 1.891,5.048 1.295,1.435 3.109,2.224 5.112,2.224 1.552,0 2.749,-0.409 3.658,-0.946 0.001,-0.001 0.003,-0.001 0.006,-0.001 0.974,-0.438 1.796,-1.09 1.563,1.112 -0.438,2.832 -2.254,4.372 -5.228,4.372 -2.083,0 -3.646,-0.701 -4.591,-1.288 -0.059,-0.037 -0.125,-0.057 -0.193,-0.057 -0.029,0 -0.061,0.005 -0.09,0.012 -0.098,0.024 -0.18,0.088 -0.228,0.175 l -0.483,0.86 c -0.095,0.167 -0.043,0.38 0.117,0.484 1.424,0.929 3.446,1.483 5.414,1.483 1.342,0 4.635,-0.312 6.23,-3.198 0.691,-1.237 1.014,-2.976 1.014,-5.47 v -8.707 c 0,-1.233 0.035,-2.332 0.105,-3.36 0.008,-0.1 -0.027,-0.2 -0.097,-0.273 -0.067,-0.075 -0.163,-0.118 -0.265,-0.118 z m -8.424,12.981 c -0.302,-0.12 -3.796,-1.604 -3.498,-5.891 0.274,-3.96 2.851,-5.215 3.25,-5.385 0.638,-0.25 1.347,-0.384 2.116,-0.384 0.83,0 1.553,0.162 2.172,0.436 3.413,1.93 3.838,8.205 0.439,10.706 -0.793,0.498 -1.713,0.784 -2.665,0.784 -0.669,0.001 -1.272,-0.096 -1.814,-0.266 z"
- id="path4293" />
- <path
- style="fill:url(#SVGID_21_)"
- inkscape:connector-curvature="0"
- d="m 288.18,341.50904 c -1.166,1.164 -2.05,2.664 -2.51,4.316 -3.031,-0.047 -6.07,1.134 -8.482,3.546 -4.062,4.06 -5.324,11.427 0.332,17.083 4.76,4.761 11.867,4.831 16.531,0.167 2.205,-2.207 3.609,-5.239 3.64,-8.449 1.565,-0.416 3.056,-1.25 4.324,-2.519 3.47,-3.471 4.531,-9.436 -0.155,-14.124 -3.907,-3.905 -9.79,-3.914 -13.68,-0.02 z m 12.779,10.184 c -0.667,0.667 -1.52,1.159 -2.461,1.428 -1.51,0.434 -2.322,0.389 -2.842,1.255 -0.52,0.866 -0.461,0.967 -0.438,2.59 0.027,1.841 -0.665,3.747 -2.4,5.484 -2.653,2.652 -7.551,3.244 -11.155,-0.359 -2.839,-2.841 -4.172,-7.62 -0.387,-11.404 1.404,-1.402 3.424,-2.233 5.547,-2.195 1.477,0.027 1.649,0.08 2.6,-0.351 0.953,-0.433 0.54,-1.397 1.109,-3.095 0.276,-0.827 0.77,-1.643 1.541,-2.416 2.059,-2.058 5.846,-2.53 8.621,0.245 2.259,2.261 3.218,5.864 0.265,8.818 z"
- id="path4300" />
- <g
- transform="translate(-170,-202.49496)"
- id="g4302">
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 416.381,533.79 v -5.23 c 0,-0.65 -0.01,-1.18 -0.031,-1.59 h 0.664 l 0.039,0.84 h 0.017 c 0.323,-0.633 0.803,-0.95 1.44,-0.95 0.484,0 0.889,0.229 1.211,0.688 0.323,0.459 0.484,1.046 0.484,1.763 0,0.797 -0.174,1.431 -0.521,1.902 -0.347,0.471 -0.782,0.708 -1.303,0.708 -0.264,0 -0.506,-0.067 -0.726,-0.2 -0.22,-0.134 -0.392,-0.323 -0.515,-0.57 h -0.016 v 2.641 h -0.743 z m 0.744,-4.761 v 0.78 c 0,0.39 0.109,0.718 0.326,0.982 0.217,0.264 0.479,0.397 0.786,0.397 0.373,0 0.669,-0.166 0.888,-0.497 0.219,-0.332 0.328,-0.779 0.328,-1.343 0,-0.507 -0.107,-0.925 -0.324,-1.255 -0.216,-0.33 -0.502,-0.495 -0.859,-0.495 -0.229,0 -0.44,0.082 -0.633,0.247 -0.191,0.165 -0.324,0.367 -0.399,0.605 -0.075,0.238 -0.113,0.433 -0.113,0.579 z"
- id="path4304" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 425.245,529.34 c 0,0.52 -0.087,0.975 -0.26,1.364 -0.173,0.391 -0.416,0.69 -0.728,0.9 -0.313,0.21 -0.65,0.315 -1.013,0.315 -0.565,0 -1.032,-0.231 -1.399,-0.692 -0.369,-0.462 -0.553,-1.062 -0.553,-1.798 0,-0.783 0.19,-1.407 0.57,-1.873 0.38,-0.465 0.859,-0.697 1.438,-0.697 0.576,0 1.045,0.231 1.404,0.692 0.361,0.463 0.541,1.058 0.541,1.789 z m -3.192,0.059 c 0,0.53 0.113,0.968 0.34,1.313 0.228,0.345 0.512,0.518 0.853,0.518 0.35,0 0.641,-0.173 0.874,-0.52 0.233,-0.347 0.35,-0.794 0.35,-1.341 0,-0.503 -0.107,-0.932 -0.321,-1.287 -0.215,-0.354 -0.508,-0.532 -0.878,-0.532 -0.377,0 -0.673,0.176 -0.891,0.527 -0.218,0.352 -0.327,0.792 -0.327,1.322 z"
- id="path4306" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 426.174,526.97 h 0.76 c 0.506,2.347 0.778,3.673 0.816,3.979 h 0.016 c 0.029,-0.26 0.359,-1.586 0.992,-3.979 h 0.631 c 0.574,2.243 0.895,3.57 0.961,3.979 h 0.016 c 0.074,-0.5 0.168,-0.989 0.28,-1.47 l 0.584,-2.51 h 0.735 l -1.279,4.84 h -0.688 c -0.44,-1.693 -0.688,-2.656 -0.743,-2.888 -0.057,-0.231 -0.121,-0.559 -0.192,-0.982 h -0.017 c -0.088,0.504 -0.203,1.017 -0.348,1.54 l -0.645,2.33 h -0.688 l -1.191,-4.839 z"
- id="path4308" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 436.396,529.579 h -2.808 c 0.011,0.523 0.14,0.925 0.388,1.203 0.248,0.278 0.57,0.417 0.965,0.417 0.429,0 0.805,-0.083 1.127,-0.25 l 0.129,0.65 c -0.382,0.213 -0.832,0.32 -1.353,0.32 -0.603,0 -1.083,-0.224 -1.44,-0.67 -0.357,-0.447 -0.535,-1.04 -0.535,-1.78 0,-0.74 0.171,-1.36 0.514,-1.86 0.343,-0.5 0.803,-0.75 1.383,-0.75 0.533,0 0.941,0.223 1.228,0.668 0.285,0.444 0.428,0.989 0.428,1.632 -0.001,0.184 -0.009,0.324 -0.026,0.42 z m -2.798,-0.67 h 2.104 c 0,-0.416 -0.086,-0.752 -0.258,-1.007 -0.172,-0.255 -0.417,-0.383 -0.734,-0.383 -0.301,0 -0.551,0.128 -0.748,0.383 -0.197,0.255 -0.319,0.591 -0.364,1.007 z"
- id="path4310" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 437.797,531.81 v -3.3 c 0,-0.627 -0.011,-1.141 -0.032,-1.54 h 0.656 l 0.048,0.97 c 0.099,-0.34 0.25,-0.604 0.452,-0.795 0.202,-0.191 0.423,-0.285 0.659,-0.285 0.051,0 0.118,0.007 0.201,0.021 v 0.88 c -0.072,-0.021 -0.158,-0.03 -0.256,-0.03 -0.27,0 -0.502,0.132 -0.695,0.396 -0.193,0.263 -0.289,0.638 -0.289,1.125 v 2.56 h -0.744 z"
- id="path4312" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 444.229,529.579 h -2.808 c 0.011,0.523 0.14,0.925 0.388,1.203 0.248,0.278 0.57,0.417 0.965,0.417 0.429,0 0.805,-0.083 1.127,-0.25 l 0.129,0.65 c -0.382,0.213 -0.832,0.32 -1.353,0.32 -0.603,0 -1.083,-0.224 -1.44,-0.67 -0.357,-0.447 -0.535,-1.04 -0.535,-1.78 0,-0.74 0.171,-1.36 0.514,-1.86 0.343,-0.5 0.803,-0.75 1.383,-0.75 0.533,0 0.941,0.223 1.228,0.668 0.285,0.444 0.428,0.989 0.428,1.632 -0.002,0.184 -0.01,0.324 -0.026,0.42 z m -2.799,-0.67 h 2.104 c 0,-0.416 -0.086,-0.752 -0.258,-1.007 -0.172,-0.255 -0.417,-0.383 -0.734,-0.383 -0.301,0 -0.551,0.128 -0.748,0.383 -0.197,0.255 -0.319,0.591 -0.364,1.007 z"
- id="path4314" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 448.365,524.689 h 0.744 v 5.851 c 0,0.539 0.01,0.963 0.031,1.27 h -0.664 l -0.056,-0.86 c -0.128,0.307 -0.312,0.545 -0.552,0.716 -0.24,0.17 -0.512,0.255 -0.816,0.255 -0.49,0 -0.9,-0.231 -1.229,-0.692 -0.328,-0.462 -0.491,-1.048 -0.491,-1.758 0,-0.771 0.173,-1.397 0.518,-1.883 0.346,-0.484 0.772,-0.728 1.282,-0.728 0.271,0 0.516,0.067 0.73,0.2 0.215,0.134 0.381,0.313 0.502,0.54 v -2.911 z m 0,5.04 v -0.77 c 0,-0.41 -0.106,-0.741 -0.318,-0.993 -0.212,-0.251 -0.467,-0.377 -0.762,-0.377 -0.36,0 -0.65,0.168 -0.87,0.505 -0.22,0.337 -0.33,0.774 -0.33,1.314 0,0.507 0.104,0.927 0.312,1.261 0.209,0.333 0.499,0.5 0.873,0.5 0.285,0 0.539,-0.131 0.762,-0.393 0.223,-0.262 0.333,-0.61 0.333,-1.047 z"
- id="path4316" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 453.014,530.54 v -5.851 h 0.76 v 3.07 c 0.282,-0.601 0.738,-0.9 1.367,-0.9 0.496,0 0.903,0.229 1.221,0.688 0.316,0.459 0.476,1.05 0.476,1.772 0,0.79 -0.175,1.421 -0.526,1.893 -0.35,0.472 -0.777,0.708 -1.281,0.708 -0.605,0 -1.062,-0.304 -1.368,-0.91 l -0.032,0.8 h -0.648 c 0.019,-0.307 0.031,-0.731 0.031,-1.27 z m 0.744,-1.5 v 0.789 c 0,0.36 0.106,0.676 0.321,0.945 0.215,0.271 0.48,0.405 0.798,0.405 0.371,0 0.664,-0.164 0.883,-0.492 0.217,-0.329 0.325,-0.771 0.325,-1.328 0,-0.517 -0.108,-0.94 -0.323,-1.272 -0.217,-0.331 -0.506,-0.497 -0.869,-0.497 -0.319,0 -0.589,0.146 -0.808,0.438 -0.219,0.29 -0.327,0.628 -0.327,1.012 z"
- id="path4318" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 457.693,526.97 h 0.816 l 0.879,2.885 c 0.075,0.24 0.163,0.549 0.265,0.925 0.104,-0.45 0.184,-0.774 0.239,-0.975 l 0.793,-2.835 h 0.799 l -1.096,3.46 c -0.35,1.1 -0.633,1.86 -0.85,2.28 -0.217,0.42 -0.453,0.73 -0.708,0.932 -0.255,0.202 -0.493,0.328 -0.714,0.378 l -0.176,-0.78 c 0.402,-0.156 0.717,-0.427 0.941,-0.81 0.226,-0.384 0.338,-0.64 0.338,-0.771 0,-0.057 -0.016,-0.133 -0.048,-0.229 l -1.478,-4.46 z"
- id="path4320" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.png
deleted file mode 100644
index 4ec0662794c..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.svg
deleted file mode 100644
index 37bca2676f2..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-bar.svg
+++ /dev/null
@@ -1,186 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="121"
- height="61"
- id="svg7089"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 68">
- <defs
- id="defs7091">
- <linearGradient
- id="SVGID_17_"
- gradientUnits="userSpaceOnUse"
- x1="329.353"
- y1="540.44342"
- x2="329.353"
- y2="570.87878">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop4136" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop4138" />
- </linearGradient>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.98994949"
- inkscape:cx="-139.11021"
- inkscape:cy="77.765252"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2060"
- inkscape:window-y="202"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7094">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-673.78571,-579.00507)">
- <rect
- style="fill:#ffffff;stroke:#0088d3;stroke-miterlimit:10"
- x="674.28571"
- y="579.50507"
- stroke-miterlimit="10"
- width="120"
- height="60"
- id="rect4119" />
- <rect
- style="fill:#0088d3"
- x="674.28571"
- y="579.50507"
- width="120"
- height="14"
- id="rect4121" />
- <g
- transform="translate(394.28571,57.50504)"
- id="g4123">
- <path
- inkscape:connector-curvature="0"
- d="m 313.036,550.972 c -0.667,-0.145 -1.138,-0.223 -1.716,-0.223 -1.42,0 -2.659,0.414 -3.686,1.229 -0.046,0.031 -0.097,0.071 -0.151,0.123 -0.115,0.099 -0.226,0.202 -0.333,0.309 -0.737,0.656 -1.376,0.975 -1.376,-0.614 v -0.333 c 0,-0.201 -0.163,-0.365 -0.365,-0.365 h -1.048 c -0.099,0 -0.193,0.04 -0.262,0.112 -0.069,0.07 -0.106,0.167 -0.103,0.265 0.053,1.661 0.108,3.38 0.108,4.798 v 9.352 c 0,0.202 0.163,0.366 0.364,0.366 h 1.102 c 0.201,0 0.365,-0.164 0.365,-0.366 v -4.944 c 0,-0.684 0.053,-1.896 0.154,-2.4 0.782,-3.89 2.485,-5.779 5.204,-5.779 0.488,0 0.938,0.082 1.433,0.181 0.023,0.006 0.048,0.008 0.072,0.008 0.073,0 0.146,-0.022 0.208,-0.065 0.081,-0.056 0.137,-0.144 0.152,-0.242 l 0.161,-0.993 c 0.031,-0.196 -0.094,-0.377 -0.283,-0.419 z"
- id="path4125" />
- <path
- inkscape:connector-curvature="0"
- d="m 357.447,551.766 c -1.253,-0.885 -2.64,-1.017 -3.354,-1.017 -1.452,0 -2.817,0.455 -3.901,1.244 -0.002,0.002 -0.005,0.002 -0.007,0.005 -0.501,0.322 -1.311,0.452 -1.306,-0.313 v -0.009 c 0,-0.055 -0.002,-0.101 -0.007,-0.139 l -0.004,-0.091 c -0.009,-0.194 -0.169,-0.349 -0.365,-0.349 h -1.048 c -0.101,0 -0.197,0.041 -0.266,0.115 -0.069,0.074 -0.105,0.173 -0.098,0.274 0.076,1.138 0.106,2.08 0.106,3.254 v 10.883 c 0,0.202 0.164,0.366 0.365,0.366 h 1.101 c 0.202,0 0.365,-0.164 0.365,-0.366 v -8.732 c 0,-0.406 0.126,-0.879 0.244,-1.186 0.002,-0.005 0.003,-0.01 0.005,-0.013 0.521,-1.518 2.106,-3.053 4.197,-3.229 1.614,0.001 4.153,1.176 4.501,4.102 0.008,0.075 0.016,0.149 0.021,0.223 0.001,0.023 0.004,0.048 0.006,0.074 0.002,0.034 0.004,0.068 0.007,0.104 0.005,0.095 0.007,0.191 0.007,0.29 0,0.167 0.003,0.317 0.008,0.454 v 7.914 c 0,0.202 0.163,0.366 0.366,0.366 h 1.101 c 0.202,0 0.365,-0.164 0.365,-0.366 v -8.115 c 0.003,-2.68 -0.809,-4.612 -2.409,-5.743 z"
- id="path4127" />
- <path
- inkscape:connector-curvature="0"
- d="m 396.461,564.405 c -0.066,-0.056 -0.15,-0.087 -0.236,-0.087 -0.02,0 -0.04,0.002 -0.06,0.006 -0.292,0.049 -0.481,0.049 -0.719,0.049 -0.573,0 -1.086,-0.167 -1.086,-2.189 v -4.942 c 0,-1.169 -0.089,-2.677 -0.79,-3.977 -0.909,-1.687 -2.583,-2.543 -4.976,-2.543 -1.235,0 -3.101,0.258 -4.982,1.483 -0.158,0.102 -0.211,0.307 -0.125,0.474 l 0.43,0.833 c 0.049,0.094 0.136,0.162 0.238,0.187 0.029,0.007 0.058,0.011 0.086,0.011 0.076,0 0.149,-0.023 0.211,-0.067 1.154,-0.817 2.587,-1.249 4.143,-1.249 1.992,0 2.995,0.925 3.491,1.965 l 0,0 c 0.5,1.107 -0.28,2.196 -1.14,2.287 -0.042,0.002 -0.084,0.004 -0.126,0.006 -0.006,0 -0.015,10e-4 -0.021,0 -0.028,0 -0.051,10e-4 -0.071,0.005 -5.475,0.312 -8.249,2.151 -8.249,5.476 0,1.012 0.4,2.024 1.099,2.778 0.615,0.664 1.776,1.456 3.808,1.456 1.732,0 3.128,-0.554 4.153,-1.232 0.03,-0.016 0.064,-0.038 0.105,-0.069 0.011,-0.01 0.021,-0.017 0.032,-0.025 0.063,-0.043 0.128,-0.088 0.188,-0.134 0.636,-0.41 0.982,-0.175 1.309,0.252 10e-4,10e-4 0.003,0.002 0.004,0.003 0.419,0.569 1.077,0.857 1.976,0.857 0.422,0 0.793,-0.047 1.169,-0.146 0.159,-0.042 0.271,-0.188 0.271,-0.353 v -0.833 c -0.002,-0.111 -0.05,-0.211 -0.132,-0.282 z m -9.103,0.263 c -1.517,0 -3.048,-0.858 -3.048,-2.778 0,-2.426 2.96,-3.281 6.068,-3.514 1.158,-0.021 2.043,1.078 2.15,2.282 v 0.493 c -0.031,0.323 -0.122,0.644 -0.283,0.942 -0.081,0.13 -0.177,0.277 -0.293,0.431 -0.02,0.023 -0.038,0.047 -0.051,0.066 -0.72,0.923 -2.107,2.078 -4.543,2.078 z"
- id="path4129" />
- <path
- inkscape:connector-curvature="0"
- d="m 298.717,551.098 h -1.021 c -0.195,0 -0.356,0.154 -0.365,0.351 -0.032,0.807 -0.445,0.915 -1.349,0.383 -0.004,-0.004 -0.009,-0.008 -0.013,-0.011 -0.089,-0.059 -0.181,-0.114 -0.272,-0.168 -0.005,-0.004 -0.011,-0.006 -0.016,-0.011 -0.043,-0.029 -0.084,-0.052 -0.123,-0.069 -0.988,-0.547 -2.147,-0.823 -3.453,-0.823 -1.865,0 -3.704,0.772 -5.048,2.119 -1.039,1.041 -2.277,2.906 -2.277,5.877 0,1.905 0.672,3.697 1.892,5.048 1.294,1.435 3.109,2.224 5.111,2.224 1.551,0 2.75,-0.409 3.658,-0.946 0.002,-10e-4 0.004,-10e-4 0.006,-10e-4 0.974,-0.437 1.796,-1.09 1.563,1.112 -0.436,2.832 -2.254,4.372 -5.228,4.372 -2.082,0 -3.646,-0.701 -4.591,-1.288 -0.058,-0.037 -0.125,-0.057 -0.193,-0.057 -0.03,0 -0.061,0.005 -0.09,0.012 -0.097,0.024 -0.179,0.088 -0.228,0.175 l -0.483,0.86 c -0.095,0.167 -0.042,0.38 0.118,0.484 1.422,0.929 3.446,1.483 5.413,1.483 1.342,0 4.635,-0.312 6.231,-3.198 0.69,-1.237 1.013,-2.976 1.013,-5.47 v -8.707 c 0,-1.233 0.035,-2.332 0.107,-3.36 0.006,-0.1 -0.029,-0.2 -0.098,-0.273 -0.066,-0.075 -0.163,-0.118 -0.264,-0.118 z m -8.425,12.981 c -0.302,-0.12 -3.795,-1.604 -3.498,-5.891 0.275,-3.963 2.854,-5.217 3.251,-5.387 0.638,-0.248 1.347,-0.382 2.115,-0.382 0.83,0 1.553,0.162 2.171,0.436 3.415,1.93 3.839,8.205 0.442,10.706 -0.794,0.498 -1.714,0.784 -2.667,0.784 -0.668,10e-4 -1.272,-0.096 -1.814,-0.266 z"
- id="path4131" />
- <path
- inkscape:connector-curvature="0"
- d="m 377.443,551.098 h -1.021 c -0.196,0 -0.357,0.154 -0.365,0.351 -0.034,0.807 -0.445,0.915 -1.349,0.383 -0.004,-0.004 -0.009,-0.008 -0.013,-0.011 -0.089,-0.059 -0.181,-0.114 -0.273,-0.168 -0.005,-0.004 -0.01,-0.008 -0.015,-0.011 -0.043,-0.029 -0.083,-0.052 -0.122,-0.069 -0.988,-0.547 -2.147,-0.823 -3.453,-0.823 -1.865,0 -3.706,0.772 -5.049,2.119 -1.039,1.041 -2.276,2.906 -2.276,5.877 0,1.905 0.672,3.697 1.891,5.048 1.294,1.435 3.109,2.224 5.112,2.224 1.551,0 2.75,-0.409 3.658,-0.946 10e-4,-10e-4 0.003,-10e-4 0.006,-10e-4 0.974,-0.438 1.796,-1.09 1.563,1.112 -0.437,2.832 -2.253,4.372 -5.227,4.372 -2.083,0 -3.646,-0.701 -4.591,-1.288 -0.058,-0.037 -0.125,-0.057 -0.193,-0.057 -0.03,0 -0.061,0.005 -0.09,0.012 -0.097,0.024 -0.179,0.088 -0.227,0.175 l -0.484,0.86 c -0.094,0.167 -0.042,0.38 0.118,0.484 1.423,0.929 3.446,1.483 5.414,1.483 1.341,0 4.635,-0.312 6.23,-3.198 0.691,-1.237 1.013,-2.976 1.013,-5.47 v -8.707 c 0,-1.233 0.035,-2.332 0.106,-3.36 0.008,-0.1 -0.028,-0.2 -0.097,-0.273 -0.068,-0.075 -0.164,-0.118 -0.266,-0.118 z m -8.424,12.981 c -0.302,-0.12 -3.795,-1.604 -3.498,-5.891 0.274,-3.96 2.851,-5.215 3.25,-5.385 0.637,-0.25 1.347,-0.384 2.116,-0.384 0.831,0 1.553,0.162 2.172,0.436 3.414,1.93 3.838,8.205 0.44,10.706 -0.794,0.498 -1.714,0.784 -2.666,0.784 -0.669,10e-4 -1.273,-0.096 -1.814,-0.266 z"
- id="path4133" />
- <linearGradient
- id="linearGradient7072"
- gradientUnits="userSpaceOnUse"
- x1="329.353"
- y1="540.44342"
- x2="329.353"
- y2="570.87878">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop7074" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop7076" />
- </linearGradient>
- <path
- style="fill:url(#SVGID_17_)"
- inkscape:connector-curvature="0"
- d="m 328.179,544.004 c -1.166,1.164 -2.049,2.664 -2.51,4.316 -3.03,-0.047 -6.07,1.134 -8.482,3.546 -4.062,4.06 -5.324,11.427 0.333,17.083 4.759,4.761 11.867,4.831 16.531,0.167 2.206,-2.207 3.61,-5.239 3.64,-8.449 1.566,-0.416 3.055,-1.25 4.324,-2.519 3.469,-3.471 4.531,-9.436 -0.155,-14.124 -3.907,-3.905 -9.789,-3.914 -13.681,-0.02 z m 12.779,10.184 c -0.667,0.667 -1.519,1.159 -2.46,1.428 -1.51,0.434 -2.322,0.389 -2.842,1.255 -0.519,0.866 -0.461,0.967 -0.438,2.59 0.027,1.841 -0.665,3.747 -2.4,5.484 -2.653,2.652 -7.551,3.244 -11.155,-0.359 -2.839,-2.841 -4.172,-7.62 -0.388,-11.404 1.404,-1.402 3.424,-2.233 5.548,-2.195 1.477,0.027 1.649,0.08 2.6,-0.351 0.952,-0.433 0.54,-1.397 1.108,-3.095 0.277,-0.827 0.771,-1.643 1.542,-2.416 2.058,-2.058 5.846,-2.53 8.621,0.245 2.26,2.261 3.218,5.864 0.264,8.818 z"
- id="path4140" />
- </g>
- <g
- transform="translate(394.28571,57.50504)"
- id="g4220">
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 286.381,533.79 v -5.23 c 0,-0.65 -0.011,-1.18 -0.032,-1.59 h 0.664 l 0.04,0.84 h 0.016 c 0.323,-0.633 0.803,-0.95 1.44,-0.95 0.485,0 0.889,0.229 1.212,0.688 0.323,0.459 0.484,1.046 0.484,1.763 0,0.797 -0.174,1.431 -0.522,1.902 -0.348,0.472 -0.782,0.708 -1.302,0.708 -0.264,0 -0.506,-0.067 -0.726,-0.2 -0.22,-0.134 -0.392,-0.323 -0.514,-0.57 h -0.016 v 2.641 h -0.744 z m 0.744,-4.761 v 0.78 c 0,0.39 0.108,0.718 0.326,0.982 0.218,0.264 0.479,0.397 0.786,0.397 0.373,0 0.669,-0.166 0.888,-0.497 0.218,-0.332 0.328,-0.779 0.328,-1.343 0,-0.507 -0.108,-0.925 -0.324,-1.255 -0.216,-0.33 -0.503,-0.495 -0.86,-0.495 -0.229,0 -0.44,0.082 -0.632,0.247 -0.192,0.165 -0.325,0.367 -0.4,0.605 -0.075,0.238 -0.112,0.433 -0.112,0.579 z"
- id="path4222" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 295.245,529.34 c 0,0.52 -0.086,0.975 -0.26,1.364 -0.173,0.391 -0.416,0.69 -0.728,0.9 -0.312,0.21 -0.649,0.315 -1.012,0.315 -0.565,0 -1.032,-0.231 -1.4,-0.692 -0.368,-0.462 -0.552,-1.062 -0.552,-1.798 0,-0.783 0.19,-1.407 0.57,-1.873 0.38,-0.465 0.859,-0.697 1.438,-0.697 0.576,0 1.044,0.231 1.404,0.692 0.36,0.463 0.54,1.058 0.54,1.789 z m -3.192,0.059 c 0,0.53 0.113,0.968 0.34,1.313 0.227,0.345 0.511,0.518 0.852,0.518 0.35,0 0.641,-0.173 0.874,-0.52 0.233,-0.347 0.35,-0.794 0.35,-1.341 0,-0.503 -0.107,-0.932 -0.322,-1.287 -0.215,-0.354 -0.508,-0.532 -0.878,-0.532 -0.376,0 -0.672,0.176 -0.89,0.527 -0.218,0.351 -0.326,0.792 -0.326,1.322 z"
- id="path4224" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 296.173,526.97 h 0.76 c 0.507,2.347 0.779,3.673 0.816,3.979 h 0.016 c 0.029,-0.26 0.36,-1.586 0.992,-3.979 h 0.632 c 0.573,2.243 0.894,3.57 0.96,3.979 h 0.016 c 0.075,-0.5 0.168,-0.989 0.28,-1.47 l 0.584,-2.51 h 0.736 l -1.28,4.84 h -0.688 c -0.44,-1.693 -0.688,-2.656 -0.744,-2.888 -0.056,-0.231 -0.12,-0.559 -0.192,-0.982 h -0.016 c -0.088,0.504 -0.204,1.017 -0.348,1.54 l -0.644,2.33 h -0.688 l -1.192,-4.839 z"
- id="path4226" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 306.397,529.579 h -2.808 c 0.011,0.523 0.14,0.925 0.388,1.203 0.248,0.278 0.569,0.417 0.964,0.417 0.429,0 0.805,-0.083 1.128,-0.25 l 0.128,0.65 c -0.381,0.213 -0.832,0.32 -1.352,0.32 -0.603,0 -1.083,-0.224 -1.44,-0.67 -0.357,-0.447 -0.536,-1.04 -0.536,-1.78 0,-0.74 0.171,-1.36 0.514,-1.86 0.343,-0.5 0.803,-0.75 1.382,-0.75 0.533,0 0.942,0.223 1.228,0.668 0.285,0.444 0.428,0.989 0.428,1.632 0,0.184 -0.008,0.324 -0.024,0.42 z m -2.8,-0.67 h 2.104 c 0,-0.416 -0.086,-0.752 -0.258,-1.007 -0.172,-0.255 -0.417,-0.383 -0.734,-0.383 -0.301,0 -0.551,0.128 -0.748,0.383 -0.197,0.255 -0.319,0.591 -0.364,1.007 z"
- id="path4228" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 307.797,531.81 v -3.3 c 0,-0.627 -0.011,-1.141 -0.032,-1.54 h 0.656 l 0.048,0.97 c 0.099,-0.34 0.25,-0.604 0.452,-0.795 0.202,-0.191 0.422,-0.285 0.66,-0.285 0.051,0 0.118,0.007 0.2,0.021 v 0.88 c -0.072,-0.021 -0.157,-0.03 -0.256,-0.03 -0.27,0 -0.501,0.132 -0.694,0.396 -0.193,0.263 -0.29,0.638 -0.29,1.125 v 2.56 h -0.744 z"
- id="path4230" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 314.229,529.579 h -2.808 c 0.011,0.523 0.14,0.925 0.388,1.203 0.248,0.278 0.569,0.417 0.964,0.417 0.429,0 0.805,-0.083 1.128,-0.25 l 0.128,0.65 c -0.381,0.213 -0.832,0.32 -1.352,0.32 -0.603,0 -1.083,-0.224 -1.44,-0.67 -0.357,-0.447 -0.536,-1.04 -0.536,-1.78 0,-0.74 0.171,-1.36 0.514,-1.86 0.343,-0.5 0.803,-0.75 1.382,-0.75 0.533,0 0.942,0.223 1.228,0.668 0.285,0.444 0.428,0.989 0.428,1.632 0,0.184 -0.008,0.324 -0.024,0.42 z m -2.8,-0.67 h 2.104 c 0,-0.416 -0.086,-0.752 -0.258,-1.007 -0.172,-0.255 -0.417,-0.383 -0.734,-0.383 -0.301,0 -0.551,0.128 -0.748,0.383 -0.197,0.255 -0.319,0.591 -0.364,1.007 z"
- id="path4232" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 318.365,524.689 h 0.744 v 5.851 c 0,0.539 0.011,0.963 0.032,1.27 h -0.664 l -0.056,-0.86 c -0.128,0.307 -0.312,0.545 -0.552,0.716 -0.24,0.17 -0.512,0.255 -0.816,0.255 -0.491,0 -0.9,-0.231 -1.228,-0.692 -0.328,-0.462 -0.492,-1.048 -0.492,-1.758 0,-0.771 0.172,-1.397 0.518,-1.883 0.346,-0.484 0.773,-0.728 1.282,-0.728 0.272,0 0.515,0.067 0.73,0.2 0.215,0.134 0.382,0.313 0.502,0.54 v -2.911 z m 0,5.04 v -0.77 c 0,-0.41 -0.106,-0.741 -0.318,-0.993 -0.212,-0.251 -0.466,-0.377 -0.762,-0.377 -0.36,0 -0.65,0.168 -0.87,0.505 -0.22,0.337 -0.33,0.774 -0.33,1.314 0,0.507 0.104,0.927 0.312,1.261 0.208,0.333 0.499,0.5 0.872,0.5 0.285,0 0.539,-0.131 0.762,-0.393 0.223,-0.262 0.334,-0.61 0.334,-1.047 z"
- id="path4234" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 323.013,530.54 v -5.851 h 0.76 v 3.07 c 0.283,-0.601 0.739,-0.9 1.368,-0.9 0.496,0 0.903,0.229 1.22,0.688 0.317,0.459 0.476,1.05 0.476,1.772 0,0.79 -0.175,1.421 -0.526,1.893 -0.351,0.472 -0.778,0.708 -1.282,0.708 -0.605,0 -1.062,-0.304 -1.368,-0.91 l -0.032,0.8 h -0.648 c 0.021,-0.307 0.032,-0.731 0.032,-1.27 z m 0.744,-1.5 v 0.789 c 0,0.36 0.107,0.676 0.322,0.945 0.215,0.271 0.48,0.405 0.798,0.405 0.371,0 0.665,-0.164 0.882,-0.492 0.217,-0.329 0.326,-0.771 0.326,-1.328 0,-0.517 -0.108,-0.94 -0.324,-1.272 -0.216,-0.331 -0.505,-0.497 -0.868,-0.497 -0.32,0 -0.589,0.146 -0.808,0.438 -0.219,0.29 -0.328,0.628 -0.328,1.012 z"
- id="path4236" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 327.693,526.97 h 0.816 l 0.88,2.885 c 0.075,0.24 0.163,0.549 0.264,0.925 0.104,-0.45 0.184,-0.774 0.24,-0.975 l 0.792,-2.835 h 0.8 l -1.096,3.46 c -0.35,1.1 -0.633,1.86 -0.85,2.28 -0.217,0.42 -0.453,0.73 -0.708,0.932 -0.255,0.202 -0.493,0.328 -0.714,0.378 l -0.176,-0.78 c 0.403,-0.156 0.717,-0.427 0.942,-0.81 0.225,-0.384 0.338,-0.64 0.338,-0.771 0,-0.057 -0.016,-0.133 -0.048,-0.229 l -1.48,-4.46 z"
- id="path4238" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.png
deleted file mode 100644
index bc275e523cb..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.svg
deleted file mode 100644
index 5d5ec8f3117..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-foreground-white.svg
+++ /dev/null
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="88"
- height="31"
- id="svg6853"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 63">
- <defs
- id="defs6855">
- <linearGradient
- id="SVGID_23_"
- gradientUnits="userSpaceOnUse"
- x1="81.903801"
- y1="561.35449"
- x2="81.903801"
- y2="584.04199">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop4378" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop4380" />
- </linearGradient>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="70.516543"
- inkscape:cy="5.8887068"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="1928"
- inkscape:window-y="52"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata6858">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-276,-331.14789)">
- <rect
- style="fill:#00293f"
- x="276"
- y="331.14789"
- width="88"
- height="31"
- id="rect4363" />
- <g
- transform="translate(230,-223.8521)"
- id="g4365">
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 70.143,568.477 c -0.48,-0.104 -0.82,-0.159 -1.238,-0.159 -1.022,0 -1.916,0.297 -2.656,0.886 -0.033,0.021 -0.069,0.051 -0.108,0.089 -0.083,0.071 -0.163,0.145 -0.241,0.223 -0.531,0.472 -0.992,0.7 -0.992,-0.444 v -0.239 c 0,-0.146 -0.118,-0.264 -0.263,-0.264 h -0.756 c -0.071,0 -0.139,0.03 -0.188,0.08 -0.05,0.051 -0.076,0.12 -0.074,0.192 0.039,1.197 0.078,2.436 0.078,3.458 v 6.74 c 0,0.146 0.118,0.264 0.263,0.264 h 0.795 c 0.145,0 0.263,-0.118 0.263,-0.264 v -3.563 c 0,-0.493 0.039,-1.368 0.111,-1.73 0.564,-2.804 1.792,-4.166 3.751,-4.166 0.352,0 0.676,0.06 1.033,0.131 0.017,0.003 0.034,0.005 0.051,0.005 0.053,0 0.105,-0.017 0.15,-0.047 0.059,-0.041 0.098,-0.104 0.11,-0.174 l 0.116,-0.717 c 0.021,-0.138 -0.068,-0.272 -0.205,-0.301 z"
- id="path4367" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 102.151,569.049 c -0.903,-0.637 -1.902,-0.731 -2.417,-0.731 -1.046,0 -2.03,0.327 -2.812,0.896 -0.002,0 -0.003,10e-4 -0.005,0.002 -0.361,0.232 -0.945,0.326 -0.941,-0.224 v -0.009 c 0,-0.038 -0.001,-0.07 -0.005,-0.1 l -0.003,-0.064 c -0.006,-0.142 -0.122,-0.252 -0.262,-0.252 H 94.95 c -0.073,0 -0.142,0.031 -0.192,0.084 -0.05,0.054 -0.075,0.124 -0.071,0.196 0.054,0.82 0.078,1.5 0.078,2.346 v 7.845 c 0,0.146 0.117,0.264 0.263,0.264 h 0.794 c 0.146,0 0.263,-0.118 0.263,-0.264 v -6.295 c 0,-0.293 0.091,-0.634 0.176,-0.855 0.002,-0.003 0.002,-0.005 0.003,-0.008 0.375,-1.094 1.519,-2.2 3.025,-2.327 1.164,10e-4 2.993,0.847 3.244,2.955 0.006,0.055 0.011,0.107 0.016,0.161 10e-4,0.018 0.003,0.035 0.004,0.054 0.002,0.024 0.003,0.05 0.005,0.074 0.003,0.068 0.005,0.137 0.005,0.21 0,0.12 10e-4,0.228 0.006,0.327 v 5.704 c 0,0.146 0.118,0.264 0.263,0.264 h 0.794 c 0.145,0 0.263,-0.118 0.263,-0.264 v -5.851 c 0.001,-1.93 -0.584,-3.322 -1.738,-4.138 z"
- id="path4369" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 129.567,578.159 c -0.047,-0.04 -0.108,-0.063 -0.169,-0.063 -0.015,0 -0.029,10e-4 -0.043,0.005 -0.211,0.035 -0.347,0.035 -0.519,0.035 -0.413,0 -0.783,-0.121 -0.783,-1.577 v -3.563 c 0,-0.843 -0.063,-1.93 -0.568,-2.866 -0.656,-1.215 -1.862,-1.831 -3.586,-1.831 -0.891,0 -2.236,0.184 -3.592,1.068 -0.113,0.073 -0.152,0.222 -0.09,0.341 l 0.311,0.6 c 0.034,0.069 0.098,0.119 0.171,0.137 0.021,0.004 0.042,0.007 0.062,0.007 0.055,0 0.108,-0.018 0.152,-0.049 0.832,-0.589 1.865,-0.9 2.986,-0.9 1.436,0 2.158,0.667 2.516,1.416 l 0,0 c 0.36,0.798 -0.203,1.583 -0.822,1.647 -0.031,0.004 -0.061,0.005 -0.091,0.006 -0.005,0 -0.011,10e-4 -0.016,0 -0.019,0 -0.036,0.002 -0.051,0.003 -3.946,0.225 -5.944,1.55 -5.944,3.947 0,0.728 0.288,1.457 0.792,2.001 0.443,0.479 1.28,1.051 2.744,1.051 1.248,0 2.254,-0.4 2.993,-0.889 0.022,-0.012 0.047,-0.027 0.076,-0.051 0.009,-0.006 0.016,-0.013 0.023,-0.019 0.046,-0.031 0.092,-0.063 0.136,-0.096 0.458,-0.296 0.708,-0.126 0.943,0.182 0.001,0 0.002,10e-4 0.003,0.002 0.302,0.411 0.776,0.619 1.424,0.619 0.304,0 0.572,-0.035 0.842,-0.106 0.116,-0.031 0.195,-0.136 0.195,-0.254 v -0.603 c -0.001,-0.078 -0.036,-0.151 -0.095,-0.2 z m -6.56,0.19 c -1.094,0 -2.197,-0.619 -2.197,-2.002 0,-1.749 2.134,-2.366 4.373,-2.534 0.835,-0.015 1.474,0.778 1.551,1.646 v 0.355 c -0.023,0.232 -0.089,0.463 -0.204,0.678 -0.058,0.096 -0.128,0.201 -0.212,0.312 -0.014,0.017 -0.027,0.033 -0.037,0.049 -0.519,0.663 -1.519,1.496 -3.274,1.496 z"
- id="path4371" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 59.823,568.567 h -0.736 c -0.142,0 -0.257,0.111 -0.263,0.253 -0.023,0.582 -0.32,0.66 -0.972,0.275 -0.003,-0.003 -0.006,-0.006 -0.01,-0.008 -0.064,-0.042 -0.129,-0.082 -0.195,-0.121 -0.003,-0.002 -0.008,-0.005 -0.011,-0.008 -0.032,-0.021 -0.061,-0.036 -0.089,-0.05 -0.712,-0.395 -1.547,-0.592 -2.488,-0.592 -1.344,0 -2.67,0.556 -3.638,1.527 -0.75,0.75 -1.642,2.093 -1.642,4.235 0,1.373 0.484,2.664 1.363,3.638 0.932,1.032 2.24,1.604 3.684,1.604 1.118,0 1.982,-0.296 2.637,-0.684 10e-4,0 0.003,-10e-4 0.004,-10e-4 0.702,-0.313 1.294,-0.784 1.126,0.802 -0.313,2.042 -1.624,3.15 -3.768,3.15 -1.5,0 -2.628,-0.504 -3.309,-0.928 -0.042,-0.026 -0.09,-0.041 -0.139,-0.041 -0.021,0 -0.043,0.005 -0.065,0.01 -0.07,0.018 -0.128,0.063 -0.164,0.126 l -0.349,0.619 c -0.068,0.121 -0.031,0.274 0.084,0.35 1.026,0.67 2.484,1.069 3.902,1.069 0.968,0 3.34,-0.225 4.492,-2.305 0.497,-0.892 0.729,-2.146 0.729,-3.942 v -6.275 c 0,-0.889 0.025,-1.683 0.077,-2.423 0.005,-0.072 -0.02,-0.144 -0.07,-0.196 -0.047,-0.052 -0.117,-0.084 -0.19,-0.084 z m -6.072,9.356 c -0.218,-0.087 -2.735,-1.155 -2.521,-4.245 0.199,-2.855 2.058,-3.758 2.344,-3.882 0.458,-0.179 0.97,-0.276 1.524,-0.276 0.599,0 1.119,0.118 1.565,0.315 2.46,1.392 2.767,5.913 0.319,7.716 -0.573,0.358 -1.235,0.565 -1.922,0.565 -0.483,0 -0.919,-0.068 -1.309,-0.193 z"
- id="path4373" />
- <path
- style="fill:#ffffff"
- inkscape:connector-curvature="0"
- d="m 116.563,568.567 h -0.736 c -0.141,0 -0.257,0.111 -0.263,0.253 -0.024,0.582 -0.321,0.66 -0.971,0.275 -0.004,-0.003 -0.007,-0.006 -0.011,-0.008 -0.063,-0.042 -0.13,-0.082 -0.196,-0.121 -0.003,-0.002 -0.007,-0.005 -0.011,-0.008 -0.031,-0.021 -0.06,-0.036 -0.087,-0.05 -0.713,-0.395 -1.548,-0.592 -2.489,-0.592 -1.344,0 -2.67,0.556 -3.638,1.527 -0.749,0.75 -1.642,2.093 -1.642,4.235 0,1.373 0.484,2.664 1.363,3.638 0.933,1.032 2.241,1.604 3.684,1.604 1.118,0 1.982,-0.296 2.637,-0.684 10e-4,0 0.002,-10e-4 0.003,-10e-4 0.702,-0.314 1.295,-0.785 1.127,0.802 -0.315,2.042 -1.625,3.15 -3.768,3.15 -1.5,0 -2.627,-0.504 -3.308,-0.928 -0.043,-0.026 -0.09,-0.041 -0.139,-0.041 -0.022,0 -0.044,0.005 -0.065,0.01 -0.07,0.018 -0.129,0.063 -0.164,0.126 l -0.349,0.619 c -0.069,0.121 -0.031,0.274 0.084,0.35 1.026,0.67 2.484,1.069 3.902,1.069 0.966,0 3.34,-0.225 4.491,-2.305 0.497,-0.892 0.73,-2.146 0.73,-3.942 v -6.275 c 0,-0.889 0.025,-1.683 0.077,-2.423 0.005,-0.072 -0.021,-0.144 -0.07,-0.196 -0.048,-0.052 -0.116,-0.084 -0.191,-0.084 z m -6.072,9.356 c -0.218,-0.087 -2.735,-1.155 -2.521,-4.245 0.198,-2.854 2.054,-3.757 2.342,-3.882 0.459,-0.179 0.971,-0.276 1.525,-0.276 0.599,0 1.119,0.118 1.566,0.315 2.459,1.392 2.766,5.913 0.317,7.716 -0.572,0.359 -1.235,0.565 -1.921,0.565 -0.482,0 -0.917,-0.068 -1.308,-0.193 z"
- id="path4375" />
- <linearGradient
- id="linearGradient6836"
- gradientUnits="userSpaceOnUse"
- x1="81.903801"
- y1="561.35449"
- x2="81.903801"
- y2="584.04199">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop6838" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop6840" />
- </linearGradient>
- <path
- style="fill:url(#SVGID_23_)"
- inkscape:connector-curvature="0"
- d="m 81.057,563.455 c -0.84,0.839 -1.477,1.92 -1.809,3.11 -2.184,-0.034 -4.375,0.816 -6.113,2.557 -2.927,2.926 -3.837,8.236 0.24,12.311 3.43,3.433 8.553,3.483 11.915,0.121 1.589,-1.59 2.602,-3.776 2.623,-6.09 1.128,-0.3 2.202,-0.901 3.117,-1.814 2.501,-2.501 3.266,-6.8 -0.112,-10.181 -2.816,-2.814 -7.056,-2.82 -9.861,-0.014 z m 9.211,7.341 c -0.48,0.479 -1.095,0.834 -1.773,1.029 -1.088,0.312 -1.674,0.279 -2.048,0.903 -0.374,0.624 -0.333,0.698 -0.316,1.868 0.02,1.325 -0.479,2.699 -1.73,3.952 -1.913,1.911 -5.442,2.338 -8.04,-0.26 -2.045,-2.048 -3.006,-5.492 -0.28,-8.22 1.013,-1.011 2.469,-1.609 4,-1.581 1.064,0.018 1.188,0.057 1.873,-0.253 0.686,-0.313 0.388,-1.007 0.798,-2.23 0.2,-0.598 0.556,-1.185 1.112,-1.742 1.483,-1.483 4.213,-1.823 6.213,0.177 1.629,1.629 2.319,4.227 0.191,6.357 z"
- id="path4382" />
- </g>
- <g
- transform="translate(230,-223.8521)"
- id="g4384">
- <path
- style="fill:#3fa9f5"
- inkscape:connector-curvature="0"
- d="m 94.988,565.938 v -4.184 c 0,-0.521 -0.008,-0.944 -0.025,-1.272 h 0.531 l 0.032,0.672 h 0.013 c 0.258,-0.507 0.642,-0.76 1.152,-0.76 0.388,0 0.711,0.184 0.969,0.55 0.258,0.367 0.387,0.837 0.387,1.41 0,0.638 -0.139,1.145 -0.417,1.522 -0.278,0.377 -0.625,0.565 -1.042,0.565 -0.211,0 -0.405,-0.054 -0.581,-0.16 -0.176,-0.106 -0.313,-0.259 -0.411,-0.456 h -0.013 v 2.112 h -0.595 z m 0.595,-3.807 v 0.624 c 0,0.312 0.087,0.573 0.261,0.785 0.174,0.213 0.383,0.318 0.629,0.318 0.299,0 0.536,-0.133 0.71,-0.397 0.175,-0.266 0.262,-0.624 0.262,-1.074 0,-0.405 -0.086,-0.74 -0.259,-1.004 -0.173,-0.265 -0.402,-0.396 -0.688,-0.396 -0.183,0 -0.352,0.066 -0.505,0.198 -0.154,0.132 -0.26,0.293 -0.32,0.484 -0.06,0.19 -0.09,0.344 -0.09,0.462 z"
- id="path4386" />
- <path
- style="fill:#3fa9f5"
- inkscape:connector-curvature="0"
- d="m 101.823,562.379 c 0,0.416 -0.069,0.779 -0.208,1.092 -0.139,0.312 -0.333,0.552 -0.583,0.72 -0.25,0.168 -0.52,0.252 -0.81,0.252 -0.452,0 -0.826,-0.185 -1.12,-0.554 -0.294,-0.369 -0.441,-0.849 -0.441,-1.438 0,-0.626 0.152,-1.126 0.456,-1.498 0.304,-0.372 0.688,-0.558 1.15,-0.558 0.461,0 0.835,0.185 1.123,0.554 0.288,0.369 0.433,0.846 0.433,1.43 z m -2.553,0.048 c 0,0.424 0.091,0.773 0.272,1.05 0.182,0.276 0.409,0.414 0.682,0.414 0.28,0 0.513,-0.139 0.699,-0.416 0.186,-0.277 0.28,-0.635 0.28,-1.072 0,-0.402 -0.086,-0.746 -0.258,-1.03 -0.172,-0.283 -0.406,-0.426 -0.702,-0.426 -0.301,0 -0.539,0.141 -0.712,0.422 -0.173,0.281 -0.261,0.634 -0.261,1.058 z"
- id="path4388" />
- <path
- style="fill:#3fa9f5"
- inkscape:connector-curvature="0"
- d="m 102.31,560.482 h 0.608 c 0.405,1.878 0.623,2.938 0.653,3.184 h 0.013 c 0.023,-0.208 0.288,-1.269 0.794,-3.184 h 0.505 c 0.458,1.795 0.715,2.856 0.768,3.184 h 0.013 c 0.06,-0.399 0.134,-0.792 0.224,-1.176 l 0.467,-2.008 h 0.589 l -1.024,3.872 h -0.55 c -0.352,-1.354 -0.55,-2.125 -0.595,-2.31 -0.045,-0.186 -0.096,-0.447 -0.153,-0.786 h -0.013 c -0.07,0.402 -0.163,0.813 -0.278,1.231 l -0.515,1.864 h -0.55 l -0.956,-3.871 z"
- id="path4390" />
- <path
- style="fill:#3fa9f5"
- inkscape:connector-curvature="0"
- d="m 110.232,562.57 h -2.246 c 0.008,0.419 0.112,0.739 0.31,0.962 0.199,0.223 0.456,0.334 0.771,0.334 0.343,0 0.644,-0.066 0.902,-0.2 l 0.103,0.521 c -0.305,0.171 -0.666,0.256 -1.082,0.256 -0.482,0 -0.866,-0.179 -1.152,-0.536 -0.286,-0.357 -0.429,-0.832 -0.429,-1.424 0,-0.592 0.137,-1.088 0.411,-1.488 0.274,-0.399 0.643,-0.6 1.105,-0.6 0.427,0 0.754,0.178 0.982,0.534 0.229,0.355 0.343,0.791 0.343,1.306 0.002,0.146 -0.004,0.258 -0.018,0.335 z m -2.239,-0.536 h 1.683 c 0,-0.333 -0.069,-0.602 -0.207,-0.806 -0.137,-0.204 -0.333,-0.306 -0.587,-0.306 -0.241,0 -0.441,0.102 -0.599,0.306 -0.158,0.204 -0.254,0.473 -0.29,0.806 z"
- id="path4392" />
- <path
- style="fill:#3fa9f5"
- inkscape:connector-curvature="0"
- d="m 111.097,564.354 v -2.64 c 0,-0.502 -0.008,-0.912 -0.025,-1.232 h 0.524 l 0.039,0.776 c 0.079,-0.272 0.2,-0.484 0.362,-0.637 0.162,-0.151 0.338,-0.228 0.528,-0.228 0.041,0 0.094,0.005 0.16,0.016 v 0.704 c -0.058,-0.016 -0.126,-0.023 -0.205,-0.023 -0.215,0 -0.4,0.105 -0.555,0.315 -0.155,0.211 -0.232,0.511 -0.232,0.9 v 2.048 h -0.596 z"
- id="path4394" />
- <path
- style="fill:#3fa9f5"
- inkscape:connector-curvature="0"
- d="m 115.986,562.57 h -2.246 c 0.008,0.419 0.112,0.739 0.31,0.962 0.199,0.223 0.456,0.334 0.771,0.334 0.343,0 0.644,-0.066 0.902,-0.2 l 0.103,0.521 c -0.305,0.171 -0.666,0.256 -1.082,0.256 -0.482,0 -0.866,-0.179 -1.152,-0.536 -0.286,-0.357 -0.429,-0.832 -0.429,-1.424 0,-0.592 0.137,-1.088 0.411,-1.488 0.274,-0.399 0.643,-0.6 1.105,-0.6 0.427,0 0.754,0.178 0.982,0.534 0.229,0.355 0.343,0.791 0.343,1.306 0.002,0.146 -0.004,0.258 -0.018,0.335 z m -2.239,-0.536 h 1.683 c 0,-0.333 -0.069,-0.602 -0.207,-0.806 -0.137,-0.204 -0.333,-0.306 -0.587,-0.306 -0.241,0 -0.441,0.102 -0.599,0.306 -0.158,0.204 -0.254,0.473 -0.29,0.806 z"
- id="path4396" />
- <path
- style="fill:#3fa9f5"
- inkscape:connector-curvature="0"
- d="m 119.04,558.658 h 0.595 v 4.681 c 0,0.432 0.008,0.771 0.025,1.016 h -0.531 l -0.045,-0.688 c -0.102,0.246 -0.25,0.437 -0.441,0.572 -0.191,0.135 -0.41,0.204 -0.653,0.204 -0.393,0 -0.72,-0.185 -0.982,-0.554 -0.262,-0.369 -0.394,-0.838 -0.394,-1.406 0,-0.616 0.138,-1.118 0.415,-1.506 0.277,-0.388 0.618,-0.582 1.025,-0.582 0.218,0 0.412,0.054 0.584,0.16 0.172,0.106 0.306,0.251 0.402,0.432 v -2.329 z m 0,4.032 v -0.616 c 0,-0.328 -0.085,-0.593 -0.254,-0.794 -0.17,-0.201 -0.373,-0.302 -0.61,-0.302 -0.288,0 -0.52,0.135 -0.696,0.404 -0.176,0.27 -0.264,0.62 -0.264,1.052 0,0.405 0.083,0.741 0.25,1.008 0.167,0.267 0.399,0.4 0.698,0.4 0.228,0 0.432,-0.104 0.609,-0.314 0.177,-0.209 0.267,-0.488 0.267,-0.838 z"
- id="path4398" />
- <path
- style="fill:#3fa9f5"
- inkscape:connector-curvature="0"
- d="m 122.246,563.339 v -4.681 h 0.608 v 2.456 c 0.226,-0.479 0.591,-0.72 1.095,-0.72 0.396,0 0.722,0.184 0.976,0.55 0.254,0.367 0.381,0.84 0.381,1.418 0,0.632 -0.14,1.137 -0.421,1.515 -0.28,0.377 -0.622,0.565 -1.025,0.565 -0.484,0 -0.849,-0.242 -1.094,-0.728 l -0.026,0.64 h -0.518 c 0.015,-0.245 0.024,-0.583 0.024,-1.015 z m 0.595,-1.2 v 0.632 c 0,0.288 0.086,0.54 0.258,0.756 0.171,0.216 0.384,0.324 0.638,0.324 0.296,0 0.532,-0.132 0.706,-0.395 0.174,-0.262 0.261,-0.616 0.261,-1.062 0,-0.413 -0.086,-0.753 -0.259,-1.018 -0.173,-0.266 -0.404,-0.398 -0.694,-0.398 -0.256,0 -0.471,0.116 -0.646,0.35 -0.177,0.234 -0.264,0.504 -0.264,0.811 z"
- id="path4400" />
- <path
- style="fill:#3fa9f5"
- inkscape:connector-curvature="0"
- d="m 125.733,560.482 h 0.653 l 0.704,2.308 c 0.06,0.192 0.13,0.439 0.211,0.74 0.083,-0.359 0.147,-0.62 0.192,-0.779 l 0.634,-2.269 h 0.64 l -0.877,2.769 c -0.279,0.88 -0.506,1.487 -0.68,1.823 -0.174,0.336 -0.362,0.585 -0.566,0.746 -0.204,0.161 -0.394,0.262 -0.571,0.302 l -0.141,-0.624 c 0.322,-0.125 0.573,-0.341 0.754,-0.647 0.18,-0.307 0.27,-0.512 0.27,-0.616 0,-0.045 -0.013,-0.106 -0.038,-0.184 l -1.185,-3.569 z"
- id="path4402" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.png
deleted file mode 100644
index fc88a02e329..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.svg
deleted file mode 100644
index c5c2f5d2d2c..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner-large.svg
+++ /dev/null
@@ -1,179 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="235"
- height="61"
- id="svg7375"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 74">
- <defs
- id="defs7377">
- <linearGradient
- id="SVGID_20_"
- gradientUnits="userSpaceOnUse"
- x1="680.95117"
- y1="529.94818"
- x2="680.95117"
- y2="567.36438">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop4257" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop4259" />
- </linearGradient>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="189.64285"
- inkscape:cy="-109.5"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2035"
- inkscape:window-y="260"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata7380">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-185.35715,-341.86218)">
- <rect
- style="fill:#ffffff;stroke:#0088d3;stroke-miterlimit:10"
- x="185.85715"
- y="342.36218"
- stroke-miterlimit="10"
- width="234"
- height="60"
- id="rect4242" />
- <g
- transform="translate(-354.14286,-179.63782)"
- id="g4244">
- <path
- inkscape:connector-curvature="0"
- d="m 660.891,542.893 c -0.819,-0.179 -1.397,-0.274 -2.11,-0.274 -1.745,0 -3.269,0.51 -4.532,1.513 -0.055,0.036 -0.116,0.086 -0.186,0.149 -0.141,0.121 -0.276,0.249 -0.409,0.381 -0.905,0.806 -1.691,1.197 -1.691,-0.757 v -0.408 c 0,-0.248 -0.201,-0.449 -0.449,-0.449 h -1.288 c -0.122,0 -0.237,0.05 -0.322,0.138 -0.085,0.087 -0.13,0.204 -0.126,0.325 0.063,2.043 0.132,4.156 0.132,5.899 v 11.497 c 0,0.247 0.201,0.448 0.449,0.448 h 1.354 c 0.249,0 0.449,-0.201 0.449,-0.448 v -6.08 c 0,-0.84 0.065,-2.332 0.189,-2.951 0.962,-4.78 3.055,-7.104 6.397,-7.104 0.601,0 1.153,0.102 1.763,0.222 0.029,0.008 0.059,0.011 0.087,0.011 0.091,0 0.181,-0.028 0.257,-0.081 0.1,-0.069 0.167,-0.177 0.188,-0.297 l 0.197,-1.222 c 0.037,-0.237 -0.116,-0.462 -0.349,-0.512 z"
- id="path4246" />
- <path
- inkscape:connector-curvature="0"
- d="m 715.489,543.868 c -1.541,-1.087 -3.246,-1.25 -4.124,-1.25 -1.784,0 -3.464,0.559 -4.797,1.528 -0.003,0.004 -0.005,0.005 -0.009,0.006 -0.616,0.397 -1.61,0.558 -1.604,-0.384 v -0.012 c 0,-0.065 -0.002,-0.122 -0.008,-0.171 l -0.006,-0.109 c -0.011,-0.24 -0.208,-0.43 -0.448,-0.43 h -1.288 c -0.124,0 -0.243,0.052 -0.328,0.143 -0.084,0.092 -0.127,0.212 -0.119,0.337 0.094,1.397 0.13,2.558 0.13,4 v 13.38 c 0,0.247 0.201,0.448 0.449,0.448 h 1.354 c 0.248,0 0.449,-0.201 0.449,-0.448 V 550.17 c 0,-0.499 0.155,-1.08 0.3,-1.458 0.003,-0.006 0.004,-0.011 0.007,-0.017 0.639,-1.864 2.589,-3.752 5.159,-3.97 1.986,0.002 5.106,1.445 5.534,5.043 0.01,0.093 0.02,0.184 0.025,0.272 0.002,0.03 0.006,0.061 0.008,0.092 0.003,0.043 0.006,0.085 0.008,0.129 0.006,0.116 0.011,0.235 0.011,0.355 0,0.205 0.003,0.392 0.009,0.559 v 9.73 c 0,0.247 0.201,0.448 0.45,0.448 h 1.353 c 0.248,0 0.45,-0.201 0.45,-0.448 v -9.977 c 0,-3.293 -0.999,-5.669 -2.965,-7.06 z"
- id="path4248" />
- <path
- inkscape:connector-curvature="0"
- d="m 762.451,559.407 c -0.082,-0.068 -0.185,-0.106 -0.29,-0.106 -0.024,0 -0.05,0.002 -0.073,0.007 -0.359,0.059 -0.592,0.059 -0.885,0.059 -0.704,0 -1.335,-0.205 -1.335,-2.689 v -6.079 c 0,-1.437 -0.109,-3.29 -0.97,-4.887 -1.118,-2.074 -3.178,-3.125 -6.118,-3.125 -1.519,0 -3.813,0.314 -6.126,1.822 -0.193,0.126 -0.26,0.377 -0.154,0.583 l 0.527,1.023 c 0.062,0.115 0.168,0.2 0.294,0.229 0.036,0.01 0.071,0.015 0.106,0.015 0.093,0 0.183,-0.029 0.26,-0.083 1.418,-1.005 3.18,-1.536 5.093,-1.536 2.449,0 3.681,1.138 4.291,2.416 l 0,0 c 0.615,1.361 -0.345,2.699 -1.4,2.812 -0.053,0.002 -0.104,0.004 -0.156,0.006 -0.009,0 -0.018,0.003 -0.026,0 -0.033,0 -0.062,0.003 -0.087,0.007 -6.732,0.384 -10.142,2.645 -10.142,6.731 0,1.243 0.493,2.488 1.352,3.416 0.757,0.816 2.183,1.79 4.682,1.79 2.128,0 3.845,-0.682 5.104,-1.515 0.037,-0.02 0.079,-0.048 0.129,-0.088 0.015,-0.01 0.026,-0.019 0.04,-0.029 0.077,-0.054 0.157,-0.108 0.231,-0.164 0.782,-0.505 1.206,-0.216 1.608,0.31 0.001,10e-4 0.003,0.003 0.004,0.005 0.516,0.698 1.325,1.053 2.43,1.053 0.52,0 0.975,-0.059 1.437,-0.181 0.196,-0.052 0.334,-0.229 0.334,-0.434 v -1.023 c -10e-4,-0.135 -0.059,-0.26 -0.16,-0.345 z m -11.191,0.323 c -1.864,0 -3.747,-1.057 -3.747,-3.417 0,-2.981 3.64,-4.034 7.461,-4.318 1.422,-0.026 2.511,1.325 2.643,2.806 v 0.606 c -0.038,0.396 -0.15,0.789 -0.348,1.157 -0.1,0.161 -0.219,0.342 -0.361,0.529 -0.023,0.029 -0.047,0.058 -0.063,0.083 -0.885,1.134 -2.591,2.554 -5.585,2.554 z"
- id="path4250" />
- <path
- inkscape:connector-curvature="0"
- d="m 643.287,543.047 h -1.255 c -0.24,0 -0.438,0.189 -0.448,0.431 -0.041,0.993 -0.547,1.126 -1.657,0.471 -0.006,-0.005 -0.011,-0.009 -0.017,-0.012 -0.108,-0.073 -0.221,-0.143 -0.333,-0.208 -0.009,-0.005 -0.014,-0.008 -0.021,-0.013 -0.054,-0.035 -0.104,-0.064 -0.15,-0.085 -1.215,-0.674 -2.641,-1.013 -4.245,-1.013 -2.292,0 -4.554,0.949 -6.206,2.605 -1.276,1.279 -2.799,3.571 -2.799,7.226 0,2.342 0.826,4.544 2.324,6.205 1.591,1.763 3.824,2.733 6.284,2.733 1.908,0 3.382,-0.502 4.498,-1.163 0.001,-0.002 0.005,-0.002 0.007,-0.003 1.197,-0.535 2.209,-1.337 1.922,1.369 -0.535,3.481 -2.77,5.374 -6.427,5.374 -2.56,0 -4.481,-0.862 -5.644,-1.584 -0.071,-0.045 -0.153,-0.068 -0.236,-0.068 -0.037,0 -0.074,0.006 -0.111,0.016 -0.118,0.028 -0.22,0.106 -0.28,0.213 l -0.594,1.059 c -0.116,0.205 -0.054,0.467 0.146,0.595 1.749,1.143 4.236,1.824 6.654,1.824 1.649,0 5.697,-0.384 7.66,-3.932 0.85,-1.521 1.245,-3.659 1.245,-6.725 v -10.704 c 0,-1.516 0.043,-2.868 0.132,-4.131 0.009,-0.123 -0.035,-0.246 -0.12,-0.337 -0.085,-0.091 -0.204,-0.143 -0.329,-0.143 z m -10.356,15.958 c -0.37,-0.146 -4.665,-1.972 -4.3,-7.24 0.338,-4.872 3.508,-6.414 3.996,-6.622 0.784,-0.306 1.656,-0.471 2.601,-0.471 1.02,0 1.908,0.2 2.67,0.535 4.196,2.372 4.718,10.088 0.542,13.162 -0.977,0.613 -2.107,0.965 -3.278,0.965 -0.822,0 -1.564,-0.12 -2.231,-0.329 z"
- id="path4252" />
- <path
- inkscape:connector-curvature="0"
- d="m 740.07,543.047 h -1.255 c -0.24,0 -0.438,0.189 -0.448,0.431 -0.04,0.993 -0.547,1.126 -1.657,0.471 -0.005,-0.005 -0.011,-0.009 -0.016,-0.012 -0.109,-0.073 -0.223,-0.143 -0.336,-0.208 -0.006,-0.005 -0.012,-0.008 -0.019,-0.013 -0.054,-0.035 -0.104,-0.064 -0.15,-0.085 -1.216,-0.674 -2.64,-1.013 -4.245,-1.013 -2.292,0 -4.555,0.949 -6.206,2.605 -1.276,1.279 -2.799,3.571 -2.799,7.226 0,2.342 0.825,4.544 2.324,6.205 1.592,1.763 3.822,2.733 6.284,2.733 1.907,0 3.381,-0.502 4.497,-1.163 0.003,-0.002 0.006,-0.002 0.008,-0.003 1.197,-0.536 2.209,-1.339 1.922,1.369 -0.537,3.481 -2.771,5.374 -6.427,5.374 -2.56,0 -4.48,-0.862 -5.643,-1.584 -0.072,-0.045 -0.155,-0.068 -0.237,-0.068 -0.038,0 -0.076,0.006 -0.112,0.016 -0.118,0.028 -0.22,0.106 -0.278,0.213 l -0.596,1.059 c -0.116,0.205 -0.053,0.467 0.146,0.595 1.748,1.143 4.235,1.824 6.654,1.824 1.649,0 5.698,-0.384 7.66,-3.932 0.849,-1.521 1.245,-3.659 1.245,-6.725 v -10.704 c 0,-1.516 0.043,-2.868 0.131,-4.131 0.01,-0.123 -0.035,-0.246 -0.119,-0.337 -0.084,-0.09 -0.202,-0.143 -0.328,-0.143 z m -10.355,15.958 c -0.373,-0.146 -4.667,-1.972 -4.302,-7.24 0.338,-4.869 3.506,-6.411 3.996,-6.621 0.784,-0.307 1.656,-0.472 2.601,-0.472 1.021,0 1.909,0.2 2.671,0.535 4.196,2.372 4.718,10.088 0.54,13.162 -0.976,0.613 -2.105,0.965 -3.276,0.965 -0.824,0 -1.565,-0.12 -2.23,-0.329 z"
- id="path4254" />
- <linearGradient
- id="linearGradient7358"
- gradientUnits="userSpaceOnUse"
- x1="680.95117"
- y1="529.94818"
- x2="680.95117"
- y2="567.36438">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop7360" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop7362" />
- </linearGradient>
- <path
- style="fill:url(#SVGID_20_)"
- inkscape:connector-curvature="0"
- d="m 679.508,534.324 c -1.433,1.434 -2.521,3.276 -3.086,5.308 -3.726,-0.058 -7.462,1.394 -10.427,4.359 -4.993,4.99 -6.546,14.049 0.409,21.002 5.851,5.851 14.588,5.939 20.322,0.205 2.711,-2.714 4.438,-6.442 4.475,-10.387 1.925,-0.514 3.756,-1.538 5.316,-3.097 4.264,-4.268 5.57,-11.6 -0.19,-17.362 -4.805,-4.801 -12.034,-4.813 -16.819,-0.028 z m 15.711,12.524 c -0.82,0.819 -1.868,1.424 -3.024,1.755 -1.856,0.531 -2.856,0.477 -3.494,1.542 -0.639,1.063 -0.567,1.188 -0.54,3.185 0.035,2.262 -0.817,4.606 -2.95,6.742 -3.263,3.26 -9.283,3.987 -13.713,-0.442 -3.492,-3.492 -5.13,-9.367 -0.479,-14.02 1.728,-1.726 4.211,-2.746 6.822,-2.699 1.814,0.033 2.026,0.099 3.195,-0.432 1.171,-0.532 0.663,-1.717 1.362,-3.804 0.341,-1.019 0.947,-2.021 1.896,-2.971 2.53,-2.529 7.187,-3.11 10.598,0.302 2.78,2.779 3.958,7.209 0.327,10.842 z"
- id="path4261" />
- </g>
- <g
- transform="translate(-354.14286,-179.63782)"
- id="g4263">
- <path
- style="fill:#b3b3b3"
- inkscape:connector-curvature="0"
- d="m 550.712,558.316 v -7.322 c 0,-0.91 -0.015,-1.652 -0.044,-2.227 h 0.929 l 0.056,1.177 h 0.023 c 0.451,-0.887 1.123,-1.33 2.016,-1.33 0.68,0 1.245,0.32 1.697,0.962 0.451,0.642 0.677,1.465 0.677,2.468 0,1.115 -0.243,2.003 -0.73,2.663 -0.487,0.661 -1.095,0.991 -1.823,0.991 -0.369,0 -0.708,-0.094 -1.016,-0.28 -0.309,-0.187 -0.549,-0.452 -0.721,-0.798 h -0.021 v 3.696 h -1.043 z m 1.042,-6.664 v 1.092 c 0,0.546 0.152,1.004 0.456,1.375 0.304,0.371 0.671,0.557 1.101,0.557 0.522,0 0.938,-0.231 1.243,-0.696 0.306,-0.464 0.459,-1.091 0.459,-1.88 0,-0.709 -0.151,-1.295 -0.454,-1.757 -0.302,-0.462 -0.703,-0.692 -1.203,-0.692 -0.321,0 -0.616,0.115 -0.885,0.346 -0.27,0.231 -0.455,0.514 -0.561,0.848 -0.104,0.332 -0.156,0.601 -0.156,0.807 z"
- id="path4265" />
- <path
- style="fill:#b3b3b3"
- inkscape:connector-curvature="0"
- d="m 563.121,552.086 c 0,0.728 -0.121,1.365 -0.363,1.911 -0.243,0.546 -0.582,0.966 -1.02,1.26 -0.438,0.294 -0.909,0.441 -1.417,0.441 -0.792,0 -1.444,-0.323 -1.96,-0.97 -0.516,-0.647 -0.772,-1.485 -0.772,-2.517 0,-1.097 0.266,-1.971 0.798,-2.621 0.531,-0.651 1.203,-0.977 2.014,-0.977 0.806,0 1.461,0.323 1.965,0.969 0.503,0.647 0.755,1.481 0.755,2.504 z m -4.469,0.084 c 0,0.742 0.159,1.354 0.477,1.838 0.316,0.482 0.715,0.725 1.192,0.725 0.489,0 0.897,-0.243 1.224,-0.729 0.327,-0.486 0.49,-1.11 0.49,-1.876 0,-0.704 -0.15,-1.306 -0.451,-1.803 -0.301,-0.497 -0.71,-0.745 -1.229,-0.745 -0.527,0 -0.942,0.246 -1.246,0.738 -0.304,0.493 -0.457,1.11 -0.457,1.852 z"
- id="path4267" />
- <path
- style="fill:#b3b3b3"
- inkscape:connector-curvature="0"
- d="m 564.421,548.768 h 1.063 c 0.71,3.286 1.09,5.144 1.143,5.572 h 0.022 c 0.042,-0.364 0.505,-2.222 1.39,-5.572 h 0.885 c 0.803,3.141 1.25,4.998 1.344,5.572 h 0.021 c 0.105,-0.7 0.236,-1.386 0.393,-2.058 l 0.817,-3.515 h 1.03 l -1.791,6.776 h -0.964 c -0.616,-2.37 -0.964,-3.718 -1.042,-4.043 -0.078,-0.324 -0.168,-0.782 -0.269,-1.375 h -0.022 c -0.123,0.705 -0.285,1.424 -0.486,2.156 l -0.902,3.262 h -0.963 l -1.669,-6.775 z"
- id="path4269" />
- <path
- style="fill:#b3b3b3"
- inkscape:connector-curvature="0"
- d="m 578.734,552.422 h -3.932 c 0.015,0.732 0.195,1.294 0.543,1.684 0.348,0.39 0.797,0.585 1.35,0.585 0.602,0 1.127,-0.117 1.58,-0.351 l 0.179,0.91 c -0.534,0.299 -1.165,0.448 -1.894,0.448 -0.844,0 -1.516,-0.313 -2.016,-0.938 -0.5,-0.625 -0.75,-1.456 -0.75,-2.492 0,-1.035 0.24,-1.903 0.719,-2.604 0.48,-0.7 1.125,-1.05 1.936,-1.05 0.746,0 1.32,0.312 1.719,0.935 0.4,0.623 0.6,1.385 0.6,2.285 0,0.257 -0.012,0.453 -0.034,0.588 z m -3.92,-0.938 h 2.945 c 0,-0.584 -0.121,-1.054 -0.361,-1.411 -0.24,-0.356 -0.584,-0.535 -1.027,-0.535 -0.422,0 -0.771,0.179 -1.047,0.535 -0.277,0.358 -0.447,0.827 -0.51,1.411 z"
- id="path4271" />
- <path
- style="fill:#b3b3b3"
- inkscape:connector-curvature="0"
- d="m 580.693,555.544 v -4.62 c 0,-0.877 -0.014,-1.596 -0.044,-2.156 h 0.918 l 0.067,1.358 c 0.139,-0.476 0.35,-0.847 0.633,-1.113 0.283,-0.266 0.592,-0.398 0.924,-0.398 0.071,0 0.164,0.009 0.28,0.027 v 1.232 c -0.101,-0.028 -0.22,-0.042 -0.358,-0.042 -0.377,0 -0.701,0.185 -0.972,0.553 -0.271,0.369 -0.405,0.894 -0.405,1.575 v 3.584 h -1.043 z"
- id="path4273" />
- <path
- style="fill:#b3b3b3"
- inkscape:connector-curvature="0"
- d="m 589.699,552.422 h -3.932 c 0.015,0.732 0.195,1.294 0.543,1.684 0.348,0.39 0.797,0.585 1.35,0.585 0.602,0 1.127,-0.117 1.58,-0.351 l 0.179,0.91 c -0.534,0.299 -1.165,0.448 -1.894,0.448 -0.844,0 -1.516,-0.313 -2.016,-0.938 -0.5,-0.625 -0.75,-1.456 -0.75,-2.492 0,-1.035 0.24,-1.903 0.719,-2.604 0.48,-0.7 1.125,-1.05 1.936,-1.05 0.746,0 1.32,0.312 1.719,0.935 0.4,0.623 0.6,1.385 0.6,2.285 -10e-4,0.257 -0.012,0.453 -0.034,0.588 z m -3.92,-0.938 h 2.945 c 0,-0.584 -0.121,-1.054 -0.361,-1.411 -0.24,-0.356 -0.584,-0.535 -1.027,-0.535 -0.422,0 -0.771,0.179 -1.047,0.535 -0.277,0.358 -0.447,0.827 -0.51,1.411 z"
- id="path4275" />
- <path
- style="fill:#b3b3b3"
- inkscape:connector-curvature="0"
- d="m 595.49,545.576 h 1.041 v 8.189 c 0,0.756 0.016,1.349 0.045,1.778 h -0.93 l -0.078,-1.204 c -0.18,0.43 -0.438,0.763 -0.773,1.001 -0.335,0.238 -0.717,0.357 -1.143,0.357 -0.687,0 -1.26,-0.323 -1.719,-0.97 -0.459,-0.647 -0.688,-1.467 -0.688,-2.461 0,-1.077 0.241,-1.956 0.726,-2.635 0.482,-0.68 1.081,-1.019 1.795,-1.019 0.38,0 0.721,0.093 1.021,0.279 0.301,0.188 0.535,0.439 0.703,0.757 v -4.072 z m 0,7.056 v -1.078 c 0,-0.574 -0.148,-1.037 -0.445,-1.39 -0.297,-0.352 -0.652,-0.528 -1.067,-0.528 -0.504,0 -0.909,0.236 -1.218,0.707 -0.309,0.472 -0.462,1.085 -0.462,1.841 0,0.71 0.146,1.298 0.437,1.765 0.291,0.467 0.698,0.699 1.221,0.699 0.4,0 0.756,-0.183 1.066,-0.549 0.312,-0.367 0.468,-0.856 0.468,-1.467 z"
- id="path4277" />
- <path
- style="fill:#b3b3b3"
- inkscape:connector-curvature="0"
- d="m 601.996,553.766 v -8.189 h 1.064 v 4.298 c 0.396,-0.84 1.033,-1.26 1.915,-1.26 0.694,0 1.264,0.32 1.708,0.962 0.444,0.642 0.666,1.469 0.666,2.481 0,1.106 -0.245,1.989 -0.736,2.649 -0.49,0.661 -1.089,0.991 -1.795,0.991 -0.848,0 -1.486,-0.425 -1.915,-1.274 l -0.044,1.12 h -0.908 c 0.03,-0.43 0.045,-1.023 0.045,-1.778 z m 1.042,-2.1 v 1.105 c 0,0.505 0.149,0.945 0.45,1.323 0.301,0.378 0.674,0.567 1.117,0.567 0.52,0 0.931,-0.229 1.235,-0.689 0.304,-0.46 0.456,-1.079 0.456,-1.858 0,-0.724 -0.15,-1.317 -0.453,-1.782 -0.303,-0.464 -0.708,-0.696 -1.215,-0.696 -0.449,0 -0.826,0.204 -1.132,0.612 -0.305,0.409 -0.458,0.881 -0.458,1.418 z"
- id="path4279" />
- <path
- style="fill:#b3b3b3"
- inkscape:connector-curvature="0"
- d="m 608.548,548.768 h 1.143 l 1.231,4.039 c 0.105,0.336 0.229,0.768 0.37,1.295 0.146,-0.63 0.258,-1.085 0.336,-1.364 l 1.108,-3.97 h 1.121 l -1.535,4.845 c -0.488,1.54 -0.886,2.604 -1.189,3.191 -0.305,0.588 -0.635,1.023 -0.992,1.306 -0.355,0.282 -0.689,0.459 -0.999,0.528 l -0.246,-1.092 c 0.563,-0.22 1.003,-0.598 1.318,-1.134 0.315,-0.537 0.474,-0.896 0.474,-1.078 0,-0.079 -0.022,-0.187 -0.067,-0.322 l -2.073,-6.244 z"
- id="path4281" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.png b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.png
deleted file mode 100644
index d430e64ea88..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.svg b/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.svg
deleted file mode 100644
index 672e4cf2735..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/groonga-powered-by-banner.svg
+++ /dev/null
@@ -1,201 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="89"
- height="32"
- id="svg5897"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 59">
- <defs
- id="defs5899">
- <linearGradient
- id="SVGID_19_"
- gradientUnits="userSpaceOnUse"
- x1="81.903801"
- y1="521.35449"
- x2="81.903801"
- y2="544.04199">
- <stop
- offset="0"
- style="stop-color:#3FA9F5"
- id="stop4174" />
- <stop
- offset="1"
- style="stop-color:#0071BC"
- id="stop4176" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_19_"
- id="linearGradient6749"
- gradientUnits="userSpaceOnUse"
- x1="81.903801"
- y1="521.35449"
- x2="81.903801"
- y2="544.04199" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_19_"
- id="linearGradient6795"
- gradientUnits="userSpaceOnUse"
- x1="81.903801"
- y1="521.35449"
- x2="81.903801"
- y2="544.04199" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="46.971944"
- inkscape:cy="73.799943"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="1928"
- inkscape:window-y="52"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5902">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-309.78571,-682.07648)">
- <g
- id="g6772">
- <rect
- id="rect4115"
- height="31"
- width="88"
- stroke-miterlimit="10"
- y="682.57648"
- x="310.28571"
- style="fill:#ffffff;stroke:#0088d3;stroke-miterlimit:10" />
- <g
- id="g4161"
- transform="translate(264.28571,167.57647)">
- <path
- id="path4163"
- d="m 70.143,528.477 c -0.48,-0.104 -0.82,-0.159 -1.238,-0.159 -1.022,0 -1.916,0.297 -2.656,0.886 -0.033,0.021 -0.069,0.051 -0.108,0.089 -0.083,0.071 -0.163,0.145 -0.241,0.223 -0.531,0.472 -0.992,0.7 -0.992,-0.444 v -0.239 c 0,-0.146 -0.118,-0.264 -0.263,-0.264 h -0.756 c -0.071,0 -0.139,0.03 -0.188,0.08 -0.05,0.051 -0.076,0.12 -0.074,0.192 0.039,1.197 0.078,2.436 0.078,3.458 v 6.74 c 0,0.146 0.118,0.264 0.263,0.264 h 0.795 c 0.145,0 0.263,-0.118 0.263,-0.264 v -3.563 c 0,-0.493 0.039,-1.368 0.111,-1.73 0.564,-2.804 1.792,-4.166 3.751,-4.166 0.352,0 0.676,0.06 1.033,0.131 0.017,0.003 0.034,0.005 0.051,0.005 0.053,0 0.105,-0.017 0.15,-0.047 0.059,-0.041 0.098,-0.104 0.11,-0.174 l 0.116,-0.717 c 0.021,-0.138 -0.068,-0.272 -0.205,-0.301 z"
- inkscape:connector-curvature="0" />
- <path
- id="path4165"
- d="m 102.151,529.049 c -0.903,-0.637 -1.902,-0.731 -2.417,-0.731 -1.046,0 -2.03,0.327 -2.812,0.896 -0.002,0 -0.003,10e-4 -0.005,0.002 -0.361,0.232 -0.945,0.326 -0.941,-0.224 v -0.009 c 0,-0.038 -0.001,-0.07 -0.005,-0.1 l -0.003,-0.064 c -0.006,-0.142 -0.122,-0.252 -0.262,-0.252 H 94.95 c -0.073,0 -0.142,0.031 -0.192,0.084 -0.05,0.054 -0.075,0.124 -0.071,0.196 0.054,0.82 0.078,1.5 0.078,2.346 v 7.845 c 0,0.146 0.117,0.264 0.263,0.264 h 0.794 c 0.146,0 0.263,-0.118 0.263,-0.264 v -6.295 c 0,-0.293 0.091,-0.634 0.176,-0.855 0.002,-0.003 0.002,-0.005 0.003,-0.008 0.375,-1.094 1.519,-2.2 3.025,-2.327 1.164,10e-4 2.993,0.847 3.244,2.955 0.006,0.055 0.011,0.107 0.016,0.161 10e-4,0.018 0.003,0.035 0.004,0.054 0.002,0.024 0.003,0.05 0.005,0.074 0.003,0.068 0.005,0.137 0.005,0.21 0,0.12 10e-4,0.228 0.006,0.327 v 5.704 c 0,0.146 0.118,0.264 0.263,0.264 h 0.794 c 0.145,0 0.263,-0.118 0.263,-0.264 v -5.851 c 0.001,-1.93 -0.584,-3.322 -1.738,-4.138 z"
- inkscape:connector-curvature="0" />
- <path
- id="path4167"
- d="m 129.567,538.159 c -0.047,-0.04 -0.108,-0.063 -0.169,-0.063 -0.015,0 -0.029,10e-4 -0.043,0.005 -0.211,0.035 -0.347,0.035 -0.519,0.035 -0.413,0 -0.783,-0.121 -0.783,-1.577 v -3.563 c 0,-0.843 -0.063,-1.93 -0.568,-2.866 -0.656,-1.215 -1.862,-1.831 -3.586,-1.831 -0.891,0 -2.236,0.184 -3.592,1.068 -0.113,0.073 -0.152,0.222 -0.09,0.341 l 0.311,0.6 c 0.034,0.069 0.098,0.119 0.171,0.137 0.021,0.004 0.042,0.007 0.062,0.007 0.055,0 0.108,-0.018 0.152,-0.049 0.832,-0.589 1.865,-0.9 2.986,-0.9 1.436,0 2.158,0.667 2.516,1.416 l 0,0 c 0.36,0.798 -0.203,1.583 -0.822,1.647 -0.031,0.004 -0.061,0.005 -0.091,0.006 -0.005,0 -0.011,10e-4 -0.016,0 -0.019,0 -0.036,0.002 -0.051,0.003 -3.946,0.225 -5.944,1.55 -5.944,3.947 0,0.728 0.288,1.457 0.792,2.001 0.443,0.479 1.28,1.051 2.744,1.051 1.248,0 2.254,-0.4 2.993,-0.889 0.022,-0.012 0.047,-0.027 0.076,-0.051 0.009,-0.006 0.016,-0.013 0.023,-0.019 0.046,-0.031 0.092,-0.063 0.136,-0.096 0.458,-0.296 0.708,-0.126 0.943,0.182 0.001,0 0.002,10e-4 0.003,0.002 0.302,0.411 0.776,0.619 1.424,0.619 0.304,0 0.572,-0.035 0.842,-0.106 0.116,-0.031 0.195,-0.136 0.195,-0.254 v -0.603 c -0.001,-0.078 -0.036,-0.151 -0.095,-0.2 z m -6.56,0.19 c -1.094,0 -2.197,-0.619 -2.197,-2.002 0,-1.749 2.134,-2.366 4.373,-2.534 0.835,-0.015 1.474,0.778 1.551,1.646 v 0.355 c -0.023,0.232 -0.089,0.463 -0.204,0.678 -0.058,0.096 -0.128,0.201 -0.212,0.312 -0.014,0.017 -0.027,0.033 -0.037,0.049 -0.519,0.663 -1.519,1.496 -3.274,1.496 z"
- inkscape:connector-curvature="0" />
- <path
- id="path4169"
- d="m 59.823,528.567 h -0.736 c -0.142,0 -0.257,0.111 -0.263,0.253 -0.023,0.582 -0.32,0.66 -0.972,0.275 -0.003,-0.003 -0.006,-0.006 -0.01,-0.008 -0.064,-0.042 -0.129,-0.082 -0.195,-0.121 -0.003,-0.002 -0.008,-0.005 -0.011,-0.008 -0.032,-0.021 -0.061,-0.036 -0.089,-0.05 -0.712,-0.395 -1.547,-0.592 -2.488,-0.592 -1.344,0 -2.67,0.556 -3.638,1.527 -0.75,0.75 -1.642,2.093 -1.642,4.235 0,1.373 0.484,2.664 1.363,3.638 0.932,1.032 2.24,1.604 3.684,1.604 1.118,0 1.982,-0.296 2.637,-0.684 10e-4,0 0.003,-10e-4 0.004,-10e-4 0.702,-0.313 1.294,-0.784 1.126,0.802 -0.313,2.042 -1.624,3.15 -3.768,3.15 -1.5,0 -2.628,-0.504 -3.309,-0.928 -0.042,-0.026 -0.09,-0.041 -0.139,-0.041 -0.021,0 -0.043,0.005 -0.065,0.01 -0.07,0.018 -0.128,0.063 -0.164,0.126 l -0.349,0.619 c -0.068,0.121 -0.031,0.274 0.084,0.35 1.026,0.67 2.484,1.069 3.902,1.069 0.968,0 3.34,-0.225 4.492,-2.305 0.497,-0.892 0.729,-2.146 0.729,-3.942 v -6.275 c 0,-0.889 0.025,-1.683 0.077,-2.423 0.005,-0.072 -0.02,-0.144 -0.07,-0.196 -0.047,-0.052 -0.117,-0.084 -0.19,-0.084 z m -6.072,9.356 c -0.218,-0.087 -2.735,-1.155 -2.521,-4.245 0.199,-2.855 2.058,-3.758 2.344,-3.882 0.458,-0.179 0.97,-0.276 1.524,-0.276 0.599,0 1.119,0.118 1.565,0.315 2.46,1.392 2.767,5.913 0.319,7.716 -0.573,0.358 -1.235,0.565 -1.922,0.565 -0.483,0 -0.919,-0.068 -1.309,-0.193 z"
- inkscape:connector-curvature="0" />
- <path
- id="path4171"
- d="m 116.563,528.567 h -0.736 c -0.141,0 -0.257,0.111 -0.263,0.253 -0.024,0.582 -0.321,0.66 -0.971,0.275 -0.004,-0.003 -0.007,-0.006 -0.011,-0.008 -0.063,-0.042 -0.13,-0.082 -0.196,-0.121 -0.003,-0.002 -0.007,-0.005 -0.011,-0.008 -0.031,-0.021 -0.06,-0.036 -0.087,-0.05 -0.713,-0.395 -1.548,-0.592 -2.489,-0.592 -1.344,0 -2.67,0.556 -3.638,1.527 -0.749,0.75 -1.642,2.093 -1.642,4.235 0,1.373 0.484,2.664 1.363,3.638 0.933,1.032 2.241,1.604 3.684,1.604 1.118,0 1.982,-0.296 2.637,-0.684 10e-4,0 0.002,-10e-4 0.003,-10e-4 0.702,-0.314 1.295,-0.785 1.127,0.802 -0.315,2.042 -1.625,3.15 -3.768,3.15 -1.5,0 -2.627,-0.504 -3.308,-0.928 -0.043,-0.026 -0.09,-0.041 -0.139,-0.041 -0.022,0 -0.044,0.005 -0.065,0.01 -0.07,0.018 -0.129,0.063 -0.164,0.126 l -0.349,0.619 c -0.069,0.121 -0.031,0.274 0.084,0.35 1.026,0.67 2.484,1.069 3.902,1.069 0.966,0 3.34,-0.225 4.491,-2.305 0.497,-0.892 0.73,-2.146 0.73,-3.942 v -6.275 c 0,-0.889 0.025,-1.683 0.077,-2.423 0.005,-0.072 -0.021,-0.144 -0.07,-0.196 -0.048,-0.052 -0.116,-0.084 -0.191,-0.084 z m -6.072,9.356 c -0.218,-0.087 -2.735,-1.155 -2.521,-4.245 0.198,-2.854 2.054,-3.757 2.342,-3.882 0.459,-0.179 0.971,-0.276 1.525,-0.276 0.599,0 1.119,0.118 1.566,0.315 2.459,1.392 2.766,5.913 0.317,7.716 -0.572,0.359 -1.235,0.565 -1.921,0.565 -0.482,0 -0.917,-0.068 -1.308,-0.193 z"
- inkscape:connector-curvature="0" />
- <linearGradient
- y2="544.04199"
- x2="81.903801"
- y1="521.35449"
- x1="81.903801"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5880">
- <stop
- id="stop5882"
- style="stop-color:#3FA9F5"
- offset="0" />
- <stop
- id="stop5884"
- style="stop-color:#0071BC"
- offset="1" />
- </linearGradient>
- <path
- id="path4178"
- d="m 81.057,523.455 c -0.84,0.839 -1.477,1.92 -1.809,3.11 -2.184,-0.034 -4.375,0.816 -6.113,2.557 -2.927,2.926 -3.837,8.236 0.24,12.311 3.43,3.433 8.553,3.483 11.915,0.121 1.589,-1.59 2.602,-3.776 2.623,-6.09 1.128,-0.3 2.202,-0.901 3.117,-1.814 2.501,-2.501 3.266,-6.8 -0.112,-10.181 -2.816,-2.814 -7.056,-2.82 -9.861,-0.014 z m 9.211,7.341 c -0.48,0.479 -1.095,0.834 -1.773,1.029 -1.088,0.312 -1.674,0.279 -2.048,0.903 -0.374,0.624 -0.333,0.698 -0.316,1.868 0.02,1.325 -0.479,2.699 -1.73,3.952 -1.913,1.911 -5.442,2.338 -8.04,-0.26 -2.045,-2.048 -3.006,-5.492 -0.28,-8.22 1.013,-1.011 2.469,-1.609 4,-1.581 1.064,0.018 1.188,0.057 1.873,-0.253 0.686,-0.313 0.388,-1.007 0.798,-2.23 0.2,-0.598 0.556,-1.185 1.112,-1.742 1.483,-1.483 4.213,-1.823 6.213,0.177 1.629,1.629 2.319,4.227 0.191,6.357 z"
- inkscape:connector-curvature="0"
- style="fill:url(#linearGradient6795)" />
- </g>
- <g
- id="g4180"
- transform="translate(264.28571,167.57647)">
- <path
- id="path4182"
- d="m 94.988,525.938 v -4.184 c 0,-0.521 -0.008,-0.944 -0.025,-1.272 h 0.531 l 0.032,0.672 h 0.013 c 0.258,-0.507 0.642,-0.76 1.152,-0.76 0.388,0 0.711,0.184 0.969,0.55 0.258,0.367 0.387,0.837 0.387,1.41 0,0.638 -0.139,1.145 -0.417,1.522 -0.278,0.377 -0.625,0.565 -1.042,0.565 -0.211,0 -0.405,-0.054 -0.581,-0.16 -0.176,-0.106 -0.313,-0.259 -0.411,-0.456 h -0.013 v 2.112 h -0.595 z m 0.595,-3.807 v 0.624 c 0,0.312 0.087,0.573 0.261,0.785 0.174,0.213 0.383,0.318 0.629,0.318 0.299,0 0.536,-0.133 0.71,-0.397 0.175,-0.266 0.262,-0.624 0.262,-1.074 0,-0.405 -0.086,-0.74 -0.259,-1.004 -0.173,-0.265 -0.402,-0.396 -0.688,-0.396 -0.183,0 -0.352,0.066 -0.505,0.198 -0.154,0.132 -0.26,0.293 -0.32,0.484 -0.06,0.19 -0.09,0.344 -0.09,0.462 z"
- inkscape:connector-curvature="0"
- style="fill:#b3b3b3" />
- <path
- id="path4184"
- d="m 101.823,522.379 c 0,0.416 -0.069,0.779 -0.208,1.092 -0.139,0.312 -0.333,0.552 -0.583,0.72 -0.25,0.168 -0.52,0.252 -0.81,0.252 -0.452,0 -0.826,-0.185 -1.12,-0.554 -0.294,-0.369 -0.441,-0.849 -0.441,-1.438 0,-0.626 0.152,-1.126 0.456,-1.498 0.304,-0.372 0.688,-0.558 1.15,-0.558 0.461,0 0.835,0.185 1.123,0.554 0.288,0.369 0.433,0.846 0.433,1.43 z m -2.553,0.048 c 0,0.424 0.091,0.773 0.272,1.05 0.182,0.276 0.409,0.414 0.682,0.414 0.28,0 0.513,-0.139 0.699,-0.416 0.186,-0.277 0.28,-0.635 0.28,-1.072 0,-0.402 -0.086,-0.746 -0.258,-1.03 -0.172,-0.283 -0.406,-0.426 -0.702,-0.426 -0.301,0 -0.539,0.141 -0.712,0.422 -0.173,0.281 -0.261,0.634 -0.261,1.058 z"
- inkscape:connector-curvature="0"
- style="fill:#b3b3b3" />
- <path
- id="path4186"
- d="m 102.31,520.482 h 0.608 c 0.405,1.878 0.623,2.938 0.653,3.184 h 0.013 c 0.023,-0.208 0.288,-1.269 0.794,-3.184 h 0.505 c 0.458,1.795 0.715,2.856 0.768,3.184 h 0.013 c 0.06,-0.399 0.134,-0.792 0.224,-1.176 l 0.467,-2.008 h 0.589 l -1.024,3.872 h -0.55 c -0.352,-1.354 -0.55,-2.125 -0.595,-2.31 -0.045,-0.186 -0.096,-0.447 -0.153,-0.786 h -0.013 c -0.07,0.402 -0.163,0.813 -0.278,1.231 l -0.515,1.864 h -0.55 l -0.956,-3.871 z"
- inkscape:connector-curvature="0"
- style="fill:#b3b3b3" />
- <path
- id="path4188"
- d="m 110.232,522.57 h -2.246 c 0.008,0.419 0.112,0.739 0.31,0.962 0.199,0.223 0.456,0.334 0.771,0.334 0.343,0 0.644,-0.066 0.902,-0.2 l 0.103,0.521 c -0.305,0.171 -0.666,0.256 -1.082,0.256 -0.482,0 -0.866,-0.179 -1.152,-0.536 -0.286,-0.357 -0.429,-0.832 -0.429,-1.424 0,-0.592 0.137,-1.088 0.411,-1.488 0.274,-0.399 0.643,-0.6 1.105,-0.6 0.427,0 0.754,0.178 0.982,0.534 0.229,0.355 0.343,0.791 0.343,1.306 0.002,0.146 -0.004,0.258 -0.018,0.335 z m -2.239,-0.536 h 1.683 c 0,-0.333 -0.069,-0.602 -0.207,-0.806 -0.137,-0.204 -0.333,-0.306 -0.587,-0.306 -0.241,0 -0.441,0.102 -0.599,0.306 -0.158,0.204 -0.254,0.473 -0.29,0.806 z"
- inkscape:connector-curvature="0"
- style="fill:#b3b3b3" />
- <path
- id="path4190"
- d="m 111.097,524.354 v -2.64 c 0,-0.502 -0.008,-0.912 -0.025,-1.232 h 0.524 l 0.039,0.776 c 0.079,-0.272 0.2,-0.484 0.362,-0.637 0.162,-0.151 0.338,-0.228 0.528,-0.228 0.041,0 0.094,0.005 0.16,0.016 v 0.704 c -0.058,-0.016 -0.126,-0.023 -0.205,-0.023 -0.215,0 -0.4,0.105 -0.555,0.315 -0.155,0.211 -0.232,0.511 -0.232,0.9 v 2.048 h -0.596 z"
- inkscape:connector-curvature="0"
- style="fill:#b3b3b3" />
- <path
- id="path4192"
- d="m 115.986,522.57 h -2.246 c 0.008,0.419 0.112,0.739 0.31,0.962 0.199,0.223 0.456,0.334 0.771,0.334 0.343,0 0.644,-0.066 0.902,-0.2 l 0.103,0.521 c -0.305,0.171 -0.666,0.256 -1.082,0.256 -0.482,0 -0.866,-0.179 -1.152,-0.536 -0.286,-0.357 -0.429,-0.832 -0.429,-1.424 0,-0.592 0.137,-1.088 0.411,-1.488 0.274,-0.399 0.643,-0.6 1.105,-0.6 0.427,0 0.754,0.178 0.982,0.534 0.229,0.355 0.343,0.791 0.343,1.306 0.002,0.146 -0.004,0.258 -0.018,0.335 z m -2.239,-0.536 h 1.683 c 0,-0.333 -0.069,-0.602 -0.207,-0.806 -0.137,-0.204 -0.333,-0.306 -0.587,-0.306 -0.241,0 -0.441,0.102 -0.599,0.306 -0.158,0.204 -0.254,0.473 -0.29,0.806 z"
- inkscape:connector-curvature="0"
- style="fill:#b3b3b3" />
- <path
- id="path4194"
- d="m 119.04,518.658 h 0.595 v 4.681 c 0,0.432 0.008,0.771 0.025,1.016 h -0.531 l -0.045,-0.688 c -0.102,0.246 -0.25,0.437 -0.441,0.572 -0.191,0.135 -0.41,0.204 -0.653,0.204 -0.393,0 -0.72,-0.185 -0.982,-0.554 -0.262,-0.369 -0.394,-0.838 -0.394,-1.406 0,-0.616 0.138,-1.118 0.415,-1.506 0.277,-0.388 0.618,-0.582 1.025,-0.582 0.218,0 0.412,0.054 0.584,0.16 0.172,0.106 0.306,0.251 0.402,0.432 v -2.329 z m 0,4.032 v -0.616 c 0,-0.328 -0.085,-0.593 -0.254,-0.794 -0.17,-0.201 -0.373,-0.302 -0.61,-0.302 -0.288,0 -0.52,0.135 -0.696,0.404 -0.176,0.27 -0.264,0.62 -0.264,1.052 0,0.405 0.083,0.741 0.25,1.008 0.167,0.267 0.399,0.4 0.698,0.4 0.228,0 0.432,-0.104 0.609,-0.314 0.177,-0.209 0.267,-0.488 0.267,-0.838 z"
- inkscape:connector-curvature="0"
- style="fill:#b3b3b3" />
- <path
- id="path4196"
- d="m 122.246,523.339 v -4.681 h 0.608 v 2.456 c 0.226,-0.479 0.591,-0.72 1.095,-0.72 0.396,0 0.722,0.184 0.976,0.55 0.254,0.367 0.381,0.84 0.381,1.418 0,0.632 -0.14,1.137 -0.421,1.515 -0.28,0.377 -0.622,0.565 -1.025,0.565 -0.484,0 -0.849,-0.242 -1.094,-0.728 l -0.026,0.64 h -0.518 c 0.015,-0.245 0.024,-0.583 0.024,-1.015 z m 0.595,-1.2 v 0.632 c 0,0.288 0.086,0.54 0.258,0.756 0.171,0.216 0.384,0.324 0.638,0.324 0.296,0 0.532,-0.132 0.706,-0.395 0.174,-0.262 0.261,-0.616 0.261,-1.062 0,-0.413 -0.086,-0.753 -0.259,-1.018 -0.173,-0.266 -0.404,-0.398 -0.694,-0.398 -0.256,0 -0.471,0.116 -0.646,0.35 -0.177,0.234 -0.264,0.504 -0.264,0.811 z"
- inkscape:connector-curvature="0"
- style="fill:#b3b3b3" />
- <path
- id="path4198"
- d="m 125.733,520.482 h 0.653 l 0.704,2.308 c 0.06,0.192 0.13,0.439 0.211,0.74 0.083,-0.359 0.147,-0.62 0.192,-0.779 l 0.634,-2.269 h 0.64 l -0.877,2.769 c -0.279,0.88 -0.506,1.487 -0.68,1.823 -0.174,0.336 -0.362,0.585 -0.566,0.746 -0.204,0.161 -0.394,0.262 -0.571,0.302 l -0.141,-0.624 c 0.322,-0.125 0.573,-0.341 0.754,-0.647 0.18,-0.307 0.27,-0.512 0.27,-0.616 0,-0.045 -0.013,-0.106 -0.038,-0.184 l -1.185,-3.569 z"
- inkscape:connector-curvature="0"
- style="fill:#b3b3b3" />
- </g>
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.png
deleted file mode 100644
index 67c29d5b79b..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.svg
deleted file mode 100644
index 0f1d0d74141..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-foreground-white.svg
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="60.000706"
- height="60.001019"
- id="svg5656"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 50">
- <defs
- id="defs5658">
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_10_"
- id="linearGradient5523"
- gradientUnits="userSpaceOnUse"
- x1="550.15039"
- y1="437.05859"
- x2="550.15039"
- y2="497.05859" />
- <linearGradient
- id="SVGID_10_"
- gradientUnits="userSpaceOnUse"
- x1="550.15039"
- y1="437.05859"
- x2="550.15039"
- y2="497.05859">
- <stop
- offset="0"
- style="stop-color:#F8BB5E"
- id="stop4057" />
- <stop
- offset="1"
- style="stop-color:#FF931E"
- id="stop4059" />
- </linearGradient>
- <linearGradient
- y2="497.05859"
- x2="550.15039"
- y1="437.05859"
- x1="550.15039"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5646"
- xlink:href="#SVGID_10_"
- inkscape:collect="always" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="5.5307199"
- inkscape:cy="22.804138"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="1932"
- inkscape:window-y="78"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5661">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-569.99965,-562.36167)">
- <polygon
- transform="translate(49.849648,125.30369)"
- points="520.15,437.059 520.15,497.059 546.012,497.059 580.15,497.059 580.15,462.92 580.15,437.059 "
- id="polygon4061"
- style="fill:url(#linearGradient5646)" />
- <path
- d="m 623.53365,599.24469 c 7.502,-7.505 9.8,-20.401 -0.335,-30.538 -4.224,-4.222 -9.514,-6.337 -14.8,-6.345 h -0.005 c -5.286,-0.007 -10.567,2.093 -14.774,6.299 -2.522,2.52 -4.434,5.76 -5.428,9.33 -6.49,-0.099 -13.001,2.411 -18.191,7.53 v 36.479 c 0.114,0.121 0.227,0.242 0.344,0.361 h 25.518 11.027 c 4.434,-4.717 7.233,-11.018 7.295,-17.672 3.385,-0.898 6.606,-2.7 9.349,-5.444 z m -13.748,-2.759 c -1.121,1.873 -0.997,2.089 -0.949,5.602 0.062,3.979 -1.437,8.102 -5.189,11.854 -5.736,5.737 -16.326,7.017 -24.119,-0.776 -6.139,-6.14 -9.021,-16.475 -0.84,-24.658 3.038,-3.034 7.406,-4.827 11.998,-4.745 3.193,0.055 3.564,0.174 5.621,-0.76 2.058,-0.938 1.166,-3.019 2.396,-6.692 0.6,-1.792 1.666,-3.551 3.332,-5.224 4.451,-4.448 12.643,-5.469 18.643,0.531 4.887,4.887 6.96,12.677 0.572,19.065 -1.441,1.444 -3.284,2.509 -5.319,3.087 -3.266,0.937 -5.023,0.838 -6.146,2.716 z"
- id="path4109"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.png b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.png
deleted file mode 100644
index d938d6e8fa8..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.svg b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.svg
deleted file mode 100644
index feae36b6604..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon-full-size.svg
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="199.80432"
- height="200.86072"
- id="svg4429"
- version="1.1"
- inkscape:version="0.48.3.1 r9886"
- sodipodi:docname="mroonga-icon-full-size.svg"
- inkscape:export-filename="mroonga-icon-full-size.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <defs
- id="defs4431">
- <linearGradient
- gradientTransform="translate(405.03952,235.75369)"
- id="SVGID_2_"
- gradientUnits="userSpaceOnUse"
- x1="223.6167"
- y1="166.2236"
- x2="223.6167"
- y2="228.2177">
- <stop
- offset="0"
- style="stop-color:#F8BB5E"
- id="stop3925" />
- <stop
- offset="1"
- style="stop-color:#FF931E"
- id="stop3927" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_2_"
- id="linearGradient2994"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(3.0240976,0,0,3.0240976,-75.850759,-189.87639)"
- x1="223.6167"
- y1="166.2236"
- x2="223.6167"
- y2="228.2177" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="-3.669379"
- inkscape:cy="107.05295"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-right="5"
- fit-margin-bottom="5"
- inkscape:window-width="1244"
- inkscape:window-height="632"
- inkscape:window-x="1984"
- inkscape:window-y="341"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4434">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-500.4859,-304.25654)">
- <path
- style="fill:url(#linearGradient2994)"
- inkscape:connector-curvature="0"
- d="m 593.27016,326.92074 c -7.06731,7.06732 -12.42602,16.15777 -15.21726,26.17355 -18.37442,-0.28423 -36.8063,6.87078 -51.43081,21.50135 -24.62221,24.61919 -32.27923,69.28813 2.01704,103.5844 28.85597,28.85899 71.95238,29.29444 100.23374,1.01007 13.36953,-13.37859 21.88235,-31.7742 22.06684,-51.23124 9.49566,-2.52813 18.5226,-7.58139 26.21894,-15.26867 21.0356,-21.04469 27.47693,-57.21288 -0.94049,-85.63639 -23.68778,-23.68172 -59.35096,-23.73314 -82.948,-0.13301 z m 77.48344,61.76115 c -4.03718,4.04019 -9.20837,7.02799 -14.91486,8.65497 -9.15391,2.62493 -14.08323,2.35275 -17.2313,7.60563 -3.14808,5.24982 -2.80031,5.86977 -2.66122,15.70715 0.16937,11.15587 -4.03108,22.72305 -14.55499,33.25298 -16.08816,16.08214 -45.78482,19.66872 -67.63693,-2.18343 -17.2162,-17.22223 -25.29659,-46.20216 -2.35278,-69.14598 8.51589,-8.50678 20.76348,-13.53887 33.6401,-13.30903 8.95432,0.15417 9.99763,0.48383 15.76157,-2.12898 5.77301,-2.63097 3.27209,-8.46749 6.71954,-18.76453 1.68142,-5.01999 4.67222,-9.96441 9.35054,-14.64875 12.47743,-12.47741 35.44542,-15.33821 52.27151,1.48182 13.70824,13.71431 19.52054,35.56339 1.60882,53.47815 z"
- id="path3929" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.png b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.png
deleted file mode 100644
index c5e25639dd9..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.svg b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.svg
deleted file mode 100644
index bd65f23fc48..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-icon.svg
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="59.99931"
- height="59.999016"
- id="svg5138"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 32">
- <defs
- id="defs5140">
- <linearGradient
- id="SVGID_14_"
- gradientUnits="userSpaceOnUse"
- x1="227.7168"
- y1="437.05859"
- x2="227.7168"
- y2="505.11819">
- <stop
- offset="0"
- style="stop-color:#F8BB5E"
- id="stop4087" />
- <stop
- offset="1"
- style="stop-color:#FF931E"
- id="stop4089" />
- </linearGradient>
- <linearGradient
- gradientTransform="translate(297.99763,51.01898)"
- y2="505.11819"
- x2="227.7168"
- y1="437.05859"
- x1="227.7168"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5136"
- xlink:href="#SVGID_14_"
- inkscape:collect="always" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="24.432041"
- inkscape:cy="35.346817"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2666"
- inkscape:window-y="446"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5143">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-495.71463,-488.07696)">
- <path
- style="fill:url(#linearGradient5136)"
- inkscape:connector-curvature="0"
- d="m 549.24763,524.95998 c 7.502,-7.505 9.799,-20.401 -0.335,-30.538 -4.223,-4.222 -9.513,-6.337 -14.799,-6.345 h -0.005 c -5.286,-0.007 -10.568,2.093 -14.775,6.299 -2.522,2.52 -4.433,5.76 -5.428,9.33 -6.49,-0.099 -13.001,2.411 -18.191,7.53 v 36.48 c 0.114,0.12 0.227,0.241 0.344,0.36 h 25.518 11.027 c 4.434,-4.717 7.234,-11.018 7.295,-17.672 3.385,-0.898 6.606,-2.7 9.349,-5.444 z m -13.748,-2.759 c -1.122,1.873 -0.998,2.089 -0.95,5.602 0.062,3.979 -1.436,8.102 -5.188,11.854 -5.737,5.737 -16.327,7.017 -24.119,-0.776 -6.14,-6.14 -9.021,-16.475 -0.84,-24.658 3.038,-3.034 7.405,-4.827 11.998,-4.745 3.193,0.055 3.564,0.174 5.621,-0.76 2.058,-0.938 1.166,-3.019 2.396,-6.692 0.6,-1.792 1.667,-3.551 3.333,-5.224 4.451,-4.448 12.642,-5.469 18.642,0.531 4.887,4.887 6.96,12.677 0.573,19.065 -1.442,1.444 -3.285,2.509 -5.32,3.087 -3.265,0.937 -5.023,0.838 -6.146,2.716 z"
- id="path4091" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.png
deleted file mode 100644
index 7267a3650c0..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.svg
deleted file mode 100644
index e1926079fc5..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo-foreground-white.svg
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="247.22577"
- height="73.113281"
- id="svg4780"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 19">
- <defs
- id="defs4782">
- <linearGradient
- gradientTransform="translate(-217.85083,355.80569)"
- id="SVGID_6_"
- gradientUnits="userSpaceOnUse"
- x1="589.38281"
- y1="162.9478"
- x2="589.38281"
- y2="231.95531">
- <stop
- offset="0"
- style="stop-color:#F8BB5E"
- id="stop3993" />
- <stop
- offset="1"
- style="stop-color:#FF931E"
- id="stop3995" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_6_"
- id="linearGradient4819"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(-217.85083,355.80569)"
- x1="589.38281"
- y1="162.9478"
- x2="589.38281"
- y2="231.95531" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#000000"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="1"
- inkscape:pageshadow="2"
- inkscape:zoom="0.98994949"
- inkscape:cx="249.54354"
- inkscape:cy="3.6354025"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-bottom="5"
- fit-margin-right="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="1928"
- inkscape:window-y="52"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4785">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-262.1014,-515.80554)">
- <g
- id="g4811">
- <path
- id="path3984"
- d="m 338.79716,540.67169 c -1.337,-0.291 -2.28,-0.448 -3.441,-0.448 -2.848,0 -5.33,0.831 -7.393,2.466 -0.09,0.062 -0.191,0.14 -0.302,0.247 -0.23,0.196 -0.452,0.406 -0.669,0.621 -1.477,1.313 -2.759,1.951 -2.759,-1.236 v -0.666 c 0,-0.405 -0.327,-0.732 -0.732,-0.732 h -2.1 c -0.2,0 -0.389,0.08 -0.527,0.223 -0.138,0.142 -0.212,0.334 -0.206,0.532 0.106,3.332 0.215,6.777 0.215,9.621 v 18.749 c 0,0.405 0.328,0.732 0.732,0.732 h 2.209 c 0.403,0 0.732,-0.327 0.732,-0.732 v -9.913 c 0,-1.37 0.107,-3.805 0.31,-4.813 1.568,-7.797 4.982,-11.588 10.435,-11.588 0.979,0 1.88,0.164 2.874,0.362 0.047,0.01 0.095,0.015 0.143,0.015 0.148,0 0.294,-0.045 0.417,-0.131 0.162,-0.112 0.273,-0.288 0.307,-0.484 l 0.322,-1.994 c 0.062,-0.383 -0.187,-0.749 -0.567,-0.831 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path3986"
- d="m 427.84417,542.26369 c -2.513,-1.776 -5.294,-2.04 -6.727,-2.04 -2.911,0 -5.648,0.912 -7.821,2.495 -0.005,0.003 -0.011,0.004 -0.015,0.008 -1.006,0.649 -2.627,0.91 -2.617,-0.625 v -0.022 c 0,-0.105 -0.005,-0.197 -0.014,-0.276 l -0.009,-0.182 c -0.018,-0.391 -0.341,-0.698 -0.731,-0.698 h -2.102 c -0.202,0 -0.396,0.083 -0.534,0.231 -0.139,0.148 -0.21,0.347 -0.195,0.55 0.152,2.28 0.212,4.171 0.212,6.524 v 21.82 c 0,0.405 0.33,0.732 0.733,0.732 h 2.209 c 0.404,0 0.731,-0.327 0.731,-0.732 v -17.51 c 0,-0.813 0.253,-1.762 0.49,-2.378 0.005,-0.009 0.007,-0.016 0.01,-0.024 1.044,-3.043 4.223,-6.121 8.417,-6.475 3.236,0.002 8.326,2.358 9.024,8.226 0.016,0.15 0.03,0.299 0.041,0.443 0.005,0.049 0.008,0.099 0.013,0.149 0.005,0.07 0.009,0.14 0.014,0.208 0.009,0.192 0.015,0.386 0.015,0.583 0,0.335 0.005,0.637 0.018,0.91 v 15.868 c 0,0.405 0.326,0.732 0.73,0.732 h 2.21 c 0.403,0 0.732,-0.327 0.732,-0.732 v -16.271 c 10e-4,-5.372 -1.627,-9.246 -4.834,-11.514 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path3988"
- d="m 504.06817,567.60569 c -0.133,-0.113 -0.301,-0.173 -0.474,-0.173 -0.039,0 -0.079,0.003 -0.118,0.01 -0.588,0.098 -0.964,0.098 -1.444,0.098 -1.147,0 -2.177,-0.336 -2.177,-4.387 v -9.913 c 0,-2.343 -0.18,-5.368 -1.583,-7.971 -1.824,-3.384 -5.181,-5.1 -9.979,-5.1 -2.475,0 -6.218,0.516 -9.99,2.975 -0.313,0.205 -0.424,0.615 -0.252,0.949 l 0.862,1.669 c 0.098,0.189 0.272,0.326 0.479,0.376 0.058,0.015 0.116,0.021 0.174,0.021 0.15,0 0.296,-0.046 0.422,-0.135 2.314,-1.639 5.188,-2.506 8.306,-2.506 3.995,0 6.004,1.854 7,3.94 v 0 c 1.002,2.22 -0.563,4.403 -2.286,4.584 -0.084,0.004 -0.169,0.008 -0.253,0.013 -0.015,-10e-4 -0.027,10e-4 -0.043,0 -0.055,-10e-4 -0.101,10e-4 -0.143,0.009 -10.979,0.626 -16.537,4.313 -16.537,10.98 0,2.028 0.801,4.057 2.201,5.568 1.235,1.334 3.56,2.922 7.637,2.922 3.471,0 6.27,-1.111 8.324,-2.472 0.061,-0.032 0.131,-0.077 0.211,-0.141 0.021,-0.018 0.044,-0.031 0.064,-0.048 0.127,-0.089 0.257,-0.177 0.377,-0.268 1.277,-0.824 1.97,-0.351 2.623,0.503 0.002,0.003 0.006,0.005 0.008,0.008 0.839,1.141 2.162,1.717 3.963,1.717 0.847,0 1.59,-0.093 2.343,-0.293 0.322,-0.085 0.544,-0.375 0.544,-0.708 v -1.669 c 0,-0.214 -0.096,-0.419 -0.259,-0.558 z m -18.252,0.527 c -3.042,0 -6.111,-1.722 -6.111,-5.572 0,-4.862 5.936,-6.58 12.166,-7.043 2.32,-0.043 4.098,2.161 4.313,4.575 v 0.989 c -0.063,0.647 -0.246,1.289 -0.569,1.888 -0.161,0.265 -0.354,0.557 -0.588,0.865 -0.04,0.048 -0.076,0.093 -0.104,0.133 -1.442,1.847 -4.223,4.165 -9.107,4.165 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path3990"
- d="m 467.93517,540.92469 h -2.047 c -0.392,0 -0.716,0.31 -0.731,0.703 -0.064,1.619 -0.892,1.836 -2.701,0.765 -0.011,-0.005 -0.02,-0.013 -0.028,-0.02 -0.179,-0.118 -0.362,-0.23 -0.547,-0.337 -0.01,-0.008 -0.02,-0.014 -0.031,-0.021 -0.087,-0.057 -0.168,-0.103 -0.243,-0.139 -1.982,-1.096 -4.308,-1.65 -6.925,-1.65 -3.739,0 -7.428,1.548 -10.121,4.249 -2.082,2.087 -4.564,5.827 -4.564,11.784 0,3.818 1.347,7.413 3.791,10.121 2.597,2.875 6.233,4.458 10.249,4.458 3.11,0 5.514,-0.819 7.335,-1.896 0.004,-0.002 0.007,-0.003 0.012,-0.005 1.953,-0.875 3.602,-2.184 3.134,2.233 -0.875,5.677 -4.518,8.764 -10.48,8.764 -4.176,0 -7.31,-1.405 -9.204,-2.584 -0.116,-0.073 -0.251,-0.109 -0.388,-0.109 -0.06,0 -0.123,0.006 -0.182,0.023 -0.192,0.049 -0.356,0.176 -0.456,0.35 l -0.968,1.724 c -0.19,0.336 -0.086,0.76 0.237,0.972 2.853,1.862 6.909,2.974 10.852,2.974 2.689,0 9.294,-0.625 12.493,-6.412 1.385,-2.481 2.031,-5.968 2.031,-10.969 v -17.456 c 0,-2.474 0.07,-4.678 0.216,-6.738 0.013,-0.203 -0.058,-0.401 -0.196,-0.55 -0.138,-0.149 -0.334,-0.234 -0.538,-0.234 z m -16.892,26.027 c -0.604,-0.24 -7.607,-3.216 -7.011,-11.812 0.549,-7.939 5.715,-10.454 6.518,-10.798 1.276,-0.5 2.698,-0.768 4.24,-0.768 1.663,0 3.112,0.327 4.354,0.873 6.845,3.871 7.696,16.452 0.883,21.467 -1.592,1 -3.437,1.572 -5.346,1.572 -1.341,0 -2.551,-0.192 -3.638,-0.534 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path3997"
- d="m 369.17717,526.64669 c -2.33801,2.337 -4.11001,5.343 -5.03101,8.655 -6.076,-0.094 -12.172,2.272 -17.008,7.11 -8.143,8.141 -10.674,22.912 0.668,34.253 9.542,9.543 23.79301,9.687 33.14401,0.334 4.422,-4.424 7.237,-10.507 7.298,-16.941 3.14,-0.836 6.125,-2.507 8.67,-5.049 6.957,-6.959 9.085,-18.919 -0.311,-28.318 -7.834,-7.831 -19.627,-7.848 -27.43,-0.044 z m 25.622,20.423 c -1.335,1.336 -3.046,2.324 -4.934,2.862 -3.026,0.868 -4.655,0.778 -5.696,2.515 -1.042,1.736 -0.925,1.941 -0.881,5.194 0.056,3.689 -1.332,7.514 -4.813,10.996 -5.319,5.318 -15.13901,6.504 -22.36601,-0.722 -5.692,-5.695 -8.363,-15.278 -0.776,-22.865 2.816,-2.813 6.867,-4.477 11.123,-4.401 2.96101,0.051 3.30601,0.16 5.21301,-0.704 1.907,-0.87 1.082,-2.8 2.222,-6.205 0.557,-1.66 1.544,-3.295 3.093,-4.844 4.125,-4.126 11.721,-5.072 17.284,0.49 4.532,4.534 6.456,11.76 0.531,17.684 z"
- inkscape:connector-curvature="0"
- style="fill:url(#linearGradient4819)" />
- <path
- id="path4033"
- d="m 299.94416,540.22369 c -3.604,0 -5.781,1.055 -7.803,2.675 -0.001,10e-4 -0.001,10e-4 -0.001,0.002 -2.141,1.482 -3.268,1.373 -5.032,0.007 -0.009,-0.007 -0.017,-0.009 -0.025,-0.015 -1.785,-1.704 -4.11,-2.669 -6.695,-2.669 -2.797,0 -5.132,0.737 -7.113,2.275 -0.042,0.029 -0.086,0.062 -0.129,0.102 -0.878,0.785 -2.286,1.01 -2.444,-0.238 l -0.017,-0.316 c 0.002,-0.087 -0.002,-0.167 -0.01,-0.234 l -0.01,-0.19 c -0.018,-0.391 -0.34,-0.697 -0.73,-0.697 h -2.101 c -0.205,0 -0.397,0.083 -0.536,0.232 -0.139,0.149 -0.209,0.347 -0.195,0.55 0.148,2.118 0.214,4.13 0.214,6.523 v 21.82 c 0,0.405 0.329,0.732 0.732,0.732 h 2.21 c 0.403,0 0.73,-0.327 0.73,-0.732 v -17.457 c 0,-1.086 0.266,-1.975 0.487,-2.529 1.183,-3.106 4.305,-6.436 8.372,-6.436 4.431,0 7.295,3.476 7.295,8.857 v 17.564 c 0,0.405 0.328,0.732 0.731,0.732 h 2.211 c 0.403,0 0.731,-0.327 0.731,-0.732 v -18.317 c 0,-1.093 0.289,-1.956 0.54,-2.585 1.118,-2.651 4.064,-5.519 7.887,-5.519 4.983,0 7.727,3.681 7.727,10.366 v 16.055 c 0,0.405 0.327,0.732 0.733,0.732 h 2.208 c 0.404,0 0.732,-0.327 0.732,-0.732 v -16.001 c 10e-4,-12.828 -8.188,-13.825 -10.699,-13.825 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.ai b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.ai
deleted file mode 100644
index 234bfbc63dc..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.ai
+++ /dev/null
@@ -1,243 +0,0 @@
-%PDF-1.5 %âãÏÓ
-1 0 obj <</Metadata 2 0 R/OCProperties<</D<</ON[5 0 R]/Order 6 0 R/RBGroups[]>>/OCGs[5 0 R]>>/Pages 3 0 R/Type/Catalog>> endobj 2 0 obj <</Length 13943/Subtype/XML/Type/Metadata>>stream
-<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
-<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.0-c060 61.134777, 2010/02/12-17:32:00 ">
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <rdf:Description rdf:about=""
- xmlns:xmp="http://ns.adobe.com/xap/1.0/"
- xmlns:xmpGImg="http://ns.adobe.com/xap/1.0/g/img/">
- <xmp:CreatorTool>Adobe Illustrator CS5</xmp:CreatorTool>
- <xmp:CreateDate>2013-04-03T11:08:21+09:00</xmp:CreateDate>
- <xmp:ModifyDate>2013-04-03T11:08:21+09:00</xmp:ModifyDate>
- <xmp:MetadataDate>2013-04-03T11:08:21+09:00</xmp:MetadataDate>
- <xmp:Thumbnails>
- <rdf:Alt>
- <rdf:li rdf:parseType="Resource">
- <xmpGImg:width>256</xmpGImg:width>
- <xmpGImg:height>68</xmpGImg:height>
- <xmpGImg:format>JPEG</xmpGImg:format>
- <xmpGImg:image>/9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA&#xA;AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK&#xA;DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f&#xA;Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgARAEAAwER&#xA;AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA&#xA;AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB&#xA;UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE&#xA;1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ&#xA;qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy&#xA;obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp&#xA;0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo&#xA;+DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A9U4q7FXYq7FXYq7FXYq7&#xA;FXYq7FXYq7FXYqhtQ1C2sLYzzmijZVHVj4DKNRqI4o8Um3DhlklQYXqPmXUbxiFcwQ9o4zTb3bqc&#xA;5nUdpZch2PCO4O7w6KEOllu18t6xdJ6vpiNW3BlPEn6Nzji7NzZBdV71nrccNr+SJMPmbRx6oJeB&#xA;ftAH1Ep7r1Hzy/g1Wm35x+YauLBm26/Isg0XXbfUoytPTuUHxxV7eK+2bjRa6Ocd0u512p0ssR74&#xA;pnmc4rsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVWvJHGKuw&#xA;QeLED9eCUgOZSIk8mAeZdUN7qThWrBATHEB02+030nOR7S1Pi5T/ADY7B6LRYOCHmUw8naVHcSPf&#xA;TLyWFuMSnpz6k/RtmX2PpRMnJLpy97j9o5zEcA6sxzpHSOxVh3mGxbSL6HUrL92jtuo6B+tPkw7Z&#xA;znaGA6fIMuPYX9v7XdaPL40Djmyuyuo7u0iuY/syqGA8K9R9Gb/DlGSAkOrqMuMwkYnorZYwdirs&#xA;VdirsVdirsVdirsVdirsVdirsVef+Ufz2/LTzTpuralYap9XstEEbajNeobZUSXl6bAv9oMUIFN6&#xA;7U3GKsF1n/nMz8rrK6aCxtNT1RENPrUUMcUTDxX1pEk+9BirOvy2/PT8vfzCka10S7kg1RFLtpd6&#xA;ghuSg6sgDOkgHfg5p3xVG/mH+b/kLyBCh8xaiI7uZecGnQL611IvTkI1+yv+U5C++KvMbb/nNT8s&#xA;pLsRy6Xq8FuTQXDRW7U92RZyQPlXFXtPlPzh5b826PHrHl6/j1DT5CV9WOoKuACUkRgHRhUfCwBx&#xA;VOMVYbafm35LuvzDuPIEVxL/AIjt1ZniaJhESsQmKrJ0r6bVxVJPzC/5yK/LPyNevp2oXkt/q0W0&#xA;2n6cizSRnwkZmjiQ/wCSX5e2KpX+XH/OT3kjz15otvLVlp+o2WpXgkNs1wkJhb0YmlcFo5GZTwQ0&#xA;+GmKvXbm5gtYHnncRxIKsxyGTJGETKRoBnCBmaG5YTq3nG8uWaOyJt4OgYf3jfT+z9Gczq+15zNQ&#xA;9Mftd7p+zYx3n6j9iV2thqupOXhiec1+KQnavu7Gn45gYtPlzG4gy8/2uXkzY8Q3ICYDydrhpVIx&#xA;83H8Myx2Pn7h83G/lLF5su0LTG07TktnYPJUtIy9KnwrnRaHTHDjETzdNqs/iz4hyTDMtxnYqkXn&#xA;R410UhvtNIgT57n9Vc1XbJAwb94dh2YCcvwQej63aaR5LvNX1BmSw0qK4urh1BYiGBDNIVUbnYHb&#xA;D2PInAPIle0hWX4IDy7+dP5c675TufNcGqpaaLZzNbXM16Pq7JKqq/Di27FlcFeNa9t82jr3ner/&#xA;APOZv5X2d00FjZanqcan/eqOGKKJvdRNIkn/AASDFWZ/l3/zkH+Wnnu8XT9LvZLPVpKmLTdQQQzP&#xA;T/fZVpInP+SrlvbFXpOKuxV5x+YH/OQP5ZeRrl7HVNQa71WP+80zT0E86+zklIo2/wAl3B9sVYLZ&#xA;f85p/lnNcenc6Xq1rETQTmK3cD3ZVm5fdXFXoN1+fP5WQ+UH82R63HdaUkiQskCs1yJZDRUa3IWR&#xA;T1PxAbb4qyzyx5k0vzNoFjr2lM76fqEYmt2kQxuVJI3VtxuMVUPNnnbyn5R0/wDSHmTVINNtTsjS&#xA;kl3I6iONQ0kh9lU4q8c1P/nND8sba4MVlp+q38akg3CxQxIfAqJJQ/3qMVZB5H/5yk/KzzXqEOm+&#xA;vcaNqFwwjgi1KNY0kkboqzRvLGKnYcytcVevYq/N78pPy11H8xPOdt5ftZDb2/FrjUbzjy9G2jID&#xA;vTuxLBVHiRir7q8t/kn+Vnl/Sk0608t2NwgXjLcXsEV1PKabmSSVWJr4CijsBir5y/5yh/JzS/I8&#xA;unedvJ0baVa3Fx9Xu7a2ZkWC5KtJFLBQ1jVgjAgUCkCnXFUX/wA44fkXZedrWTz956aXVbeaZo9O&#xA;tLiR3+sGE8HnuGJ5OoccFWv7JrtTFX0RrP5O/ldq+lvpl15X01Ldl4I1vbRW8se1AY5YlR0I9jir&#xA;5t/Kwap+UP8AzkZP5FkuXm0TV5Ba1bpIk0ZlspqdOaswjani2KvsPFXwP+fuq635e/5yB8yahpV5&#xA;Lp+pRSRGG7tnKSIs9jEDxdaEVjkIxV7p+Rv/ADjT5astBtfMfnixXV/MWpKLo2V6PUgtkk+JVeJt&#xA;pJSDVzIDQ7AbVKr2fTvIfkjTNRj1PTfL+m2Oowq0cV5bWkEMqow4lQ8aq1KbYqxzzdrTXl81rG3+&#xA;i2xKgDozjZm+joM5LtbWHJk4B9Mfvek7O0vBDiP1S+5R8saJ+lLsmWotIKGUjbkT0UfPvlfZui8e&#xA;e/0R5/qZ67VeFHb6i9EiiiijWOJAkaiioooAPYDOvjERFAUHmZSJNnmuySHYq7FUNeanYWSFrqdI&#xA;qfsk/EfkvU5Tm1OPGLkQG3FgnM+kW8/8xa+2q3Q4ApaxVESHqa9WPuc5LtDXHPLb6Ryek0Wj8GO/&#xA;1HmmfmfTBF+UHmG0mBBm0bUPVA2I9W2k2+YBpnTdnYTjwxB58/m6DW5RPKSOT4s/Ij8n7j8y/NUl&#xA;pNK1toemqs+rXKU9Ti5IjhjqCOchU7nYAE+AOa4r7V0n8l/yp0vS/wBG23lXTZLcqFka4to7iV6C&#xA;lXlmDyMfpxV85/8AOR//ADj/AKf5NtU88+ShJZafbzR/X7FGY/VZGcCK4gcnkq+oVUrX4SRTboq+&#xA;h/yT88zedvy00bXbo11B42t9QPStxbsYneg2HqcQ9PfFWG/85Qfm9eeRvKsGlaLMYfMGvepHDcqa&#xA;Pb2yACWVCPsuSwVD23I3XFWP/kN/zjV5ft9DtfNHnmyXVtc1NRcx6feD1ILeOX4k9WNqiSVgavzq&#xA;BWlKiuKvYNT/ACo/LLUrJ7O88raW0EgoeFpDE6+6SRqjofdWBxV8S/n/APlAfy283JbWbSTaBqaN&#xA;PpU0m7LxNJIHbbk0ZI37qR3rir7G/IH/AMk15T/5gV/4k2Ktfmd+SXlD8xtR0e819rhf0SXHp28n&#xA;ATxSUJickEgclG60brv4Kpvov5V/lvolusGmeWdNgVRx5m2jklYf5csgeRv9kxxV49/zkz+R3kf/&#xA;AANf+btFsbfRdW0kJLKLZFgguYmdY2R414oH+KqsBUnY1rsqzD/nF/zvf+bPyptH1GVp7/SJ5NMn&#xA;nc1eRYlSSJmJ3J9KVVJ70riryL/nB2KM6z5slKj1FtrRVbuFaSUkfTxGKvrfFXiv/OXoH/Km7j2v&#xA;rSn/AARxVkH/ADjd/wCSS8rf8YJv+omXFXpWKvlH8+II4/8AnKr8vnX7Uz6K7/MapIn6kGKvq7FX&#xA;xj+YXl6HzF/zmMdIuFD2099pj3EbdHih0+3mkQ/6yRkYq+zsVQ+o3JttPubgdYoncfNVJGU6jJwY&#xA;5S7gW3BDjmI95eSFySSTUnqc4C3s6eieR40XQldftSSOzfMHj+oZ1/YsQMF95LzPasic1dwCf5tn&#xA;WuxV2KpJ5wvri00V2gYo8jrGXGxANSaH6M1na2aWPCTHYk05/ZuKM8tHoLeblySSTUnqc423qaZP&#xA;5U8sy3UqX14nG1Qho42G8h7Gn8v683fZfZpmRkmPSOXn+x1PaGuEAYR+r7v2p5+Yf/KAeZv+2Vff&#xA;9Qz51TzrxH/nCO3hXyT5guQoE0mpLG79yscCFR9Bkb78VfR2KvPv+cgER/yZ82BlDAWRNCK7q6kH&#xA;6CMVYZ/zhsT/AMqjm9tVuaf8i4cVeX/85DwjXf8AnJfy3ol6a2UjaTY8T09K4uiXqPf1Tir7EAAF&#xA;BsB0GKuxV89/85rWVtJ+W2kXj0FzBq8cULGtSsttOXUU8fSU7+GKvRfyB/8AJNeU/wDmBX/iTYqp&#xA;/m9+d3lX8s7GI6grX2sXalrLSIGCyOoJHqSMa+nHUU5UJJ6A0NFXiVr+bP8AzlT5/H1nydoK6Xpk&#xA;u9vcx28SoyV6i41AmKT5oPorirCvzi8uf85KWvloXvny7uL3y/6iG4WGeKSCKSoWP1ooOIHxUo1C&#xA;te9Tir1v/nCX/lAdd/7ap/6hosVYr/zg5/x1fN3/ABgsv+JzYq+tMVeK/wDOXv8A5Ju5/wCY60/4&#xA;kcVZB/zjd/5JLyt/xgm/6iZcVelYq+Vfz9/9an/Lj/ty/wDdXmxV9VYq+S9T/wDW40/4z2//AHRU&#xA;xV9aYqgdcjaTRr5F3YwSUHjRScxtbEnDMD+aXI0hrLEn+cHkvLOBt7Smb/l9qiGOfTnNHB9aGvcG&#xA;gYfR1zpewtSKOM8+Y/S6DtnTmxkHuLMc6J0TsVdirEfzCvkW1t7IH95I/qsPBVBUfeT+Gc/29mAh&#xA;GHUm3d9jYSZGfQbNeStE06bTxfXEAlnMjCNnqVCrQbKfh649j6PHLHxyFyte1NVOM+CJoUy/OgdI&#xA;x/8AMP8A5QDzN/2yr7/qGfFXiv8AzhL/AMoDrv8A21T/ANQ0WKvorFWAfn9/5JrzZ/zAt/xJcVYT&#xA;/wA4bf8Ako5v+2rc/wDJqHFWBf8AOYnlnU9J82eXvzB01CqBY7WadRVY7u1kae3Zvd1JA/1MVfRH&#xA;5afmHonn3ypZ67pcq85EC31oGBkt7gCjxOOo3Hwk/aWhxVlWKvjz/nMb8ytO1nWNP8m6XOtxFozv&#xA;capIhDILthwSIEH7UScufu1OoOKvoT8gf/JNeU/+YFf+JNir59isNP8AOP8AzmHe2fmgCa1tbmZb&#xA;aynAMcosbesEfE7cTw9Qj9revXFX2AqqqhVAVVFFUbAAdhirzr/nILzPoWg/lP5hXVJEEmp2U+n6&#xA;fbsRzluLiMonBT19Mt6h8AMVedf84Ssv+A9eWo5DVale4Bt4qH8MVV/+cWfyl8+eQtS8yyeaNPWy&#xA;ivUto7N1ngmEpiaUsQIncqKMPtAdcVfQmKvMv+ci/JXmPzl+Wdzo3l22F5qZubeZLYyRxcljf4qP&#xA;KyJUA13YYqm/5LeWdY8sflfoGhazCLfU7KBxdQK6yBGeZ5OPNCykgOK0JGKs2xV4F+bn5V+efMP5&#xA;+eSvNekaeLjQdJ/Rv6RuzPBH6X1XUJLiX927rI1I3BHFTir33FXz3eflL58m/wCcqV89pp6/4VDx&#xA;SHUDPB0TTFtiPR5+tX1Vp9j3xV9CYq4gEEEVB2IxIUPI9e0yTTNTmtWB4A8oW8Y2+yf4ZwOt0xw5&#xA;THp09z22jzjNjEuvX3oS1u57W4juIHKSxHkjDscox5JQkJRNEN+TEJxMTyL0XQ/Omm30ax3Tra3f&#xA;Rlc0Rj4qx2+g512j7Xx5RUzwz+x5bV9l5MZuI4o/ayFWVlDKQVO4I6ZtgbdYQk+s+a9K02Nh6guL&#xA;n9mCMgmv+URULmv1faeLCOfFLuH42c7S9nZcp5VHvLze9vbzVdQaaSslxOwVEXoK7KqjOPzZp58n&#xA;Ed5S/FPVYsUcMKG0Q9V0iwGn6Zb2Y3MSAOR0LHdj/wAETnc6TB4WKMO4f2vG6nN4mQy70ZmQ0JR5&#xA;w0661LylrenWih7u9sLq3t0JCgySwsiAk7CrNirzD/nFz8u/N/kfyfqth5osRp95dagZ4YfWhmJi&#xA;9GNOXKB5FHxKdq1xV7NirEfzb8var5j/AC28w6JpMYm1K+tHjtYWZUDvUMF5MQorSm5pirF/+caf&#xA;I3mjyX+XL6R5lsxY6i9/PcC3EsU1I3SNVJaFpE34Hvir0TzH5c0XzJot1outWqXmm3icJ4H+8MpG&#xA;6sp3VhuDuMVfMF//AM40/m95C12XV/ys1314X2SFpUt7kp1EcySj6tMB4sR/qjFURcaD/wA5reYo&#xA;Rpmo3i6VayLwluln063JB2JMljznH+wGKsC/Oj/nHyx/LXyLpus3OtSalr99frbXESoI7fg0Msrs&#xA;gPKRirIo5E716DFX1h+SdmbT8o/KMJBUtpdtLQkE/voxL2/18VeYfn3+QPmTWfM0P5gfl/N6PmWH&#xA;03urQSCB5JIABFPBI1FEgVQrKxAIHWvVVjEP5n/85gQW405/KhnuV/dm/fTnLk9OXKN1t/pC0xV2&#xA;mf8AOOf5tfmPqn6b/NnW5LJVQrb2iNFNOobeiRxf6NAnQmlSe4HXFUB5X/Kb/nJ78tdX1Gw8ki3u&#xA;NKvZEL3vqWRgkEZYRyGK5YSxtxb4gq/S1AcVfXeKuxV2KuxV2KuxV2KuxV2KuxVJ/Mvl6HWbQLUR&#xA;3UVTBL7n9lv8k5r+0NBHUQrlIci52h1pwS74nmHl17Z3djcNb3UZimTqp/WD3GcVmwzxy4ZCi9hi&#xA;yxyR4omwocsqbad6jBStTxPUdsNo4XAkkACpOwAwBXoHkzynJaldSv043FP9HgPVK/tN/leA7fPp&#xA;1XZPZhh+8yfV0Hd5+95rtTtET/dw+nqe9mGdA6J2KuxV2KuxV2KuxVjn5g+e9G8i+VbvzJrAke0t&#xA;eCiGEBpZJJGCIiAlRuT3OwxVJfKH56/lX5qtkk0/X7a3uHA5WN862lwrH9nhKVD08ULD3xVPNW/M&#xA;TyHpFo93qXmHT7aBBUs1zESdq0VQxZj7KCcVfKf5i+aNR/5yC/M/SfLPlSKYeW9NZv8AS3QrSN2U&#xA;XF7Ip+yoVQsatufYtTFX2PY2VtY2VvZWyenbWsaQwRjoqRqFUfQBiqtirsVdirsVdirsVdirsVdi&#xA;rsVdirsVdirsVdiqU+Yv8P8A1T/cz6fp7+ny/vK9+HH4vuzB1/5fg/fVX2/Dq5uh8fi/dXf2fHo8&#xA;w1T9Desf0Z6/pV/3fx/Dj/HOK1Pg3+64q86ew0/i1+84b8kLB6Pqj1+XpftcKcvortlMKv1cvJun&#xA;denm9A8o/wCDvUX6lX6/+z9ap6v+w/Y/4HfOq7L/ACd+j6/6XP4dPk8x2l+br1/R/R5fHr82X5v3&#xA;RuxV2KuxV2KuxV2KuxVKfNf+F/8AD95/in6p+geH+nfpDh9W41FOfqfD9qlPfpvir4t/Mb/oVb69&#xA;L/hz9O+tVv8Ajm+n9S5f9H372lenHan0YqxTy3/yob6+v+IP8S/VarT6v9Sp139Svxcf9XfFX2j+&#xA;Sv8AyqH/AA0f+Va/VvqNV+u8OX1v1KGn1r1f31evHlt/Ltir0LFXYq7FXYq7FX//2Q==</xmpGImg:image>
- </rdf:li>
- </rdf:Alt>
- </xmp:Thumbnails>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/"
- xmlns:stDim="http://ns.adobe.com/xap/1.0/sType/Dimensions#"
- xmlns:xmpG="http://ns.adobe.com/xap/1.0/g/">
- <xmpTPg:NPages>1</xmpTPg:NPages>
- <xmpTPg:HasVisibleTransparency>False</xmpTPg:HasVisibleTransparency>
- <xmpTPg:HasVisibleOverprint>False</xmpTPg:HasVisibleOverprint>
- <xmpTPg:MaxPageSize rdf:parseType="Resource">
- <stDim:w>87.251177</stDim:w>
- <stDim:h>25.792741</stDim:h>
- <stDim:unit>Millimeters</stDim:unit>
- </xmpTPg:MaxPageSize>
- <xmpTPg:PlateNames>
- <rdf:Seq>
- <rdf:li>Cyan</rdf:li>
- <rdf:li>Magenta</rdf:li>
- <rdf:li>Yellow</rdf:li>
- <rdf:li>Black</rdf:li>
- </rdf:Seq>
- </xmpTPg:PlateNames>
- <xmpTPg:SwatchGroups>
- <rdf:Seq>
- <rdf:li rdf:parseType="Resource">
- <xmpG:groupName>åˆæœŸè¨­å®šã®ã‚¹ã‚¦ã‚©ãƒƒãƒã‚°ãƒ«ãƒ¼ãƒ—</xmpG:groupName>
- <xmpG:groupType>0</xmpG:groupType>
- </rdf:li>
- </rdf:Seq>
- </xmpTPg:SwatchGroups>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:illustrator="http://ns.adobe.com/illustrator/1.0/">
- <illustrator:Type>Document</illustrator:Type>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:format>application/pdf</dc:format>
- <dc:title>
- <rdf:Alt>
- <rdf:li xml:lang="x-default">mroonga-logo</rdf:li>
- </rdf:Alt>
- </dc:title>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
- <xmpMM:RenditionClass>proof:pdf</xmpMM:RenditionClass>
- <xmpMM:DocumentID>uuid:4379d2f2-92f2-dc4a-80ad-17a20c304810</xmpMM:DocumentID>
- <xmpMM:InstanceID>uuid:05546b07-0c26-2747-aadd-acdb3045814f</xmpMM:InstanceID>
- </rdf:Description>
- <rdf:Description rdf:about=""
- xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
- <pdf:Producer>Adobe PDF library 9.90</pdf:Producer>
- </rdf:Description>
- </rdf:RDF>
-</x:xmpmeta>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<?xpacket end="w"?> endstream endobj 3 0 obj <</Count 1/Kids[7 0 R]/Type/Pages>> endobj 7 0 obj <</ArtBox[5.09961 5.0 242.326 68.1133]/BleedBox[0.0 0.0 247.326 73.1133]/Contents 8 0 R/LastModified(D:20130403110821+09'00')/MediaBox[0.0 0.0 247.326 73.1133]/Parent 3 0 R/PieceInfo<</Illustrator 9 0 R>>/Resources<</ExtGState<</GS0 10 0 R>>/Properties<</MC0 5 0 R>>/Shading<</Sh0 11 0 R>>>>/Thumb 12 0 R/TrimBox[0.0 0.0 247.326 73.1133]/Type/Page>> endobj 8 0 obj <</Filter/FlateDecode/Length 3431>>stream
-H‰lWËŽl9Ü×Wœ¨sN;mo¹H³B€X°F­Ë0RbîÀÿéSõ¢+ü:v>"#¿üñëñå_Ëñ»ß=n¿ÜÊ1ü4ó£¶qzã¾ñ÷o·¿ÿÄ<ÿ¾ÿxûò§oß?¾ýëßÿùÛçñý§Û—þRŽ½ýr˜VØ1â«­£Í³®åÇÇÏÚüóín§{ÃvÜëY'¶œ­ÍãîøW7ø¸Ýsëš›çõ¸—Ó§w+çtçöbZ‹U»°Øì,‰¬'4úXt­ÆB-Ló_Œ‘píž3´Üq|¼¶°ÌÚÙ£NžzA;÷áãF³Ÿ¯}äö¹ô”ÚñÏ:,1.Èý°üsàS}ÅsÃ8Çì2…'\Õ ÛÈïϳ„Îãõ&¯å³¬„•ÿÏRƵœûŽ[yü}çGÚ¾Q羞Fê:}Œ}¿kd̼Qç½ tà Ó@kø5ph>7´³¶—ãßËý°ï]Ö
-d³Æt2 Ê4ü¸ýýöç—lµèçlxfCÚ2.ÙÊ×ûaÈ>\¡ZäX£í, ßxÎÂ×6’ua$]™L`ܤ?ò£§Aúž§—¯äÊ‹§ùáÅAÛÕMŠ_g ÒWòl¼sxDê\{u»ÌAfâ—öÖZ¸5Ú•vVF¢x~¨7"ßYកÃzKø)XaŒ\
-ÐœûjB=M#ßÓÜ 
-òÑ ·€ŒRdž\²
-é²4GÆ¥›Wbh¥•|¬Éped&êi‹\KOÍÖœu]`nÛ0ñ2½¯É–K§Ù]dþÄŽJ4eѲ½TAvÈ…Ó™°Ê|Fêáê/±~-þHÙ2˜ÖFÚ…® Ø˜%ךö
-n^°*MÈ:=ÿ/O!fñpl¨¤98æITàDŠ%Ó ÆwPȨ))4ÇœLÞEX*Nêg¡ñ«øýã6[ ARôbwíCDÑOðøLêÛh`;i—â!ÎV´’~îJh„ÔC‡¬I˜”3­9~6.D~B3i‘qMå0_ŸZb…æTGšâ?(7MOzÛ¦C=¤``°+¿-ñL€tè$»ÁŸC©°
-ù›:@Ç I9M˜tƒ'£xOä-ùJîh ÑŠ’'#2) øh£ *\V™è°*·°8œ¹!3Ý'QÃ60CGPTÜfŠÀ'øð˜B¤z Ö4Ê¢ÐÚâ+jñ:.!rC©d º‡SeMT¹lP
-é·ZntˆbÒ ¨UHA[¡G6ÒÚ‚(¹fÁñ]Ç’¯»Š??YtwÏ·à-å ®‰Ûr ™×ï[H.n81Õx
-ì·´ ;ÇŽnN!vùJø(} ÌêÙ TÊ¥ølH} 82aµœ‘zD4
-NÎQ\À\ëuá„Ý ,ðX(žˆÍä¦E¨±{¸§j4Ó¢…éÚ„”r&Ù7–ê»)R¤ìÖÃi?ŸIè§k…1_²ì|Üü!ñ
-)D-SUkÑì}À&­I€1ÝI“ú-‹ö%0æÒ:ºƒpð„p)¡Ñ¹)º$¥Ü236á%$8½¢3Øe¬”+T›;C¼H
-ö½cvCX¼Éÿ§ªZ!9ÙÕ3=R·ZÝUL~1aÉ®n×æÁ°é0×(
-ÓQàahñÌ"²W]‘A0a•Ê¼œñvjMÓ†G†éÆëŒ6‚Ðz`Ç…D>SÔ•€ïV“A­&ž6ÒæÉpY’‘ Ý+EÁ`刱iŸµq榳H¡šbDýH÷ævɹ³;à·Ùê`×ãrúî~¡Åž¿]o—ëûï??6wûy:yöîõ¬z)¤ÙgŒºÃ_o lSB™ªEŸÈCAÅ?½¸óó›woîéÅY ÷®FÝÞ€ÊÕÄøvÕ¼˜ýíõ¹sÿX©L¨ ¥rçþѸ¿[ØwmŒŠø7/=R*ÙË{šþ…ªéN)p‘5†©+m¸·h’HâJ†”§·`saAÉ«¢rYP‘%™Œ+Yã¼W†¸ Ä3Ž‰¬} Ö¦a%)nRyU‹}‡šÕ¢"%A")Lz^³"‰ãõJ>†VYp0΀´ MÁ7ñF´õ5j³4ˆ>¡ðV ¼Õ»d^°èrÛý¹éŸþ]ONʱ´Ztº‘Â¥O4µÕïÏ7¢éHs ¶R2+z+aáI ·RH‹š¢(«…4Î(ûÚjP(µùvé¢Ôe|¼°`ÁgÖt‡ {¬óõ`Q7ÝßÝ‚8B´Ó©7ðƒ4’@´ôí[†‘íÌBcÛ¿7ñX‘_RPma70Æ$ÕtNà¤æi¡‹Æëm-ªˆÄbGCõ½LÈòÍšèó9«›¾»6@ÚcôØ°6›¹7Ã3N×j‡ž³ùQ L¬[ØòÝ°Ñrº{tL¦C¶ëÉ_Ò
- ‚Ù‰Ï  ¹Ãt¼çdàBU£žñ¡™—C:º©‡=<ÑCþÈnöØ3a›°E â’³—;ëÂF¼Ÿ¾~vøù+À
-8;VGKd0Te-#XdEtNUCiWkORq"Vh&W#Td^iJ23NbJHJCsPi.X2-+Ss6VZ9dPW\CoS1
-LJg-V)Y*lkesN.`^A?7AC@InQC3+KOU-Fom!s%T7S='~> endstream endobj 13 0 obj [/Indexed/DeviceRGB 255 14 0 R] endobj 14 0 obj <</Filter[/ASCII85Decode/FlateDecode]/Length 428>>stream
-8;X]O>EqN@%''O_@%e@?J;%+8(9e>X=MR6S?i^YgA3=].HDXF.R$lIL@"pJ+EP(%0
-b]6ajmNZn*!='OQZeQ^Y*,=]?C.B+\Ulg9dhD*"iC[;*=3`oP1[!S^)?1)IZ4dup`
-E1r!/,*0[*9.aFIR2&b-C#s<Xl5FH@[<=!#6V)uDBXnIr.F>oRZ7Dl%MLY\.?d>Mn
-6%Q2oYfNRF$$+ON<+]RUJmC0I<jlL.oXisZ;SYU[/7#<&37rclQKqeJe#,UF7Rgb1
-VNWFKf>nDZ4OTs0S!saG>GGKUlQ*Q?45:CI&4J'_2j<etJICj7e7nPMb=O6S7UOH<
-PO7r\I.Hu&e0d&E<.')fERr/l+*W,)q^D*ai5<uuLX.7g/>$XKrcYp0n+Xl_nU*O(
-l[$6Nn+Z_Nq0]s7hs]`XX1nZ8&94a\~> endstream endobj 11 0 obj <</AntiAlias false/ColorSpace 15 0 R/Coords[0.0 0.0 1.0 0.0]/Domain[0.0 1.0]/Extend[true true]/Function 16 0 R/ShadingType 2>> endobj 15 0 obj /DeviceRGB endobj 16 0 obj <</Bounds[]/Domain[0.0 1.0]/Encode[0.0 1.0]/FunctionType 3/Functions[17 0 R]>> endobj 17 0 obj <</C0[0.972549 0.733337 0.368622]/C1[1.0 0.576477 0.117645]/Domain[0.0 1.0]/FunctionType 2/N 1.0>> endobj 5 0 obj <</Intent 18 0 R/Name(svg4429)/Type/OCG/Usage 19 0 R>> endobj 18 0 obj [/View/Design] endobj 19 0 obj <</CreatorInfo<</Creator(Adobe Illustrator 15.0)/Subtype/Artwork>>>> endobj 10 0 obj <</AIS false/BM/Normal/CA 1.0/OP false/OPM 1/SA true/SMask/None/Type/ExtGState/ca 1.0/op false>> endobj 9 0 obj <</LastModified(D:20130403110821+09'00')/Private 20 0 R>> endobj 20 0 obj <</AIMetaData 21 0 R/AIPrivateData1 22 0 R/AIPrivateData2 23 0 R/ContainerVersion 11/CreatorVersion 15/NumBlock 2/RoundtripStreamType 1/RoundtripVersion 15>> endobj 21 0 obj <</Length 1005>>stream
-%!PS-Adobe-3.0 %%Creator: Adobe Illustrator(R) 15.0 %%AI8_CreatorVersion: 15.0.2 %%For: (SHIDARA Yoji) () %%Title: (mroonga-logo.svg) %%CreationDate: 2013/04/03 11:08 %%Canvassize: 16383 %%BoundingBox: 178 388 417 453 %%HiResBoundingBox: 178.9365 388.9434 416.1631 452.0566 %%DocumentProcessColors: Cyan Magenta Yellow Black %AI5_FileFormat 11.0 %AI12_BuildNumber: 399 %AI3_ColorUsage: Color %AI7_ImageSettings: 0 %%RGBProcessColor: 0 0 0 ([レジストレーション]) %AI3_Cropmarks: 173.8369 383.9434 421.1631 457.0566 %AI3_TemplateBox: 297.5 420.5 297.5 420.5 %AI3_TileBox: -114.9409 132.5 704.2715 708.5 %AI3_DocumentPreview: None %AI5_ArtSize: 14400 14400 %AI5_RulerUnits: 1 %AI9_ColorModel: 1 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 800 %AI5_NumLayers: 1 %AI9_OpenToView: -974 1133 1 2546 1413 26 0 0 2567 42 0 0 0 1 1 0 1 1 0 1 %AI5_OpenViewLayers: 7 %%PageOrigin:0 0 %AI7_GridSettings: 72 8 72 8 1 0 0.8 0.8 0.8 0.9 0.9 0.9 %AI9_Flatten: 1 %AI12_CMSettings: 00.MS %%EndComments endstream endobj 22 0 obj <</Length 5618>>stream
-%%BoundingBox: 178 388 417 453 %%HiResBoundingBox: 178.9365 388.9434 416.1631 452.0566 %AI7_Thumbnail: 128 36 8 %%BeginData: 5468 Hex Bytes %0000330000660000990000CC0033000033330033660033990033CC0033FF %0066000066330066660066990066CC0066FF009900009933009966009999 %0099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF3300FF66 %00FF9900FFCC3300003300333300663300993300CC3300FF333300333333 %3333663333993333CC3333FF3366003366333366663366993366CC3366FF %3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC99 %33CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF660000660033 %6600666600996600CC6600FF6633006633336633666633996633CC6633FF %6666006666336666666666996666CC6666FF669900669933669966669999 %6699CC6699FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF33 %66FF6666FF9966FFCC66FFFF9900009900339900669900999900CC9900FF %9933009933339933669933999933CC9933FF996600996633996666996699 %9966CC9966FF9999009999339999669999999999CC9999FF99CC0099CC33 %99CC6699CC9999CCCC99CCFF99FF0099FF3399FF6699FF9999FFCC99FFFF %CC0000CC0033CC0066CC0099CC00CCCC00FFCC3300CC3333CC3366CC3399 %CC33CCCC33FFCC6600CC6633CC6666CC6699CC66CCCC66FFCC9900CC9933 %CC9966CC9999CC99CCCC99FFCCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF %CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0033FF0066FF0099FF00CC %FF3300FF3333FF3366FF3399FF33CCFF33FFFF6600FF6633FF6666FF6699 %FF66CCFF66FFFF9900FF9933FF9966FF9999FF99CCFF99FFFFCC00FFCC33 %FFCC66FFCC99FFCCCCFFCCFFFFFF33FFFF66FFFF99FFFFCC110000001100 %000011111111220000002200000022222222440000004400000044444444 %550000005500000055555555770000007700000077777777880000008800 %000088888888AA000000AA000000AAAAAAAABB000000BB000000BBBBBBBB %DD000000DD000000DDDDDDDDEE000000EE000000EEEEEEEE0000000000FF %00FF0000FFFFFF0000FF00FFFFFF00FFFFFF %524C45FD3AFFCFC9C9C8C8C2C9C9FD76FFCAC9C2C89FC8C2C89FC8C2C9CA %FD72FFCFC8C1C8C8C8C2C9C9C9C2C8C1C8CAFD70FFA8C89FC89FC8C8CFCA %FFFFFFA7C89FC8A8FD6FFFC9C2C8C2C8C9FD08FFC9C1C9FD6EFFC99FC8C2 %C2C9FD09FFCFC89FC9FD6DFFC2C8C2C8C2FD0BFFCAC8C1FD6CFFA7C89FC8 %9FC9FD0CFFC2C1A7FD68FFC9C9C8C8C2C8C2C8CAFD0CFFCFC1C9FD65FFC9 %C89FC8C1C29FC8C1C29FCFFD0CFFCAC29FFD3EFFA8FD09FFA8FD13FFA8FD %07FFC8C8C1C8C1C8C1C8C1C8C1C9FD0EFFC2C8CAFD09FFA8FD11FFA8FD11 %FFA8FD08FF5252FFFF5227F8F8F87DA8FFFFFF7D52F8F8F8277DFD07FFA8 %5252FFFFA82727F8F827FD04FFCFC2C19FC8C1C1A0C9C9CAA7CFCFFD0DFF %A7C2C1CAFFA827A8FFFF5227F8F8F852A8FD0AFFA85227F8F8F8527DFFA8 %5252FD06FFA85227F8F8F82752FD05FFF8F87D27FD06F852A8FF52FD07F8 %52FD06FFA8F827FFA8FD06F8FD04FFC2C8C1C8C1C8C9FD14FFCEC1C8CAFF %52F827A8FD07F827A8FD08FFA8FD08F82752F827FD04FFA852F8F8F827FD %04F852FD04FFFD05F87DA8A852F8F827F8F8F852A8A87D52F8F87DFD05FF %A8F8F852F8F827A8A8A87DFFFFFFA0C2C1C29FC8CAFD15FF9FC8C1CFFF7D %FD04F827A8A8A827F8F8F8A8FD06FF7DF8F827FD04A87DFD04F827FD04FF %A8F8F852A8A8FFA852F8F852FFFFFFF8F8F827FD05FF7DFD04F8A8FD05FF %52F827FD06FFFD04F852FD07FFC9C1C1C8C1C8CAFD15FFC8C2C1C8FFFF7D %F8F8F852FD05FF7DF8F852FD05FFA8F8F852FD06FFA8F8F8F852FD05FF7D %A8FD06FF7DF8F8A8FFFFF8F8F8FD07FF27F8F87DFD06FFA8F8F8A8FD04FF %A8F8F8F827FD07FFCAC2C1C29FC1C9FD15FFA0C1C1C1A0FFFF7DF8F852FD %07FF52F8F8FD05FF27F827FD08FF52F8F827FD0EFF27F87DFFFFF8F87DFD %07FF7DF827A8FD07FF27F87DFD05FFF8F8F8A8FD07FFC9C1C8C1C8C2FD13 %FFCFC9C2C8C1C8C1FFFFFF7DF8F8FD09FFF8F8A8FFFFFFA8F8F8A8FD08FF %A8F8F852FD0EFF27F852FFFFF8F8A8FD07FF7DF8F8FD08FF52F87DFD04FF %A827F827FD08FFC1C2C1C29FC9FD11FFCA9FC2C1C19FC8C1C9FFFFFF7DF8 %27FD09FF27F87DFFFFFF7DF827FD0AFF27F827FD0BFFA8A852F8F852FFFF %F8F8FD08FFA8F827FD08FF52F852FD05FFF8F852FD07FFCAC2C1C8C1C2CA %FD11FFC1C1C1C8C1C8C1C8FD04FF7DF852FD09FF27F87DFFFFFF27F852FD %0AFF7DF852FD07FFA85227FD06F852FFFFF8F8A8FD07FF7DF8F8FD08FF7D %F87DFD04FFA8F8F8A8FD07FFC9C1C19FC1C1CFFD10FFA7C1C1C19FC2C1C2 %CAFD04FF7DF852FD09FF27F87DFFFFFF27F87DFD0AFF52F827FD05FFA827 %FD05F827F8F8F852FFFFF8F8FD08FFA8F827FD08FF52F852FD05FFF8F8A8 %FD07FFC9C1C1C8C1C8CFFD10FFCFC1C8C1C8C1C8CAFD05FF7DF852FD09FF %27F87DFFFFFF27F852FD0AFF7DF852FD04FFA827F8F852A8A8FFFF7DF8F8 %52FFFFF8F8A8FD07FF7DF8F8FD08FF7DF87DFD04FFA8F8F8A8FD07FFC9C1 %C1C1C2C1CFFD10FFC9FD04C1C9CFFD06FF7DF852FD09FF52F87DFFFFFF52 %F852FD0AFF52F827FD04FF27F827A8FD06FF52F852FFFFF8F8A8FD07FFA8 %F827FD08FF52F852FD05FFF8F8A8FD07FFC8C1C1C2C1C1C9FD10FFC9C1C2 %C9FD09FF7DF852FD09FF27F87DFFFFFF52F8F8FD0AFF27F852FD04FFF8F8 %A8FD07FF52F852FFFFF8F8A8FD07FF7DF8F8FD08FF7DF87DFD04FFA8F8F8 %A8FD07FFC998C1C1C19FC8FD10FFC2C19FCFFD09FF7DF852FD09FF27F87D %FFFFFFA8F8F87DFD08FFA8F8F827FFFFFF7DF827FD08FF52F852FFFFF8F8 %FD08FFA8F827FD08FF52F852FD05FFF8F8A8FD07FFC9C1C1C2C1C8C1CFFD %0EFFCFC2C1C8CAFD09FF7DF852FD09FF27F87DFD04FF52F827A8FD07FF27 %F8F852FFFFFFA8F827FD07FFA8F8F852FFFFF8F8A8FD07FF7DF8F8FD08FF %7DF87DFD04FFA8F8F8A8FD07FFCFFD07C1FD0EFFC9C1C1C1FD0AFF7DF852 %FD09FF27F87DFD04FFA8F8F8277DFD05FF27F8F8F827FFFFFFA8F8F8A8FD %05FFA8F8F8F852FFFFF8F8FD08FFA8F827FD08FF52F852FD05FFF8F8A8FD %08FFC8C1C2FD04C1C2FD0CFFCFC1C2C1C8FD0AFF7DF852FD09FF27F87DFD %05FF7DF8F8F8527D7D52FD05F852FD04FF27F8F87DA8FFA87DFD05F87D7D %F8F8A8FD07FF7DF8F8FD08FF52F852FD04FFA8F8F8A8FD08FFC9C19FC1C1 %C19FC1C2FD0AFFCFC1C19FC1C9FD0AFF7DF852FD09FF27F87DFD06FFA827 %FD06F827A852F827FD05FFFD08F852A827F8F8F87D52FD09FF527DFD08FF %A852A8FD05FF527DFD0AFFC1C1C1C2C1C2C1C1C2CFFD07FFC9FD05C1FD0B %FFA8527DFD09FF7D52A8FD08FFA85252527DA8FFFF7DF852FD06FF5227F8 %272752A8FFFFFF52527DFD29FFC9BAFD08C1C8C9CAC9CAC8C2BAC1C1C1BA %C9FD2AFF27F87DFD09FFA8FD33FFC8C1C2FD0FC1C2C1C8FD2AFFA8F8F8A8 %FD3DFFCAC298C1C1C199C1C1C199C1C1C199C1C1C198C1CAFD2AFF52F827 %FD3FFFCFC8C1C1C1C2C1C1C1C2C1C1C1C2C1C1C1C8CFFD21FF277DFD07FF %7DF8F87DFD40FFCAC8BAFD0BC1BAC2CAFD21FFA8F8F827527D7D7D5227F8 %F852FD43FFCFFD0BC1C9FD24FF7D27FD07F8277DFD46FFC9C89FC1C1C199 %C2C9FD28FFA852522727527DA8FD16FFFF %%EndData endstream endobj 23 0 obj <</Length 26246>>stream
-%AI12_CompressedDataxœì½‡’kÉ’¦À?  º6Àñ¦=l{ïo[4€îÆm4€>
-œÕ»<z×Z­æKy±Ñzi¥;ß½¤Œn¡B¹ U8†å3Œaø8Ë.1
-V(7¿+w:õ_ÁcVâÊr­^³Zo¾äZ?@¡¬ÄyE‰ ¬D|¼U?©uÜuÒ*/‰X1­
-É'yóõçÿíëOþõ§ÿëëÏ¿ßþ¾þôï¿þü‡_þww)½­Õ~/koœO+¼¤à¼8Ç€Ë:àøÎYí½Ý€9 èâT9-BMþÚ¾ë5^Rk‘eh“Qã,ÏA™ÒœÌâŨl¡´ö]½öýRü Õ¬Q¼eµî)UA`ú—>9é5jÚy³ÞE
-geí¥ÖRh5z]BªŠÑLÌ^ùKM³:8lךg­ 2ÆEU`.y Â8'
-ŒåãœD:àD èŒ3;e­¿´ml Û1:a6`~µúK½¹¤O~ØÔêUkÎe.®Ð?‚´bûO5þ£C¨»ÝZS:ÐZ~ßF;Lzÿz,6«ùÖ;¢¾ƒ ¦]=ÁÊ£ÏÌïä ¼ÞkÓÑ“ß0KGZ½‰mÆÈåá¨ÑƒG›Z«×Þn>·bIÊ(`4Z-NÂz'?ÿO—ëíTàÛ…Ú3,ëuZzË1ü&þ¹å8ÿÿúƒáÿÙüñùŠYüÿCü“7Þ‚¶ŠÍïjV»/7«ñ˲ÖÎQ£Ü,kqRîÑ i¿‡¾8ºÃÿ Ò^ý;è¤ ˜0 žv­Ò%¯*®qT°=
-ïèL+W`¢ã‡OŸáxÛàLŒ_™ÛdCºÜ£Ü}vYkV;Œöl˜(|†BÚ\8d§\)Z<§õ:¯ñ³V«a+C“â¯ìƒ!]^„Bo˜´‹ÍþV 刼Ð<lÒ©ñ÷ñϽ9ùÆ ::`ÒÿQŒ j*kèåÿo£É—ú‹Vn¿Ö+~ÚÑûãÌþŒÎ»ø'7Ì(i¿ƒ¬Á/ïO­F½óîÚ…ŠþS½Glÿ¨¬uë•FíôK§[{j§â¹Þ¬Âú>íÕ»5³}ÁmÔC㧯åv´Ù}-‘š§fƒâd»È]\Œ±ñ\Ó&7µrµ²”èóf³ü^«Æ_ô¢T¬¿Õ”x®»‰­Ä˜‚ùÉ9>Yø¨®ÂHŒ ÿáGÔ?‚óƒ?@\äé_l F!*¢
-Ÿœ˜‡O>%Ò 'ñð$ü'ÃG‘Tød¥<|
-RI*É0™•9™—Y„þSd5&«rNÎç áS’K
-«pðá>’µü—UrðÉ“QdsÙ<|
-Ùb¶(`s\ŽÏ 91'å 5¨§æ J.—Ëç
-¹"|Jy&Ïæ¹<ŸpàПÉåóùB,_„O‰`—-pðá |ÄŒ¾ ”‚
-è¯
-%+ÃGÊŠðàÃg¹X–˲„ªJj>|^…ö¡>þST˜4œ_ ><¥Œ¢X
-A@æñÖ‚•ÂÙš±†0rC0š\ÁdKã 6Tú-ºî—F­Ëì6[ß7ÉøR ÖÿâëÏÿäëOüõç?»õ.Ï
-¥ßô0*•¥Ë–öö›Fµ²ôLÜx¿éLuk?„g²ŽNÃLç»—y¨<fÛ˜ø¨cZ¶êT^ëªVkêu\«ËVÌ7­þÔëÖ:´ê²þw\-õMùßõtE¨¹iµN«§U":ùÚí¶—2™vOk¤[ÚK¦Zÿ½×q\
-µçr¯asÓP¨wÚò—ý²¦SºÂH2…HaEÁ="2
-#n×çL.ntGììã³Z­œ%„¡·?%nµ`9µš[6Õ˜÷­œ¯5ÖôrÇ
-´¸e%”­–æX
-<'£ÒæÙ,©m.†ÐšÖjDEö+©j¬¸n‹?tMÑPõj¯ËøtI
-éÛŠ Dl£ÇÁGk£¿Y¨™³VÛÖ†~ÌêõN2¡Ón¹[ ~‹Lêà¯Ù–Üv³Zû¡T×:!ãs¿rZ«´š:…ʪHÐ˳Ò
-al•
-'§eV’<Ù&Ô$™#Á%*bZâe%ø —ÜâÕàê¦ÐR#´m“»›VÕ·¾Å¢*¦9Yô…Ô†hO& UªtW"€ C¥ì–N·¡Wo·«þ]c5½k³^„–¡..åF`ÐßK¸´jš#B'p@´¾ay$o™‹­F£F fk£gÙÜ9ƒ†ãY£r-ëT#;Ó26aÍ¿€iq¯FÃx%„á D}Îqw% ”k­SÃ!˜îX³óVooo¾EdMMêÁê±ÁìDõNë O(°!Ú±…õŠG§ñ=ô3eµ.9(‡ljº·ä­bý•C—«‰óhÖÈ&ÍÒ}?ãÏ|‡nbg.¨Ÿ)g7;ýdº‹ìÌÓEæ¬sj÷¹õWË£K,¯»ÄNì.±äÍ-Çá±9ˆ‚—øÍÞr¼€gFüpgóš­ Ø0ÉųÛ}ˆtΩ>=\ÿKƒ!Ÿ¼÷tبwTñÅ<©5.Ä“Æ‚ñnE·4[–¯4^o_(j{ýО–¿«íK¬Ãø²Nva¶xz±‰»Àa< KÓr–3¶W®lŠ“Õž‚ƒî´Ë—‰;“NSÿ»Æ n:Yo‘œmk¬st{­JÙ#ö†4øƒ~ÌŒç‹ÔgÛíÄçG/ÏNW–iµJÝrvØÁjc÷Œè­èŒ£úµÆQM{®Uº®Š}{b¯­ï·êU÷Ì÷UkºuWKá¬0‰„yT(=Щ|«Y%¶Äv@©?×Má:T+C¼ àу Q?ˆª<mj˜ç²S¨{ ®NZzåKøëÄC'ÆM‡lnF{Mïi»Yiôyï´ L¶Áwlç›Åýûÿâ¯ÿù¿üô§ †¡ùøt+¬ê›5Y¬Iª°ÌÁ~u×Q7æNsÔ> ô9ªž„˜7Λ:½§‚nÔ¥Ž%­õöû–öfŽg°×lcìE;¶{Ó‚ÐÏMe¼z¦Õß1ÀéÒ¹è;åGTÇW,ÖÍ{ºÕWö[ÍVåW+´¾oÒœH?E.êû»u#\ƒC+Ë÷]P7¾àÁ VTPOXÛ¶kzÜ+[[„a½ØÞ³„<{s;Ð+iÔ$l'è5ª‚¦‚S¡¦1ñþr«
-—SˆÏ–'F1ŒT¬I&GdŸZÆCÒÎ
-¯¶z/
-SÕ^±°>·+.ÚÝo¬$2y
-½XÝN–ªÒ´|’:ðê”)]|:•¦G§Ù¬_§±³9õéÜÖÉÍÅÙí§ô•ç¬Þ~.Kz§G³³.ôòËÝF•t
-´øTJvÌêµvÇí`§©þYMß«ûùyèThõ‘ÒýJÉ·ÓXBlNv­n–µû™Ä…O§¥ŠÔœ•xÏN;Ù;ÞêæÅÑí–к¹nywº2™ìÌÊ3šW§Zï‘M¤’ë7w^¼”Ô⚬ÒÔôé…¶ìÝ©p}Ç”î¶N<!,u–o™‹SÒ)`ÌEJ› ½ßNgk/‡>Nd´Nûh;suKt”ãÒܺ¼1±ÝÊmw§{rîZïôz1éêT:Ý{» oßJH?m0{7E‘tŠ4æ‚uë£#¿MKžîÏiußN7ÞòY¯Nc èö&Åœ.Õ:^°v&wow«µ…®g§§ë˾ÜníäH§±D?¬7yæböJñîtoªwúòTU<;½Øc[^OÆnÏ73› ßì2m~çÓõÔÅýåcÖ³ÓËõ§9Ò)J±~X²ÝKŸNoæîð,åÝéÁáËç«ÂÊœ«S]"3wÝô±/‚ßæg®ü:-1Ç+Þn¤´›l(ÙÖâçEɧSekâò€Ù£–'»›ÎE³®õ.oìtÞêz¡\épj9uß{€NW5w§s'Óz§oêœKÒÌ0û"é”›]Kn9;Mk—)èº]ìg{é‰Û)©ntúXámK¥®'‹ .ôNdK‡³´Ó»îÒé{¡NÏ/o­î`§™~VxÎ.Ê{3Ÿ¡ÓRÏÝ©V_Oé.§nç3+1*Êùõó½=¬S7ñéæ;eú˜þ:3yÕ=Þ†N¹>î¬eŸšçó ~Åzj—Èš–Sf¯Ï÷nw<ßî•'V˜íÛù®ÏÓÙ5¶Ü9šòz
-Ür²TZ˜Hä¦ ø¼Ÿ·žš’\šfñé|ÿÓ׶!ʼž65ùðnK$”ìõ¼ÛUصO²÷Ó홉ÃËâ±ÏÓîòîöÎTÇzêÔav™»½ùy±çýö®ôp°±Ö›õyºû|´$_,z=Eùrð‰5d)·ÐÏ©˜is.û)~Oš9/ß×|ž®$/ò+—cÏss—ÓZ=çótká!/Ýz?ÝÏ–>¯¦ø”õÔ‰±ƒ“×χâ¼÷ÛWŸßùN†óyúþÑZ|«)^O‘Ʈ“ò¢ÏÛws7&u÷?}ø¸ üÐûiùŠ[\K~«]”º“‡5ï§ÏÌÝëìçíIϧ‰ËãêErâ`Ýcš¶úpÌo'“ø<Ý·¦W¹ÜöáqîŸö1!-ûðÞ™¸›-x=¹ß{\JÎ%V&=ßî=®¦æ6.çÊÖÓµvj¥M¾!Gkµ¦nM&Ü L¼£¼išÉ·tÀº‰;·»ÌN,N.'.îOѸ<›HÞ¤zøím[°rw@ºz“ékk«­7ÍééÏê9–Èì+ÍY&³zÕ#æ0×ç³Ó©L}õ)ÞdÌŒ“oj“ÜìêÑ¢nìL·ì²pmŠGö¿óNDP,‘|š>y³Øµ½S!uëßédé~Ñ·S¦”“rßÞ-(ÆM~ùÁ§Óëû€N7'DßNÑJÚÔ®ÍnyG§ÊÖÔ‡Ô»5:Ýl8Ñ{gïT8¶£÷xãÄ!÷«33SV·óËóŸNÅW¤¶¶w§Âõµo§D¾¼ØgÕÙ)±|:kl‡'¿NËV§T»˜v ˜Yòí”h$¾¢>rîÕ)jã+ þž,mϸf•]
-– ä5üúÅÙ~ðü!O^Ø×)†ZD.×'…oyn”ù3|}t7O›ƒ!ËŸ6/lÄN%r¹û"‹yžý¸ò¥,‹®bȽŖ§g·ÂVNÞ‘’uÌgƵr6Ÿ:.¼Ûæ%Y.Ös½Ðt³žâm¾mïÀ€06àlÜÙâ]gÓl‚÷Fàæ”y®Êâía×k<æho_À?7v§kîŠhAï:V¥q{®Ê”/hüôòî^0h17pý ÝN‚F=C×ß@€Æjå‡sqdA•š!PyûõBÛ)&Ü
-^¶¬iðãc–‚ݯ+è
-šÅ^|tyî®óÊŽ>b#_·ñuúÙ䟷™gvòÚ‹ˆÅ7 ²|—¸÷×㔼‘%Ž€,ç_íR)æXâìN/‚Õî]Ú±x°‡$È—
-t¡Å-_1Ú >? àÆô×R²8< NUC“§*½ëR¥-I€2í=KÇSQqgìXõÕnОTŸ&$Û» +‚ÐÇoª #hcX/»n8›yéxÂ)þ¢x£Ýt¾~žà½
-p Û)¶'î@–î²îÑŸ=[.y2-ãÉ,§˜·7±¨,> :<f9tÁtTƒ=‡.8ƒŽœ©2†ºà :g¶àð9tÁt±Äxrè‚3è\Ù‚CçÐgÐáÙãÈ¡ ΠëË2‡.8ƒŽd Ž!‡.8ƒNÏ°9‡.8ƒNß­9‡.8ƒŽXICäÐ9’ýó€Ú.KÜÛìµëuþXÁ±gSTîG”¸½ú”ôUέ(‚›BXœKTÓÑŒ;"thO/àé(r,yàßѬ,y<YXêϲé4›‹˜„7ï;$¿=¾€Æ‡Ï+g$<s.:|é°õéî !EÎ| qƒ xCO$in ^CÎíYÐFuêƒCAè^RÄ`ûâ{s¦lU¿^œ4§êîušì6P(ˆ·½?¸ÇØ{® GUˆ•šì-$–FLÀ¾î
-d_Lý( ɘ cþ[!C`¬ï0„As:~eÍè¤g?ÀxÙòM]²grEÍ— á~ûb/[¡ÆÞKÿ„pçîºçÚîƒ 7öú\»ÆžÏ\îzrf &úÇð³^­™öÁIx¢\ÿ ¹bz_¶Ü;#þf˜®]øÚG‡ÿ£/2œ^ë ,9/ñ槹l¹V¹çù0SQõHî®ó”vê‘Û^Y±Î+—éŸÕ$Þ8 8$A.œëøgD¹#ˆ†ÖÇ`H!)­±è+þ®›Œº\ÝqHƒAÍŽO.ç9*Ðý1|fœ5$:/Aélyd|†„ÙW~LxòóȘvÑñ’ç5$Ÿ³;ÖÙŽË#ÃO«íà°uŒ“ÆØÝ‘Ý;^7‡‰h6¼ï ä‘!¿ôvwvtÐÐ#ãÝ= -‚G&ì<%LC‹ ì GFêÌ@ òȘgÜ…"&,Ò>(9Ǯà v¤BJœÊòFÏR–í9VaÑ4Q”åöî8r×ÏÙàˆOÛÀ3æjwH§Žh$r60¦7
-h«©ôKQh{wôsÃpÆc‰à“Ã"æÕ…„NÅ",ÝÝ‘c׉ü:·[hê¨;^.PJŽª=OͺöQ¡,é‘e‹QŒ¶Ñ9T>\Ÿ-F2âÆ7†óÇ"äÃE¡±Ñóáh„ª;#nÜùpƒE¨›ç²^õŒ¸qçÃùg Ž3.$jLùpVT§oªÆòá¬x{F\DÙ9Î^Æ™ç±Çm[=)‘7è‚óÅJÁ9&e¥ëáác"û¢$†[ûçC¦×»"!/Zc8†”´âð ·Ã‹í¸ŒçÀVüN9#팚cO[Eè°’›4E<Ÿº½]1ð‘"ž=¶ò0…-hoÕÈH° a"†Íˆ²ù-óã;›º˜”ù.Ãâíu”tÒ`mð=Â)VbÞXN†v‚Ï–‰f½’vY†¾R Û}b+ý²0ø4-ß0klÌy$pàih„ø¥¾y— ËBUi‡Aퟑz9ŽŒÔÛ1f¤BcãËH½ýKF*;)Žê?"ùY ®V†ÊH…vã›þùb!éüGÃŒ##5ühCO?q†,€CSCƒŒ¨6îX†KÉ…¾e¸” ™ˆ¨Ñ¶z2œÏ2-Î-Å¢Dô8Œ’
-é,è‘Sᜫr)eUž
-7’]9N·+}׸Rá¨Wá*Ðþ=Žör¬FW óé ÜjG*kø‰ð˜Wç9žÎ~P^Ý8T306.26ÕŒá:ÌSÇyÈpÈæBß©ιÌD
-ª ]À,¿& ï5Br³kH¾AäKÄTÝtLoó$gCõ#dÊÏ7ÏráSéâ4–ØÈts{Eí~õaõ¬ðÆæs™ËÂTmç´°>z¶Úzœ—àÛæԛ͗®nKUnvm²@…q÷ÚüÉý `ÊÁú‰ÓëLv›º¸>²»¯)`kKù›k¿d·«€ ;¼™õí”\«íÓ©4…—jßù]’a×æý;ÅKµ};ÅKµ_¬\,÷}|©€d·#‘³uêL
-aÝ Ÿ³¦_sU%pÍ]ÿ=#>èéš;3“+袻èI>Å'}Í+‹Óû¢»ÁÒ”<®¹£8Ä5w¾EûEwCä*9½B±D„‹î† öà×Ïç§F>窽;¶<‹õ¥ãHɯ™Eú¾
-ôjÅ–a7D.»«1ß³#ÝÀîN¬õ8 ÊVý¥ô`§bcùàäOýÎ;¢ã"E†Ûd—/*?×æ`^üjô4$ƒ@[K¹#¨¡l>ü–Ì(®?Ì~
-RÝ£f¦\´¢j>Q7®ÆÆuƒáEËJdaíwÞ"]4žù¸<7ª@ZY›ýˆí„lGÊඎ(r4Ô~!í8+¼ˆÇµ@\‰ £íð¢î5×—È0ûš™qvÃo~åuÐù 7ÜíÞêÀî¢kã£ÜpçÊ|ì»ãnˆåãa1ìMycÉK2ï¸*w^Ò`×Ò vÃ]lCr†»á.ê©æ¤2 >6pÀ†¯šM=¸saÝgFO¬-O>ME5Bƒ2ÇX{ûAÒjG<状êÍ
-¹ÂvFH¬5ùigôÄZl%è\¸ÁòÛ/ƒóÛ½’˜b‰Àe¸è± ¯÷kùßûæ°Ì ILÂ2@SX’šÙn;¯/b„ 46°Ùî¿*¯"¹©£$1!ÆJc
-ÌLûðv¥_Óìê…?cV û½
-8¨ˆM1̧QVºTÃ|:ôÎïHŠáµ¥zÝ”7hŽkîêÕóŒ‹xœbùîØxÌK>)Y<ÂÑTД)·:JŽ«û,d¿½¤H7å wÝ£3–\’7®ë¯]ñSYÏA:šµz™LéaÑ«?#ͬó¢iël‚&é­Ë×…O¥ë³Â§¢¶‘Ý’Îvò¹t%ŸÏev1Œó´mžDÃ98Ý»äÌœš:o7nìyâÎÔ´ÿ|8åxéÈNJŽ|¸ùåÊ¡g^,AïaK¬L´üÒðܹŽÔ´jÆ·S¦t–;vØ/®Ô4{–˜»ÓÇ kîU[§fŽ`ŒÞö4ß1au§¦ W¯{Ë>÷°M&}SÓ´Þ#›ÖãǼ2âæW–ßýoœ ¸[O¸¾ñꔜ EüîŸpÈ”Zgg¾ÎìÕ^«~ÖH§¶= gÞñ•§Åƒ›M_ô:./Ô;ÅU©w{Ü7«°4õîÉ7Η"Ö[¶êQãSS¸Ý‹Ô¢:¢õt1¹'yFwK·Ôk¸EgŸxÃKÚy…Mš–øã|ÿùrG3­A¢˜‚n1 …q{HüS’>|‡d³‘£ j°Ps£Ë}3Ka”Ð*×,?’ßÍ,Q=IG³¦Î¶3⧨¡U¾‚VVÚ@¡UYi^š§›F¢§Ö@QZþ±=…¨!›†ä¶ÅFHu ˆÒ2õ±ˆ©€þÞ ¸^â´6èhúí§in¹˜•~ó×8L‰û¢ïöetì(§Æ¹1VÛ¾õ}q »<
-Ž[ýœgª ê_°îõ õóGž
-¿×/RôÈ÷ú­Þê7ø}|Ã$àzÝÇ7òU¶}·úùß›0ؽ~Áád!çóG¾×/xCÅŒSñ^¿`Kpþ1Üëg+âMFCÝë¼OcœÜ2ê½~Á×dy ÷úßê&‘¾ÕϦ[Žt¯ß`kØ{ý„Öw«ßð÷ñ rŠGà}|#æ=Ì›·úœÍ¡ßëçgåÛNý^¿àÀVŠ±Ñïõ >ÏÃy/Ïð÷ú9R®úâ3ÜCÃÞëz¯_ È»@ûe÷úëôÜÇ7Üa:®ˆîÑîõ³·ÒoK~zCÿ½~WñÅ> #u {ý‚Ã0†d÷úù‘½Õo YiÔ#"",7ì^¿`5Ç•Y?ô½~Nl»5†½Ï=ÜŠÿ}|cà›æ­~£ßÇÅ|
-‰¹ò¸×o˜dxç4ê½~}9OŽ[ýÌ^F¼×Ï\†ž·úY|l´{ý‚ba|D¼×/Øl·al¤{ýœãŠ¶*¿×o$»2ò½~Á·úázWΓÿ­~§Íu¯Ÿ‘Yå­ÚrEGº×/8!ÖW"x¯_pú®Êqœdµx«ŸÓ£8ü½~Cê0Þë|…^Ì|hcA÷úE·í^¿`á`xGÝâaOH÷éh{BÀ©\ð9ÂÔ¦ÃÌòÓê[ÆåÚ Üà ¼·Ê•ÜN-§kƱì“ïöbÂ˜Í AHš€‘¥8<W.[3Â&’7©ÞÄbfv?Íï©ÓF•½Ž¦qìÄÜ‹vœYL,Íð—ûbV”æ;¯Û™V¯<»USÔ¹õ›éO“ÛÝÔD¶t’™¼¾—–b‰éÓ‹V6ñÖ<Ý›­½¶¥Ó½ù­º÷²ñöxðº[;UÕƒÛ­‹S¶½û|úz\oœofö{›©äÃC~>õùZü|ø~4¿üÜžÿ´ÑÕ§ÉYMã§'&[µV&ÁL¿.Ç©O{•‹yu~?¹ö1ý¾ÇTÍ‚¦­/MÌÝmîOp¹ÃÆürEØ`JÌúS:»,1›S­fóðàUÓêë‹Zïum¶3»pð„€Oè™–kÅùUåà'dsE…ëc¦x!?h—)&sXódHú¼<Ôòš¶Öé>•²{¥Õìjź’¤j¦fs'²ªb Y V8}=ŸþÐ6šÒÁÄåÁî<ÕÒÞczzn&qu4­,7r‰£ÓÍÙÇÓíUAÙ—æÍ{ ašn‹‹òÞÌg’e3_êL–¶'´ú]8O@´jNe+o_>‰†Ðˆ:¡û[shö[e-Lt’—Å×ãÕë×óÕÉfõ~3µµÜ8YÑ.w=_¤Ë•ì–¬m^&ñ[r¾°è•’[ÛÛlñ~i%_/gXDy³XyûP™ÌÕÛ"÷°U]ÀõRþXDÙ=‘‹ø6ÂÕÖ¿~>™&Í{j–˜8LFRä'àa£?—æÉOX¤'ðsc‘þ¼ëÔÈ7Ü­^Yy,=¤nv™çû—å½ Æ½kèÓ|4ÌÙäOæƒûƒs¶j>Hê´=zY}61¶‹Óۯƃƒ”ÝÜ›,›eó¶Ê›÷éŠù`‘<ˆ%ôGí%K3:«LDzg·¤=r´í§û„Ùöñ<­òÔfñôãE“L $·°,Mª
-Ã5NÅ5u¿±Ì\L;#î€RFI,Ç~«TçèÐbÆ·E¯öŒÞ [‹lfª³2¾¬IkçÂAV¾«&é*I}:Ðé÷ú†Ë¾·ö:ÙÝËËGB\0/H^\ªW}3@¿´ WØZE ï’R7Wø´ÍR²/TEý[ãœÓ¿õnîÉ抩òƒþ{ Æ.EÚÄç lñSšäžp 0ÉÉÛ½½íÇÔ•ImŸ8Ûh—«ŸÍÂ|ñâj ayrÀòx9‘G~±ŒGŸäé—¹ìQåy¯°»=qj¹`ã Æ¼é{›±ùÕ &›ã½íšÑéÞÎ@Öù w.Ñò3Ë7¢þ­P®›5y½ÞÅ{Ö=šÃüÙ]©Ð˜¬dOÎng‹O‹—–Ü'Z÷ÃXŒ Æ}”7¥ê’} ¹_¦æS{­³üùÎË5s=ó~Ä\¼^Ò¤9µ’¨m”Y½N€5e +œ3Öçi[¯ü~^k°|„$“é&qº¥"·¯À·­YŒàüÀC ÑU¼•" ]{ó–-(½n¥uŽ·1q§³µ|z$¼pw½•íLýª›¦Q_Xš'z ?½\Üñ²A/=Ø¥‹™ž=¨{’Õs=Z|MN™ä~ÇÎee`Âk«óÆwé²G~ˆ°ìO’/¶òoÙ*—ût¾®³ÿµ=†Ÿv‘hvY·ÜÌ}H€ô—Cd\s&|˜›%sÉd6ó ´¬<¹Ý†ŸÛ´
-¨±×ŸsÉf‰ÝZ,–ÈZ-ÛZ?á#ècT‡Ã‰°4J—«‘Ü#Ï¥®x™»>È.´™låø KÖçÅìBk#EN¢ÈnI¹Çý˼ZT* Eí~é~ùÓ^sm³qqu›Ýo˜L§ýJÈÂAšDˆ’+vÞõ£PŸÄzºDæs
-¯HSí|>÷6Û¼-¤åÙÎrMÕÞ²§½‰Wùcëd¯X.Ϧ‹Ÿª“¯„ˆ`•U­»¼KáqujÞÂltkïtiïdc©X«çÞ’ÉãâÖQÝøÈf²…í÷z–!›ÓõM¡PŸtQó<Àõ29¿Ö›™°zÖ90ÀVÏ˻ӅÛÂææê[ö¬ÀD7–
-Ñ#P·4Õ)Î×?½fÏ..5¯žc _TcÏ(IìöP=_r…tzå²ôнƒõ²±¼óv2Ò×—×f‚§û ±¹—NŸÙˆ nÖ8!D?®b¿‰W#/Ú¤/Ó)4s‡GÀÖEñ1{¶ü9Yؾ‘v çääÆÊz)m®ÅÂzɪ\;˜+ºæÙŠOßQ±–×M [Ùw`ú§B0èC³
-ú脆r
-¨'èïËYsÄ:n
-š„ü9¡ƒÔ­-‚¯Ò1È"…—©Szh}ãüÀ>ÅäúʾÊéZ½Îhãr®l¬ixÔ¢ÁóÉõ›†,`ù¤èðòá›~ ×c­UInNÂòIÍ5pKÇ=2) cW­L‘^¤å®oÌuõš|š>¹e˓¦u‹¶m¢àÞBÀ²Â½›HødG‚ë&§7¥m aƒ·¡ ±2ñh @ÈX(ÀѼÙcá0q1 ëKoM s.,š(Ð;ÕïKZå
-ô¦‚°Ú5¨¿7a!aBèÜÌD¡ƒõ¥£®¹œKíšHغKO~>7^ô¥̧Ÿ5°HÂÛ½)MâÇ|›ø\KFh" rU:4K Û½æÙXÁëAŸ—¾&H†ú`ÐìZ£ßUØD>½ ò –èk‚$qÆùRÆERzüXd¢z¾ß`§J»]É.̾&‡\ÝzL3åÕ@,½ µ;7‡ÁD–yÏ&"λ°7¿àÛ€ž—äE_çìbØl”W¬ø›«Ø=Šì½<QarN&¸²ö›hç™PT‰¼ÅémVç–ÉÍ­œÑ„45w£ñ¶š›¹”^¯ô™µê%„ƒÂ£½ÞÞ¤'¸h,ªÍóä°\Ç ±Íû´7‰D¥óÍÁŸ@, £½4`ÖÀôFf$0¶K!\'”ƶ¤=v´1¬Ÿp¡Y[Ë°f[B7}¾bkâé>…ëØ%²{O/óó£¡Í.Xy(LT¦åŨá-‘ÙÊâjzÆ… u™á$21¹D6I½~øšËfçßd¼TòúÞHšÚo’„XSvÌü®G0È$qfAOŠ£‰H˜Çg$"éiJbzÖøÆ&‰É¥'þˆò;¤‰8âêBŒfg‚{£AA>m¼XʘYMöH§frdÊþ@íšÉŠ»öDH<Ì€Ð-ÚÝËfRÙnÆþ ·=Yg¶ž…w`ÏñÎGs<ɼس<!™ÉŒi=ÉrzƒæÚá:G‚<`i
-É6ZímÃ@ÌëYR@‹Kæ ‡ û䜒Òåq†vPYßF´ëÍVŽÏI³xÏçÊb{oyMÐ,¿Ô¢€DsfC —ZßX¶yá²÷ŒsNó'gå¸ÔVi%¸G.;Ç{«f;9±{4]Û¼û¤¼dO{Óõâ§êƒ°¥rw½û =sìúldƒ”Î{VåºlfÈ^.ê©•Çyd—ƒÄ/¡í§;´/Y#ï’$ö·ðo~ôœD®¸üŽ¹×Ÿô*d’?™É¶ŸókϪäîÍ´ÅO¼ýAámZO}û,Z°|’JeÕ²þ¸YïÒöÜ7~&uˆh½ƒ?×—è2¸cÍo¶lP~fÿEÀ2Ác4ǥNjë|a^I•JÅý ÅšSàXµœ3“‹âdç]g
-l»û¯üÆq2©#¡¼~è@ÂRg”X\/äv®á7àPh3Á{Ћs+Ö‰ýÚ:n²wêEJ è»û#4aí'7Kø7Q¼]›‹º"<(OnÎ;w‘ÃN¡ x®ÊYkSyH0è-æHFâ€`ÐÓGÙÝŸ@—cHÚ©ÒXÛcQWwÒÎ#`¶³“vº†Ã$íTioàŽ`,&,ºt5á7[ô¬ù¤E—ÃE*$íTÙOØÆÚÃE—Se’Ü`§Óe
-¾Ý°º“èéž[S·ÁÌ<•yã[U ‰%ëå„´¸HÎ ‡ŸWýí·ÆøvoQÛ7»¾·¦æ­ÊÛÜOðúY©û Ãõ÷.9òëj÷©çü«T:Ì5”)Åæ ¡‘³³7yëðMú‡Íi*ÎdºW–󧢓J÷žJÞd7ð Ñ2k|«ZÓVtÏN÷³Ð7±{QšK­-Ë‹“û¥Çý„jΩµŸó»³M{Î6Íþ½µØ2,¡m–}(6«ö»X"%§µn¯ć\í¥ÞÜ+©i16N? |ð¯¬ÆYN‰s¢?D,Ý{Š%;ß½§¦â{ÍXâ!“Õº…z¥[o5ËÚ—ø]íïoâKq«îr< £a 6<Jáv!©w€{‡øRòôbóáìµÞ)6j8ÎT<sÚÕêÍ—xò‡÷Fª-âŸfù½Fßö~þ]¹ÑÓ+°ñÌv³ë|ÜýÒ֟¸µ2ï²U§òZoTµZS¯ã˜5àN«ZoÃKÕV…+dÄÉ[^n9þ“˜[^dn9üÍÊPÎßr üDzúwî°n• öï¬õ]âmï„ùŒÁ†nìX±U,w¡ó§^·Ö¡UáQ?–ú§¾Þ|ëTÊíÚÒw5­-‡c’I Jškª,1ßÌýðôÃŒ¯w–Œšá¿v»í¥Læûï¿O/¥[ÚK«tÚåJ­“ iì7ˆ7°~è0ˆ%2:ŒÒVO«Ôž#µt³ÖÍÎ
-æÃE&]íV¿U¬X0ûaE«>Dßó„2XUU3 —á¸Eha±ó¥Ù-ÿ°ØìL}«˜ pú’Æw/à c&ãÿîof24?˜+•È W´Z¹[ÿ®Vi½¿·šÊ¾Ý©FÈü ®F‡ºÝÓÔj%S£zC'æÙÌ·
-wµâ(ð©Û§
-‘rø/ÆijðßÕ÷±^ì<TùzøÏ?<•;5øR|ø¶u0Õ
-»ª~W¯}C9oÖ1Òì×
-ŸZZµ¦µ@"×»_¢Ž:ɦ™àº¿AÊuAÔO5´B¥Õhi‘ž’È¿oh¦~Ûå—Ú€
-
-¹Q{îF‡9ýíÒvL`kõ—×àþm€Z)ì§V·;€ÿ­€Û€)€™_o‚z³ø}½Ú} ¼Êü(oNÈÂQðZˆðá·háHˆ®Öq,£þÖ X­Ó+E·Ûxî·ô`»M¯ô^þ¡þ^ÿU-ºRó[`°÷ööòÂø†áéfã™\«Õ Oó¸ÝP«æ¾l¿·[Z×Ð6‰Z'Sñ«ËX>l¼câ‡1&­rªÌÊq&­ÈªÌ)øEeXU‚/²ªªŠH¢˜øU9Fƒ8üñ~ìÀ—ÏPô}œeâûñ›;&^E'øIŒ™´Ä³J\à¹4'prü=Æ jšSE•”‰</Ç9AIó"#‘Ie(‘Ó¬¢ŠVIÞÒ¼À)öZlZUJô/¯Â`¬Ã€](Hñ|Œ”12)b%N"•$FH £")T‘ œšVeYÔ_ã$hËd0ƒ%ŒÀ“Qfy(PÒ
-'Ó×xZÄ×d¥Š¯)X—ÒŒ$CwœœQ±•À
-°)>Íñ‚`•í‘2†—Xû‹\Z$™–°ŒDJdF%²$SÜÁÉ OG€a&X"¨2mHàyúšÈpô=Ž ¿'j Ì*Ãó´qg†Ò‚¨ˆöh›xý=ZÆÀè$‘#C·• 
-e¥´¨ÿ–+Ã<³tT
-R6§(¡bIá(¡±²ÊQêçEÙ*AêWÒ,«SŸ^ È‘•è{ +ÂLÀjc
-#ÓZ,#Šz ÇÑX‰VI…¼Ç3¬â¬%²^Ki ¥(Q‘h2Ï tTP–(¯Žcé{ŠL¨!«MdÓ¬ªRÂXÀê)ã$–R¨¬
-Ø r2a¬ÄP`œ &ïÁtöbϱ°½¸v¹ûŠÓùmï ¹çe9 ZÍf­Òmi‹•žö]¹ÛÓ"D¶|Ë<ž
-ö¯ÙŠx“{¤ˆv¯òÀÄh ‘J†‡µJ©ðaYF0ÚA©J$„Ê  ‚EáéˆX^–- Ń\»Ì‚¦X˜Aí² Ë`¶7¡&-`dZ
-1"½–ÌŠ¤p¨—(<GJ@qÑ’2¢ïA‹•”¨´
-+)6*ƒQæºÌ&ê̼ƒ>Agq)ØÞÒ"ËËöÆm%}še¸XxIÖÛ¢e@:"ƒÜR€ÛŠáüx?·Î{pðTåwªÁïTÕ`®X¤
-YF¤Ë‡eÀ€/@‰ÄëJ”Z,>Re«¤BÞãÕU‹Ú•X"G&%ŒY¢xDSDæ8Úº:‹¬U°ð°°dÎ,À΀sŒ½K•, ¡U ¢øTHWFr™Ç%n•¡|"j”ˆ,
-Y`팀–EóC7‡‰(‡¶0Š‘jÿ § µsÕáeÍp†ÑE¥QœN…&D4ŠŒ2^åA`ëºÇ¡àRá=^Õíx‰ŠpØ'‡êêCŠ (1Å +‚î@ê(º!B‰*9+²È<°Dß–Òª„™Š  Ž†"ˆ+KÈP°Ô ˆ°LA1e´Ž%t¦°DhKƒso”TÈ{¢È¹jQ#ûcô– c½AÀþ
-HVd˜€;†Î H •ðeFW8  ˜¢pZ•$¨„ºŠh2¡Œl¼t(Š™PwÙ™dýMžú °-Q"J(àLä82íŠ Êºdfi[bH/“PC„Iuù-¡â
-²H±É(h›ÏådI°J*„S³ÇÚk gý*‘ĸƒž¨ÊDÈ mJ@'*‹sÀÓ:² Ø @cW8ò’Y$ ÿÚÓKXZ¢JúkÔªA¼I*•TNy–]‰‰t¶ËÐe@Ô¼wÂ`¨ÇÏ(#¬ŠG¥çáU[ ©Nm•‰0©Èx¡uŠ?’J)
-QFa”Š¤ N2ËtäDž2ž(ÉÀˉøƒÁ©Š¤— K‰öÓÀ°°•˜!œçî™É{Ìê¼sáÑéTíå˜ß©½¿S{ýÕ^Ü@âeО@ÎP‡‹¢â6/ÃB)h–í‘2žgX« KFÖý@2)‘¨ä .…ZÂXF´APC$ Ís(aF÷!‹èó‘A((*õ„‰Kô<RF¶/° ¸)!+›7Lx,‘8j…†¾Gx±É xÃ3¤;
-°D&2c2ÑH‘¶X¦H©%©€¢¢G K!%ªñ(Õõ«‰m]$\
-bÕJ(1\ÄÇ„ï±T 7Lî8/©ºŠ…nEⶑ$£!½X®¤ïaXµDäN2ÝÂaù@‰¤ë{ /ö
-݉ dYžê±¼ˆj‰ˆ<Åèû:­`ÞDBV°a ¨Åƒ„“©Œ=%¢¨£Œ±ûE0
-è¾Oå6/±†ú2SFüJ"ª‰¬U‚à!åìµ
-±É‰BT²m@ÊŒÎÇr†z$%úˆômB^q)£a‡ª+AŠ,QaCÕ#hKˆ¸C ÌV˜q Ïè&ŽRáQ¡uNAg–œY‚À±” ¬Z€&¢¡æ 0w°H @¤Æ âR¢z.–IèCÁ˜#Z€Êµb–TÈkZ†ŽZ¬Z)‘hƒ´K
-t/‹ˆšƒ¨7…Æ.–}K,vqÂŽ¾gh´"êõœJYgn” -€|Ò”ˆ ;(,.j(Q•#% m)IJî‚D›R ÖZvDMFËh f ¥õV-˜)F”$Ò'¢óLʉÂ-‘á<á€Å'ÚW8^…1ÔŽª½¶ÝôBKÔ(ÃmQ@1‚l•ÛÃ5%<!|´N$`(Ã/Ml.R„Û€Ä{ Ë™TAß½ÅoÒÑ|‰œš¢
-î‹ë~wICVé
-°qi7Ï{ðü=C=þ¢È25_À&VQ@'ëš>(?,!
-Å<ÙÂC7Gd+§ºR¨â1Fí Þ‡ÄB\lØ8'É`¤(Ô‡¥
-:iqº+‚e¨ºƒôgú IëøKìsN6vÞ‘$‰KX $î
-M#ЀC§...Ž KX²…Ç)z Áþ”— uˆƒNÆQê&NŒKÐÃoQW÷yܸûÿÚ¹ºÞ¶m(ú üô &”¤(‰zŒƒn(à­C×}P(±ftpìÁñ†íßïžÃK‰Zê&i_Š6AÄÇ"E]òò~,¡€\)c XÞZb
-|Õ·k̺{ô¬§¿2Ç|èFɳw ¾Îõž¨Ït ¾E¡ƒøv¹2Y~ª#ÍΡxئÌÉ߈f:MV➸”¦!­ÛF»=Çà¤ôÎ)¤¢›`b.†!%hmNìIäÐi³š ¶24kÄX°H=qjÇ9&"V˜¥´ð$Y©‚s¼ÈG®îø´¶C9Ûe¬Âë…xŸâíÕ™L¬X_T(]-#‘éJÄ·Ñw6ÒÏY¦ BºU¥… ‡'˜˜¦dÒí°µ\‹]—«pãZ£jÔ^€Ô•ºåuÍ1§9WpWs¬«}[ڮ֧׾¬‰™ *€ö¥üw×ÙZ»òÌ÷UJ¤ë’LMp Vy ‘®²a¡+a+b¾QZblÙ‚é´%Øû@lUétÕqæÅë:å 6ð9‰$¢7b­‰TAY†U,ôeBKî&{gµ\“3!>V;c»ˆ‘'UU:öCZ˜Ã9$áÊD$&$JT‹VŠ©H»Öf-ƒSNAê<4$š0ÝÀã[åäÀÅVé"•ÍLüqO„q­¦c±i¾Fu®áâÿ>ætÄ…šdÌy"¢ˆëO^¯
-)c#Á¢Â 11“¢ºKl"¿Í0>t7Ž•Â¤µ&{!n˱•`‘’q2¾xÀzq6]3 ½w0bäaFZü„¹
-0000000016 00000 n
-0000000144 00000 n
-0000014164 00000 n
-0000000000 00000 f
-0000019272 00000 n
-0000052841 00000 n
-0000014215 00000 n
-0000014580 00000 n
-0000019571 00000 n
-0000019458 00000 n
-0000018892 00000 n
-0000018080 00000 n
-0000018331 00000 n
-0000018379 00000 n
-0000019035 00000 n
-0000019062 00000 n
-0000019157 00000 n
-0000019342 00000 n
-0000019373 00000 n
-0000019644 00000 n
-0000019818 00000 n
-0000020874 00000 n
-0000026543 00000 n
-0000052864 00000 n
-trailer <</Size 25/Root 1 0 R/Info 24 0 R/ID[<628E0D96B8764CF1B62B34BF8A303D42><7E679379DE5E47D8B7B5A8C6AA8AD1BC>]>> startxref 53040 %%EOF \ No newline at end of file
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.png b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.png
deleted file mode 100644
index 300bb1ca537..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.svg b/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.svg
deleted file mode 100644
index 302f718356c..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/mroonga-logo.svg
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="247.32675"
- height="73.113281"
- id="svg4429"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 7">
- <defs
- id="defs4431">
- <linearGradient
- gradientTransform="translate(405.03952,235.75369)"
- id="SVGID_2_"
- gradientUnits="userSpaceOnUse"
- x1="223.6167"
- y1="166.2236"
- x2="223.6167"
- y2="228.2177">
- <stop
- offset="0"
- style="stop-color:#F8BB5E"
- id="stop3925" />
- <stop
- offset="1"
- style="stop-color:#FF931E"
- id="stop3927" />
- </linearGradient>
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="-17.227243"
- inkscape:cy="76.496767"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5.1"
- fit-margin-right="5"
- fit-margin-bottom="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2109"
- inkscape:window-y="329"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4434">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-519.14376,-395.80554)">
- <g
- id="g4460">
- <path
- id="path3916"
- d="m 595.93852,420.61969 c -1.336,-0.291 -2.281,-0.448 -3.442,-0.448 -2.847,0 -5.33,0.831 -7.391,2.466 -0.091,0.062 -0.192,0.14 -0.303,0.247 -0.231,0.196 -0.452,0.406 -0.668,0.621 -1.478,1.313 -2.76,1.951 -2.76,-1.236 v -0.666 c 0,-0.405 -0.327,-0.732 -0.732,-0.732 h -2.101 c -0.198,0 -0.388,0.08 -0.525,0.223 -0.139,0.142 -0.212,0.334 -0.206,0.532 0.105,3.332 0.215,6.777 0.215,9.621 v 18.749 c 0,0.405 0.328,0.732 0.732,0.732 h 2.209 c 0.404,0 0.732,-0.327 0.732,-0.732 v -9.913 c 0,-1.37 0.107,-3.805 0.309,-4.813 1.569,-7.797 4.982,-11.588 10.435,-11.588 0.979,0 1.881,0.164 2.874,0.362 0.048,0.01 0.096,0.015 0.144,0.015 0.148,0 0.294,-0.045 0.417,-0.131 0.163,-0.112 0.273,-0.288 0.306,-0.484 l 0.323,-1.994 c 0.062,-0.383 -0.187,-0.749 -0.568,-0.831 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3918"
- d="m 684.98552,422.21169 c -2.512,-1.776 -5.292,-2.04 -6.726,-2.04 -2.91,0 -5.648,0.912 -7.822,2.495 -0.005,0.003 -0.01,0.004 -0.014,0.008 -1.004,0.649 -2.627,0.91 -2.618,-0.625 l 0,-0.022 c 0.002,-0.105 -0.003,-0.197 -0.013,-0.276 l -0.008,-0.182 c -0.019,-0.391 -0.34,-0.698 -0.731,-0.698 h -2.102 c -0.203,0 -0.396,0.083 -0.535,0.231 -0.138,0.148 -0.209,0.347 -0.195,0.55 0.152,2.28 0.214,4.171 0.214,6.524 v 21.82 c 0,0.405 0.328,0.732 0.731,0.732 h 2.209 c 0.404,0 0.732,-0.327 0.732,-0.732 v -17.51 c 0,-0.813 0.253,-1.762 0.49,-2.378 0.004,-0.009 0.006,-0.016 0.01,-0.024 1.043,-3.043 4.224,-6.121 8.417,-6.475 3.236,0.002 8.327,2.358 9.024,8.226 0.016,0.15 0.03,0.299 0.042,0.443 0.004,0.049 0.008,0.099 0.011,0.149 0.005,0.07 0.009,0.14 0.014,0.208 0.009,0.192 0.015,0.386 0.015,0.583 0,0.335 0.006,0.637 0.017,0.91 v 15.868 c 0,0.405 0.328,0.732 0.733,0.732 h 2.208 c 0.404,0 0.732,-0.327 0.732,-0.732 v -16.271 c 0,-5.372 -1.627,-9.246 -4.835,-11.514 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3920"
- d="m 761.20952,447.55369 c -0.133,-0.113 -0.301,-0.173 -0.473,-0.173 -0.04,0 -0.08,0.003 -0.12,0.01 -0.587,0.098 -0.965,0.098 -1.442,0.098 -1.147,0 -2.177,-0.336 -2.177,-4.387 v -9.913 c 0,-2.343 -0.179,-5.368 -1.583,-7.971 -1.822,-3.384 -5.181,-5.1 -9.978,-5.1 -2.475,0 -6.217,0.516 -9.99,2.975 -0.315,0.205 -0.422,0.615 -0.25,0.949 l 0.861,1.669 c 0.098,0.189 0.272,0.326 0.478,0.376 0.058,0.015 0.116,0.021 0.173,0.021 0.151,0 0.299,-0.046 0.424,-0.135 2.314,-1.639 5.186,-2.506 8.305,-2.506 3.995,0 6.004,1.854 7,3.94 v 0 c 1.004,2.22 -0.561,4.403 -2.285,4.584 -0.085,0.004 -0.17,0.008 -0.254,0.013 -0.014,-0.001 -0.028,10e-4 -0.042,0 -0.055,-0.001 -0.101,10e-4 -0.143,0.009 -10.978,0.626 -16.538,4.313 -16.538,10.98 0,2.028 0.803,4.057 2.202,5.568 1.233,1.334 3.56,2.922 7.635,2.922 3.471,0 6.271,-1.111 8.325,-2.472 0.061,-0.032 0.13,-0.077 0.211,-0.141 0.023,-0.018 0.042,-0.031 0.064,-0.048 0.128,-0.089 0.256,-0.177 0.378,-0.268 1.275,-0.824 1.969,-0.351 2.623,0.503 0.002,0.003 0.006,0.005 0.008,0.008 0.84,1.141 2.161,1.717 3.962,1.717 0.846,0 1.591,-0.093 2.344,-0.293 0.32,-0.085 0.543,-0.375 0.543,-0.708 v -1.669 c -0.002,-0.214 -0.097,-0.419 -0.261,-0.558 z m -18.252,0.527 c -3.042,0 -6.111,-1.722 -6.111,-5.572 0,-4.862 5.936,-6.58 12.167,-7.043 2.32,-0.043 4.097,2.161 4.311,4.575 v 0.989 c -0.062,0.647 -0.246,1.289 -0.568,1.888 -0.162,0.265 -0.356,0.557 -0.589,0.865 -0.04,0.048 -0.075,0.093 -0.103,0.133 -1.442,1.847 -4.223,4.165 -9.107,4.165 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3922"
- d="m 725.07752,420.87269 h -2.047 c -0.393,0 -0.716,0.31 -0.731,0.703 -0.066,1.619 -0.892,1.836 -2.703,0.765 -0.009,-0.005 -0.018,-0.013 -0.027,-0.02 -0.178,-0.118 -0.362,-0.23 -0.546,-0.337 -0.011,-0.008 -0.02,-0.014 -0.031,-0.021 -0.087,-0.057 -0.168,-0.103 -0.244,-0.139 -1.982,-1.096 -4.307,-1.65 -6.924,-1.65 -3.739,0 -7.429,1.548 -10.122,4.249 -2.082,2.087 -4.564,5.827 -4.564,11.784 0,3.818 1.346,7.413 3.792,10.121 2.595,2.875 6.234,4.458 10.248,4.458 3.111,0 5.514,-0.819 7.335,-1.896 0.004,-0.002 0.007,-0.003 0.012,-0.005 1.954,-0.875 3.603,-2.184 3.135,2.233 -0.875,5.677 -4.519,8.764 -10.482,8.764 -4.175,0 -7.31,-1.405 -9.204,-2.584 -0.118,-0.073 -0.251,-0.109 -0.387,-0.109 -0.06,0 -0.122,0.006 -0.182,0.023 -0.193,0.049 -0.358,0.176 -0.456,0.35 l -0.97,1.724 c -0.189,0.336 -0.085,0.76 0.237,0.972 2.853,1.862 6.91,2.974 10.854,2.974 2.689,0 9.293,-0.625 12.493,-6.412 1.385,-2.481 2.031,-5.968 2.031,-10.969 v -17.456 c 0,-2.474 0.07,-4.678 0.214,-6.738 0.014,-0.203 -0.057,-0.401 -0.195,-0.55 -0.139,-0.151 -0.332,-0.234 -0.536,-0.234 z m -16.892,26.027 c -0.605,-0.24 -7.609,-3.216 -7.013,-11.812 0.551,-7.939 5.716,-10.454 6.517,-10.798 1.278,-0.5 2.701,-0.768 4.242,-0.768 1.665,0 3.113,0.327 4.354,0.873 6.845,3.871 7.696,16.452 0.884,21.467 -1.592,1 -3.436,1.572 -5.345,1.572 -1.343,0 -2.553,-0.192 -3.639,-0.534 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3929"
- d="m 626.30252,406.64669 c -2.337,2.337 -4.109,5.343 -5.032,8.655 -6.076,-0.094 -12.171,2.272 -17.007,7.11 -8.142,8.141 -10.674,22.912 0.667,34.253 9.542,9.543 23.793,9.687 33.145,0.334 4.421,-4.424 7.236,-10.507 7.297,-16.941 3.14,-0.836 6.125,-2.507 8.67,-5.049 6.956,-6.959 9.086,-18.919 -0.311,-28.318 -7.833,-7.831 -19.626,-7.848 -27.429,-0.044 z m 25.622,20.423 c -1.335,1.336 -3.045,2.324 -4.932,2.862 -3.027,0.868 -4.657,0.778 -5.698,2.515 -1.041,1.736 -0.926,1.941 -0.88,5.194 0.056,3.689 -1.333,7.514 -4.813,10.996 -5.32,5.318 -15.14,6.504 -22.366,-0.722 -5.693,-5.695 -8.365,-15.278 -0.778,-22.865 2.816,-2.813 6.866,-4.477 11.124,-4.401 2.961,0.051 3.306,0.16 5.212,-0.704 1.909,-0.87 1.082,-2.8 2.222,-6.205 0.556,-1.66 1.545,-3.295 3.092,-4.844 4.126,-4.126 11.721,-5.072 17.285,0.49 4.533,4.535 6.455,11.76 0.532,17.684 z"
- inkscape:connector-curvature="0"
- style="fill:url(#SVGID_2_)" />
- <path
- id="path3965"
- d="m 557.08552,420.17169 c -3.604,0 -5.78,1.055 -7.803,2.675 0,10e-4 -10e-4,10e-4 -10e-4,0.002 -2.14,1.482 -3.267,1.373 -5.033,0.007 -0.008,-0.007 -0.015,-0.009 -0.023,-0.015 -1.786,-1.704 -4.111,-2.669 -6.696,-2.669 -2.797,0 -5.133,0.737 -7.113,2.275 -0.042,0.029 -0.085,0.062 -0.129,0.102 -0.878,0.785 -2.285,1.01 -2.444,-0.238 l -0.015,-0.316 c 0,-0.087 -0.002,-0.167 -0.011,-0.234 l -0.009,-0.19 c -0.019,-0.391 -0.341,-0.697 -0.732,-0.697 h -2.1 c -0.204,0 -0.397,0.083 -0.536,0.232 -0.139,0.149 -0.209,0.347 -0.195,0.55 0.148,2.118 0.214,4.13 0.214,6.523 v 21.82 c 0,0.405 0.328,0.732 0.732,0.732 h 2.209 c 0.404,0 0.732,-0.327 0.732,-0.732 v -17.457 c 0,-1.086 0.264,-1.975 0.486,-2.529 1.183,-3.106 4.304,-6.436 8.371,-6.436 4.432,0 7.296,3.476 7.296,8.857 v 17.564 c 0,0.405 0.328,0.732 0.732,0.732 h 2.21 c 0.404,0 0.732,-0.327 0.732,-0.732 v -18.317 c 0,-1.093 0.288,-1.956 0.54,-2.585 1.117,-2.651 4.065,-5.519 7.887,-5.519 4.983,0 7.727,3.681 7.727,10.366 v 16.055 c 0,0.405 0.328,0.732 0.732,0.732 h 2.209 c 0.403,0 0.731,-0.327 0.731,-0.732 v -16.001 c 0,-12.828 -8.189,-13.825 -10.7,-13.825 z"
- inkscape:connector-curvature="0" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.png
deleted file mode 100644
index 200af027c95..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.svg
deleted file mode 100644
index bd9b8f5de35..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-foreground-white.svg
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="60.000706"
- height="60.001022"
- id="svg5730"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 53">
- <defs
- id="defs5732">
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_11_"
- id="linearGradient5525"
- gradientUnits="userSpaceOnUse"
- x1="630.15039"
- y1="437.05859"
- x2="630.15039"
- y2="497.05859" />
- <linearGradient
- id="SVGID_11_"
- gradientUnits="userSpaceOnUse"
- x1="630.15039"
- y1="437.05859"
- x2="630.15039"
- y2="497.05859">
- <stop
- offset="0"
- style="stop-color:#8CC84B"
- id="stop4064" />
- <stop
- offset="1"
- style="stop-color:#6BA025"
- id="stop4066" />
- </linearGradient>
- <linearGradient
- y2="497.05859"
- x2="630.15039"
- y1="437.05859"
- x1="630.15039"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5728"
- xlink:href="#SVGID_11_"
- inkscape:collect="always" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="153.57178"
- inkscape:cy="-47.142348"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="1928"
- inkscape:window-y="52"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5735">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-221.42822,-405.21881)">
- <polygon
- transform="translate(-378.72178,-31.839165)"
- points="600.15,437.059 600.15,497.059 626.012,497.059 660.15,497.059 660.15,462.92 660.15,437.059 "
- id="polygon4068"
- style="fill:url(#linearGradient5728)" />
- <path
- d="m 274.96222,442.10183 c 7.502,-7.505 9.8,-20.401 -0.335,-30.538 -4.224,-4.222 -9.514,-6.337 -14.8,-6.345 h -0.005 c -5.286,-0.007 -10.567,2.093 -14.774,6.299 -2.522,2.52 -4.434,5.76 -5.428,9.33 -6.49,-0.099 -13.001,2.411 -18.191,7.53 v 36.479 c 0.114,0.121 0.227,0.242 0.344,0.361 h 25.518 11.027 c 4.434,-4.717 7.233,-11.018 7.295,-17.672 3.385,-0.898 6.606,-2.7 9.349,-5.444 z m -13.748,-2.759 c -1.121,1.873 -0.997,2.089 -0.949,5.602 0.062,3.979 -1.437,8.102 -5.189,11.854 -5.736,5.737 -16.326,7.017 -24.119,-0.776 -6.139,-6.14 -9.021,-16.475 -0.84,-24.658 3.038,-3.034 7.406,-4.827 11.998,-4.745 3.193,0.055 3.564,0.174 5.621,-0.76 2.058,-0.938 1.166,-3.019 2.396,-6.692 0.6,-1.792 1.666,-3.551 3.332,-5.224 4.451,-4.448 12.643,-5.469 18.643,0.531 4.887,4.887 6.96,12.677 0.572,19.065 -1.441,1.444 -3.284,2.509 -5.319,3.087 -3.266,0.937 -5.023,0.838 -6.146,2.716 z"
- id="path4111"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.png b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.png
deleted file mode 100644
index 19af1caf322..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.svg b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.svg
deleted file mode 100644
index fa72e426df5..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon-full-size.svg
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="199.804"
- height="200.85701"
- id="svg4522"
- version="1.1"
- inkscape:version="0.48.3.1 r9886"
- sodipodi:docname="nroonga-icon-full-size.svg"
- inkscape:export-filename="nroonga-icon-full-size.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <defs
- id="defs4524">
- <linearGradient
- gradientTransform="translate(496.09341,431.09054)"
- id="SVGID_3_"
- gradientUnits="userSpaceOnUse"
- x1="223.6167"
- y1="254.24409"
- x2="223.6167"
- y2="319.0174">
- <stop
- offset="0"
- style="stop-color:#8CC84B"
- id="stop3942" />
- <stop
- offset="1"
- style="stop-color:#6BA025"
- id="stop3944" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_3_"
- id="linearGradient4561"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(496.09341,431.09054)"
- x1="223.6167"
- y1="254.24409"
- x2="223.6167"
- y2="319.0174" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_3_"
- id="linearGradient3123"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(3.0240925,0,0,3.0240925,43.472464,-149.79555)"
- x1="223.6167"
- y1="254.24409"
- x2="223.6167"
- y2="319.0174" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.9899495"
- inkscape:cx="143.90298"
- inkscape:cy="78.573219"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-right="5"
- fit-margin-bottom="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2200"
- inkscape:window-y="217"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4527">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-619.80813,-617.64797)">
- <path
- style="fill:url(#linearGradient3123)"
- inkscape:connector-curvature="0"
- d="m 712.59225,640.31214 c -7.0673,7.06428 -12.426,16.1547 -15.21723,26.17352 -18.37439,-0.28427 -36.80623,6.87376 -51.43074,21.49827 -24.62217,24.61611 -32.27917,69.28801 2.01707,103.58424 28.85589,28.85589 71.95223,29.29741 100.23354,1.00703 13.36952,-13.37557 21.88234,-31.7681 22.06681,-51.22813 9.49565,-2.52814 18.52256,-7.58443 26.21888,-15.26562 21.03559,-21.04769 27.4769,-57.21281 -0.94049,-85.63625 -23.68772,-23.68167 -59.35084,-23.73308 -82.94784,-0.13306 z m 77.4833,61.75499 c -4.03716,4.04321 -9.20836,7.02799 -14.91482,8.65495 -9.15393,2.62189 -14.0832,2.35577 -17.23128,7.60862 -3.14808,5.2468 -2.80031,5.86674 -2.66121,15.70714 0.16935,11.15285 -4.03111,22.72 -14.55495,33.24989 -16.08817,16.08213 -45.78476,19.66568 -67.63686,-2.18339 -17.21616,-17.21918 -25.29653,-46.20209 -2.35274,-69.14285 8.51584,-8.50678 20.76342,-13.53887 33.64001,-13.31206 8.95433,0.15725 9.99765,0.4899 15.76157,-2.12594 5.77299,-2.63096 3.27206,-8.47048 6.71953,-18.76449 1.68139,-5.01999 4.67222,-9.96741 9.35049,-14.65173 12.47741,-12.47438 35.44539,-15.3382 52.27144,1.48181 13.70821,13.72031 19.52052,35.56333 1.60882,53.47805 z"
- id="path3946" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.png b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.png
deleted file mode 100644
index 4a851d78640..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.svg b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.svg
deleted file mode 100644
index 5492d40f6bc..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-icon.svg
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="59.99931"
- height="59.999016"
- id="svg5211"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 35">
- <defs
- id="defs5213">
- <linearGradient
- id="SVGID_15_"
- gradientUnits="userSpaceOnUse"
- x1="307.7168"
- y1="437.05859"
- x2="307.7168"
- y2="505.11819">
- <stop
- offset="0"
- style="stop-color:#8CC84B"
- id="stop4094" />
- <stop
- offset="1"
- style="stop-color:#6BA025"
- id="stop4096" />
- </linearGradient>
- <linearGradient
- gradientTransform="translate(-104.85951,28.161837)"
- y2="505.11819"
- x2="307.7168"
- y1="437.05859"
- x1="307.7168"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5209"
- xlink:href="#SVGID_15_"
- inkscape:collect="always" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.4"
- inkscape:cx="100.06073"
- inkscape:cy="2.7065346"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2484"
- inkscape:window-y="361"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5216">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-172.85749,-465.21981)">
- <path
- style="fill:url(#linearGradient5209)"
- inkscape:connector-curvature="0"
- d="m 226.39049,502.10283 c 7.502,-7.505 9.799,-20.401 -0.335,-30.538 -4.223,-4.222 -9.513,-6.337 -14.799,-6.345 h -0.005 c -5.286,-0.007 -10.568,2.093 -14.775,6.299 -2.522,2.52 -4.433,5.76 -5.428,9.33 -6.49,-0.099 -13.001,2.411 -18.191,7.53 v 36.48 c 0.114,0.12 0.227,0.241 0.344,0.36 h 25.518 11.027 c 4.434,-4.717 7.234,-11.018 7.295,-17.672 3.385,-0.898 6.606,-2.7 9.349,-5.444 z m -13.748,-2.759 c -1.122,1.873 -0.998,2.089 -0.95,5.602 0.062,3.979 -1.436,8.102 -5.188,11.854 -5.737,5.737 -16.327,7.017 -24.119,-0.776 -6.14,-6.14 -9.021,-16.475 -0.84,-24.658 3.038,-3.034 7.405,-4.827 11.998,-4.745 3.193,0.055 3.564,0.174 5.621,-0.76 2.058,-0.938 1.166,-3.019 2.396,-6.692 0.6,-1.792 1.667,-3.551 3.333,-5.224 4.451,-4.448 12.642,-5.469 18.642,0.531 4.887,4.887 6.96,12.677 0.573,19.065 -1.442,1.444 -3.285,2.509 -5.32,3.087 -3.265,0.937 -5.023,0.838 -6.146,2.716 z"
- id="path4098" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.png
deleted file mode 100644
index 9813997cce6..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.svg
deleted file mode 100644
index 53376b4b55d..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo-foreground-white.svg
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="229.3342"
- height="73.11216"
- id="svg4859"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 22">
- <defs
- id="defs4861">
- <linearGradient
- gradientTransform="translate(-243.93947,236.80482)"
- id="SVGID_7_"
- gradientUnits="userSpaceOnUse"
- x1="589.36517"
- y1="253"
- x2="589.36517"
- y2="319.03049">
- <stop
- offset="0"
- style="stop-color:#8CC84B"
- id="stop4010" />
- <stop
- offset="1"
- style="stop-color:#6BA025"
- id="stop4012" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_7_"
- id="linearGradient4898"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(-243.93947,236.80482)"
- x1="589.36517"
- y1="253"
- x2="589.36517"
- y2="319.03049" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#000000"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="1"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="121.09567"
- inkscape:cy="47.984651"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-bottom="5"
- fit-margin-right="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2267"
- inkscape:window-y="391"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4864">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-253.90433,-487.23467)">
- <g
- id="g4890">
- <path
- id="path3999"
- d="m 312.70853,512.04782 c -1.337,-0.292 -2.28,-0.447 -3.441,-0.447 -2.848,0 -5.33,0.83 -7.393,2.465 -0.09,0.061 -0.191,0.141 -0.302,0.247 -0.23,0.197 -0.452,0.406 -0.669,0.622 -1.477,1.313 -2.759,1.949 -2.759,-1.236 v -0.667 c 0,-0.403 -0.327,-0.73 -0.732,-0.73 h -2.1 c -0.2,0 -0.389,0.079 -0.527,0.222 -0.138,0.142 -0.212,0.333 -0.206,0.532 0.106,3.332 0.215,6.777 0.215,9.622 v 18.75 c 0,0.402 0.328,0.732 0.732,0.732 h 2.209 c 0.403,0 0.732,-0.33 0.732,-0.732 v -9.914 c 0,-1.372 0.107,-3.806 0.31,-4.813 1.568,-7.798 4.982,-11.589 10.435,-11.589 0.979,0 1.88,0.163 2.874,0.363 0.047,0.01 0.095,0.014 0.143,0.014 0.148,0 0.294,-0.043 0.417,-0.13 0.162,-0.114 0.273,-0.289 0.307,-0.484 l 0.322,-1.995 c 0.062,-0.383 -0.187,-0.751 -0.567,-0.832 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4001"
- d="m 401.75553,513.63982 c -2.513,-1.775 -5.294,-2.04 -6.727,-2.04 -2.911,0 -5.648,0.911 -7.821,2.494 -0.005,0.003 -0.011,0.005 -0.015,0.009 -1.006,0.647 -2.627,0.908 -2.617,-0.625 v -0.022 c 0,-0.106 -0.005,-0.198 -0.014,-0.276 l -0.009,-0.182 c -0.018,-0.391 -0.341,-0.697 -0.731,-0.697 h -2.102 c -0.202,0 -0.396,0.083 -0.534,0.231 -0.139,0.146 -0.21,0.346 -0.195,0.548 0.152,2.281 0.212,4.171 0.212,6.524 v 21.821 c 0,0.402 0.33,0.732 0.733,0.732 h 2.209 c 0.404,0 0.731,-0.33 0.731,-0.732 v -17.511 c 0,-0.813 0.253,-1.763 0.49,-2.378 0.005,-0.009 0.007,-0.016 0.01,-0.024 1.044,-3.044 4.223,-6.12 8.417,-6.475 3.236,0.002 8.326,2.359 9.024,8.225 0.016,0.149 0.03,0.298 0.041,0.443 0.005,0.05 0.008,0.098 0.013,0.148 0.005,0.073 0.009,0.142 0.014,0.21 0.009,0.189 0.015,0.384 0.015,0.583 0,0.334 0.005,0.638 0.018,0.91 v 15.87 c 0,0.402 0.326,0.732 0.73,0.732 h 2.21 c 0.403,0 0.732,-0.33 0.732,-0.732 v -16.271 c 10e-4,-5.373 -1.627,-9.248 -4.834,-11.515 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4003"
- d="m 279.67053,513.63982 c -2.512,-1.775 -5.293,-2.04 -6.726,-2.04 -2.91,0 -5.649,0.911 -7.822,2.494 -0.006,0.003 -0.009,0.005 -0.015,0.009 -1.005,0.647 -2.627,0.908 -2.617,-0.625 l -10e-4,-0.022 c 0.002,-0.106 -0.002,-0.198 -0.013,-0.276 l -0.007,-0.182 c -0.021,-0.391 -0.342,-0.697 -0.732,-0.697 h -2.101 c -0.204,0 -0.397,0.083 -0.535,0.231 -0.139,0.146 -0.211,0.346 -0.195,0.548 0.151,2.281 0.215,4.171 0.215,6.524 v 21.821 c 0,0.402 0.327,0.732 0.729,0.732 h 2.21 c 0.403,0 0.732,-0.33 0.732,-0.732 v -17.511 c 0,-0.813 0.253,-1.763 0.489,-2.378 0.004,-0.009 0.007,-0.016 0.009,-0.024 1.044,-3.044 4.224,-6.12 8.418,-6.475 3.236,0.002 8.325,2.359 9.023,8.225 0.017,0.149 0.03,0.298 0.043,0.443 0.004,0.05 0.008,0.098 0.012,0.148 0.004,0.073 0.01,0.142 0.014,0.21 0.008,0.189 0.015,0.384 0.015,0.583 0,0.334 0.005,0.638 0.018,0.91 v 15.87 c 0,0.402 0.327,0.732 0.73,0.732 h 2.209 c 0.404,0 0.733,-0.33 0.733,-0.732 v -16.271 c 10e-4,-5.373 -1.627,-9.248 -4.835,-11.515 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4005"
- d="m 477.97953,538.98182 c -0.133,-0.113 -0.301,-0.174 -0.474,-0.174 -0.039,0 -0.079,0.004 -0.118,0.011 -0.588,0.099 -0.964,0.099 -1.444,0.099 -1.147,0 -2.177,-0.337 -2.177,-4.387 v -9.914 c 0,-2.344 -0.18,-5.368 -1.583,-7.971 -1.824,-3.384 -5.181,-5.101 -9.979,-5.101 -2.475,0 -6.218,0.516 -9.99,2.975 -0.313,0.204 -0.424,0.615 -0.252,0.949 l 0.862,1.671 c 0.098,0.188 0.272,0.324 0.479,0.375 0.058,0.013 0.116,0.021 0.174,0.021 0.15,0 0.296,-0.048 0.422,-0.134 2.314,-1.64 5.188,-2.507 8.306,-2.507 3.995,0 6.004,1.856 7,3.942 l 0,0 c 1.002,2.219 -0.563,4.403 -2.286,4.584 -0.084,0.004 -0.169,0.007 -0.253,0.012 -0.015,0 -0.027,10e-4 -0.043,0 -0.055,-0.002 -0.101,0.002 -0.143,0.009 -10.979,0.627 -16.537,4.313 -16.537,10.979 0,2.029 0.801,4.056 2.201,5.57 1.235,1.332 3.56,2.922 7.637,2.922 3.471,0 6.27,-1.112 8.324,-2.474 0.061,-0.03 0.131,-0.076 0.211,-0.141 0.021,-0.017 0.044,-0.03 0.064,-0.047 0.127,-0.091 0.257,-0.177 0.377,-0.27 1.277,-0.824 1.97,-0.35 2.623,0.505 0.002,10e-4 0.006,0.004 0.008,0.008 0.839,1.141 2.162,1.717 3.963,1.717 0.847,0 1.59,-0.094 2.343,-0.293 0.322,-0.086 0.544,-0.376 0.544,-0.708 v -1.67 c 0,-0.214 -0.096,-0.419 -0.259,-0.558 z m -18.252,0.528 c -3.042,0 -6.111,-1.724 -6.111,-5.573 0,-4.863 5.936,-6.58 12.166,-7.043 2.32,-0.043 4.098,2.161 4.313,4.575 v 0.989 c -0.063,0.646 -0.246,1.289 -0.569,1.888 -0.161,0.265 -0.354,0.556 -0.588,0.864 -0.04,0.049 -0.076,0.094 -0.104,0.135 -1.442,1.847 -4.223,4.165 -9.107,4.165 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4007"
- d="m 441.84653,512.30182 h -2.047 c -0.392,0 -0.716,0.31 -0.731,0.702 -0.064,1.618 -0.892,1.835 -2.701,0.766 -0.011,-0.006 -0.02,-0.014 -0.028,-0.019 -0.179,-0.121 -0.362,-0.23 -0.547,-0.339 -0.01,-0.009 -0.02,-0.014 -0.031,-0.021 -0.087,-0.057 -0.168,-0.102 -0.243,-0.139 -1.982,-1.096 -4.308,-1.65 -6.925,-1.65 -3.739,0 -7.428,1.547 -10.121,4.249 -2.082,2.087 -4.564,5.826 -4.564,11.783 0,3.819 1.347,7.415 3.791,10.124 2.597,2.872 6.233,4.456 10.249,4.456 3.11,0 5.514,-0.82 7.335,-1.896 0.004,-0.002 0.007,-0.004 0.012,-0.005 1.953,-0.873 3.602,-2.182 3.134,2.234 -0.875,5.678 -4.518,8.765 -10.48,8.765 -4.176,0 -7.31,-1.406 -9.204,-2.584 -0.116,-0.074 -0.251,-0.11 -0.388,-0.11 -0.06,0 -0.123,0.007 -0.182,0.021 -0.192,0.051 -0.356,0.176 -0.456,0.351 l -0.968,1.725 c -0.19,0.335 -0.086,0.761 0.237,0.972 2.853,1.862 6.909,2.975 10.852,2.975 2.689,0 9.294,-0.624 12.493,-6.413 1.385,-2.48 2.031,-5.968 2.031,-10.968 v -17.456 c 0,-2.475 0.07,-4.678 0.216,-6.738 0.013,-0.202 -0.058,-0.402 -0.196,-0.55 -0.138,-0.148 -0.334,-0.235 -0.538,-0.235 z m -16.892,26.024 c -0.604,-0.238 -7.607,-3.214 -7.011,-11.809 0.549,-7.941 5.715,-10.457 6.518,-10.798 1.276,-0.499 2.698,-0.77 4.24,-0.77 1.663,0 3.112,0.328 4.354,0.875 6.845,3.87 7.696,16.453 0.883,21.465 -1.592,1 -3.437,1.574 -5.346,1.574 -1.341,0 -2.551,-0.195 -3.638,-0.537 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4014"
- d="m 343.07253,498.07582 c -2.338,2.336 -4.11,5.342 -5.031,8.655 -6.076,-0.094 -12.172,2.273 -17.008,7.109 -8.143,8.14 -10.674,22.912 0.668,34.253 9.542,9.542 23.793,9.688 33.144,0.333 4.422,-4.423 7.237,-10.505 7.298,-16.94 3.14,-0.836 6.125,-2.508 8.67,-5.048 6.957,-6.96 9.085,-18.919 -0.311,-28.318 -7.835,-7.831 -19.628,-7.848 -27.43,-0.044 z m 25.622,20.421 c -1.335,1.337 -3.046,2.324 -4.934,2.862 -3.026,0.867 -4.655,0.779 -5.696,2.516 -1.042,1.735 -0.925,1.94 -0.881,5.194 0.056,3.688 -1.332,7.513 -4.813,10.995 -5.319,5.318 -15.139,6.503 -22.366,-0.722 -5.692,-5.694 -8.363,-15.278 -0.776,-22.864 2.816,-2.813 6.867,-4.477 11.123,-4.402 2.961,0.052 3.306,0.162 5.213,-0.703 1.907,-0.87 1.082,-2.801 2.222,-6.205 0.557,-1.66 1.544,-3.296 3.093,-4.845 4.125,-4.125 11.721,-5.072 17.284,0.49 4.532,4.537 6.456,11.76 0.531,17.684 z"
- inkscape:connector-curvature="0"
- style="fill:url(#linearGradient4898)" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.png b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.png
deleted file mode 100644
index d5362b91c39..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.svg b/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.svg
deleted file mode 100644
index 7b0b870b43b..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/nroonga-logo.svg
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="229.33453"
- height="73.012161"
- id="svg4522"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 10">
- <defs
- id="defs4524">
- <linearGradient
- gradientTransform="translate(496.09341,431.09054)"
- id="SVGID_3_"
- gradientUnits="userSpaceOnUse"
- x1="223.6167"
- y1="254.24409"
- x2="223.6167"
- y2="319.0174">
- <stop
- offset="0"
- style="stop-color:#8CC84B"
- id="stop3942" />
- <stop
- offset="1"
- style="stop-color:#6BA025"
- id="stop3944" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_3_"
- id="linearGradient4561"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(496.09341,431.09054)"
- x1="223.6167"
- y1="254.24409"
- x2="223.6167"
- y2="319.0174" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="101.4407"
- inkscape:cy="55.868778"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-right="5"
- fit-margin-bottom="4.9"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="1920"
- inkscape:window-y="260"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4527">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-628.18988,-681.52039)">
- <g
- id="g4553">
- <path
- id="path3931"
- d="m 686.99241,706.33354 c -1.336,-0.292 -2.281,-0.447 -3.442,-0.447 -2.847,0 -5.33,0.83 -7.391,2.465 -0.091,0.061 -0.192,0.141 -0.303,0.247 -0.231,0.197 -0.452,0.406 -0.668,0.622 -1.478,1.313 -2.76,1.949 -2.76,-1.236 v -0.667 c 0,-0.403 -0.327,-0.73 -0.732,-0.73 h -2.101 c -0.198,0 -0.388,0.079 -0.525,0.222 -0.139,0.142 -0.212,0.333 -0.206,0.532 0.105,3.332 0.215,6.777 0.215,9.622 v 18.75 c 0,0.402 0.328,0.732 0.732,0.732 h 2.209 c 0.404,0 0.732,-0.33 0.732,-0.732 v -9.914 c 0,-1.372 0.107,-3.806 0.309,-4.813 1.569,-7.798 4.982,-11.589 10.435,-11.589 0.979,0 1.881,0.163 2.874,0.363 0.048,0.01 0.096,0.014 0.144,0.014 0.148,0 0.294,-0.043 0.417,-0.13 0.163,-0.114 0.273,-0.289 0.306,-0.484 l 0.323,-1.995 c 0.062,-0.383 -0.187,-0.751 -0.568,-0.832 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3933"
- d="m 776.03941,707.92554 c -2.512,-1.775 -5.292,-2.04 -6.726,-2.04 -2.91,0 -5.648,0.911 -7.822,2.494 -0.005,0.003 -0.01,0.005 -0.014,0.009 -1.004,0.647 -2.627,0.908 -2.618,-0.625 l 0,-0.022 c 0.002,-0.106 -0.003,-0.198 -0.013,-0.276 l -0.008,-0.182 c -0.019,-0.391 -0.34,-0.697 -0.731,-0.697 h -2.102 c -0.203,0 -0.396,0.083 -0.535,0.231 -0.138,0.146 -0.209,0.346 -0.195,0.548 0.152,2.281 0.214,4.171 0.214,6.524 v 21.821 c 0,0.402 0.328,0.732 0.731,0.732 h 2.209 c 0.404,0 0.732,-0.33 0.732,-0.732 v -17.511 c 0,-0.813 0.253,-1.763 0.49,-2.378 0.004,-0.009 0.006,-0.016 0.01,-0.024 1.043,-3.044 4.224,-6.12 8.417,-6.475 3.236,0.002 8.327,2.359 9.024,8.225 0.016,0.149 0.03,0.298 0.042,0.443 0.004,0.05 0.008,0.098 0.011,0.148 0.005,0.073 0.009,0.142 0.014,0.21 0.009,0.189 0.015,0.384 0.015,0.583 0,0.334 0.006,0.638 0.017,0.91 v 15.87 c 0,0.402 0.328,0.732 0.733,0.732 h 2.208 c 0.404,0 0.732,-0.33 0.732,-0.732 v -16.271 c 0,-5.373 -1.627,-9.248 -4.835,-11.515 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3935"
- d="m 653.95541,707.92554 c -2.512,-1.775 -5.292,-2.04 -6.726,-2.04 -2.91,0 -5.649,0.911 -7.821,2.494 -0.006,0.003 -0.01,0.005 -0.016,0.009 -1.003,0.647 -2.626,0.908 -2.616,-0.625 l -0.001,-0.022 c 0.001,-0.106 -0.002,-0.198 -0.013,-0.276 l -0.008,-0.182 c -0.018,-0.391 -0.34,-0.697 -0.731,-0.697 h -2.102 c -0.202,0 -0.396,0.083 -0.534,0.231 -0.139,0.146 -0.209,0.346 -0.196,0.548 0.152,2.281 0.213,4.171 0.213,6.524 v 21.821 c 0,0.402 0.328,0.732 0.732,0.732 h 2.209 c 0.404,0 0.732,-0.33 0.732,-0.732 v -17.511 c 0,-0.813 0.252,-1.763 0.489,-2.378 0.003,-0.009 0.007,-0.016 0.01,-0.024 1.043,-3.044 4.224,-6.12 8.417,-6.475 3.236,0.002 8.326,2.359 9.024,8.225 0.017,0.149 0.031,0.298 0.042,0.443 0.004,0.05 0.009,0.098 0.012,0.148 0.005,0.073 0.01,0.142 0.014,0.21 0.009,0.189 0.015,0.384 0.015,0.583 0,0.334 0.006,0.638 0.018,0.91 v 15.87 c 0,0.402 0.327,0.732 0.732,0.732 h 2.208 c 0.405,0 0.732,-0.33 0.732,-0.732 v -16.271 c 0,-5.373 -1.627,-9.248 -4.835,-11.515 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3937"
- d="m 852.26341,733.26754 c -0.133,-0.113 -0.301,-0.174 -0.473,-0.174 -0.04,0 -0.08,0.004 -0.12,0.011 -0.587,0.099 -0.965,0.099 -1.442,0.099 -1.147,0 -2.177,-0.337 -2.177,-4.387 v -9.914 c 0,-2.344 -0.179,-5.368 -1.583,-7.971 -1.822,-3.384 -5.181,-5.101 -9.978,-5.101 -2.475,0 -6.217,0.516 -9.99,2.975 -0.315,0.204 -0.422,0.615 -0.25,0.949 l 0.861,1.671 c 0.098,0.188 0.272,0.324 0.478,0.375 0.058,0.013 0.116,0.021 0.173,0.021 0.151,0 0.299,-0.048 0.424,-0.134 2.314,-1.64 5.186,-2.507 8.305,-2.507 3.995,0 6.004,1.856 7,3.942 l 0,0 c 1.004,2.219 -0.561,4.403 -2.285,4.584 -0.085,0.004 -0.17,0.007 -0.254,0.012 -0.014,0 -0.028,0.001 -0.042,0 -0.055,-0.002 -0.101,0.002 -0.143,0.009 -10.978,0.627 -16.538,4.313 -16.538,10.979 0,2.029 0.803,4.056 2.202,5.57 1.233,1.332 3.56,2.922 7.635,2.922 3.471,0 6.271,-1.112 8.325,-2.474 0.061,-0.03 0.13,-0.076 0.211,-0.141 0.023,-0.017 0.042,-0.03 0.064,-0.047 0.128,-0.091 0.256,-0.177 0.378,-0.27 1.275,-0.824 1.969,-0.35 2.623,0.505 0.002,0.001 0.006,0.004 0.008,0.008 0.84,1.141 2.161,1.717 3.962,1.717 0.846,0 1.591,-0.094 2.344,-0.293 0.32,-0.086 0.543,-0.376 0.543,-0.708 v -1.67 c -0.002,-0.214 -0.097,-0.419 -0.261,-0.558 z m -18.252,0.528 c -3.042,0 -6.111,-1.724 -6.111,-5.573 0,-4.863 5.936,-6.58 12.167,-7.043 2.32,-0.043 4.097,2.161 4.311,4.575 v 0.989 c -0.062,0.646 -0.246,1.289 -0.568,1.888 -0.162,0.265 -0.356,0.556 -0.589,0.864 -0.04,0.049 -0.075,0.094 -0.103,0.135 -1.442,1.847 -4.223,4.165 -9.107,4.165 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3939"
- d="m 816.13141,706.58754 h -2.047 c -0.393,0 -0.716,0.31 -0.731,0.702 -0.066,1.618 -0.892,1.835 -2.703,0.766 -0.009,-0.006 -0.018,-0.014 -0.027,-0.019 -0.178,-0.121 -0.362,-0.23 -0.546,-0.339 -0.011,-0.009 -0.02,-0.014 -0.031,-0.021 -0.087,-0.057 -0.168,-0.102 -0.244,-0.139 -1.982,-1.096 -4.307,-1.65 -6.924,-1.65 -3.739,0 -7.429,1.547 -10.122,4.249 -2.082,2.087 -4.564,5.826 -4.564,11.783 0,3.819 1.346,7.415 3.792,10.124 2.595,2.872 6.234,4.456 10.248,4.456 3.111,0 5.514,-0.82 7.335,-1.896 0.004,-0.002 0.007,-0.004 0.012,-0.005 1.954,-0.873 3.603,-2.182 3.135,2.234 -0.875,5.678 -4.519,8.765 -10.482,8.765 -4.175,0 -7.31,-1.406 -9.204,-2.584 -0.118,-0.074 -0.251,-0.11 -0.387,-0.11 -0.06,0 -0.122,0.007 -0.182,0.021 -0.193,0.051 -0.358,0.176 -0.456,0.351 l -0.97,1.725 c -0.189,0.335 -0.085,0.761 0.237,0.972 2.853,1.862 6.91,2.975 10.854,2.975 2.689,0 9.293,-0.624 12.493,-6.413 1.385,-2.48 2.031,-5.968 2.031,-10.968 v -17.456 c 0,-2.475 0.07,-4.678 0.214,-6.738 0.014,-0.202 -0.057,-0.402 -0.195,-0.55 -0.139,-0.152 -0.332,-0.235 -0.536,-0.235 z m -16.892,26.024 c -0.605,-0.238 -7.609,-3.214 -7.013,-11.809 0.551,-7.941 5.716,-10.457 6.517,-10.798 1.278,-0.499 2.701,-0.77 4.242,-0.77 1.665,0 3.113,0.328 4.354,0.875 6.845,3.87 7.696,16.453 0.884,21.465 -1.592,1 -3.436,1.574 -5.345,1.574 -1.343,0 -2.553,-0.195 -3.639,-0.537 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3946"
- d="m 717.35641,692.36154 c -2.337,2.336 -4.109,5.342 -5.032,8.655 -6.076,-0.094 -12.171,2.273 -17.007,7.109 -8.142,8.14 -10.674,22.912 0.667,34.253 9.542,9.542 23.793,9.688 33.145,0.333 4.421,-4.423 7.236,-10.505 7.297,-16.94 3.14,-0.836 6.125,-2.508 8.67,-5.048 6.956,-6.96 9.086,-18.919 -0.311,-28.318 -7.833,-7.831 -19.626,-7.848 -27.429,-0.044 z m 25.622,20.421 c -1.335,1.337 -3.045,2.324 -4.932,2.862 -3.027,0.867 -4.657,0.779 -5.698,2.516 -1.041,1.735 -0.926,1.94 -0.88,5.194 0.056,3.688 -1.333,7.513 -4.813,10.995 -5.32,5.318 -15.14,6.503 -22.366,-0.722 -5.693,-5.694 -8.365,-15.278 -0.778,-22.864 2.816,-2.813 6.866,-4.477 11.124,-4.402 2.961,0.052 3.306,0.162 5.212,-0.703 1.909,-0.87 1.082,-2.801 2.222,-6.205 0.556,-1.66 1.545,-3.296 3.092,-4.845 4.126,-4.125 11.721,-5.072 17.285,0.49 4.533,4.537 6.455,11.76 0.532,17.684 z"
- inkscape:connector-curvature="0"
- style="fill:url(#linearGradient4561)" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.png
deleted file mode 100644
index 75b4be8bbfb..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.svg
deleted file mode 100644
index 6b853e29ec2..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-foreground-white.svg
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="60.000706"
- height="60.001022"
- id="svg5804"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 56">
- <defs
- id="defs5806">
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_12_"
- id="linearGradient5527"
- gradientUnits="userSpaceOnUse"
- x1="710.15039"
- y1="437.05859"
- x2="710.15039"
- y2="497.05859" />
- <linearGradient
- id="SVGID_12_"
- gradientUnits="userSpaceOnUse"
- x1="710.15039"
- y1="437.05859"
- x2="710.15039"
- y2="497.05859">
- <stop
- offset="0"
- style="stop-color:#AE0000"
- id="stop4071" />
- <stop
- offset="1"
- style="stop-color:#740000"
- id="stop4073" />
- </linearGradient>
- <linearGradient
- y2="497.05859"
- x2="710.15039"
- y1="437.05859"
- x1="710.15039"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5802"
- xlink:href="#SVGID_12_"
- inkscape:collect="always" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="82.14321"
- inkscape:cy="1.4290814"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="1956"
- inkscape:window-y="265"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5809">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-292.85679,-453.79024)">
- <polygon
- transform="translate(-387.29321,16.732264)"
- points="680.15,437.059 680.15,497.059 706.012,497.059 740.15,497.059 740.15,462.92 740.15,437.059 "
- id="polygon4075"
- style="fill:url(#linearGradient5802)" />
- <path
- d="m 346.39079,490.67326 c 7.502,-7.505 9.8,-20.401 -0.335,-30.538 -4.224,-4.222 -9.514,-6.337 -14.8,-6.345 h -0.005 c -5.286,-0.007 -10.567,2.093 -14.774,6.299 -2.522,2.52 -4.434,5.76 -5.428,9.33 -6.49,-0.099 -13.001,2.411 -18.191,7.53 v 36.479 c 0.114,0.121 0.227,0.242 0.344,0.361 h 25.518 11.027 c 4.434,-4.717 7.233,-11.018 7.295,-17.672 3.385,-0.898 6.606,-2.7 9.349,-5.444 z m -13.748,-2.759 c -1.121,1.873 -0.997,2.089 -0.949,5.602 0.062,3.979 -1.437,8.102 -5.189,11.854 -5.736,5.737 -16.326,7.017 -24.119,-0.776 -6.139,-6.14 -9.021,-16.475 -0.84,-24.658 3.038,-3.034 7.406,-4.827 11.998,-4.745 3.193,0.055 3.564,0.174 5.621,-0.76 2.058,-0.938 1.166,-3.019 2.396,-6.692 0.6,-1.792 1.666,-3.551 3.332,-5.224 4.451,-4.448 12.643,-5.469 18.643,0.531 4.887,4.887 6.96,12.677 0.572,19.065 -1.441,1.444 -3.284,2.509 -5.319,3.087 -3.266,0.937 -5.023,0.838 -6.146,2.716 z"
- id="path4113"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.png b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.png
deleted file mode 100644
index 4a478047725..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.svg b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.svg
deleted file mode 100644
index 1db5c145fc1..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon-full-size.svg
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="199.804"
- height="200.85513"
- id="svg4616"
- version="1.1"
- inkscape:version="0.48.3.1 r9886"
- sodipodi:docname="rroonga-icon-full-size.svg"
- inkscape:export-filename="rroonga-icon-full-size.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <defs
- id="defs4618">
- <linearGradient
- gradientTransform="translate(279.85374,93.654148)"
- id="SVGID_4_"
- gradientUnits="userSpaceOnUse"
- x1="223.6167"
- y1="340.418"
- x2="223.6167"
- y2="403.2283">
- <stop
- offset="0"
- style="stop-color:#AE0000"
- id="stop3959" />
- <stop
- offset="1"
- style="stop-color:#740000"
- id="stop3961" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_4_"
- id="linearGradient4655"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(279.85374,93.654148)"
- x1="223.6167"
- y1="340.418"
- x2="223.6167"
- y2="403.2283" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_4_"
- id="linearGradient3223"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(3.0240925,0,0,3.0240925,-172.76721,-661.31971)"
- x1="223.6167"
- y1="340.418"
- x2="223.6167"
- y2="403.2283" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="-28.568467"
- inkscape:cy="54.713275"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-bottom="5"
- fit-margin-right="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2065"
- inkscape:window-y="414"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4621">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-403.56846,-366.22033)">
- <path
- style="fill:url(#linearGradient3223)"
- inkscape:connector-curvature="0"
- d="m 496.35258,388.87808 c -7.0673,7.07335 -12.426,16.1547 -15.21723,26.17957 -18.37439,-0.28427 -36.80623,6.86771 -51.43074,21.49827 -24.62217,24.61914 -32.27917,69.28499 2.01707,103.5782 28.85589,28.86496 71.95223,29.2974 100.23354,1.01609 13.36952,-13.37858 21.88234,-31.77414 22.06681,-51.22813 9.49565,-2.53116 18.52256,-7.58442 26.21888,-15.26864 21.03559,-21.04466 27.4769,-57.21281 -0.94049,-85.63625 -23.68772,-23.67865 -59.35084,-23.73308 -82.94784,-0.13911 z m 77.4833,61.76104 c -4.03716,4.04926 -9.20836,7.02799 -14.91482,8.661 -9.15393,2.62491 -14.0832,2.3467 -17.23128,7.6056 -3.14808,5.24982 -2.80031,5.86976 -2.66121,15.70411 0.16935,11.15588 -4.03111,22.72605 -14.55495,33.25292 -16.08817,16.0791 -45.78476,19.6687 -67.63686,-2.1834 -17.21616,-17.21615 -25.29653,-46.20208 -2.35274,-69.14285 8.51584,-8.50979 20.76342,-13.54491 33.64001,-13.31508 8.95433,0.16028 9.99765,0.48688 15.76157,-2.12593 5.77299,-2.62492 3.27206,-8.46444 6.71953,-18.7645 1.68139,-5.01999 4.67222,-9.96136 9.35049,-14.6487 12.47741,-12.47438 35.44539,-15.33518 52.27144,1.48483 13.70821,13.71426 19.52052,35.56333 1.60882,53.472 z"
- id="path3963" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.png b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.png
deleted file mode 100644
index ed60fbd066f..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.svg b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.svg
deleted file mode 100644
index b7e1594a5d1..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-icon.svg
+++ /dev/null
@@ -1,93 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="59.999706"
- height="59.999016"
- id="svg5279"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 38">
- <defs
- id="defs5281">
- <linearGradient
- id="SVGID_16_"
- gradientUnits="userSpaceOnUse"
- x1="387.71631"
- y1="437.05859"
- x2="387.71631"
- y2="505.11819">
- <stop
- offset="0"
- style="stop-color:#AE0000"
- id="stop4101" />
- <stop
- offset="1"
- style="stop-color:#740000"
- id="stop4103" />
- </linearGradient>
- <linearGradient
- gradientTransform="translate(-244.85971,159.59041)"
- y2="505.11819"
- x2="387.71631"
- y1="437.05859"
- x1="387.71631"
- gradientUnits="userSpaceOnUse"
- id="linearGradient5277"
- xlink:href="#SVGID_16_"
- inkscape:collect="always" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="1.979899"
- inkscape:cx="91.150426"
- inkscape:cy="12.210734"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2611"
- inkscape:window-y="426"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata5284">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-112.85729,-596.64839)">
- <path
- style="fill:url(#linearGradient5277)"
- inkscape:connector-curvature="0"
- d="m 166.39029,633.53141 c 7.502,-7.505 9.8,-20.401 -0.335,-30.538 -4.224,-4.222 -9.514,-6.337 -14.8,-6.345 h -0.005 c -5.286,-0.007 -10.567,2.093 -14.774,6.299 -2.522,2.52 -4.433,5.76 -5.428,9.33 -6.49,-0.099 -13.001,2.411 -18.191,7.53 v 36.48 c 0.114,0.12 0.227,0.241 0.344,0.36 h 25.518 11.027 c 4.434,-4.717 7.234,-11.018 7.295,-17.672 3.385,-0.898 6.607,-2.7 9.349,-5.444 z m -13.748,-2.759 c -1.121,1.873 -0.997,2.089 -0.949,5.602 0.062,3.979 -1.437,8.102 -5.189,11.854 -5.737,5.737 -16.327,7.017 -24.119,-0.776 -6.14,-6.14 -9.021,-16.475 -0.84,-24.658 3.038,-3.034 7.405,-4.827 11.998,-4.745 3.193,0.055 3.564,0.174 5.621,-0.76 2.058,-0.938 1.166,-3.019 2.396,-6.692 0.6,-1.792 1.667,-3.551 3.333,-5.224 4.451,-4.448 12.642,-5.469 18.642,0.531 4.887,4.887 6.96,12.677 0.572,19.065 -1.441,1.444 -3.284,2.509 -5.319,3.087 -3.265,0.937 -5.023,0.838 -6.146,2.716 z"
- id="path4105" />
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.png b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.png
deleted file mode 100644
index 72f9bdf52fa..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.svg b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.svg
deleted file mode 100644
index df19d65d1fa..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo-foreground-white.svg
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="219.71045"
- height="73.111534"
- id="svg4954"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 25">
- <defs
- id="defs4956">
- <linearGradient
- gradientTransform="translate(-325.8942,122.22558)"
- id="SVGID_8_"
- gradientUnits="userSpaceOnUse"
- x1="589.36517"
- y1="341"
- x2="589.36517"
- y2="405.3815">
- <stop
- offset="0"
- style="stop-color:#AE0000"
- id="stop4027" />
- <stop
- offset="1"
- style="stop-color:#740000"
- id="stop4029" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_8_"
- id="linearGradient4993"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(-325.8942,122.22558)"
- x1="589.36517"
- y1="341"
- x2="589.36517"
- y2="405.3815" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#000000"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="1"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="193.42665"
- inkscape:cy="19.412904"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-bottom="5"
- fit-margin-right="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2188"
- inkscape:window-y="270"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4959">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-181.57334,-458.66356)">
- <g
- id="g4985">
- <path
- id="path4016"
- d="m 230.7538,483.47858 c -1.337,-0.292 -2.28,-0.45 -3.441,-0.45 -2.848,0 -5.33,0.832 -7.393,2.467 -0.09,0.062 -0.191,0.142 -0.302,0.247 -0.23,0.197 -0.452,0.405 -0.669,0.621 -1.477,1.313 -2.759,1.95 -2.759,-1.235 v -0.666 c 0,-0.404 -0.327,-0.733 -0.732,-0.733 h -2.1 c -0.2,0 -0.389,0.081 -0.527,0.223 -0.138,0.143 -0.212,0.335 -0.206,0.533 0.106,3.333 0.215,6.778 0.215,9.622 v 18.749 c 0,0.403 0.328,0.731 0.732,0.731 h 2.209 c 0.403,0 0.732,-0.328 0.732,-0.731 v -9.913 c 0,-1.371 0.107,-3.805 0.31,-4.813 1.568,-7.798 4.982,-11.59 10.435,-11.59 0.979,0 1.88,0.164 2.874,0.364 0.047,0.01 0.095,0.013 0.143,0.013 0.148,0 0.294,-0.043 0.417,-0.129 0.162,-0.113 0.273,-0.288 0.307,-0.485 l 0.322,-1.993 c 0.062,-0.386 -0.187,-0.752 -0.567,-0.832 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4018"
- d="m 204.7028,483.47858 c -1.338,-0.292 -2.282,-0.45 -3.443,-0.45 -2.846,0 -5.331,0.832 -7.39,2.467 -0.092,0.062 -0.193,0.142 -0.305,0.247 -0.229,0.197 -0.452,0.405 -0.669,0.621 -1.477,1.313 -2.759,1.95 -2.759,-1.235 v -0.666 c 0,-0.404 -0.327,-0.733 -0.731,-0.733 h -2.102 c -0.198,0 -0.387,0.081 -0.525,0.223 -0.138,0.143 -0.212,0.335 -0.205,0.533 0.105,3.333 0.215,6.778 0.215,9.622 v 18.749 c 0,0.403 0.327,0.731 0.732,0.731 h 2.21 c 0.402,0 0.729,-0.328 0.729,-0.731 v -9.913 c 0,-1.371 0.108,-3.805 0.31,-4.813 1.568,-7.798 4.983,-11.59 10.436,-11.59 0.978,0 1.88,0.164 2.873,0.364 0.048,0.01 0.096,0.013 0.144,0.013 0.148,0 0.294,-0.043 0.416,-0.129 0.165,-0.113 0.275,-0.288 0.307,-0.485 l 0.323,-1.993 c 0.061,-0.386 -0.187,-0.752 -0.566,-0.832 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4020"
- d="m 319.8008,485.06958 c -2.513,-1.775 -5.294,-2.041 -6.727,-2.041 -2.911,0 -5.648,0.913 -7.821,2.496 -0.005,0.003 -0.011,0.003 -0.015,0.007 -1.006,0.649 -2.627,0.911 -2.617,-0.624 v -0.021 c 0,-0.107 -0.005,-0.198 -0.014,-0.278 l -0.009,-0.181 c -0.018,-0.391 -0.341,-0.699 -0.731,-0.699 h -2.102 c -0.202,0 -0.396,0.086 -0.534,0.232 -0.139,0.148 -0.21,0.348 -0.195,0.549 0.152,2.282 0.212,4.17 0.212,6.526 v 21.819 c 0,0.403 0.33,0.731 0.733,0.731 h 2.209 c 0.404,0 0.731,-0.328 0.731,-0.731 v -17.51 c 0,-0.815 0.253,-1.763 0.49,-2.378 0.005,-0.01 0.007,-0.016 0.01,-0.026 1.044,-3.042 4.223,-6.118 8.417,-6.474 3.236,0 8.326,2.358 9.024,8.226 0.016,0.15 0.03,0.299 0.041,0.443 0.005,0.05 0.008,0.099 0.013,0.148 0.005,0.07 0.009,0.14 0.014,0.209 0.009,0.19 0.015,0.386 0.015,0.584 0,0.332 0.005,0.636 0.018,0.909 v 15.868 c 0,0.403 0.326,0.731 0.73,0.731 h 2.21 c 0.403,0 0.732,-0.328 0.732,-0.731 v -16.271 c 0.001,-5.372 -1.627,-9.246 -4.834,-11.513 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4022"
- d="m 396.0248,510.41058 c -0.133,-0.111 -0.301,-0.173 -0.474,-0.173 -0.039,0 -0.079,0.005 -0.118,0.01 -0.588,0.097 -0.964,0.097 -1.444,0.097 -1.147,0 -2.177,-0.334 -2.177,-4.386 v -9.913 c 0,-2.344 -0.18,-5.367 -1.583,-7.971 -1.824,-3.384 -5.181,-5.099 -9.979,-5.099 -2.475,0 -6.218,0.516 -9.99,2.974 -0.313,0.205 -0.424,0.614 -0.252,0.949 l 0.862,1.67 c 0.098,0.188 0.272,0.325 0.479,0.377 0.058,0.013 0.116,0.019 0.174,0.019 0.15,0 0.296,-0.046 0.422,-0.133 2.314,-1.64 5.188,-2.506 8.306,-2.506 3.995,0 6.004,1.854 7,3.939 0,0 0,0 0,0.002 1.002,2.219 -0.563,4.402 -2.286,4.584 -0.084,0.005 -0.169,0.006 -0.253,0.012 -0.015,0 -0.027,0 -0.043,0 -0.055,-0.002 -0.101,0.002 -0.143,0.009 -10.979,0.628 -16.537,4.312 -16.537,10.98 0,2.028 0.801,4.057 2.201,5.569 1.235,1.332 3.56,2.92 7.637,2.92 3.471,0 6.27,-1.111 8.324,-2.472 0.061,-0.032 0.131,-0.076 0.211,-0.141 0.021,-0.017 0.044,-0.029 0.064,-0.047 0.127,-0.09 0.257,-0.18 0.377,-0.269 1.277,-0.825 1.97,-0.351 2.623,0.502 0.002,0.005 0.006,0.006 0.008,0.008 0.839,1.143 2.162,1.72 3.963,1.72 0.847,0 1.59,-0.094 2.343,-0.296 0.322,-0.086 0.544,-0.374 0.544,-0.706 v -1.672 c 0,-0.215 -0.096,-0.417 -0.259,-0.557 z m -18.252,0.529 c -3.042,0 -6.111,-1.725 -6.111,-5.573 0,-4.862 5.936,-6.58 12.166,-7.043 2.32,-0.043 4.098,2.161 4.313,4.575 v 0.988 c -0.063,0.647 -0.246,1.289 -0.569,1.889 -0.161,0.263 -0.354,0.556 -0.588,0.864 -0.04,0.048 -0.076,0.092 -0.104,0.134 -1.442,1.848 -4.223,4.166 -9.107,4.166 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4024"
- d="m 359.8918,483.72858 h -2.047 c -0.392,0 -0.716,0.31 -0.731,0.704 -0.064,1.617 -0.892,1.835 -2.701,0.766 -0.011,-0.008 -0.02,-0.013 -0.028,-0.021 -0.179,-0.118 -0.362,-0.229 -0.547,-0.339 -0.01,-0.005 -0.02,-0.011 -0.031,-0.019 -0.087,-0.059 -0.168,-0.102 -0.243,-0.139 -1.982,-1.097 -4.308,-1.652 -6.925,-1.652 -3.739,0 -7.428,1.549 -10.121,4.249 -2.082,2.089 -4.564,5.828 -4.564,11.785 0,3.816 1.347,7.414 3.791,10.122 2.597,2.873 6.233,4.458 10.249,4.458 3.11,0 5.514,-0.822 7.335,-1.898 0.004,0 0.007,-0.003 0.012,-0.004 1.953,-0.874 3.602,-2.182 3.134,2.233 -0.875,5.677 -4.518,8.764 -10.48,8.764 -4.176,0 -7.31,-1.406 -9.204,-2.583 -0.116,-0.073 -0.251,-0.111 -0.388,-0.111 -0.06,0 -0.123,0.008 -0.182,0.022 -0.192,0.051 -0.356,0.177 -0.456,0.351 l -0.968,1.725 c -0.19,0.335 -0.086,0.763 0.237,0.972 2.853,1.864 6.909,2.976 10.852,2.976 2.689,0 9.294,-0.624 12.493,-6.413 1.385,-2.482 2.031,-5.968 2.031,-10.968 v -17.456 c 0,-2.476 0.07,-4.679 0.216,-6.738 0.013,-0.203 -0.058,-0.401 -0.196,-0.55 -0.138,-0.149 -0.334,-0.236 -0.538,-0.236 z m -16.892,26.028 c -0.604,-0.24 -7.607,-3.216 -7.011,-11.813 0.549,-7.939 5.715,-10.454 6.518,-10.796 1.276,-0.501 2.698,-0.77 4.24,-0.77 1.663,0 3.112,0.327 4.354,0.871 6.845,3.873 7.696,16.454 0.883,21.469 -1.592,1 -3.437,1.573 -5.346,1.573 -1.341,0.001 -2.551,-0.192 -3.638,-0.534 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
- <path
- id="path4031"
- d="m 261.1178,469.50258 c -2.338,2.339 -4.11,5.342 -5.031,8.657 -6.076,-0.094 -12.172,2.271 -17.008,7.109 -8.143,8.141 -10.674,22.911 0.668,34.251 9.542,9.545 23.793,9.688 33.144,0.336 4.422,-4.424 7.237,-10.507 7.298,-16.94 3.14,-0.837 6.125,-2.508 8.67,-5.049 6.957,-6.959 9.085,-18.919 -0.311,-28.318 -7.835,-7.83 -19.628,-7.848 -27.43,-0.046 z m 25.622,20.423 c -1.335,1.339 -3.046,2.324 -4.934,2.864 -3.026,0.868 -4.655,0.776 -5.696,2.515 -1.042,1.736 -0.925,1.941 -0.881,5.193 0.056,3.689 -1.332,7.515 -4.813,10.996 -5.319,5.317 -15.139,6.504 -22.366,-0.722 -5.692,-5.693 -8.363,-15.278 -0.776,-22.864 2.816,-2.814 6.867,-4.479 11.123,-4.403 2.961,0.053 3.306,0.161 5.213,-0.703 1.907,-0.868 1.082,-2.799 2.222,-6.205 0.557,-1.66 1.544,-3.294 3.093,-4.844 4.125,-4.125 11.721,-5.071 17.284,0.491 4.532,4.535 6.456,11.76 0.531,17.682 z"
- inkscape:connector-curvature="0"
- style="fill:url(#linearGradient4993)" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.png b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.png
deleted file mode 100644
index 54f6db6be99..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.svg b/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.svg
deleted file mode 100644
index 6fa698cdc9e..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/rroonga-logo.svg
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="219.71234"
- height="73.111534"
- id="svg4616"
- version="1.1"
- inkscape:version="0.48.1 r9760"
- sodipodi:docname="æ–°è¦ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆ 13">
- <defs
- id="defs4618">
- <linearGradient
- gradientTransform="translate(279.85374,93.654148)"
- id="SVGID_4_"
- gradientUnits="userSpaceOnUse"
- x1="223.6167"
- y1="340.418"
- x2="223.6167"
- y2="403.2283">
- <stop
- offset="0"
- style="stop-color:#AE0000"
- id="stop3959" />
- <stop
- offset="1"
- style="stop-color:#740000"
- id="stop3961" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#SVGID_4_"
- id="linearGradient4655"
- gradientUnits="userSpaceOnUse"
- gradientTransform="translate(279.85374,93.654148)"
- x1="223.6167"
- y1="340.418"
- x2="223.6167"
- y2="403.2283" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="0.35"
- inkscape:cx="-46.572402"
- inkscape:cy="-9.1585194"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-bottom="5"
- fit-margin-right="5"
- inkscape:window-width="902"
- inkscape:window-height="442"
- inkscape:window-x="2065"
- inkscape:window-y="414"
- inkscape:window-maximized="0" />
- <metadata
- id="metadata4621">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="レイヤー 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-421.5724,-430.09213)">
- <g
- id="g4647">
- <path
- id="path3948"
- d="m 470.75274,454.90715 c -1.336,-0.292 -2.281,-0.45 -3.442,-0.45 -2.847,0 -5.33,0.832 -7.391,2.467 -0.091,0.062 -0.192,0.142 -0.303,0.247 -0.231,0.197 -0.452,0.405 -0.668,0.621 -1.478,1.313 -2.76,1.95 -2.76,-1.235 v -0.666 c 0,-0.404 -0.327,-0.733 -0.732,-0.733 h -2.101 c -0.198,0 -0.388,0.081 -0.525,0.223 -0.139,0.143 -0.212,0.335 -0.206,0.533 0.105,3.333 0.215,6.778 0.215,9.622 v 18.749 c 0,0.403 0.328,0.731 0.732,0.731 h 2.209 c 0.404,0 0.732,-0.328 0.732,-0.731 v -9.913 c 0,-1.371 0.107,-3.805 0.309,-4.813 1.569,-7.798 4.982,-11.59 10.435,-11.59 0.979,0 1.881,0.164 2.874,0.364 0.048,0.01 0.096,0.013 0.144,0.013 0.148,0 0.294,-0.043 0.417,-0.129 0.163,-0.113 0.273,-0.288 0.306,-0.485 l 0.323,-1.993 c 0.062,-0.386 -0.187,-0.752 -0.568,-0.832 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3950"
- d="m 444.70074,454.90715 c -1.337,-0.292 -2.281,-0.45 -3.442,-0.45 -2.847,0 -5.33,0.832 -7.391,2.467 -0.092,0.062 -0.192,0.142 -0.303,0.247 -0.231,0.197 -0.452,0.405 -0.668,0.621 -1.478,1.313 -2.759,1.95 -2.759,-1.235 v -0.666 c 0,-0.404 -0.327,-0.733 -0.732,-0.733 h -2.101 c -0.198,0 -0.388,0.081 -0.526,0.223 -0.138,0.143 -0.212,0.335 -0.206,0.533 0.105,3.333 0.215,6.778 0.215,9.622 v 18.749 c 0,0.403 0.327,0.731 0.732,0.731 h 2.209 c 0.404,0 0.732,-0.328 0.732,-0.731 v -9.913 c 0,-1.371 0.107,-3.805 0.309,-4.813 1.569,-7.798 4.983,-11.59 10.435,-11.59 0.979,0 1.881,0.164 2.874,0.364 0.048,0.01 0.096,0.013 0.144,0.013 0.148,0 0.294,-0.043 0.417,-0.129 0.163,-0.113 0.273,-0.288 0.306,-0.485 l 0.323,-1.993 c 0.061,-0.386 -0.188,-0.752 -0.568,-0.832 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3952"
- d="m 559.79974,456.49815 c -2.512,-1.775 -5.292,-2.041 -6.726,-2.041 -2.91,0 -5.648,0.913 -7.822,2.496 -0.005,0.003 -0.01,0.003 -0.014,0.007 -1.004,0.649 -2.627,0.911 -2.618,-0.624 l 0,-0.021 c 0.002,-0.107 -0.003,-0.198 -0.013,-0.278 l -0.008,-0.181 c -0.019,-0.391 -0.34,-0.699 -0.731,-0.699 h -2.102 c -0.203,0 -0.396,0.086 -0.535,0.232 -0.138,0.148 -0.209,0.348 -0.195,0.549 0.152,2.282 0.214,4.17 0.214,6.526 v 21.819 c 0,0.403 0.328,0.731 0.731,0.731 h 2.209 c 0.404,0 0.732,-0.328 0.732,-0.731 v -17.51 c 0,-0.815 0.253,-1.763 0.49,-2.378 0.004,-0.01 0.006,-0.016 0.01,-0.026 1.043,-3.042 4.224,-6.118 8.417,-6.474 3.236,0 8.327,2.358 9.024,8.226 0.016,0.15 0.03,0.299 0.042,0.443 0.004,0.05 0.008,0.099 0.011,0.148 0.005,0.07 0.009,0.14 0.014,0.209 0.009,0.19 0.015,0.386 0.015,0.584 0,0.332 0.006,0.636 0.017,0.909 v 15.868 c 0,0.403 0.328,0.731 0.733,0.731 h 2.208 c 0.404,0 0.732,-0.328 0.732,-0.731 v -16.271 c 0,-5.372 -1.627,-9.246 -4.835,-11.513 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3954"
- d="m 636.02374,481.83915 c -0.133,-0.111 -0.301,-0.173 -0.473,-0.173 -0.04,0 -0.08,0.005 -0.12,0.01 -0.587,0.097 -0.965,0.097 -1.442,0.097 -1.147,0 -2.177,-0.334 -2.177,-4.386 v -9.913 c 0,-2.344 -0.179,-5.367 -1.583,-7.971 -1.822,-3.384 -5.181,-5.099 -9.978,-5.099 -2.475,0 -6.217,0.516 -9.99,2.974 -0.315,0.205 -0.422,0.614 -0.25,0.949 l 0.861,1.67 c 0.098,0.188 0.272,0.325 0.478,0.377 0.058,0.013 0.116,0.019 0.173,0.019 0.151,0 0.299,-0.046 0.424,-0.133 2.314,-1.64 5.186,-2.506 8.305,-2.506 3.995,0 6.004,1.854 7,3.939 0,0 0,0 0,0.002 1.004,2.219 -0.561,4.402 -2.285,4.584 -0.085,0.005 -0.17,0.006 -0.254,0.012 -0.014,0 -0.028,0 -0.042,0 -0.055,-0.002 -0.101,0.002 -0.143,0.009 -10.978,0.628 -16.538,4.312 -16.538,10.98 0,2.028 0.803,4.057 2.202,5.569 1.233,1.332 3.56,2.92 7.635,2.92 3.471,0 6.271,-1.111 8.325,-2.472 0.061,-0.032 0.13,-0.076 0.211,-0.141 0.023,-0.017 0.042,-0.029 0.064,-0.047 0.128,-0.09 0.256,-0.18 0.378,-0.269 1.275,-0.825 1.969,-0.351 2.623,0.502 0.002,0.005 0.006,0.006 0.008,0.008 0.84,1.143 2.161,1.72 3.962,1.72 0.846,0 1.591,-0.094 2.344,-0.296 0.32,-0.086 0.543,-0.374 0.543,-0.706 v -1.672 c -0.002,-0.215 -0.097,-0.417 -0.261,-0.557 z m -18.252,0.529 c -3.042,0 -6.111,-1.725 -6.111,-5.573 0,-4.862 5.936,-6.58 12.167,-7.043 2.32,-0.043 4.097,2.161 4.311,4.575 v 0.988 c -0.062,0.647 -0.246,1.289 -0.568,1.889 -0.162,0.263 -0.356,0.556 -0.589,0.864 -0.04,0.048 -0.075,0.092 -0.103,0.134 -1.442,1.848 -4.223,4.166 -9.107,4.166 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3956"
- d="m 599.89174,455.15715 h -2.047 c -0.393,0 -0.716,0.31 -0.731,0.704 -0.066,1.617 -0.892,1.835 -2.703,0.766 -0.009,-0.008 -0.018,-0.013 -0.027,-0.021 -0.178,-0.118 -0.362,-0.229 -0.546,-0.339 -0.011,-0.005 -0.02,-0.011 -0.031,-0.019 -0.087,-0.059 -0.168,-0.102 -0.244,-0.139 -1.982,-1.097 -4.307,-1.652 -6.924,-1.652 -3.739,0 -7.429,1.549 -10.122,4.249 -2.082,2.089 -4.564,5.828 -4.564,11.785 0,3.816 1.346,7.414 3.792,10.122 2.595,2.873 6.234,4.458 10.248,4.458 3.111,0 5.514,-0.822 7.335,-1.898 0.004,0 0.007,-0.003 0.012,-0.004 1.954,-0.874 3.603,-2.182 3.135,2.233 -0.875,5.677 -4.519,8.764 -10.482,8.764 -4.175,0 -7.31,-1.406 -9.204,-2.583 -0.118,-0.073 -0.251,-0.111 -0.387,-0.111 -0.06,0 -0.122,0.008 -0.182,0.022 -0.193,0.051 -0.358,0.177 -0.456,0.351 l -0.97,1.725 c -0.189,0.335 -0.085,0.763 0.237,0.972 2.853,1.864 6.91,2.976 10.854,2.976 2.689,0 9.293,-0.624 12.493,-6.413 1.385,-2.482 2.031,-5.968 2.031,-10.968 v -17.456 c 0,-2.476 0.07,-4.679 0.214,-6.738 0.014,-0.203 -0.057,-0.401 -0.195,-0.55 -0.139,-0.15 -0.332,-0.236 -0.536,-0.236 z m -16.892,26.028 c -0.605,-0.24 -7.609,-3.216 -7.013,-11.813 0.551,-7.939 5.716,-10.454 6.517,-10.796 1.278,-0.501 2.701,-0.77 4.242,-0.77 1.665,0 3.113,0.327 4.354,0.871 6.845,3.873 7.696,16.454 0.884,21.469 -1.592,1 -3.436,1.573 -5.345,1.573 -1.343,10e-4 -2.553,-0.192 -3.639,-0.534 z"
- inkscape:connector-curvature="0" />
- <path
- id="path3963"
- d="m 501.11674,440.93115 c -2.337,2.339 -4.109,5.342 -5.032,8.657 -6.076,-0.094 -12.171,2.271 -17.007,7.109 -8.142,8.141 -10.674,22.911 0.667,34.251 9.542,9.545 23.793,9.688 33.145,0.336 4.421,-4.424 7.236,-10.507 7.297,-16.94 3.14,-0.837 6.125,-2.508 8.67,-5.049 6.956,-6.959 9.086,-18.919 -0.311,-28.318 -7.833,-7.83 -19.626,-7.848 -27.429,-0.046 z m 25.622,20.423 c -1.335,1.339 -3.045,2.324 -4.932,2.864 -3.027,0.868 -4.657,0.776 -5.698,2.515 -1.041,1.736 -0.926,1.941 -0.88,5.193 0.056,3.689 -1.333,7.515 -4.813,10.996 -5.32,5.317 -15.14,6.504 -22.366,-0.722 -5.693,-5.693 -8.365,-15.278 -0.778,-22.864 2.816,-2.814 6.866,-4.479 11.124,-4.403 2.961,0.053 3.306,0.161 5.212,-0.703 1.909,-0.868 1.082,-2.799 2.222,-6.205 0.556,-1.66 1.545,-3.294 3.092,-4.844 4.126,-4.125 11.721,-5.071 17.285,0.491 4.533,4.535 6.455,11.76 0.532,17.682 z"
- inkscape:connector-curvature="0"
- style="fill:url(#linearGradient4655)" />
- </g>
- </g>
-</svg>
diff --git a/storage/mroonga/vendor/groonga/data/images/logo/update-files.sh b/storage/mroonga/vendor/groonga/data/images/logo/update-files.sh
deleted file mode 100755
index 03f68f0afee..00000000000
--- a/storage/mroonga/vendor/groonga/data/images/logo/update-files.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-list_paths()
-{
- variable_name=$1
- echo "$variable_name = \\"
- sort | \
- sed \
- -e 's,^,\t,' \
- -e 's,$, \\,'
- echo " \$(NULL)"
- echo
-}
-
-# image files.
-ls *.svg *.png | \
- list_paths "image_files"
diff --git a/storage/mroonga/vendor/groonga/data/munin/Makefile.am b/storage/mroonga/vendor/groonga/data/munin/Makefile.am
deleted file mode 100644
index 329dea592d9..00000000000
--- a/storage/mroonga/vendor/groonga/data/munin/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-if INSTALL_MUNIN_PLUGINS
-munin_pluginsdir = $(datarootdir)/$(PACKAGE)/munin/plugins
-dist_munin_plugins_SCRIPTS = \
- groonga_cpu_load_ \
- groonga_cpu_time_ \
- groonga_status_ \
- groonga_memory_ \
- groonga_n_records_ \
- groonga_query_performance_ \
- groonga_disk_ \
- groonga_throughput_
-endif
diff --git a/storage/mroonga/vendor/groonga/data/munin/groonga_cpu_load_ b/storage/mroonga/vendor/groonga/data/munin/groonga_cpu_load_
deleted file mode 100755
index 17161acb00b..00000000000
--- a/storage/mroonga/vendor/groonga/data/munin/groonga_cpu_load_
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/bin/sh
-
-#%# family=auto
-#%# capabilities=autoconf suggest
-
-case "$1" in
- autoconf|detect)
- pid_paths=
- if [ -n "${pid_path}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${pid_path}"
- fi
- # For backward compatibility. Remove me when 5.0.0.
- if [ -n "${pid_file}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${pid_file}"
- fi
- if [ -n "${http_pid_path}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${http_pid_path}"
- fi
- if [ -n "${httpd_pid_path}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${httpd_pid_path}"
- fi
- if [ -n "${gqtp_pid_path}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${gqtp_pid_path}"
- fi
- if [ -z "${pid_paths}" ]; then
- message="no (No PID path is specified. Specify "
- message="${message} env.pid_path, env.http_pid_path, "
- message="${message} env.httpd_pid_path and/or env.gqtp_pid_path.)"
- echo "${message}"
- exit 1
- fi
-
- for _pid_path in ${pid_paths}; do
- if [ -f "${_pid_path}" ]; then
- echo "yes"
- exit 0
- fi
- done
-
- echo "no (All PID paths don't exist: ${pid_paths})"
- exit 1
- ;;
- suggest)
- if [ -n "${http_pid_path}" -a -f "${http_pid_path}" ]; then
- echo "http"
- fi
- if [ -n "${httpd_pid_path}" -a -f "${httpd_pid_path}" ]; then
- echo "httpd"
- fi
- if [ -n "${gqtp_pid_path}" -a -f "${gqtp_pid_path}" ]; then
- echo "gqtp"
- fi
- exit 0
- ;;
- config)
- if [ -z "${label}" ]; then
- title="groonga: CPU load"
- else
- title="groonga: ${label}: CPU load"
- fi
- cat <<EOF
-graph_title ${title}
-graph_vlabel CPU load (%)
-graph_category groonga
-graph_info groonga CPU load
-
-cpu_load.label CPU load
-cpu_load.type GAUGE
-EOF
- exit 0
- ;;
- *)
- ;;
-esac
-
-server_type="${0##*_}"
-if [ -n "${server_type}" ]; then
- pid_path_variable_name="${server_type}_pid_path"
-else
- # For backward compatibility. Remove me when 5.0.0.
- if [ -z "${pid_path}" -a -n "${pid_file}" ]; then
- pid_path_variable_name="pid_file"
- else
- pid_path_variable_name="pid_path"
- fi
-fi
-_pid_path=$(eval "echo \${${pid_path_variable_name}}")
-if [ -z "${_pid_path}" ]; then
- echo "PID path isn't specified by env.${pid_path_variable_name}" 1>&2
- exit 1
-fi
-if [ ! -f "${_pid_path}" ]; then
- echo "PID path doesn't exist: ${_pid_path}" 1>&2
- exit 1
-fi
-
-groonga_pid=$(cat ${_pid_path})
-top_for_groonga=$(top -b -n 1 -p ${groonga_pid} | grep ${groonga_pid})
-load_in_percent=$(echo ${top_for_groonga} | sed -r -e 's/ +/ /g' | cut -d' ' -f 9)
-echo "cpu_load.value ${load_in_percent}"
diff --git a/storage/mroonga/vendor/groonga/data/munin/groonga_cpu_time_ b/storage/mroonga/vendor/groonga/data/munin/groonga_cpu_time_
deleted file mode 100755
index 5c60c17db55..00000000000
--- a/storage/mroonga/vendor/groonga/data/munin/groonga_cpu_time_
+++ /dev/null
@@ -1,122 +0,0 @@
-#!/usr/bin/env ruby
-
-#%# family=auto
-#%# capabilities=autoconf suggest
-
-label = ENV["label"]
-
-command = ARGV.shift
-
-def autoconf
- pid_path_variable_names = [
- "pid_path",
- "pid_file", # For backward compatibility. Remove me when 5.0.0.
- "http_pid_path",
- "httpd_pid_path",
- "gqtp_pid_path",
- ]
- pid_paths = pid_path_variable_names.collect do |variable_name|
- ENV[variable_name]
- end
- pid_paths = pid_paths.compact
- if pid_paths.empty?
- variable_names = pid_path_variable_names.collect do |name|
- "env.#{name}"
- end
- variable_names_label = variable_names[0..-2].join(", ")
- variable_names_label << " and/or #{variable_names.last}"
- puts("no (No PID path is specified. Specify #{variable_names_label}.)")
- exit(false)
- end
- pid_paths.each do |pid_path|
- next unless File.exist?(pid_path)
- puts("yes")
- exit(true)
- end
- pid_paths_label = pid_paths.join(", ")
- puts("no (All PID paths don't exist: #{pid_paths_label})")
- exit(false)
-end
-
-def suggest
- exist_p = lambda do |variable_name|
- pid_path = ENV[variable_name]
- pid_path and File.exist?(pid_path)
- end
- if exist_p.call("http_pid_path")
- puts("http")
- end
- if exist_p.call("httpd_pid_path")
- puts("httpd")
- end
- if exist_p.call("gqtp_pid_path")
- puts("gqtp")
- end
- exit(true)
-end
-
-def target_pid_path
- if /_([^_]+)\z/ =~ $0
- service_type = $1
- pid_path_variable_name = "#{service_type}_pid_path"
- pid_path = ENV[pid_path_variable_name]
- else
- pid_path_variable_name = "pid_path"
- pid_path = ENV[pid_path_variable_name]
- # For backward compatibility. Remove me when 5.0.0.
- pid_path ||= ENV["pid_file"]
- end
-
- if pid_path.nil?
- $stderr.puts("PID path isn't specified by env.#{pid_path_variable_name}")
- exit(false)
- end
-
- unless File.exist?(pid_path)
- $stderr.puts("PID path doesn't exist: #{pid_path}")
- exit(false)
- end
-
- pid_path
-end
-
-case command
-when "autoconf", "detect"
- autoconf
-when "suggest"
- suggest
-when "config"
- if label
- title = "groonga: #{label}: CPU time"
- else
- title = "groonga: CPU time"
- end
- puts(<<EOF)
-graph_title #{title}
-graph_vlabel CPU time (days)
-graph_category groonga
-graph_info groonga CPU time
-
-cpu_time.label CPU time
-cpu_time.type GAUGE
-EOF
- exit(true)
-end
-
-groonga_pid = File.read(target_pid_path).strip
-time = `ps h -o time -p #{groonga_pid}`.chomp
-if /\A(?:(\d+)-)?(\d+):(\d+):(\d+)\z/ =~ time
- day, hours, minutes, seconds, = $1, $2, $3, $4
- day = (day || 0).to_i
- hours = hours.to_i
- minutes = minutes.to_i
- seconds = seconds.to_i
- time_in_seconds = seconds + minutes * 60 + hours * 60 * 60
- day_in_seconds = 60 * 60 * 24
- fraction_in_day = time_in_seconds.to_f / day_in_seconds.to_f
- cpu_time_in_day = day + fraction_in_day
- puts("cpu_time.value #{cpu_time_in_day}")
-else
- $stderr.puts("invalid time format: <#{time}>")
- exit(false)
-end
diff --git a/storage/mroonga/vendor/groonga/data/munin/groonga_disk_ b/storage/mroonga/vendor/groonga/data/munin/groonga_disk_
deleted file mode 100755
index c65aad52b2b..00000000000
--- a/storage/mroonga/vendor/groonga/data/munin/groonga_disk_
+++ /dev/null
@@ -1,246 +0,0 @@
-#!/usr/bin/env ruby
-
-#%# family=auto
-#%# capabilities=autoconf suggest
-
-require 'shellwords'
-begin
- require 'json'
-rescue LoadError
- require 'rubygems'
- require 'json'
-end
-require 'English'
-
-label = ENV["label"]
-@groonga = ENV["groonga"] || "groonga"
-@du = ENV["du"] || "du"
-
-command = ARGV.shift
-
-def parse(success, result)
- if success
- begin
- status, body = JSON.parse(result)
- return_code, start_time, elapsed, error_message = status
- if return_code.zero?
- [success, body]
- else
- [false, error_message]
- end
- rescue JSON::ParserError
- [false, $!.message]
- end
- else
- [success, result]
- end
-end
-
-def run(command, *args)
- database_path = Shellwords.shellescape(@database_path)
- result = `#{@groonga} #{database_path} #{command} #{args.join(' ')} 2>&1`
- parse($?.success?, result)
-end
-
-def parse_list(header, list)
- list.collect do |item|
- parsed_item = {}
- header.each_with_index do |(name, type), i|
- parsed_item[name] = item[i]
- end
- parsed_item
- end
-end
-
-def schema
- tables = []
- success, table_list_body = run("table_list")
- unless success
- puts("error: #{table_list_body}")
- exit(false)
- end
- parse_list(table_list_body[0], table_list_body[1..-1]).each do |table|
- table_name = table["name"]
- table["key"] = "table_#{table_name}"
- success, column_list_body = run("column_list", table_name)
- unless success
- puts("error: #{column_list_body}")
- exit(false)
- end
- table["columns"] = parse_list(column_list_body[0], column_list_body[1..-1])
- table["columns"].each do |column|
- column["key"] = "column_#{table_name}_#{column['name']}"
- column["full_name"] = "#{table_name}.#{column['name']}"
- end
- tables << table
- end
- tables
-end
-
-def parse_du_result(result)
- usages = {}
- result.each_line do |line|
- if /\A(\d+)\s+/ =~ line
- usage = $1
- path = $POSTMATCH.strip
- usages[path] = usage.to_i
- end
- end
- usages
-end
-
-def compute_size(usages, base_path)
- usage = 0
- return usage if base_path.empty?
-
- usages.each do |path, size|
- usage += size if path.start_with?(base_path)
- end
- usage
-end
-
-def setup_database_path
- if /_([^_]+)\z/ =~ $0
- service_type = $1
- database_path_variable_name = "#{service_type}_database_path"
- database_path = ENV[database_path_variable_name]
- else
- database_path_variable_name = "database_path"
- database_path = ENV[database_path_variable_name]
- # For backward compatibility. Remove me when 5.0.0.
- database_path ||= ENV["path"]
- end
-
- if database_path.nil?
- key = "env.#{database_path_variable_name}"
- $stderr.puts("Database path isn't specified by #{key}")
- exit(false)
- end
-
- unless File.exist?(database_path)
- $stderr.puts("Database path doesn't exist: #{database_path}")
- exit(false)
- end
-
- @database_path = database_path
-end
-
-def autoconf
- database_path_variable_names = [
- "database_path",
- "path", # For backward compatibility. Remove me when 5.0.0.
- "http_database_path",
- "httpd_database_path",
- "gqtp_database_path",
- ]
- database_paths = database_path_variable_names.collect do |variable_name|
- ENV[variable_name]
- end
- database_paths = database_paths.compact
- if database_paths.empty?
- variable_names = database_path_variable_names.collect do |name|
- "env.#{name}"
- end
- variable_names_label = variable_names[0..-2].join(", ")
- variable_names_label << " and/or #{variable_names.last}"
- puts("no (No database path is specified. Specify #{variable_names_label}.)")
- exit(false)
- end
- database_paths.each do |database_path|
- next unless File.exist?(database_path)
- puts("yes")
- exit(true)
- end
- database_paths_label = database_paths.join(", ")
- puts("no (All database paths don't exist: #{database_paths_label})")
- exit(false)
-end
-
-def suggest
- exist_p = lambda do |variable_name|
- database_path = ENV[variable_name]
- database_path and File.exist?(database_path)
- end
- if exist_p.call("http_database_path")
- puts("http")
- end
- if exist_p.call("httpd_database_path")
- puts("httpd")
- end
- if exist_p.call("gqtp_database_path")
- puts("gqtp")
- end
- exit(true)
-end
-
-case command
-when "autoconf", "detect"
- autoconf
-when "suggest"
- suggest
-when "config"
- setup_database_path
- if label.nil?
- title = "groonga: disk usage"
- else
- title = "groonga: #{label}: disk usage"
- end
- puts(<<EOF)
-graph_title #{title}
-graph_vlabel Bytes
-graph_category groonga
-graph_info disk usage in groonga tables and columns
-graph_args --base 1024
-graph_total Total
-
-database.label Database
-database.draw AREA
-EOF
- schema.each do |table|
- table_key = table["key"]
- table_name = table["name"]
- puts(<<EOF)
-
-#{table_key}.label #{table_name}
-#{table_key}.draw STACK
-EOF
- table["columns"].each do |column|
- column_key = column["key"]
- column_name = column["full_name"]
- puts(<<EOF)
-
-#{column_key}.label #{column_name}
-#{column_key}.draw STACK
-EOF
- end
- end
- exit(true)
-end
-
-setup_database_path
-database_path = Shellwords.shellescape(@database_path)
-du_result = `#{@du} -B1 #{database_path}*`
-unless $?.success?
- $stderr.puts("error: #{du_result}")
- exit(false)
-end
-usages = parse_du_result(du_result)
-usage = compute_size(usages, @database_path)
-puts(<<EOF)
-database.value #{usage}
-EOF
-schema.each do |table|
- table_key = table["key"]
- table_name = table["name"]
- usage = compute_size(usages, table["path"])
- puts(<<EOF)
-#{table_key}.value #{usage}
-EOF
- table["columns"].each do |column|
- column_key = column["key"]
- usage = compute_size(usages, column["path"])
- puts(<<EOF)
-#{column_key}.value #{usage}
-EOF
- end
-end
diff --git a/storage/mroonga/vendor/groonga/data/munin/groonga_memory_ b/storage/mroonga/vendor/groonga/data/munin/groonga_memory_
deleted file mode 100755
index 675154bcbf6..00000000000
--- a/storage/mroonga/vendor/groonga/data/munin/groonga_memory_
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/sh
-
-#%# family=auto
-#%# capabilities=autoconf suggest
-
-case "$1" in
- autoconf|detect)
- pid_paths=
- if [ -n "${pid_path}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${pid_path}"
- fi
- # For backward compatibility. Remove me when 5.0.0.
- if [ -n "${pid_file}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${pid_file}"
- fi
- if [ -n "${http_pid_path}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${http_pid_path}"
- fi
- if [ -n "${httpd_pid_path}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${httpd_pid_path}"
- fi
- if [ -n "${gqtp_pid_path}" ]; then
- pid_paths="${pid_paths}${pid_paths:+ }${gqtp_pid_path}"
- fi
- if [ -z "${pid_paths}" ]; then
- message="no (No PID path is specified. Specify "
- message="${message} env.pid_path, env.http_pid_path, "
- message="${message} env.httpd_pid_path and/or env.gqtp_pid_path.)"
- echo "${message}"
- exit 1
- fi
-
- for _pid_path in ${pid_paths}; do
- if [ -f "${_pid_path}" ]; then
- echo "yes"
- exit 0
- fi
- done
-
- echo "no (All PID paths don't exist: ${pid_paths})"
- exit 1
- ;;
- suggest)
- if [ -n "${http_pid_path}" -a -f "${http_pid_path}" ]; then
- echo "http"
- fi
- if [ -n "${httpd_pid_path}" -a -f "${httpd_pid_path}" ]; then
- echo "httpd"
- fi
- if [ -n "${gqtp_pid_path}" -a -f "${gqtp_pid_path}" ]; then
- echo "gqtp"
- fi
- exit 0
- ;;
- config)
- if [ -z "${label}" ]; then
- title="groonga: memory usage"
- else
- title="groonga: ${label}: memory usage"
- fi
- cat <<EOF
-graph_title ${title}
-graph_vlabel memory usage
-graph_category groonga
-graph_info groonga memory usage
-
-rss.label resident set size
-rss.type GAUGE
-vsz.label virtual memory size
-vsz.type GAUGE
-EOF
- exit 0
- ;;
- *)
- ;;
-esac
-
-server_type="${0##*_}"
-if [ -n "${server_type}" ]; then
- pid_path_variable_name="${server_type}_pid_path"
-else
- # For backward compatibility. Remove me when 5.0.0.
- if [ -z "${pid_path}" -a -n "${pid_file}" ]; then
- pid_path_variable_name="pid_file"
- else
- pid_path_variable_name="pid_path"
- fi
-fi
-_pid_path=$(eval "echo \${${pid_path_variable_name}}")
-if [ -z "${_pid_path}" ]; then
- echo "PID path isn't specified by env.${pid_path_variable_name}" 1>&2
- exit 1
-fi
-if [ ! -f "${_pid_path}" ]; then
- echo "PID path doesn't exist: ${_pid_path}" 1>&2
- exit 1
-fi
-
-groonga_pid=$(cat ${_pid_path})
-read rss_in_kb vsz_in_kb <<EOC
-$(ps h -o rss,vsz -p ${groonga_pid})
-EOC
-echo "rss.value ${rss_in_kb}000"
-echo "vsz.value ${vsz_in_kb}000"
diff --git a/storage/mroonga/vendor/groonga/data/munin/groonga_n_records_ b/storage/mroonga/vendor/groonga/data/munin/groonga_n_records_
deleted file mode 100755
index c131c481efa..00000000000
--- a/storage/mroonga/vendor/groonga/data/munin/groonga_n_records_
+++ /dev/null
@@ -1,256 +0,0 @@
-#!/usr/bin/env ruby
-
-#%# family=auto
-#%# capabilities=autoconf suggest
-
-require 'shellwords'
-require 'net/http'
-require 'erb'
-begin
- require 'json'
-rescue LoadError
- require 'rubygems'
- require 'json'
-end
-
-label = ENV["label"]
-@groonga = ENV["groonga"] || "groonga"
-@default_host = ENV["host"] || "127.0.0.1"
-@default_http_port = 10041
-@default_gqtp_port = 10043
-@database_path = nil
-
-command = ARGV.shift
-
-def parse(success, result)
- if success
- begin
- status, body = JSON.parse(result)
- return_code, start_time, elapsed, error_message = status
- if return_code.zero?
- [success, body]
- else
- [false, error_message]
- end
- rescue JSON::ParserError
- [false, "#{$!.message}: #{result}"]
- end
- else
- [success, result]
- end
-end
-
-def run_http(host, port, command, *args)
- path = "/d/#{command}"
- unless args.empty?
- parameters = args.each_slice(2).collect do |key, value|
- key = key.gsub(/\A--/, "")
- "#{ERB::Util.u(key)}=#{ERB::Util.u(value)}"
- end
- path << "?" << parameters.join("&")
- end
- response = Net::HTTP.start(host, port) do |http|
- http.get(path)
- end
- if response.is_a?(Net::HTTPSuccess)
- parse(true, response.body)
- else
- [false, "#{response.code}: #{response.body}"]
- end
-end
-
-def run_gqtp(host, port, command, *args)
- groonga = "#{@groonga} -p #{port} -c #{host}"
- result = `#{groonga} #{command} #{args.join(' ')} 2>&1`
- parse($?.success?, result)
-end
-
-def run_command_line(database_path, command, *args)
- database_path = Shellwords.shellescape(database_path)
- result = `#{@groonga} #{database_path} #{command} #{args.join(' ')} 2>&1`
- parse($?.success?, result)
-end
-
-def run(command, *args)
- case @service_type
- when "http"
- run_http(@http_host, @http_port, command, *args)
- when "httpd"
- run_http(@httpd_host, @httpd_port, command, *args)
- when "gqtp"
- run_gqtp(@gqtp_host, @gqtp_port, command, *args)
- else
- run_command_line(@database_path, command, *args)
- end
-end
-
-def exclude_tables
- case @service_type
- when "http"
- @http_exclude_tables
- when "httpd"
- @httpd_exclude_tables
- when "gqtp"
- @gqtp_exclude_tables
- else
- @exclude_tables
- end
-end
-
-def parse_list(header, list)
- list.collect do |item|
- parsed_item = {}
- header.each_with_index do |(name, type), i|
- parsed_item[name] = item[i]
- end
- parsed_item
- end
-end
-
-def table_list
- success, body = run("table_list")
- unless success
- puts("error: #{body}")
- exit(false)
- end
- tables = parse_list(body[0], body[1..-1])
- tables.reject do |table|
- name = table["name"]
- exclude_tables.include?(name)
- end
-end
-
-def setup_service_type
- if /_([^_]+)\z/ =~ $0
- @service_type = $1
- else
- @service_type = nil
- end
-end
-
-def parse_exclude_tables(raw_exclude_tables_value)
- (raw_exclude_tables_value || "").split(/\s*,\s*/)
-end
-
-def setup_command_line
- @database_path = ENV["database_path"]
- # For backward compatibility. Remove me when 5.0.0.
- @database_path ||= ENV["path"]
- @exclude_tables = parse_exclude_tables(ENV["exclude_tables"])
-end
-
-def setup_http
- @http_host = ENV["http_host"] || @default_host
- @http_port = (ENV["http_port"] || @default_http_port).to_i
- @http_exclude_tables = parse_exclude_tables(ENV["http_exclude_tables"])
-end
-
-def setup_httpd
- @httpd_host = ENV["httpd_host"] || @default_host
- @httpd_port = (ENV["httpd_port"] || @default_http_port).to_i
- @httpd_exclude_tables = parse_exclude_tables(ENV["httpd_exclude_tables"])
-end
-
-def setup_gqtp
- @gqtp_host = ENV["gqtp_host"] || @default_host
- @gqtp_port = (ENV["gqtp_port"] || @default_gqtp_port).to_i
- @gqtp_exclude_tables = parse_exclude_tables(ENV["gqtp_exclude_tables"])
-end
-
-def setup
- setup_service_type
- setup_command_line
- setup_http
- setup_httpd
- setup_gqtp
-end
-
-def autoconf
- results = []
-
- if @database_path and File.exist?(@database_path)
- results << run_command_line(@database_path, "status")
- end
-
- if @http_host and @http_port
- results << run_http(@http_host, @http_port, "status")
- end
-
- if @httpd_host and @httpd_port
- results << run_http(@httpd_host, @httpd_port, "status")
- end
-
- if @gqtp_host and @gqtp_port
- results << run_gqtp(@gqtp_host, @gqtp_port, "status")
- end
-
- if results.any? {|success, _| success}
- puts("yes")
- exit(true)
- else
- errors = results.collect do |_, result|
- result
- end
- error_detail = errors.join(", ")
- puts("no (#{error_detail})")
- exit(false)
- end
-end
-
-def suggest
- if @http_host and @http_port
- success, _ = run_http(@http_host, @http_port, "status")
- puts("http") if success
- end
- if @httpd_host and @httpd_port
- success, _ = run_http(@httpd_host, @httpd_port, "status")
- puts("httpd") if success
- end
- if @gqtp_host and @gqtp_port
- success, _ = run_gqtp(@gqtp_host, @gqtp_port, "status")
- puts("gqtp") if success
- end
- exit(true)
-end
-
-setup
-case command
-when "autoconf", "detect"
- autoconf
-when "suggest"
- suggest
-when "config"
- if label.nil?
- title = "groonga: number of records"
- else
- title = "groonga: #{label}: number of records"
- end
- puts(<<EOF)
-graph_title #{title}
-graph_vlabel records
-graph_category groonga
-graph_info number of records in groonga table
-EOF
- table_list.each do |table|
- name = table["name"]
- puts(<<EOF)
-
-#{name}.label #{name}
-#{name}.type GAUGE
-EOF
- end
- exit(true)
-end
-
-table_list.each do |table|
- name = table["name"]
- success, body = run("select", "--table", name, "--limit", "0")
- unless success
- puts("error: #{body}")
- exit(false)
- end
- n_records = body[0][0][0]
- puts(<<EOF)
-#{name}.value #{n_records}
-EOF
-end
diff --git a/storage/mroonga/vendor/groonga/data/munin/groonga_query_performance_ b/storage/mroonga/vendor/groonga/data/munin/groonga_query_performance_
deleted file mode 100755
index 1e3a33b78a3..00000000000
--- a/storage/mroonga/vendor/groonga/data/munin/groonga_query_performance_
+++ /dev/null
@@ -1,198 +0,0 @@
-#!/usr/bin/env ruby
-
-#%# family=auto
-#%# capabilities=autoconf suggest
-
-require 'English'
-require 'strscan'
-
-label = ENV["label"]
-
-command = ARGV.shift
-
-def autoconf
- query_log_path_variable_names = [
- "query_log_path",
- "log_path", # For backward compatibility. Remove me when 5.0.0.
- "http_query_log_path",
- "httpd_query_log_path",
- "gqtp_query_log_path",
- ]
- query_log_paths = query_log_path_variable_names.collect do |variable_name|
- ENV[variable_name]
- end
- query_log_paths = query_log_paths.compact
- if query_log_paths.empty?
- variable_names = query_log_path_variable_names.collect do |name|
- "env.#{name}"
- end
- variable_names_label = variable_names[0..-2].join(", ")
- variable_names_label << " and/or #{variable_names.last}"
- puts("no (No query log path is specified. Specify #{variable_names_label}.)")
- exit(false)
- end
- query_log_paths.each do |query_log_path|
- next unless File.exist?(query_log_path)
- puts("yes")
- exit(true)
- end
- query_log_paths_label = query_log_paths.join(", ")
- puts("no (All query log paths don't exist: #{query_log_paths_label})")
- exit(false)
-end
-
-def suggest
- exist_p = lambda do |variable_name|
- query_log_path = ENV[variable_name]
- query_log_path and File.exist?(query_log_path)
- end
- if exist_p.call("http_query_log_path")
- puts("http")
- end
- if exist_p.call("httpd_query_log_path")
- puts("httpd")
- end
- if exist_p.call("gqtp_query_log_path")
- puts("gqtp")
- end
- exit(true)
-end
-
-def target_query_log_path
- if /_([^_]+)\z/ =~ $0
- service_type = $1
- query_log_path_variable_name = "#{service_type}_query_log_path"
- query_log_path = ENV[query_log_path_variable_name]
- else
- query_log_path_variable_name = "query_log_path"
- query_log_path = ENV[query_log_path_variable_name]
- # For backward compatibility. Remove me when 5.0.0.
- query_log_path ||= ENV["log_file"]
- end
-
- if query_log_path.nil?
- key = "env.#{query_log_path_variable_name}"
- $stderr.puts("Query log path isn't specified by #{key}")
- exit(false)
- end
-
- unless File.exist?(query_log_path)
- $stderr.puts("Query log path doesn't exist: #{query_log_path}")
- exit(false)
- end
-
- query_log_path
-end
-
-class ReverseLineReader
- def initialize(io)
- @io = io
- @io.seek(0, IO::SEEK_END)
- @buffer = ""
- @data = ""
- end
-
- def each
- separator = $/
- separator_length = separator.length
- while read_to_buffer
- loop do
- index = @buffer.rindex(separator, @buffer.length - 1 - separator_length)
- break if index.nil? or index.zero?
- last_line = @buffer.slice!((index + separator_length)..-1)
- yield(last_line)
- end
- end
- yield(@buffer) unless @buffer.empty?
- end
-
- private
- BYTES_PER_READ = 4096
- def read
- position = @io.pos
- if position < BYTES_PER_READ
- bytes_per_read = position
- else
- bytes_per_read = BYTES_PER_READ
- end
-
- if bytes_per_read.zero?
- @data.replace("")
- else
- @io.seek(-bytes_per_read, IO::SEEK_CUR)
- @io.read(bytes_per_read, @data)
- @io.seek(-bytes_per_read, IO::SEEK_CUR)
- end
-
- @data
- end
-
- def read_to_buffer
- data = read
- if data.empty?
- false
- else
- @buffer.insert(0, data)
- true
- end
- end
-end
-
-case command
-when "autoconf", "detect"
- autoconf
-when "suggest"
- suggest
-when "config"
- if label.nil?
- title = "groonga: query performance"
- else
- title = "groonga: #{label}: query performance"
- end
- puts(<<EOF)
-graph_title #{title}
-graph_vlabel seconds
-graph_category groonga
-graph_info groonga query performance
-
-longest.label Longest
-average.label Average
-median.label Median
-EOF
- exit(true)
-end
-
-span = 60 * 5 # 5min
-mega = 1_000_000.0
-now = Time.now
-elapsed_times = []
-File.open(target_query_log_path) do |log_file|
- ReverseLineReader.new(log_file).each do |line|
- case line
- when /\A(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)\.(\d+)\|([\da-f])+\|<(\d+) rc=0$/
- _, year, month, day, hour, minutes, seconds, milliseconds,
- context, elapsed = $LAST_MATCH_INFO.to_a
- time_stamp = Time.local(year, month, day,
- hour, minutes, seconds, milliseconds)
- difference = now - time_stamp
- break if difference > span
- elapsed_in_micro_seconds = elapsed.to_i / mega
- elapsed_times << elapsed_in_micro_seconds
- end
- end
-end
-
-sorted_elapsed_times = elapsed_times.sort
-if sorted_elapsed_times.empty?
- longest = 0
- average = 0
- median = 0
-else
- longest = sorted_elapsed_times.last
- average = sorted_elapsed_times.inject(&:+) / sorted_elapsed_times.size.to_f
- median = sorted_elapsed_times[sorted_elapsed_times.size / 2]
-end
-
-puts("longest.value #{longest}")
-puts("average.value #{average}")
-puts("median.value #{median}")
diff --git a/storage/mroonga/vendor/groonga/data/munin/groonga_status_ b/storage/mroonga/vendor/groonga/data/munin/groonga_status_
deleted file mode 100755
index 22cdde272db..00000000000
--- a/storage/mroonga/vendor/groonga/data/munin/groonga_status_
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/usr/bin/env ruby
-
-#%# family=auto
-#%# capabilities=autoconf suggest
-
-require 'net/http'
-begin
- require 'json'
-rescue LoadError
- require 'rubygems'
- require 'json'
-end
-
-label = ENV["label"]
-@groonga = ENV["groonga"] || "groonga"
-@default_host = ENV["host"] || "127.0.0.1"
-@default_http_port = 10041
-@default_gqtp_port = 10043
-
-command = ARGV.shift
-
-def parse(success, result)
- if success
- begin
- status, body = JSON.parse(result)
- return_code, start_time, elapsed, error_message = status
- if return_code.zero?
- [success, body]
- else
- [false, error_message]
- end
- rescue JSON::ParserError
- [false, $!.message]
- end
- else
- [success, result]
- end
-end
-
-def run_http(host, port, command)
- path = "/d/#{command}"
- response = Net::HTTP.start(host, port) do |http|
- http.get(path)
- end
- if response.is_a?(Net::HTTPSuccess)
- parse(true, response.body)
- else
- [false, "#{response.code}: #{response.body}"]
- end
-end
-
-def run_gqtp(host, port, command)
- groonga = "#{@groonga} -p #{port} -c #{host}"
- result = `#{groonga} #{command} 2>&1`
- parse($?.success?, result)
-end
-
-def run(command)
- case @service_type
- when "http"
- run_http(@http_host, @http_port, command)
- when "httpd"
- run_http(@httpd_host, @httpd_port, command)
- when "gqtp"
- run_gqtp(@gqtp_host, @gqtp_port, command)
- else
- [false, "unknown service type: #{@service_type}"]
- end
-end
-
-def setup_service_type
- if /_([^_]+)\z/ =~ $0
- @service_type = $1
- else
- @service_type = nil
- end
-end
-
-def setup_http
- @http_host = ENV["http_host"] || @default_host
- @http_port = (ENV["http_port"] || @default_http_port).to_i
-end
-
-def setup_httpd
- @httpd_host = ENV["httpd_host"] || @default_host
- @httpd_port = (ENV["httpd_port"] || @default_http_port).to_i
-end
-
-def setup_gqtp
- @gqtp_host = ENV["gqtp_host"] || @default_host
- @gqtp_port = (ENV["gqtp_port"] || @default_gqtp_port).to_i
-end
-
-def setup
- setup_service_type
- setup_http
- setup_httpd
- setup_gqtp
-end
-
-def autoconf
- results = []
-
- if @http_host and @http_port
- results << run_http(@http_host, @http_port, "status")
- end
-
- if @httpd_host and @httpd_port
- results << run_http(@httpd_host, @httpd_port, "status")
- end
-
- if @gqtp_host and @gqtp_port
- results << run_gqtp(@gqtp_host, @gqtp_port, "status")
- end
-
- if results.any? {|success, _| success}
- puts("yes")
- exit(true)
- else
- errors = results.collect do |_, result|
- result
- end
- error_detail = errors.join(", ")
- puts("no (#{error_detail})")
- exit(false)
- end
-end
-
-def suggest
- if @http_host and @http_port
- success, _ = run_http(@http_host, @http_port, "status")
- puts("http") if success
- end
- if @httpd_host and @httpd_port
- success, _ = run_http(@httpd_host, @httpd_port, "status")
- puts("httpd") if success
- end
- if @gqtp_host and @gqtp_port
- success, _ = run_gqtp(@gqtp_host, @gqtp_port, "status")
- puts("gqtp") if success
- end
- exit(true)
-end
-
-setup
-case command
-when "autoconf", "detect"
- autoconf
-when "suggest"
- suggest
-when "config"
- if label.nil?
- title = "groonga: status"
- else
- title = "groonga: #{label}: status"
- end
- puts(<<EOF)
-graph_title #{title}
-graph_vlabel status
-graph_category groonga
-graph_info groonga status
-
-alloc_count.label alloc count
-alloc_count.type GAUGE
-EOF
- exit(true)
-end
-
-success, body = run("status")
-unless success
- puts("error: #{body}")
- exit(false)
-end
-puts(<<EOF)
-alloc_count.value #{body["alloc_count"]}
-EOF
diff --git a/storage/mroonga/vendor/groonga/data/munin/groonga_throughput_ b/storage/mroonga/vendor/groonga/data/munin/groonga_throughput_
deleted file mode 100755
index 241ae8e5794..00000000000
--- a/storage/mroonga/vendor/groonga/data/munin/groonga_throughput_
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/usr/bin/env ruby
-
-#%# family=auto
-#%# capabilities=autoconf suggest
-
-require 'net/http'
-begin
- require 'json'
-rescue LoadError
- require 'rubygems'
- require 'json'
-end
-
-label = ENV["label"]
-@groonga = ENV["groonga"] || "groonga"
-@default_host = ENV["host"] || "127.0.0.1"
-@default_http_port = 10041
-@default_gqtp_port = 10043
-
-command = ARGV.shift
-
-def parse(success, result)
- if success
- begin
- status, body = JSON.parse(result)
- return_code, start_time, elapsed, error_message = status
- if return_code.zero?
- [success, body]
- else
- [false, error_message]
- end
- rescue JSON::ParserError
- [false, $!.message]
- end
- else
- [success, result]
- end
-end
-
-def run_http(host, port, command)
- path = "/d/#{command}"
- response = Net::HTTP.start(host, port) do |http|
- http.get(path)
- end
- if response.is_a?(Net::HTTPSuccess)
- parse(true, response.body)
- else
- [false, "#{response.code}: #{response.body}"]
- end
-end
-
-def run_gqtp(host, port, command)
- groonga = "#{@groonga} -p #{port} -c #{host}"
- result = `#{groonga} #{command} 2>&1`
- parse($?.success?, result)
-end
-
-def run(command)
- case @service_type
- when "http"
- run_http(@http_host, @http_port, command)
- when "httpd"
- run_http(@httpd_host, @httpd_port, command)
- when "gqtp"
- run_gqtp(@gqtp_host, @gqtp_port, command)
- else
- [false, "unknown service type: #{@service_type}"]
- end
-end
-
-def setup_service_type
- if /_([^_]+)\z/ =~ $0
- @service_type = $1
- else
- @service_type = nil
- end
-end
-
-def setup_http
- @http_host = ENV["http_host"] || @default_host
- @http_port = (ENV["http_port"] || @default_http_port).to_i
-end
-
-def setup_httpd
- @httpd_host = ENV["httpd_host"] || @default_host
- @httpd_port = (ENV["httpd_port"] || @default_http_port).to_i
-end
-
-def setup_gqtp
- @gqtp_host = ENV["gqtp_host"] || @default_host
- @gqtp_port = (ENV["gqtp_port"] || @default_gqtp_port).to_i
-end
-
-def setup
- setup_service_type
- setup_http
- setup_httpd
- setup_gqtp
-end
-
-def autoconf
- results = []
-
- if @http_host and @http_port
- results << run_http(@http_host, @http_port, "status")
- end
-
- if @httpd_host and @httpd_port
- results << run_http(@httpd_host, @httpd_port, "status")
- end
-
- if @gqtp_host and @gqtp_port
- results << run_gqtp(@gqtp_host, @gqtp_port, "status")
- end
-
- if results.any? {|success, _| success}
- puts("yes")
- exit(true)
- else
- errors = results.collect do |_, result|
- result
- end
- error_detail = errors.join(", ")
- puts("no (#{error_detail})")
- exit(false)
- end
-end
-
-def suggest
- if @http_host and @http_port
- success, _ = run_http(@http_host, @http_port, "status")
- puts("http") if success
- end
- if @httpd_host and @httpd_port
- success, _ = run_http(@httpd_host, @httpd_port, "status")
- puts("httpd") if success
- end
- if @gqtp_host and @gqtp_port
- success, _ = run_gqtp(@gqtp_host, @gqtp_port, "status")
- puts("gqtp") if success
- end
- exit(true)
-end
-
-setup
-case command
-when "autoconf", "detect"
- autoconf
-when "suggest"
- suggest
-when "config"
- if label.nil?
- title = "groonga: throughput"
- else
- title = "groonga: #{label}: throughput"
- end
- puts(<<EOF)
-graph_title #{title}
-graph_vlabel queries per ${graph_period}
-graph_category groonga
-graph_info groonga throughput
-
-n_queries.label N queries
-n_queries.type COUNTER
-EOF
- exit(true)
-end
-
-success, body = run("status")
-unless success
- puts("error: #{body}")
- exit(false)
-end
-puts(<<EOF)
-n_queries.value #{body["n_queries"]}
-EOF
diff --git a/storage/mroonga/vendor/groonga/data/scripts/Makefile.am b/storage/mroonga/vendor/groonga/data/scripts/Makefile.am
deleted file mode 100644
index a9b50395c3e..00000000000
--- a/storage/mroonga/vendor/groonga/data/scripts/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-dist_sbin_SCRIPTS = groonga-httpd-restart
diff --git a/storage/mroonga/vendor/groonga/data/scripts/groonga-httpd-restart.in b/storage/mroonga/vendor/groonga/data/scripts/groonga-httpd-restart.in
deleted file mode 100755
index 6fe9c88f929..00000000000
--- a/storage/mroonga/vendor/groonga/data/scripts/groonga-httpd-restart.in
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-# -*- indent-tabs-mode: nil; sh-indentation: 4 -*-
-#
-# Copyright(C) 2012-2013 Brazil
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-prefix=@prefix@
-
-SERVICE_NAME=groonga-httpd
-GROONGA_HTTPD=${SERVICE_NAME}
-PID_FILE=@localstatedir@/run/groonga/${GROONGA_HTTPD}.pid
-TIMEOUT=3
-
-# Source configuration.
-if [ -f /etc/default/${SERVICE_NAME} ]; then
- . /etc/default/${SERVICE_NAME}
-elif [ -f /etc/sysconfig/${SERVICE_NAME} ]; then
- . /etc/sysconfig/${SERVICE_NAME}
-fi
-
-OLD_PID_FILE=${PID_FILE}.oldbin
-
-wait_until () {
- for n in $(seq ${TIMEOUT}); do
- if "$@"; then
- return 0
- fi
- sleep 1
- done
- return 1
-}
-
-wait_while () {
- for n in $(seq ${TIMEOUT}); do
- if ! "$@"; then
- return 0
- fi
- sleep 1
- done
- return 1
-}
-
-start_master () {
- local pid=$1
- kill -USR2 ${pid}
-}
-
-switch_worker () {
- local pid=$1
- kill -WINCH ${pid}
-}
-
-stop_master () {
- local pid=$1
- kill -QUIT ${pid}
-}
-
-if [ ! -f "${PID_FILE}" ]; then
- echo "PID file isn't found. groonga-httpd may not be running: <${PID_FILE}>"
- exit 1
-fi
-
-OLD_PID=$(cat ${PID_FILE})
-start_master ${OLD_PID}
-
-if ! wait_until [ -f ${OLD_PID_FILE} ]; then
- echo "Failed to create old PID file: <${PID_FILE}>"
- exit 1
-fi
-
-if ! wait_until [ -f ${PID_FILE} ]; then
- echo "Failed to start new groonga-httpd master."
- exit 1
-fi
-
-NEW_PID=$(cat ${PID_FILE})
-
-OLD_WORKER_PROCESSES=$(pgrep -P ${OLD_PID} | grep -v ${NEW_PID})
-switch_worker ${OLD_PID}
-for pid in ${OLD_WORKER_PROCESSES}; do
- wait_while ps --pid=${pid} > /dev/null
-done
-OLD_WORKER_PROCESSES=$(pgrep -P ${OLD_PID} | grep -v ${NEW_PID})
-if [ -n "${OLD_WORKER_PROCESSES}" ]; then
- echo "Failed to stop old groonga-httpd worker process."
- stop_master ${NEW_PID}
- echo "Rollback to old groonga-httpd master."
- exit 2
-fi
-
-stop_master ${OLD_PID}
-exit $?
-
diff --git a/storage/mroonga/vendor/groonga/data/synonyms.tsv b/storage/mroonga/vendor/groonga/data/synonyms.tsv
deleted file mode 100644
index 17e2923440c..00000000000
--- a/storage/mroonga/vendor/groonga/data/synonyms.tsv
+++ /dev/null
@@ -1,5 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# key[TAB]synonym1[TAB]synonym2[TAB]...
-#
-#groonga groonga rroonga mroonga
diff --git a/storage/mroonga/vendor/groonga/data/systemd/Makefile.am b/storage/mroonga/vendor/groonga/data/systemd/Makefile.am
deleted file mode 100644
index 5e83c678fbe..00000000000
--- a/storage/mroonga/vendor/groonga/data/systemd/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = fedora
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/Makefile.am b/storage/mroonga/vendor/groonga/data/systemd/fedora/Makefile.am
deleted file mode 100644
index 97caba36347..00000000000
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-SUBDIRS = sysconfig
-
-services = \
- groonga-server-http.service \
- groonga-server-gqtp.service \
- groonga-httpd.service
-
-if FEDORA_PLATFORM
-unitdir = /usr/lib/systemd/system
-dist_unit_DATA = $(services)
-else
-EXTRA_DIST = $(services)
-endif
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service b/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service
deleted file mode 100644
index 7f19d7228d3..00000000000
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-httpd.service
+++ /dev/null
@@ -1,15 +0,0 @@
-[Unit]
-Description=Groonga HTTP Server
-After=network.target
-Conflicts=groonga.service
-
-[Service]
-Type=forking
-User=root
-Group=root
-ExecStartPre=-/usr/bin/mkdir -p /var/log/groonga/httpd
-ExecStart=/usr/sbin/groonga-httpd
-ExecStop=/usr/sbin/groonga-httpd -s stop
-
-[Install]
-WantedBy=multi-user.target
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-gqtp.service b/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-gqtp.service
deleted file mode 100644
index 666c1609d42..00000000000
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-gqtp.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Groonga Text Searching Engine
-After=network.target
-
-[Service]
-Type=forking
-EnvironmentFile=-/etc/sysconfig/groonga-server-gqtp
-User=groonga
-Group=groonga
-ExecStart=/usr/bin/groonga -d --pid-path /var/run/groonga/groonga-gqtp.pid --bind-address $ADDRESS --log-path $LOG_PATH --query-log-path $QUERY_LOG_PATH --protocol $PROTOCOL --port $PORT $DATABASE
-
-[Install]
-WantedBy=multi-user.target
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-http.service b/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-http.service
deleted file mode 100644
index 6638e03ae3c..00000000000
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/groonga-server-http.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=Groonga Text Searching Engine
-After=network.target
-
-[Service]
-Type=forking
-EnvironmentFile=-/etc/sysconfig/groonga-server-http
-User=groonga
-Group=groonga
-ExecStart=/usr/bin/groonga -d --pid-path /var/run/groonga/groonga-http.pid --bind-address $ADDRESS --log-path $LOG_PATH --query-log-path $QUERY_LOG_PATH --protocol $PROTOCOL --port $PORT $DATABASE
-
-[Install]
-WantedBy=multi-user.target
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/Makefile.am b/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/Makefile.am
deleted file mode 100644
index 5de8250e5c7..00000000000
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/Makefile.am
+++ /dev/null
@@ -1,8 +0,0 @@
-data = groonga-server-http groonga-server-gqtp
-
-if FEDORA_PLATFORM
-sysconfigdir = $(sysconfdir)/sysconfig
-dist_sysconfig_DATA = $(data)
-else
-EXTRA_DIST = $(data)
-endif
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp b/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp
deleted file mode 100644
index 89e45c35942..00000000000
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-gqtp
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default
-ADDRESS=127.0.0.1
-DATABASE=/var/lib/groonga/db/db
-LOG_PATH=/var/log/groonga/groonga-gqtp.log
-QUERY_LOG_PATH=/var/log/groonga/query-gqtp.log
-PROTOCOL=gqtp
-PORT=10043
-GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
diff --git a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http b/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http
deleted file mode 100644
index 7141818a331..00000000000
--- a/storage/mroonga/vendor/groonga/data/systemd/fedora/sysconfig/groonga-server-http
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default
-ADDRESS=127.0.0.1
-DATABASE=/var/lib/groonga/db/db
-LOG_PATH=/var/log/groonga/groonga-http.log
-QUERY_LOG_PATH=/var/log/groonga/query-http.log
-PROTOCOL=http
-PORT=10041
-GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
diff --git a/storage/mroonga/vendor/groonga/data/travis/setup.sh b/storage/mroonga/vendor/groonga/data/travis/setup.sh
deleted file mode 100755
index 285776ee590..00000000000
--- a/storage/mroonga/vendor/groonga/data/travis/setup.sh
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-#
-# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-# set -x
-set -e
-
-if [ "$GROONGA_MASTER" = "yes" ]; then
- sudo apt-get install -qq -y -V autotools-dev pkg-config libmecab-dev \
- libmsgpack-dev libevent-dev
- git clone --depth 1 https://github.com/groonga/groonga.git
- cd groonga
- ./autogen.sh
- ./configure --prefix=/usr --localstatedir=/var --enable-debug
- make -j$(grep '^processor' /proc/cpuinfo | wc -l) > /dev/null
- sudo make install > /dev/null
- cd ..
-else
- sudo apt-get purge libzmq3
-
- distribution=$(lsb_release --short --id | tr 'A-Z' 'a-z')
- case $distribution in
- debian)
- code_name=$(lsb_release --short --codename)
- component=main
- apt_url_base=http://packages.groonga.org
- cat <<EOF | sudo tee /etc/apt/sources.list.d/groonga.list
-deb ${apt_url_base}/${distribution}/ ${code_name} ${component}
-deb-src ${apt_url_base}/${distribution}/ ${code_name} ${component}
-EOF
- sudo apt-get update -qq
- sudo apt-get install -qq -y --allow-unauthenticated groonga-keyring
- ;;
- ubuntu)
- sudo apt-get install -qq -y -V software-properties-common
- sudo add-apt-repository -y ppa:groonga/ppa
- ;;
- esac
-
- sudo apt-get update -qq
- sudo apt-get install -qq -y -V groonga libgroonga-dev
-fi
diff --git a/storage/mroonga/vendor/groonga/examples/Makefile.am b/storage/mroonga/vendor/groonga/examples/Makefile.am
deleted file mode 100644
index f436342d053..00000000000
--- a/storage/mroonga/vendor/groonga/examples/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = dictionary
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/Makefile.am b/storage/mroonga/vendor/groonga/examples/dictionary/Makefile.am
deleted file mode 100644
index 8d71ed61944..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/Makefile.am
+++ /dev/null
@@ -1,34 +0,0 @@
-SUBDIRS = \
- edict \
- eijiro \
- gene95 \
- jmdict
-
-dist_examples_dictionary_SCRIPTS = \
- init-db.sh
-
-nobase_dist_examples_dictionary_DATA = \
- readme.txt \
- $(html_files)
-
-# find html -type f | sort | sed -e 's,^,\t,g'
-html_files = \
- html/css/dictionary.css \
- html/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png \
- html/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png \
- html/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png \
- html/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png \
- html/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png \
- html/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png \
- html/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png \
- html/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png \
- html/css/smoothness/images/ui-icons_222222_256x240.png \
- html/css/smoothness/images/ui-icons_2e83ff_256x240.png \
- html/css/smoothness/images/ui-icons_454545_256x240.png \
- html/css/smoothness/images/ui-icons_888888_256x240.png \
- html/css/smoothness/images/ui-icons_cd0a0a_256x240.png \
- html/css/smoothness/jquery-ui-1.8.12.custom.css \
- html/index.html \
- html/js/dictionary.js \
- html/js/jquery-1.7.2.min.js \
- html/js/jquery-ui-1.8.18.custom.min.js
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/edict/Makefile.am b/storage/mroonga/vendor/groonga/examples/dictionary/edict/Makefile.am
deleted file mode 100644
index 376f9d520ab..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/edict/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-edictdir = $(examples_dictionarydir)/edict
-dist_edict_SCRIPTS = \
- edict2grn.rb \
- edict-import.sh
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict-import.sh b/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict-import.sh
deleted file mode 100755
index b98397be05a..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict-import.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-base_dir=$(dirname $0)
-
-if [ 1 != $# -a 2 != $# ]; then
- echo "usage: $0 db_path [edict.gz_path]"
- exit 1
-fi
-
-if [ -z $2 ]; then
- edict_gz=edict.gz
- if [ ! -f $edict_gz ]; then
- wget -O $edict_gz http://ftp.monash.edu.au/pub/nihongo/edict.gz
- fi
-else
- edict_gz=$2
-fi
-
-if zcat $edict_gz | ${base_dir}/edict2grn.rb | groonga $1 > /dev/null; then
- echo "edict data loaded."
-fi
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict2grn.rb b/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict2grn.rb
deleted file mode 100755
index 664b12c2148..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/edict/edict2grn.rb
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-
-$KCODE = 'u'
-
-require 'English'
-require 'kconv'
-
-class String
- def to_json
- a = split(//).map {|char|
- case char
- when '"' then '\\"'
- when '\\' then '\\\\'
- when "\b" then '\b'
- when "\f" then '\f'
- when "\n" then '\n'
- when "\r" then ''
- when "\t" then '\t'
- else char
- end
- }
- "\"#{a.join('')}\""
- end
-end
-
-class Array
- def to_json
- '[' + map {|element|
- element.to_json
- }.join(',') + ']'
- end
-end
-
-puts <<END
-column_create item_dictionary edict_desc COLUMN_SCALAR ShortText
-column_create bigram item_dictionary_edict_desc COLUMN_INDEX|WITH_POSITION item_dictionary edict_desc
-load --table item_dictionary
-[["_key","edict_desc","kana"],
-END
-
-while !STDIN.eof?
- line = Kconv.toutf8(gets)
- key, body = line.strip.split('/', 2)
- key = key.strip
- if /\s*\[(.+)\]\z/ =~ key
- key = $PREMATCH
- reading = $1
- body = "[#{reading}] #{body}"
- kana = NKF.nkf("-Ww --katakana", reading)
- else
- kana = NKF.nkf("-Ww --katakana", key)
- end
- puts [key, body, kana].to_json
-end
-puts ']'
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/eijiro/Makefile.am b/storage/mroonga/vendor/groonga/examples/dictionary/eijiro/Makefile.am
deleted file mode 100644
index 4059a529cef..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/eijiro/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-eijirodir = $(examples_dictionarydir)/eijiro
-dist_eijiro_SCRIPTS = \
- eijiro2grn.rb \
- eijiro-import.sh
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro-import.sh b/storage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro-import.sh
deleted file mode 100755
index 4042d7fbf56..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro-import.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-base_dir=$(dirname $0)
-
-if [ 2 != $# ]; then
- echo "usage: $0 db_path eijiro.csv_path"
- exit 1
-fi
-
-if iconv -f UCS2 -t UTF8 $2 | ${base_dir}/eijiro2grn.rb | groonga $1 > /dev/null; then
- echo "eijiro data loaded."
-fi
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro2grn.rb b/storage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro2grn.rb
deleted file mode 100755
index 62c1e1309bf..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/eijiro/eijiro2grn.rb
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-
-$KCODE = 'u'
-
-require 'rubygems'
-require 'fastercsv'
-
-class String
- def to_json
- a = split(//).map {|char|
- case char
- when '"' then '\\"'
- when '\\' then '\\\\'
- when "\b" then '\b'
- when "\f" then '\f'
- when "\n" then '\n'
- when "\r" then ''
- when "\t" then '\t'
- else char
- end
- }
- "\"#{a.join('')}\""
- end
-end
-
-class Array
- def to_json
- '[' + map {|element|
- element.to_json
- }.join(',') + ']'
- end
-end
-
-puts <<END
-column_create item_dictionary eijiro_trans COLUMN_SCALAR ShortText
-column_create item_dictionary eijiro_exp COLUMN_SCALAR ShortText
-column_create item_dictionary eijiro_level COLUMN_SCALAR Int32
-column_create item_dictionary eijiro_memory COLUMN_SCALAR Int32
-column_create item_dictionary eijiro_modify COLUMN_SCALAR Int32
-column_create item_dictionary eijiro_pron COLUMN_SCALAR ShortText
-column_create item_dictionary eijiro_filelink COLUMN_SCALAR ShortText
-column_create bigram item_dictionary_eijiro_trans COLUMN_INDEX|WITH_POSITION item_dictionary eijiro_trans
-load --table item_dictionary
-[["_key","norm","eijiro_trans","eijiro_exp","eijiro_level","eijiro_memory","eijiro_modify","eijiro_pron","eijiro_filelink","kana"],
-END
-
-n = 0
-FasterCSV.new(ARGF, :row_sep => "\r\n").each {|l|
- if n > 0
- keyword,word,trans,exp,level,memory,modify,pron,filelink = l
- kana = ''
- if trans =~ /ã€ï¼ ã€‘(.*?)(ã€|$)/
- kana = $1.split("ã€")
- end
- puts [word,keyword,trans,exp,level,memory,modify,pron,filelink,kana].map{|e| e || ''}.to_json
- end
- n += 1
-}
-
-puts "]"
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/gene95/Makefile.am b/storage/mroonga/vendor/groonga/examples/dictionary/gene95/Makefile.am
deleted file mode 100644
index e89f13f595c..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/gene95/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-gene95dir = $(examples_dictionarydir)/gene95
-dist_gene95_SCRIPTS = \
- gene2grn.rb \
- gene-import.sh
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/gene95/gene-import.sh b/storage/mroonga/vendor/groonga/examples/dictionary/gene95/gene-import.sh
deleted file mode 100755
index 488d6c83adc..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/gene95/gene-import.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-base_dir=$(dirname $0)
-
-if [ 1 != $# -a 2 != $# ]; then
- echo "usage: $0 db_path [gene.txt_path]"
- exit 1
-fi
-
-if [ -z $2 ]; then
- dictionary_dir=gene95-dictionary
- gene_txt=${dictionary_dir}/gene.txt
- if [ ! -f $gene_txt ]; then
- gene95_tar_gz=gene95.tar.gz
- wget -O $gene95_tar_gz \
- http://www.namazu.org/~tsuchiya/sdic/data/gene95.tar.gz
- mkdir -p ${dictionary_dir}
- tar xvzf ${gene95_tar_gz} -C ${dictionary_dir}
- fi
-else
- gene_txt=$2
-fi
-
-if cat $gene_txt | ${base_dir}/gene2grn.rb | groonga $1 > /dev/null; then
- echo "gene95 data loaded."
-fi
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/gene95/gene2grn.rb b/storage/mroonga/vendor/groonga/examples/dictionary/gene95/gene2grn.rb
deleted file mode 100755
index 0d10cfd1085..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/gene95/gene2grn.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-
-$KCODE = 'u'
-
-require 'kconv'
-
-class String
- def to_json
- a = split(//).map {|char|
- case char
- when '"' then '\\"'
- when '\\' then '\\\\'
- when "\b" then '\b'
- when "\f" then '\f'
- when "\n" then '\n'
- when "\r" then ''
- when "\t" then '\t'
- else char
- end
- }
- "\"#{a.join('')}\""
- end
-end
-
-class Array
- def to_json
- '[' + map {|element|
- element.to_json
- }.join(',') + ']'
- end
-end
-
-puts <<END
-column_create item_dictionary gene95_desc COLUMN_SCALAR ShortText
-column_create bigram item_dictionary_gene95_desc COLUMN_INDEX|WITH_POSITION item_dictionary gene95_desc
-load --table item_dictionary
-[["_key","gene95_desc"],
-END
-
-while !STDIN.eof?
- key = Kconv.toutf8(gets.strip)
- body = Kconv.toutf8(gets.strip)
- puts [key, body].to_json
-end
-puts ']'
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/dictionary.css b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/dictionary.css
deleted file mode 100644
index 72b5a6749b3..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/dictionary.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#result {
- margin-top: 7em;
-}
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
deleted file mode 100644
index 5b5dab2ab7b..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
deleted file mode 100644
index ac8b229af95..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
deleted file mode 100644
index ad3d6346e00..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
deleted file mode 100644
index 42ccba269b6..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
deleted file mode 100644
index 5a46b47cb16..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
deleted file mode 100644
index 86c2baa655e..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
deleted file mode 100644
index 4443fdc1a15..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
deleted file mode 100644
index 7c9fa6c6edc..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_222222_256x240.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_222222_256x240.png
deleted file mode 100644
index b273ff111d2..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_222222_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_2e83ff_256x240.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_2e83ff_256x240.png
deleted file mode 100644
index 09d1cdc856c..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_2e83ff_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_454545_256x240.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_454545_256x240.png
deleted file mode 100644
index 59bd45b907c..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_454545_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_888888_256x240.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_888888_256x240.png
deleted file mode 100644
index 6d02426c114..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_888888_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_cd0a0a_256x240.png b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_cd0a0a_256x240.png
deleted file mode 100644
index 2ab019b73ec..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/images/ui-icons_cd0a0a_256x240.png
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/jquery-ui-1.8.12.custom.css b/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/jquery-ui-1.8.12.custom.css
deleted file mode 100644
index c85aabaec06..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/css/smoothness/jquery-ui-1.8.12.custom.css
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- * jQuery UI CSS Framework 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- */
-
-/* Layout helpers
-----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
-.ui-helper-clearfix { display: inline-block; }
-/* required comment for clearfix to work in Opera \*/
-* html .ui-helper-clearfix { height:1%; }
-.ui-helper-clearfix { display:block; }
-/* end clearfix */
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
-
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
-
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
-
-
-/*
- * jQuery UI CSS Framework 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Theming/API
- *
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
- */
-
-
-/* Component containers
-----------------------------------*/
-.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
-.ui-widget .ui-widget { font-size: 1em; }
-.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
-.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
-.ui-widget-content a { color: #222222; }
-.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
-.ui-widget-header a { color: #222222; }
-
-/* Interaction states
-----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
-.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
-.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
-.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
-.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
-.ui-widget :active { outline: none; }
-
-/* Interaction Cues
-----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
-.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
-.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
-.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
-.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
-.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
-.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
-
-/* Icons
-----------------------------------*/
-
-/* states and images */
-.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
-.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
-.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
-.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
-.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
-.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
-.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
-.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
-
-/* positioning */
-.ui-icon-carat-1-n { background-position: 0 0; }
-.ui-icon-carat-1-ne { background-position: -16px 0; }
-.ui-icon-carat-1-e { background-position: -32px 0; }
-.ui-icon-carat-1-se { background-position: -48px 0; }
-.ui-icon-carat-1-s { background-position: -64px 0; }
-.ui-icon-carat-1-sw { background-position: -80px 0; }
-.ui-icon-carat-1-w { background-position: -96px 0; }
-.ui-icon-carat-1-nw { background-position: -112px 0; }
-.ui-icon-carat-2-n-s { background-position: -128px 0; }
-.ui-icon-carat-2-e-w { background-position: -144px 0; }
-.ui-icon-triangle-1-n { background-position: 0 -16px; }
-.ui-icon-triangle-1-ne { background-position: -16px -16px; }
-.ui-icon-triangle-1-e { background-position: -32px -16px; }
-.ui-icon-triangle-1-se { background-position: -48px -16px; }
-.ui-icon-triangle-1-s { background-position: -64px -16px; }
-.ui-icon-triangle-1-sw { background-position: -80px -16px; }
-.ui-icon-triangle-1-w { background-position: -96px -16px; }
-.ui-icon-triangle-1-nw { background-position: -112px -16px; }
-.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
-.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
-.ui-icon-arrow-1-n { background-position: 0 -32px; }
-.ui-icon-arrow-1-ne { background-position: -16px -32px; }
-.ui-icon-arrow-1-e { background-position: -32px -32px; }
-.ui-icon-arrow-1-se { background-position: -48px -32px; }
-.ui-icon-arrow-1-s { background-position: -64px -32px; }
-.ui-icon-arrow-1-sw { background-position: -80px -32px; }
-.ui-icon-arrow-1-w { background-position: -96px -32px; }
-.ui-icon-arrow-1-nw { background-position: -112px -32px; }
-.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
-.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
-.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
-.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
-.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
-.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
-.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
-.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
-.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
-.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
-.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
-.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
-.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
-.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
-.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
-.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
-.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
-.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
-.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
-.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
-.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
-.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
-.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
-.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
-.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
-.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
-.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
-.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
-.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
-.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
-.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
-.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
-.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
-.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
-.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
-.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
-.ui-icon-arrow-4 { background-position: 0 -80px; }
-.ui-icon-arrow-4-diag { background-position: -16px -80px; }
-.ui-icon-extlink { background-position: -32px -80px; }
-.ui-icon-newwin { background-position: -48px -80px; }
-.ui-icon-refresh { background-position: -64px -80px; }
-.ui-icon-shuffle { background-position: -80px -80px; }
-.ui-icon-transfer-e-w { background-position: -96px -80px; }
-.ui-icon-transferthick-e-w { background-position: -112px -80px; }
-.ui-icon-folder-collapsed { background-position: 0 -96px; }
-.ui-icon-folder-open { background-position: -16px -96px; }
-.ui-icon-document { background-position: -32px -96px; }
-.ui-icon-document-b { background-position: -48px -96px; }
-.ui-icon-note { background-position: -64px -96px; }
-.ui-icon-mail-closed { background-position: -80px -96px; }
-.ui-icon-mail-open { background-position: -96px -96px; }
-.ui-icon-suitcase { background-position: -112px -96px; }
-.ui-icon-comment { background-position: -128px -96px; }
-.ui-icon-person { background-position: -144px -96px; }
-.ui-icon-print { background-position: -160px -96px; }
-.ui-icon-trash { background-position: -176px -96px; }
-.ui-icon-locked { background-position: -192px -96px; }
-.ui-icon-unlocked { background-position: -208px -96px; }
-.ui-icon-bookmark { background-position: -224px -96px; }
-.ui-icon-tag { background-position: -240px -96px; }
-.ui-icon-home { background-position: 0 -112px; }
-.ui-icon-flag { background-position: -16px -112px; }
-.ui-icon-calendar { background-position: -32px -112px; }
-.ui-icon-cart { background-position: -48px -112px; }
-.ui-icon-pencil { background-position: -64px -112px; }
-.ui-icon-clock { background-position: -80px -112px; }
-.ui-icon-disk { background-position: -96px -112px; }
-.ui-icon-calculator { background-position: -112px -112px; }
-.ui-icon-zoomin { background-position: -128px -112px; }
-.ui-icon-zoomout { background-position: -144px -112px; }
-.ui-icon-search { background-position: -160px -112px; }
-.ui-icon-wrench { background-position: -176px -112px; }
-.ui-icon-gear { background-position: -192px -112px; }
-.ui-icon-heart { background-position: -208px -112px; }
-.ui-icon-star { background-position: -224px -112px; }
-.ui-icon-link { background-position: -240px -112px; }
-.ui-icon-cancel { background-position: 0 -128px; }
-.ui-icon-plus { background-position: -16px -128px; }
-.ui-icon-plusthick { background-position: -32px -128px; }
-.ui-icon-minus { background-position: -48px -128px; }
-.ui-icon-minusthick { background-position: -64px -128px; }
-.ui-icon-close { background-position: -80px -128px; }
-.ui-icon-closethick { background-position: -96px -128px; }
-.ui-icon-key { background-position: -112px -128px; }
-.ui-icon-lightbulb { background-position: -128px -128px; }
-.ui-icon-scissors { background-position: -144px -128px; }
-.ui-icon-clipboard { background-position: -160px -128px; }
-.ui-icon-copy { background-position: -176px -128px; }
-.ui-icon-contact { background-position: -192px -128px; }
-.ui-icon-image { background-position: -208px -128px; }
-.ui-icon-video { background-position: -224px -128px; }
-.ui-icon-script { background-position: -240px -128px; }
-.ui-icon-alert { background-position: 0 -144px; }
-.ui-icon-info { background-position: -16px -144px; }
-.ui-icon-notice { background-position: -32px -144px; }
-.ui-icon-help { background-position: -48px -144px; }
-.ui-icon-check { background-position: -64px -144px; }
-.ui-icon-bullet { background-position: -80px -144px; }
-.ui-icon-radio-off { background-position: -96px -144px; }
-.ui-icon-radio-on { background-position: -112px -144px; }
-.ui-icon-pin-w { background-position: -128px -144px; }
-.ui-icon-pin-s { background-position: -144px -144px; }
-.ui-icon-play { background-position: 0 -160px; }
-.ui-icon-pause { background-position: -16px -160px; }
-.ui-icon-seek-next { background-position: -32px -160px; }
-.ui-icon-seek-prev { background-position: -48px -160px; }
-.ui-icon-seek-end { background-position: -64px -160px; }
-.ui-icon-seek-start { background-position: -80px -160px; }
-/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
-.ui-icon-seek-first { background-position: -80px -160px; }
-.ui-icon-stop { background-position: -96px -160px; }
-.ui-icon-eject { background-position: -112px -160px; }
-.ui-icon-volume-off { background-position: -128px -160px; }
-.ui-icon-volume-on { background-position: -144px -160px; }
-.ui-icon-power { background-position: 0 -176px; }
-.ui-icon-signal-diag { background-position: -16px -176px; }
-.ui-icon-signal { background-position: -32px -176px; }
-.ui-icon-battery-0 { background-position: -48px -176px; }
-.ui-icon-battery-1 { background-position: -64px -176px; }
-.ui-icon-battery-2 { background-position: -80px -176px; }
-.ui-icon-battery-3 { background-position: -96px -176px; }
-.ui-icon-circle-plus { background-position: 0 -192px; }
-.ui-icon-circle-minus { background-position: -16px -192px; }
-.ui-icon-circle-close { background-position: -32px -192px; }
-.ui-icon-circle-triangle-e { background-position: -48px -192px; }
-.ui-icon-circle-triangle-s { background-position: -64px -192px; }
-.ui-icon-circle-triangle-w { background-position: -80px -192px; }
-.ui-icon-circle-triangle-n { background-position: -96px -192px; }
-.ui-icon-circle-arrow-e { background-position: -112px -192px; }
-.ui-icon-circle-arrow-s { background-position: -128px -192px; }
-.ui-icon-circle-arrow-w { background-position: -144px -192px; }
-.ui-icon-circle-arrow-n { background-position: -160px -192px; }
-.ui-icon-circle-zoomin { background-position: -176px -192px; }
-.ui-icon-circle-zoomout { background-position: -192px -192px; }
-.ui-icon-circle-check { background-position: -208px -192px; }
-.ui-icon-circlesmall-plus { background-position: 0 -208px; }
-.ui-icon-circlesmall-minus { background-position: -16px -208px; }
-.ui-icon-circlesmall-close { background-position: -32px -208px; }
-.ui-icon-squaresmall-plus { background-position: -48px -208px; }
-.ui-icon-squaresmall-minus { background-position: -64px -208px; }
-.ui-icon-squaresmall-close { background-position: -80px -208px; }
-.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
-.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
-.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
-.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
-.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
-.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
-
-
-/* Misc visuals
-----------------------------------*/
-
-/* Corner radius */
-.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; }
-.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
-.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
-.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
-.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; }
-.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
-.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
-.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
-.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
-
-/* Overlays */
-.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
-.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
- * jQuery UI Resizable 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Resizable#theming
- */
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;
- /* http://bugs.jqueryui.com/ticket/7233
- - Resizable: resizable handles fail to work in IE if transparent and content overlaps
- */
- background-image:url(data:);
-}
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
- * jQuery UI Selectable 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Selectable#theming
- */
-.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
-/*
- * jQuery UI Accordion 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Accordion#theming
- */
-/* IE/Win - Fix animation bug - #4615 */
-.ui-accordion { width: 100%; }
-.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
-.ui-accordion .ui-accordion-li-fix { display: inline; }
-.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
-.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
-.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
-.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
-.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
-.ui-accordion .ui-accordion-content-active { display: block; }
-/*
- * jQuery UI Autocomplete 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Autocomplete#theming
- */
-.ui-autocomplete { position: absolute; cursor: default; }
-
-/* workarounds */
-* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
-
-/*
- * jQuery UI Menu 1.8.12
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Menu#theming
- */
-.ui-menu {
- list-style:none;
- padding: 2px;
- margin: 0;
- display:block;
- float: left;
-}
-.ui-menu .ui-menu {
- margin-top: -3px;
-}
-.ui-menu .ui-menu-item {
- margin:0;
- padding: 0;
- zoom: 1;
- float: left;
- clear: left;
- width: 100%;
-}
-.ui-menu .ui-menu-item a {
- text-decoration:none;
- display:block;
- padding:.2em .4em;
- line-height:1.5;
- zoom:1;
-}
-.ui-menu .ui-menu-item a.ui-state-hover,
-.ui-menu .ui-menu-item a.ui-state-active {
- font-weight: normal;
- margin: -1px;
-}
-/*
- * jQuery UI Button 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Button#theming
- */
-.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
-.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
-button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
-.ui-button-icons-only { width: 3.4em; }
-button.ui-button-icons-only { width: 3.7em; }
-
-/*button text element */
-.ui-button .ui-button-text { display: block; line-height: 1.4; }
-.ui-button-text-only .ui-button-text { padding: .4em 1em; }
-.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
-.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
-.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
-.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
-/* no icon support for input elements, provide padding by default */
-input.ui-button { padding: .4em 1em; }
-
-/*button icon element(s) */
-.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
-.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
-.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
-.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
-.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
-
-/*button sets*/
-.ui-buttonset { margin-right: 7px; }
-.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
-
-/* workarounds */
-button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
-/*
- * jQuery UI Dialog 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Dialog#theming
- */
-.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
-.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
-.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
-.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
-.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
-.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
-.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
-.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
-.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
-.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
-.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
-/*
- * jQuery UI Slider 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Slider#theming
- */
-.ui-slider { position: relative; text-align: left; }
-.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
-.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
-
-.ui-slider-horizontal { height: .8em; }
-.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
-.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
-.ui-slider-horizontal .ui-slider-range-min { left: 0; }
-.ui-slider-horizontal .ui-slider-range-max { right: 0; }
-
-.ui-slider-vertical { width: .8em; height: 100px; }
-.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
-.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
-.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
-.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
- * jQuery UI Tabs 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Tabs#theming
- */
-.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
-.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
-.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
-.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
-.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
-.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
-.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
-.ui-tabs .ui-tabs-hide { display: none !important; }
-/*
- * jQuery UI Datepicker 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Datepicker#theming
- */
-.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
-.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
-.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
-.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
-.ui-datepicker .ui-datepicker-prev { left:2px; }
-.ui-datepicker .ui-datepicker-next { right:2px; }
-.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
-.ui-datepicker .ui-datepicker-next-hover { right:1px; }
-.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
-.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
-.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
-.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
-.ui-datepicker select.ui-datepicker-month,
-.ui-datepicker select.ui-datepicker-year { width: 49%;}
-.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
-.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
-.ui-datepicker td { border: 0; padding: 1px; }
-.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
-.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
-.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
-.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
-
-/* with multiple calendars */
-.ui-datepicker.ui-datepicker-multi { width:auto; }
-.ui-datepicker-multi .ui-datepicker-group { float:left; }
-.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
-.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
-.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
-.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
-.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
-.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
-.ui-datepicker-row-break { clear:both; width:100%; }
-
-/* RTL support */
-.ui-datepicker-rtl { direction: rtl; }
-.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
-.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
-.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group { float:right; }
-.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
-
-/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
-.ui-datepicker-cover {
- display: none; /*sorry for IE5*/
- display/**/: block; /*sorry for IE5*/
- position: absolute; /*must have*/
- z-index: -1; /*must have*/
- filter: mask(); /*must have*/
- top: -4px; /*must have*/
- left: -4px; /*must have*/
- width: 200px; /*must have*/
- height: 200px; /*must have*/
-}/*
- * jQuery UI Progressbar 1.8.12
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Progressbar#theming
- */
-.ui-progressbar { height:2em; text-align: left; }
-.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/index.html b/storage/mroonga/vendor/groonga/examples/dictionary/html/index.html
deleted file mode 100644
index a96042bc4ee..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/index.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
-<head>
-<meta http-equiv="Content-Language" content="ja" />
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
-<title>groonga dictionary search</title>
-<meta http-equiv="content-style-type" content="text/css" />
-<meta http-equiv="content-script-type" content="text/javascript" />
-<link type="text/css" href="css/smoothness/jquery-ui-1.8.12.custom.css" rel="stylesheet" />
-<link type="text/css" rel="stylesheet" href="css/dictionary.css" />
-</head>
-<body>
-<form action="javascript:(function(){$('.search').blur()})()" name="search" id="search">
-<input type="text" size="60" maxlength="60" name="key" class="search" />
-<input type="submit" value="検索"/>
-</form>
-<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
-<script type="text/javascript" src="js/jquery-ui-1.8.18.custom.min.js"></script>
-<script type="text/javascript" src="js/dictionary.js"></script>
-<script type="text/javascript">
-$(document).ready(function(){
- $(".search").autocomplete({source: dictionarySource("http://" + location.host + "/d/suggest")});
-});
-</script>
-<div id="result"></div>
-</body>
-</html>
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/dictionary.js b/storage/mroonga/vendor/groonga/examples/dictionary/html/js/dictionary.js
deleted file mode 100644
index 850c64cc667..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/dictionary.js
+++ /dev/null
@@ -1,82 +0,0 @@
-function dictionarySource(url) {
- function displayItems(items) {
- var results = $("<dl />");
- $.each(items,
- function(i, val) {
- results.append($("<dt />")
- .append($("<span />")
- .text(val[0])
- .click(function() {
- $(".search").val($(this).text());
- $("#search").submit();
- })));
- results.append($("<dd />")
- .append($("<span />").text(val[1]))
- .append($("<span />").text(val[2]))
- );
- });
- $("#result")
- .empty()
- .append(results);
- };
-
- var request_index = 0;
- var columns = "_key,gene95_desc,edict_desc";
- var xhr;
- function source(request, response) {
- function onSuccess(data, status) {
- if (this.autocomplete_request != request_index) {
- return;
- }
- var completions = data[1]["complete"];
- var items = [];
- if (completions && completions.length > 2) {
- completions.shift();
- completions.shift();
- $.each(completions,
- function(i, item) {
- var key = item[0];
- items.push(key);
- if (items.length >= 3) {
- return false;
- }
- return true;
- });
- }
- if (completions.length > 0) {
- displayItems(completions);
- }
- response(items);
- }
-
- function onError() {
- if (this.autocomplete_request != request_index) {
- return;
- }
- response([]);
- }
-
- if (xhr) {
- xhr.abort();
- }
- xhr = $.ajax(url,
- {
- data: {
- query: request.term,
- types: 'complete',
- table: 'item_dictionary',
- column: 'kana',
- limit: 25,
- output_columns: columns,
- frequency_threshold: 1,
- prefix_search: "yes"
- },
- dataType: "jsonp",
- autocomplete_request: ++request_index,
- success: onSuccess,
- error: onError
- });
- };
-
- return source;
-}
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.min.js b/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.min.js
deleted file mode 100644
index 16ad06c5aca..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-1.7.2.min.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery v1.7.2 jquery.com | jquery.org/license */
-(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
-a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
-.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.min.js b/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.min.js
deleted file mode 100644
index f00a62f133f..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/html/js/jquery-ui-1.8.18.custom.min.js
+++ /dev/null
@@ -1,356 +0,0 @@
-/*!
- * jQuery UI 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI
- */(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.18",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*!
- * jQuery UI Widget 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}});return d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e;if(f&&e.charAt(0)==="_")return h;f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b){h=f;return!1}}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))});return h}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}this._setOptions(e);return this},_setOptions:function(b){var c=this;a.each(b,function(a,b){c._setOption(a,b)});return this},_setOption:function(a,b){this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b);return this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);this.element.trigger(c,d);return!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);/*!
- * jQuery UI Mouse 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Mouse
- *
- * Depends:
- * jquery.ui.widget.js
- */(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent")){a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation();return!1}}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName)},_mouseDown:function(b){if(!c){this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted){b.preventDefault();return!0}}!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0;return!0}},_mouseMove:function(b){if(a.browser.msie&&!(document.documentMode>=9)&&!b.button)return this._mouseUp(b);if(this._mouseStarted){this._mouseDrag(b);return b.preventDefault()}this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b));return!this._mouseStarted},_mouseUp:function(b){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b));return!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);/*
- * jQuery UI Position 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Position
- */(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1];return this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]!==e){var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0}},top:function(b,c){if(c.at[1]!==e){var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];if(!c||!c.ownerDocument)return null;if(b)return this.each(function(){a.offset.setOffset(this,b)});return h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);/*
- * jQuery UI Draggable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!!this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy();return this}},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return!1;this.handle=this._getHandle(b);if(!this.handle)return!1;c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")});return!0},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment();if(this._trigger("start",b)===!1){this._clear();return!1}this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.helper.addClass("ui-draggable-dragging"),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return!0},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1){this._mouseUp({});return!1}this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){d._trigger("stop",b)!==!1&&d._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)});return c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute"));return a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.18"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!!e.length){var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);/*
- * jQuery UI Droppable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Droppables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * jquery.ui.mouse.js
- * jquery.ui.draggable.js
- */(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;!!c&&(c.currentItem||c.element)[0]!=this.element[0]&&this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance)){e=!0;return!1}});if(e)return!1;if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d));return this.element}return!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.18"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();droppablesLoop:for(var g=0;g<d.length;g++){if(d[g].options.disabled||b&&!d[g].accept.call(d[g].element[0],b.currentItem||b.element))continue;for(var h=0;h<f.length;h++)if(f[h]==d[g].element[0]){d[g].proportions.height=0;continue droppablesLoop}d[g].visible=d[g].element.css("display")!="none";if(!d[g].visible)continue;e=="mousedown"&&d[g]._activate.call(d[g],c),d[g].offset=d[g].element.offset(),d[g].proportions={width:d[g].element[0].offsetWidth,height:d[g].element[0].offsetHeight}}},drop:function(b,c){var d=!1;a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){!this.options||(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c)))});return d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))}})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);/*
- * jQuery UI Resizable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');/sw|se|ne|nw/.test(f)&&h.css({zIndex:++c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){c.disabled||(a(this).removeClass("ui-resizable-autohide"),b._handles.show())},function(){c.disabled||b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement);return this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b);return!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui());return!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove();return!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width));return a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null);return a},_proportionallyResize:function(){var b=this.options;if(!!this._proportionallyResizeElements.length){var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(a.browser.msie&&(!!a(c).is(":hidden")||!!a(c).parents(":hidden").length))continue;e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.18"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!!i){e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/e.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*e.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);/*
- * jQuery UI Selectable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Selectables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy();return this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(!this.options.disabled){var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element});return!1}})}},_mouseDrag:function(b){var c=this;this.dragged=!0;if(!this.options.disabled){var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!!i&&i.element!=c.element[0]){var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}});return!1}},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove();return!1}}),a.extend(a.ui.selectable,{version:"1.8.18"})})(jQuery);/*
- * jQuery UI Sortable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Sortables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f){e=a(this);return!1}});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}this.currentItem=e,this._removeCurrentsFromItems();return!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b);return!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(b,c){if(!!b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1}},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem));return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();if(!e)return!1;return this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1)},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a),this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];e||(b.style.visibility="hidden");return b},update:function(a,b){if(!e||!!d.forcePlaceholderSize)b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!!c)if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.items[i][this.containers[d].floating?"left":"top"];Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i])}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height());return d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.18"})})(jQuery);/*
- * jQuery UI Accordion 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Accordion
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");(b.autoHeight||b.fillHeight)&&c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}if(f){a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus();return!1}return!0}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(!d.disabled){if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return}},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!!g)return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;this.running||(this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data))}}),a.extend(a.ui.accordion,{version:"1.8.18",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size())b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);else{if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})}},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);/*
- * jQuery UI Autocomplete 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Autocomplete
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * jquery.ui.position.js
- */(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!b.options.disabled&&!b.element.propAttr("readOnly")){d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._move("previous",c),c.preventDefault();break;case e.DOWN:b._move("next",c),c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){b.options.disabled||(b.selectedItem=null,b.previous=b.element.val())}).bind("blur.autocomplete",function(a){b.options.disabled||(clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150))}),this._initSource(),this.response=function(){return b._response.apply(b,arguments)},this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,d,e;a.isArray(this.options.source)?(d=this.options.source,this.source=function(b,c){c(a.ui.autocomplete.filter(d,b.term))}):typeof this.options.source=="string"?(e=this.options.source,this.source=function(d,f){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:e,data:d,dataType:"json",context:{autocompleteRequest:++c},success:function(a,b){this.autocompleteRequest===c&&f(a)},error:function(){this.autocompleteRequest===c&&f([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==!1)return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this.response)},_response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close(),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){if(b.length&&b[0].label&&b[0].value)return b;return a.map(b,function(b){if(typeof b=="string")return{label:b,value:b};return a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible"))this.search(null,b);else{if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)}},widget:function(){return this.menu.element}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){!a(c.target).closest(".ui-menu-item a").length||(c.preventDefault(),b.select(c))}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){!this.active||(this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null)},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active)this.activate(c,this.element.children(b));else{var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))}},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10}),result.length||(result=this.element.children(".ui-menu-item:first")),this.activate(b,result)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);/*
- * jQuery UI Button 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Button
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form}));return e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){h.disabled||(a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active"))}).bind("mouseleave.button",function(){h.disabled||a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){f||b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){h.disabled||(f=!1,d=a.pageX,e=a.pageY)}).bind("mouseup.button",function(a){!h.disabled&&(d!==a.pageX||e!==a.pageY)&&(f=!0)})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed","true");var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);b==="disabled"?c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1):this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var b=this.buttonElement.removeClass(i),c=a("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);/*
- * jQuery UI Dialog 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * jquery.ui.button.js
- * jquery.ui.draggable.js
- * jquery.ui.mouse.js
- * jquery.ui.position.js
- * jquery.ui.resizable.js
- */(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||"&#160;",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){b.close(a);return!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1!==c._trigger("beforeClose",b)){c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d);return c}},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;if(e.modal&&!b||!e.stack&&!e.modal)return d._trigger("focus",c);e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c);return d},open:function(){if(!this._isOpen){var b=this,c=b.options,d=b.uiDialog;b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode===a.ui.keyCode.TAB){var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey){d.focus(1);return!1}if(b.target===d[0]&&b.shiftKey){e.focus(1);return!1}}}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open");return b}},_createButtons:function(b){var c=this,d=!1,e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){a!=="click"&&(a in f?e[a](b):e.attr(a,b))}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||"&#160;"))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.18",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");b||(this.uuid+=1,b=this.uuid);return"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}),a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize));var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&c.bgiframe(),this.instances.push(c);return c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;if(a.browser.msie&&a.browser.version<7){b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return b<c?a(window).height()+"px":b+"px"}return a(document).height()+"px"},width:function(){var b,c;if(a.browser.msie){b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return b<c?a(window).width()+"px":b+"px"}return a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)}),b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}}),a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);/*
- * jQuery UI Slider 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Slider
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */(function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=a(this).data("index.ui-slider-handle"),f,g,h,i;if(!b.options.disabled){switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:d.preventDefault();if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),f=b._start(d,e);if(f===!1)return}}i=b.options.step,b.options.values&&b.options.values.length?g=h=b.values(e):g=h=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:h=b._valueMin();break;case a.ui.keyCode.END:h=b._valueMax();break;case a.ui.keyCode.PAGE_UP:h=b._trimAlignValue(g+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(g-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g===b._valueMax())return;h=b._trimAlignValue(g+i);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g===b._valueMin())return;h=b._trimAlignValue(g-i)}b._slide(d,e,h)}}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy();return this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;if(c.disabled)return!1;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i);if(j===!1)return!1;this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0;return!0},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);this._slide(a,this._handleIndex,c);return!1},_mouseStop:function(a){this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1;return!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e;return this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values());return this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length)this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);else return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1)this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);else{if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()}},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,c,d;if(arguments.length){b=this.options.values[a],b=this._trimAlignValue(b);return b}c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;Math.abs(c)*2>=b&&(d+=c>0?b:-b);return parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.18"})})(jQuery);/*
- * jQuery UI Tabs 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Tabs
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */(function(a,b){function f(){return++d}function e(){return++c}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash){e.selected=a;return!1}}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1){this.blur();return!1}e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected")){e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur();return!1}if(!f.length){e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur();return!1}}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$="+a+"]")));return a},destroy:function(){var b=this.options;this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie);return this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e]));return this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0]));return this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a])));return this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;this.anchors.eq(a).trigger(this.options.event+".tabs");return this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup();return this},url:function(a,b){this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b);return this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.18"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){t=d.selected,e()}:function(a){a.clientX&&c.rotate(null)});a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate);return this}})})(jQuery);/*
- * jQuery UI Datepicker 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Datepicker
- *
- * Depends:
- * jquery.ui.core.js
- */(function($,undefined){function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);!c.length||c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);!$.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])&&!!d.length&&(d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover"))})}function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}$.extend($.ui,{datepicker:{version:"1.8.18"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){extendRemove(this._defaults,a||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);c.hasClass(this.markerClassName)||(this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a))},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){$.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]);return!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);c.hasClass(this.markerClassName)||(c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block"))},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f);return this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})}},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!!b.hasClass(this.markerClassName)){var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);c&&!c.inline&&this._setDateFromField(c,b);return c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(a){$.datepicker.log(a)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if(!$.datepicker._isDisabledDatepicker(a)&&$.datepicker._lastInput!=a){var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){e|=$(this).css("position")=="fixed";return!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0);return b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=$.data(a,PROP_NAME))&&this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=this,f=function(){$.datepicker._tidyDialog(b),e._curInst=null};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,f):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,f),c||f(),this._datepickerShowing=!1;var g=this._get(b,"onClose");g&&g.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!!$.datepicker._curInst){var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);this._isDisabledDatepicker(d[0])||(this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e))},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if(!$(d).hasClass(this._unselectableClass)&&!this._isDisabledDatepicker(e[0])){var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();b.setMonth(0),b.setDate(1);return Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;c&&s++;return c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;r+=f[0].length;return parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase()){f=c[0],r+=d.length;return!1}});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;for(;;){var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;c&&m++;return c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;c&&e++;return c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()!=a.lastVal){var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)}},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;b.setDate(b.getDate()+a);return b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0));return this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){if(!a)return null;a.setHours(a.getHours()>12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),
-a._keyEvent=!1;return K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>";return l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;e=d&&e>d?d:e;return e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth()));return this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return $.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b));return this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)})},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.18",window["DP_jQuery_"+dpuuid]=$})(jQuery);/*
- * jQuery UI Progressbar 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Progressbar
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===b)return this._value();this._setOption("value",a);return this},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;typeof a!="number"&&(a=0);return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.18"})})(jQuery);/*
- * jQuery UI Effects 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/
- */jQuery.effects||function(a,b){function l(b){if(!b||typeof b=="number"||a.fx.speeds[b])return!0;if(typeof b=="string"&&!a.effects[b])return!0;return!1}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete;return[b,c,d,e]}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function d(b,d){var e;do{e=a.curCSS(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function c(b){var c;if(b&&b.constructor==Array&&b.length==3)return b;if(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))return[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)];if(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))return[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55];if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))return[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)];if(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))return[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)];if(c=/rgba\(0, 0, 0, 0\)/.exec(b))return e.transparent;return e[a.trim(b).toLowerCase()]}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){a.isFunction(d)&&(e=d,d=null);return this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class");a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.18",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){b=="toggle"&&(b=a.is(":hidden")?"show":"hide");return b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"}));return d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;if(b.parent().is(".ui-effects-wrapper")){c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus();return c}return b},setTransition:function(b,c,d,e){e=e||{},a.each(c,function(a,c){unit=b.cssUnit(c),unit[0]>0&&(e[c]=unit[0]*d+unit[1])});return e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];if(a.fx.off||!i)return h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)});return i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="show";return this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);b[1].mode="hide";return this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);c[1].mode="toggle";return this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])});return d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b+c;return-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b+c;return d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){if((b/=e/2)<1)return d/2*b*b*b*b*b+c;return d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){if(b==0)return c;if(b==e)return c+d;if((b/=e/2)<1)return d/2*Math.pow(2,10*(b-1))+c;return d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){if((b/=e/2)<1)return-d/2*(Math.sqrt(1-b*b)-1)+c;return d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);if(b<1)return-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c;return h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);return e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){g==b&&(g=1.70158);if((c/=f/2)<1)return e/2*c*c*(((g*=1.525)+1)*c-g)+d;return e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){if(c<f/2)return a.easing.easeInBounce(b,c*2,0,e,f)*.5+d;return a.easing.easeOutBounce(b,c*2-f,0,e,f)*.5+e*.5+d}})}(jQuery);/*
- * jQuery UI Effects Blind 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Blind
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/*
- * jQuery UI Effects Bounce 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Bounce
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight({margin:!0})/3:c.outerWidth({margin:!0})/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing),g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g,c.animate(l,i/2,b.options.easing,function(){c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/*
- * jQuery UI Effects Clip 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Clip
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();e=="show"&&(h.css(i.size,0),h.css(i.position,j/2));var k={};k[i.size]=e=="show"?j:0,k[i.position]=e=="show"?0:j/2,h.animate(k,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Drop 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Drop
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0})/2:c.outerWidth({margin:!0})/2);e=="show"&&c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Explode 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Explode
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3,d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);for(var i=0;i<c;i++)for(var j=0;j<d;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);/*
- * jQuery UI Effects Fade 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Fade
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Fold 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Fold
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);/*
- * jQuery UI Effects Highlight 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Highlight
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Pulsate 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Pulsate
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show");times=(b.options.times||5)*2-1,duration=b.duration?b.duration/2:a.fx.speeds._default/2,isVisible=c.is(":visible"),animateTo=0,isVisible||(c.css("opacity",0).show(),animateTo=1),(d=="hide"&&isVisible||d=="show"&&!isVisible)&&times--;for(var e=0;e<times;e++)c.animate({opacity:animateTo},duration,b.options.easing),animateTo=(animateTo+1)%2;c.animate({opacity:animateTo},duration,b.options.easing,function(){animateTo==0&&c.hide(),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);/*
- * jQuery UI Effects Scale 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Scale
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:!0,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}}),c.effect("scale",b.options,b.duration,b.callback),c.dequeue()})},a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),e=="hide"&&(c.from.opacity=1,c.to.opacity=0)),d.from=c.from,d.to=c.to,d.mode=e,c.effect("size",d,b.duration,b.callback),c.dequeue()})},a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,n={height:c.height(),width:c.width()};c.from=b.options.from||n,c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y,c.from.left=(n.width-c.from.width)*p.x,c.to.top=(n.height-c.to.height)*p.y,c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both")q.from.y!=q.to.y&&(d=d.concat(h),c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(d=d.concat(i),c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to));(l=="content"||l=="both")&&q.from.y!=q.to.y&&(d=d.concat(g),c.from=a.effects.setTransition(c,g,q.from.y,c.from),c.to=a.effects.setTransition(c,g,q.to.y,c.to)),a.effects.save(c,k?d:e),c.show(),a.effects.createWrapper(c),c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both")h=h.concat(["marginTop","marginBottom"]).concat(g),i=i.concat(["marginLeft","marginRight"]),f=d.concat(h).concat(i),c.find("*[width]").each(function(){child=a(this),k&&a.effects.save(child,f);var c={height:child.height(),width:child.width()};child.from={height:c.height*q.from.y,width:c.width*q.from.x},child.to={height:c.height*q.to.y,width:c.width*q.to.x},q.from.y!=q.to.y&&(child.from=a.effects.setTransition(child,h,q.from.y,child.from),child.to=a.effects.setTransition(child,h,q.to.y,child.to)),q.from.x!=q.to.x&&(child.from=a.effects.setTransition(child,i,q.from.x,child.from),child.to=a.effects.setTransition(child,i,q.to.x,child.to)),child.css(child.from),child.animate(child.to,b.duration,b.options.easing,function(){k&&a.effects.restore(child,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Shake 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Shake
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,i=b.duration||b.options.duration||140;a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g,m[j]=(k=="pos"?"+=":"-=")+g*2,n[j]=(k=="pos"?"-=":"+=")+g*2,c.animate(l,i,b.options.easing);for(var p=1;p<h;p++)c.animate(m,i,b.options.easing).animate(n,i,b.options.easing);c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);/*
- * jQuery UI Effects Slide 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Slide
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"show"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight({margin:!0}):c.outerWidth({margin:!0}));e=="show"&&c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);/*
- * jQuery UI Effects Transfer 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Transfer
- *
- * Depends:
- * jquery.effects.core.js
- */(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery); \ No newline at end of file
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/init-db.sh b/storage/mroonga/vendor/groonga/examples/dictionary/init-db.sh
deleted file mode 100755
index 351d90e7b30..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/init-db.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-if [ 1 != $# ]; then
- echo "usage: $0 db_path"
- exit 1
-fi
-
-if groonga-suggest-create-dataset $1 dictionary > /dev/null; then
- echo "db initialized."
-fi
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/jmdict/Makefile.am b/storage/mroonga/vendor/groonga/examples/dictionary/jmdict/Makefile.am
deleted file mode 100644
index 70b4a5bc010..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/jmdict/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-jmdictdir = $(examples_dictionarydir)/jmdict
-dist_jmdict_SCRIPTS = \
- jmdict.rb
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/jmdict/jmdict.rb b/storage/mroonga/vendor/groonga/examples/dictionary/jmdict/jmdict.rb
deleted file mode 100755
index bf8926783cb..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/jmdict/jmdict.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-
-require 'rexml/document'
-require 'rexml/parsers/streamparser'
-require 'rexml/parsers/baseparser'
-require 'rexml/streamlistener'
-
-#REXML::Document.new(STDIN)
-
-class MyListener
- include REXML::StreamListener
- def tag_start(name, attrs)
- # p name, attrs
- case name
- when 'entry'
- @n = 0
- end
- end
- def tag_end name
- # p "tag_end: #{x}"
- case name
- when 'sense'
- @n += 1
- when 'entry'
- @n_ents += 1
- puts "#{@ent}:#{@n}" if (@n > 8)
- when 'ent_seq'
- @ent = @text
- end
- end
-
- def text(text)
- @text = text
- end
-
- def xmldecl(version, encoding, standalone)
- @n_ents = 0
- end
-end
-
-REXML::Parsers::StreamParser.new(STDIN, MyListener.new).parse
diff --git a/storage/mroonga/vendor/groonga/examples/dictionary/readme.txt b/storage/mroonga/vendor/groonga/examples/dictionary/readme.txt
deleted file mode 100644
index 555706e0061..00000000000
--- a/storage/mroonga/vendor/groonga/examples/dictionary/readme.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-.. highlightlang:: none
-
-辞書検索ツール
-==============
-
-åå‰
-----
-
-groonga辞書検索ツール
-
-説明
-----
-
-様々ãªå•†ç”¨ãƒ»éžå•†ç”¨ã®è¾žæ›¸ãƒ•ã‚¡ã‚¤ãƒ«ã‚’インãƒãƒ¼ãƒˆã—ã¦groongaã§æ¤œç´¢ã§ãるよã†ã«ã—ã¾ã™ã€‚
-
-対応ã—ã¦ã„る辞書
-++++++++++++++++
-
-ç¾çŠ¶ã§ã¯ä¸‹è¨˜ã®è¾žæ›¸ã«å¯¾å¿œã—ã¦ã„ã¾ã™ã€‚
-
-* EDICT
-
-EDICTã¯ã€Monash大学Jim Breen教授ãŒæä¾›ã—ã¦ã„る和英辞書ã§ã™ã€‚下記ã‹ã‚‰å…¥æ‰‹ã§ãã¾ã™ã€‚
-
-http://ftp.monash.edu.au/pub/nihongo/edict.gz
-
-* GENE95
-
-GENE95ã¯ã€Kurumiã•ã‚“(NiftyID: GGD00145)ãŒä½œæˆã•ã‚ŒãŸè‹±å’Œè¾žæ›¸ã§ã™ã€‚下記ã‹ã‚‰å…¥æ‰‹ã§ãã¾ã™ã€‚
-
-http://www.namazu.org/~tsuchiya/sdic/data/gene95.tar.gz
-
-* 英辞郎
-
-英辞郎ã¯ã€EDPã¨ã„ã†å›£ä½“ã«ã‚ˆã£ã¦ç·¨çº‚ã•ã‚Œã¦ã„る英和・和英辞書ã§ã™ã€‚
-
-http://www.eijiro.jp/
-
-書店やオンラインショップãªã©ã§è³¼å…¥ã§ãã¾ã™ã€‚
-
-データベースã®åˆæœŸåŒ–
-++++++++++++++++++++
-
-本ディレクトリã§ä¸‹è¨˜ã®ã‚ˆã†ã«å®Ÿè¡Œã—ã€è¾žæ›¸ãƒ‡ãƒ¼ã‚¿ã‚’æ ¼ç´ã™ã‚‹ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ãƒ•ã‚¡ã‚¤ãƒ«ã‚’下記ã®ã‚ˆã†ã«ã—ã¦åˆæœŸåŒ–ã—ã¾ã™ã€‚
-
- ./init-db.sh データベースパスå
-
-ã“ã®ã‚ˆã†ã«ã—ã¦ä½œæˆã—ãŸãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã«ã¤ã„ã¦ã€æ§˜ã€…ãªè¾žæ›¸ã®ãƒ‡ãƒ¼ã‚¿ã‚’インãƒãƒ¼ãƒˆã™ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚
-
-インãƒãƒ¼ãƒˆã®æ–¹æ³•
-++++++++++++++++
-
-* EDICT
-
-edictディレクトリé…下ã§ä»¥ä¸‹ã®ã‚ˆã†ã«å®Ÿè¡Œã—ã¾ã™ã€‚ edict.gzã¯è‡ªå‹•ã§ãƒ€ã‚¦ãƒ³ãƒ­ãƒ¼ãƒ‰ã—ã¾ã™ã€‚
-
- ./edict-import.sh データベースパスå
-
-* GENE95
-
-gene95ディレクトリé…下ã§ä¸‹è¨˜ã®ã‚ˆã†ã«å®Ÿè¡Œã—ã¾ã™ã€‚ gene95.tar.gzã¯è‡ªå‹•ã§ãƒ€ã‚¦ãƒ³ãƒ­ãƒ¼ãƒ‰ã—ã¾ã™ã€‚
-
- ./gene-import.sh データベースパスå
-
-* 英辞郎
-
-英辞郎ã«ä»˜å±žã®PDICツールを用ã„ã¦CSVファイル形å¼ã«è¾žæ›¸ã‚’エクスãƒãƒ¼ãƒˆã—ã¾ã™ã€‚(ã“ã®ã¨ã「登録項目ã€ã§ã™ã¹ã¦ã®é …目を出力ã™ã‚‹ã‚ˆã†ã«ã—ã¾ã™) eijiroディレクトリé…下ã§ä¸‹è¨˜ã®ã‚ˆã†ã«å®Ÿè¡Œã—ã¾ã™ã€‚
-
- ./eijiro-import.sh データベースパスå 出力ã—ãŸCSVファイルã®ãƒ‘スå
-
-(英辞郎第四版ã§å‹•ä½œã‚’確èªã—ã¦ã„ã¾ã™)
diff --git a/storage/mroonga/vendor/groonga/packages/Makefile.am b/storage/mroonga/vendor/groonga/packages/Makefile.am
deleted file mode 100644
index 5ba46fdfd66..00000000000
--- a/storage/mroonga/vendor/groonga/packages/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-SUBDIRS = \
- apt \
- ubuntu \
- rpm \
- yum \
- source \
- windows
diff --git a/storage/mroonga/vendor/groonga/packages/apt/Makefile.am b/storage/mroonga/vendor/groonga/packages/apt/Makefile.am
deleted file mode 100644
index 484cb3f8fb6..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/Makefile.am
+++ /dev/null
@@ -1,98 +0,0 @@
-REPOSITORIES_PATH = repositories
-DISTRIBUTIONS = debian
-ARCHITECTURES = i386 amd64
-CODE_NAMES = wheezy
-KEYRING_PACKAGE = groonga-keyring
-KEYRING_VERSION = 2012.05.29
-KEYRING_BASE_NAME = $(KEYRING_PACKAGE)-$(KEYRING_VERSION)
-
-all:
-
-release: build sign-packages update-repository sign-repository upload
-
-remove-existing-packages:
- for distribution in $(DISTRIBUTIONS); do \
- find $(REPOSITORIES_PATH)/$${distribution}/pool \
- -type f -delete; \
- done
-
-ensure-rsync-path:
- @if test -z "$(RSYNC_PATH)"; then \
- echo "--with-rsync-path configure option must be specified."; \
- false; \
- fi
-
-download: ensure-rsync-path
- for distribution in $(DISTRIBUTIONS); do \
- rsync -avz --progress --delete \
- $(RSYNC_PATH)/$${distribution} \
- ${REPOSITORIES_PATH}/; \
- done
-
-sign-packages:
- ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
-
-update-repository:
- ./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \
- '$(ARCHITECTURES)' '$(CODE_NAMES)'
-
-sign-repository:
- ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODE_NAMES)'
-
-upload: ensure-rsync-path
- for distribution in $(DISTRIBUTIONS); do \
- (cd $(REPOSITORIES_PATH)/$${distribution}; \
- rsync -avz --progress --delete \
- dists pool $(RSYNC_PATH)/$${distribution}); \
- done
-
-build: build-package-deb build-keyring-deb
-
-run-vagrant:
- vagrant destroy --force
- for architecture in $(ARCHITECTURES); do \
- for code_name in $(CODE_NAMES); do \
- id=debian-$$code_name-$$architecture; \
- vagrant up $$id || exit 1; \
- vagrant destroy --force $$id; \
- done; \
- done
-
-build-package-deb: prepare-build-package-deb
- $(MAKE) run-vagrant
-
-prepare-build-package-deb: source env.sh
- cp env.sh tmp/
- rm -rf tmp/debian
- cp -rp $(srcdir)/../debian/ tmp/
-
-source: tmp/$(PACKAGE)-$(VERSION).tar.gz
-
-tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
- mkdir -p tmp/
- cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $@
-
-
-build-keyring-deb: prepare-build-keyring-deb
- $(MAKE) run-vagrant
-
-keyring-source: tmp/$(KEYRING_BASE_NAME).tar.gz
-
-ensure-public-key:
- gpg --list-keys '$(GPG_UID)' > /dev/null || \
- gpg --keyserver keyserver.ubuntu.com --recv-key '$(GPG_UID)'
-
-tmp/$(KEYRING_BASE_NAME).tar.gz: ensure-public-key
- rm -rf $(KEYRING_BASE_NAME)
- mkdir -p $(KEYRING_BASE_NAME)
- gpg --armor --export '$(GPG_UID)' > \
- $(KEYRING_BASE_NAME)/groonga-keyring.gpg
- mkdir -p tmp/
- tar cvzf tmp/$(KEYRING_BASE_NAME).tar.gz $(KEYRING_BASE_NAME)
-
-prepare-build-keyring-deb: keyring-source
- echo "PACKAGE=$(KEYRING_PACKAGE)" > tmp/env.sh
- echo "VERSION=$(KEYRING_VERSION)" >> tmp/env.sh
- echo "DEPENDED_PACKAGES='gnupg'" >> tmp/env.sh
- rm -rf tmp/debian
- cp -a $(srcdir)/debian/ tmp/
diff --git a/storage/mroonga/vendor/groonga/packages/apt/Vagrantfile b/storage/mroonga/vendor/groonga/packages/apt/Vagrantfile
deleted file mode 100644
index e1c41785dd8..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/Vagrantfile
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
-VAGRANTFILE_API_VERSION = "2"
-
-Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
- vms = [
- {
- :id => "debian-wheezy-i386",
- :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.6-i386_chef-provisionerless.box
-",
- },
- {
- :id => "debian-wheezy-amd64",
- :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.6_chef-provisionerless.box",
- },
- ]
-
- vms.each do |vm|
- config.vm.define(vm[:id]) do |node|
- node.vm.box = vm[:id]
- node.vm.box_url = vm[:box_url]
- hour_in_seconds = 60 * 60
- node.vm.boot_timeout = 1 * hour_in_seconds
- node.vm.provision(:shell, :privileged => false, :path => "build-deb.sh")
- node.vm.provider("virtualbox") do |virtual_box|
- virtual_box.memory = 512
- virtual_box.customize ["modifyvm", :id, "--hwvirtex", "off"]
- end
- end
- end
-end
diff --git a/storage/mroonga/vendor/groonga/packages/apt/build-deb.sh b/storage/mroonga/vendor/groonga/packages/apt/build-deb.sh
deleted file mode 100755
index ec6789e2be5..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/build-deb.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-
-LANG=C
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-. /vagrant/tmp/env.sh
-
-swap_file=/tmp/swap
-run sudo dd if=/dev/zero of="$swap_file" bs=1024 count=4096K
-run sudo mkswap "$swap_file"
-run sudo swapon "$swap_file"
-
-run sudo apt-get update
-run sudo apt-get install -y lsb-release
-
-distribution=$(lsb_release --id --short | tr 'A-Z' 'a-z')
-code_name=$(lsb_release --codename --short)
-case "${distribution}" in
- debian)
- component=main
- ;;
- ubuntu)
- component=universe
- ;;
-esac
-
-run sudo apt-get install -V -y build-essential devscripts ${DEPENDED_PACKAGES}
-
-run mkdir -p build
-run cp /vagrant/tmp/${PACKAGE}-${VERSION}.tar.gz \
- build/${PACKAGE}_${VERSION}.orig.tar.gz
-run cd build
-run tar xfz ${PACKAGE}_${VERSION}.orig.tar.gz
-run cd ${PACKAGE}-${VERSION}/
-run cp -rp /vagrant/tmp/debian debian
-# export DEB_BUILD_OPTIONS=noopt
-run debuild -us -uc
-run cd -
-
-package_initial=$(echo "${PACKAGE}" | sed -e 's/\(.\).*/\1/')
-pool_dir="/vagrant/repositories/${distribution}/pool/${code_name}/${component}/${package_initial}/${PACKAGE}"
-run mkdir -p "${pool_dir}/"
-run cp *.tar.gz *.dsc *.deb "${pool_dir}/"
diff --git a/storage/mroonga/vendor/groonga/packages/apt/debian/changelog b/storage/mroonga/vendor/groonga/packages/apt/debian/changelog
deleted file mode 100644
index d1e8835e2a5..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/debian/changelog
+++ /dev/null
@@ -1,11 +0,0 @@
-groonga-keyring (2012.05.29-1) unstable; urgency=low
-
- * Replace old key id to new one.
-
- -- groonga Key (groonga Official Signing Key) <packages@groonga.org> Tue, 29 May 2012 00:00:00 +0900
-
-groonga-keyring (2012.04.29-1) unstable; urgency=low
-
- * Initial release.
-
- -- groonga Key (groonga Official Signing Key) <packages@groonga.org> Sun, 29 Apr 2012 00:00:00 +0900
diff --git a/storage/mroonga/vendor/groonga/packages/apt/debian/compat b/storage/mroonga/vendor/groonga/packages/apt/debian/compat
deleted file mode 100644
index 7f8f011eb73..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-7
diff --git a/storage/mroonga/vendor/groonga/packages/apt/debian/control b/storage/mroonga/vendor/groonga/packages/apt/debian/control
deleted file mode 100644
index 949ce13370a..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/debian/control
+++ /dev/null
@@ -1,18 +0,0 @@
-Source: groonga-keyring
-Section: misc
-Priority: important
-Maintainer: groonga project <packages@groonga.org>
-Build-Depends:
- debhelper (>= 7.0.50)
-Standards-Version: 3.9.1
-Homepage: http://groonga.org/
-
-Package: groonga-keyring
-Section: misc
-Architecture: all
-Depends:
- ${misc:Depends},
- gnupg
-Description: GnuPG archive key of the groonga repository
- The groonga repository digitally signs its Release files. This
- package contains the repository key used for that.
diff --git a/storage/mroonga/vendor/groonga/packages/apt/debian/copyright b/storage/mroonga/vendor/groonga/packages/apt/debian/copyright
deleted file mode 100644
index bcf01d23f98..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/debian/copyright
+++ /dev/null
@@ -1,34 +0,0 @@
-This package was debianized by Kouhei Sutou <kou@clear-code.com> on
-Sun, 29 Apr 2012 00:00:00 +0000.
-
-It was downloaded from <http://groonga.org/>
-
-Upstream Author(s):
-
- Daijiro MORI <morita at razil. jp>
- Tasuku SUENAGA <a at razil. jp>
- Yutaro Shimamura <yu at razil. jp>
- Kouhei Sutou <kou at cozmixng. org>
- Kazuho Oku <kazuhooku at gmail. com>
- Moriyoshi Koizumi <moriyoshi at gmail. com>
-
-Copyright:
-
- Copyright(C) 2009-2012 Brazil
-
-License:
-
- This library is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 2.1 of the License.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-The Debian packaging is (C) 2012, Kouhei Sutou <kou@clear-code.com> and
-is licensed under the LGPL-2.1, see `/usr/share/common-licenses/LGPL-2.1'.
diff --git a/storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.install b/storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.install
deleted file mode 100644
index a068a88bf27..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/keyrings/*
diff --git a/storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postinst b/storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postinst
deleted file mode 100755
index bf268a63e62..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postinst
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/sh
-
-set -e
-
-prevver="$2"
-
-case "$1" in
- configure)
- if [ -x /usr/bin/apt-key ]; then
- apt-key add /usr/share/keyrings/groonga-keyring.gpg
- fi
- ;;
- abort-upgrade|abort-deconfigure|abort-remove)
- :
- ;;
- *)
- echo "Called with unknown argument $1, bailing out."
- exit 1
- ;;
-esac
-
-#DEBHELPER#
diff --git a/storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postrm.in b/storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postrm.in
deleted file mode 100644
index b2e8ad6b6e6..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/debian/groonga-keyring.postrm.in
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /bin/sh
-
-set -e
-
-case "$1" in
- remove)
- if [ -x /usr/bin/apt-key ]; then
- apt-key del @GPG_UID@
- fi
- ;;
- purge)
- :
- ;;
- upgrade|deconfigure)
- :
- ;;
- failed-upgrade)
- :
- ;;
- *)
- echo "prerm called with unknown argument \`$1'" >&2
- exit 1
- ;;
-esac
-
-#DEBHELPER#
diff --git a/storage/mroonga/vendor/groonga/packages/apt/debian/rules b/storage/mroonga/vendor/groonga/packages/apt/debian/rules
deleted file mode 100755
index 759f2fd5ed8..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/debian/rules
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile-gmake -*-
-#
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-# This has to be exported to make some magic below work.
-export DH_OPTIONS
-
-%:
- dh $@
-
-override_dh_install:
- install -d debian/tmp/usr/share/keyrings/
- install -m 0644 groonga-keyring.gpg \
- debian/tmp/usr/share/keyrings/
-
- dh_install
diff --git a/storage/mroonga/vendor/groonga/packages/apt/debian/source/format b/storage/mroonga/vendor/groonga/packages/apt/debian/source/format
deleted file mode 100644
index 163aaf8d82b..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/storage/mroonga/vendor/groonga/packages/apt/env.sh.in b/storage/mroonga/vendor/groonga/packages/apt/env.sh.in
deleted file mode 100644
index 0b56e9fe38f..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/env.sh.in
+++ /dev/null
@@ -1,13 +0,0 @@
-PACKAGE=@PACKAGE@
-VERSION=@VERSION@
-DEPENDED_PACKAGES="
-debhelper
-autotools-dev
-zlib1g-dev
-liblzo2-dev
-libmsgpack-dev
-libzmq-dev
-libevent-dev
-libmecab-dev
-libpcre3-dev
-"
diff --git a/storage/mroonga/vendor/groonga/packages/apt/sign-packages.sh b/storage/mroonga/vendor/groonga/packages/apt/sign-packages.sh
deleted file mode 100755
index 6e74f1ceff2..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/sign-packages.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-script_base_dir=`dirname $0`
-
-if [ $# != 3 ]; then
- echo "Usage: $0 GPG_UID DESITINATION CODES"
- echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'"
- exit 1
-fi
-
-GPG_UID=$1
-DESTINATION=$2
-CODES=$3
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-for code_name in ${CODES}; do
- case ${code_name} in
- wheezy|jessie|unstable)
- distribution=debian
- ;;
- *)
- distribution=ubuntu
- ;;
- esac
-
- base_directory=${DESTINATION}${distribution}
- debsign -pgpg2 --re-sign -k${GPG_UID} \
- $(find ${base_directory} -name '*.dsc' -or -name '*.changes') &
- if [ "${PARALLEL}" != "yes" ]; then
- wait
- fi
-done
-
-wait
diff --git a/storage/mroonga/vendor/groonga/packages/apt/sign-repository.sh b/storage/mroonga/vendor/groonga/packages/apt/sign-repository.sh
deleted file mode 100755
index 312528805a4..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/sign-repository.sh
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh
-
-script_base_dir=`dirname $0`
-
-if [ $# != 3 ]; then
- echo "Usage: $0 GPG_UID DESTINATION CODES"
- echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'"
- exit 1
-fi
-
-GPG_UID=$1
-DESTINATION=$2
-CODES=$3
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-for code_name in ${CODES}; do
- case ${code_name} in
- wheezy|jessie|unstable)
- distribution=debian
- ;;
- *)
- distribution=ubuntu
- ;;
- esac
-
- release=${DESTINATION}${distribution}/dists/${code_name}/Release
- rm -f ${release}.gpg
- gpg2 --sign --detach-sign --armor \
- --local-user ${GPG_UID} \
- --output ${release}.gpg \
- ${release} &
-
- if [ "${PARALLEL}" != "yes" ]; then
- wait
- fi
-done
-
-wait
diff --git a/storage/mroonga/vendor/groonga/packages/apt/update-repository.sh b/storage/mroonga/vendor/groonga/packages/apt/update-repository.sh
deleted file mode 100755
index a87805ae729..00000000000
--- a/storage/mroonga/vendor/groonga/packages/apt/update-repository.sh
+++ /dev/null
@@ -1,130 +0,0 @@
-#!/bin/sh
-
-script_base_dir=`dirname $0`
-
-if [ $# != 4 ]; then
- echo "Usage: $0 PROJECT_NAME DESTINATION ARCHITECTURES CODES"
- echo " e.g.: $0 mroonga repositories/ 'i386 amd64' 'lenny unstable hardy karmic'"
- exit 1
-fi
-
-PROJECT_NAME=$1
-DESTINATION=$2
-ARCHITECTURES=$3
-CODES=$4
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-update_repository()
-{
- distribution=$1
- code_name=$2
- component=$3
-
- rm -rf dists/${code_name}
- mkdir -p dists/${code_name}/${component}/binary-i386/
- mkdir -p dists/${code_name}/${component}/binary-amd64/
- mkdir -p dists/${code_name}/${component}/source/
-
- cat <<EOF > dists/.htaccess
-Options +Indexes
-EOF
-
- cat <<EOF > dists/${code_name}/${component}/binary-i386/Release
-Archive: ${code_name}
-Component: ${component}
-Origin: The ${PROJECT_NAME} project
-Label: The ${PROJECT_NAME} project
-Architecture: i386
-EOF
-
- cat <<EOF > dists/${code_name}/${component}/binary-amd64/Release
-Archive: ${code_name}
-Component: ${component}
-Origin: The ${PROJECT_NAME} project
-Label: The ${PROJECT_NAME} project
-Architecture: amd64
-EOF
-
- cat <<EOF > dists/${code_name}/${component}/source/Release
-Archive: ${code_name}
-Component: ${component}
-Origin: The ${PROJECT_NAME} project
-Label: The ${PROJECT_NAME} project
-Architecture: source
-EOF
-
- cat <<EOF > generate-${code_name}.conf
-Dir::ArchiveDir ".";
-Dir::CacheDir ".";
-TreeDefault::Directory "pool/${code_name}/${component}";
-TreeDefault::SrcDirectory "pool/${code_name}/${component}";
-Default::Packages::Extensions ".deb";
-Default::Packages::Compress ". gzip bzip2";
-Default::Sources::Compress ". gzip bzip2";
-Default::Contents::Compress "gzip bzip2";
-
-BinDirectory "dists/${code_name}/${component}/binary-i386" {
- Packages "dists/${code_name}/${component}/binary-i386/Packages";
- Contents "dists/${code_name}/Contents-i386";
- SrcPackages "dists/${code_name}/${component}/source/Sources";
-};
-
-BinDirectory "dists/${code_name}/${component}/binary-amd64" {
- Packages "dists/${code_name}/${component}/binary-amd64/Packages";
- Contents "dists/${code_name}/Contents-amd64";
- SrcPackages "dists/${code_name}/${component}/source/Sources";
-};
-
-Tree "dists/${code_name}" {
- Sections "${component}";
- Architectures "i386 amd64 source";
-};
-EOF
- apt-ftparchive generate generate-${code_name}.conf
- chmod 644 dists/${code_name}/Contents-*
-
- rm -f dists/${code_name}/Release*
- rm -f *.db
- cat <<EOF > release-${code_name}.conf
-APT::FTPArchive::Release::Origin "The ${PROJECT_NAME} project";
-APT::FTPArchive::Release::Label "The ${PROJECT_NAME} project";
-APT::FTPArchive::Release::Architectures "i386 amd64";
-APT::FTPArchive::Release::Codename "${code_name}";
-APT::FTPArchive::Release::Suite "${code_name}";
-APT::FTPArchive::Release::Components "${component}";
-APT::FTPArchive::Release::Description "${PACKAGE_NAME} packages";
-EOF
- apt-ftparchive -c release-${code_name}.conf \
- release dists/${code_name} > /tmp/Release
- mv /tmp/Release dists/${code_name}
-}
-
-for code_name in ${CODES}; do
- case ${code_name} in
- wheezy|jessie|unstable)
- distribution=debian
- component=main
- ;;
- *)
- distribution=ubuntu
- component=universe
- ;;
- esac
-
- mkdir -p ${DESTINATION}${distribution}
- (cd ${DESTINATION}${distribution}
- update_repository $distribution $code_name $component) &
- if [ "${PARALLEL}" != "yes" ]; then
- wait
- fi
-done
-
-wait
diff --git a/storage/mroonga/vendor/groonga/packages/check-utility.sh b/storage/mroonga/vendor/groonga/packages/check-utility.sh
deleted file mode 100755
index 8c06067f9bd..00000000000
--- a/storage/mroonga/vendor/groonga/packages/check-utility.sh
+++ /dev/null
@@ -1,538 +0,0 @@
-#!/bin/sh
-
-# Usage: check-utility.sh [--install-groonga]
-# [--check-install]
-# [--check-address]
-# [--enable-repository]
-#
-# CODES="squeeze wheezy unstable lucid natty oneiric precise"
-# DISTRIBUTIONS="centos fedora"
-
-CHROOT_ROOT=/var/lib/chroot
-CHECK_ADDRESS=0
-CHECK_INSTALL=0
-CHECK_INSTALL_PACKAGE=groonga
-CHECK_BUILD=0
-ENABLE_REPOSITORY=0
-DISABLE_REPOSITORY=0
-INSTALL_SCRIPT=0
-INSTALL_GROONGA=0
-UNINSTALL_GROONGA=0
-
-common_deb_procedure ()
-{
- for code in $CODES; do
- for arch in $DEB_ARCHITECTURES; do
- root_dir=$CHROOT_ROOT/$code-$arch
- eval $1 $code $arch $root_dir
- done
- done
-}
-
-common_rpm_procedure ()
-{
- for dist in $DISTRIBUTIONS; do
- case $dist in
- "fedora")
- DISTRIBUTIONS_VERSION="19"
- ;;
- "centos")
- DISTRIBUTIONS_VERSION="5 6"
- ;;
- esac
- for ver in $DISTRIBUTIONS_VERSION; do
- for arch in $RPM_ARCHITECTURES; do
- root_dir=$CHROOT_ROOT/$dist-$ver-$arch
- eval $1 $dist $arch $ver $root_dir
- done
- done
- done
-}
-
-copy_and_exec_script ()
-{
- chroot_host=$1
- root_dir=$2
- script=$3
- if [ -d $root_dir ]; then
- echo "copy script $script to $root_dir/tmp"
- sudo rm -f $root_dir/tmp/$script
- cp tmp/$script $root_dir/tmp
- sudo chmod 755 $root_dir/tmp/$script
- sudo chname $chroot_host chroot $root_dir /tmp/$script
- fi
-}
-
-echo_packages_repository_address ()
-{
- root_dir=$1
- code=$2
- arch=$3
- address=`grep "packages.groonga.org" $root_dir/etc/hosts | grep -v "#"`
- nameserver=`grep "nameserver" $root_dir/etc/resolv.conf | grep -v "#" | cut -d ' ' -f 2`
- if [ -z "$address" ]; then
- echo "$code-$arch: default nameserver:$nameserver"
- else
- echo "$code-$arch: $address nameserver:$nameserver"
- fi
-}
-
-setup_distributions ()
-{
- if [ -z "$DISTRIBUTIONS" ]; then
- DISTRIBUTIONS="centos fedora"
- fi
-}
-
-setup_rpm_architectures ()
-{
- if [ -z "$RPM_ARCHITECTURES" ]; then
- RPM_ARCHITECTURES="i386 x86_64"
- fi
-}
-
-setup_codes ()
-{
- if [ -z "$CODES" ]; then
- CODES="squeeze wheezy jessie unstable lucid precise quantal raring"
- fi
-}
-setup_deb_architectures ()
-{
- if [ -z "$DEB_ARCHITECTURES" ]; then
- DEB_ARCHITECTURES="i386 amd64"
- fi
-}
-
-check_packages_repository_address ()
-{
- common_deb_procedure "check_packages_deb_repository_address"
- common_rpm_procedure "check_packages_rpm_repository_address"
-}
-
-check_packages_deb_repository_address ()
-{
- code=$1
- arch=$2
- root_dir=$3
- if [ -d "$root_dir" ]; then
- echo_packages_repository_address "$root_dir" "$code" "$arch"
- fi
-}
-
-check_packages_rpm_repository_address ()
-{
- dist=$1
- arch=$2
- ver=$3
- root_dir=$4
- if [ -d "$root_dir" ]; then
- echo_packages_repository_address "$root_dir" "$dist-$ver" "$arch"
- fi
-}
-
-
-host_address ()
-{
- ifconfig_result=`LANG=C /sbin/ifconfig wlan0`
- inet_addr=`echo "$ifconfig_result" | grep "inet addr:192"`
- address=`echo $inet_addr | ruby -ne '/inet addr:(.+?)\s/ =~ $_ && puts($1)'`
- HOST_ADDRESS=$address
-}
-
-check_build_packages ()
-{
- common_deb_procedure "check_build_deb_packages"
- common_rpm_procedure "check_build_rpm_packages"
-}
-
-check_build_deb_packages ()
-{
- code=$1
- arch=$2
- BASE_VERSION=`cat ../base_version`
- RESULT_SET=`find apt/repositories -name "*$BASE_VERSION*" | grep $code | grep $arch`
- if [ -z "$RESULT_SET" ]; then
- printf "%8s %5s %s => 0 deb\n" $code $arch $BASE_VERSION
- else
- PACKAGE_COUNT=`find apt/repositories -name "*$BASE_VERSION*" | grep $code | grep $arch | wc | awk '{print \$1}'`
- printf "%8s %5s %s => %2d debs\n" $code $arch $BASE_VERSION $PACKAGE_COUNT
- fi
-}
-
-check_build_rpm_packages ()
-{
- dist=$1
- arch=$2
- ver=$3
- BASE_VERSION=`cat ../base_version`
- FIND_PATH=yum/repositories/$dist/$ver/$arch
- RESULT_SET=`find $FIND_PATH -name "*$BASE_VERSION*"`
- if [ -z "$RESULT_SET" ]; then
- printf "%8s %6s %s => 0 rpm\n" $dist$ver $arch $BASE_VERSION
- else
- PACKAGE_COUNT=`find $FIND_PATH -name "*$BASE_VERSION*" | wc -l`
- printf "%8s %6s %s => %2d rpms\n" $dist$ver $arch $BASE_VERSION $PACKAGE_COUNT
- fi
-}
-
-check_installed_groonga_packages ()
-{
- common_deb_procedure "check_installed_groonga_deb_packages"
- common_rpm_procedure "check_installed_groonga_rpm_packages"
-}
-
-check_installed_groonga_deb_packages ()
-{
- code=$1
- arch=$2
- root_dir=$3
- CHECK_SCRIPT=check-deb-groonga.sh
- cat > tmp/$CHECK_SCRIPT <<EOF
-#!/bin/sh
-dpkg -l | grep $CHECK_INSTALL_PACKAGE
-EOF
- copy_and_exec_script $code-$arch $root_dir $CHECK_SCRIPT
-}
-
-
-check_installed_groonga_rpm_packages ()
-{
- dist=$1
- arch=$2
- ver=$3
- root_dir=$4
- CHECK_SCRIPT=check-rpm-groonga.sh
- cat > tmp/$CHECK_SCRIPT <<EOF
-#!/bin/sh
-rpm -qa | grep $CHECK_INSTALL_PACKAGE
-EOF
- copy_and_exec_script $code-$ver-$arch $root_dir $CHECK_SCRIPT
-}
-
-install_groonga_packages ()
-{
- common_deb_procedure "install_groonga_deb_packages"
- common_rpm_procedure "install_groonga_rpm_packages"
-}
-
-install_groonga_deb_packages ()
-{
- code=$1
- arch=$2
- root_dir=$3
- cat > tmp/install-aptitude-groonga.sh <<EOF
-#!/bin/sh
-sudo aptitude clean
-rm -f /var/lib/apt/lists/packages.groonga.org_*
-rm -f /var/lib/apt/lists/partial/packages.groonga.org_*
-sudo aptitude update
-sudo aptitude -V -D -y --allow-untrusted install groonga-keyring
-sudo aptitude update
-sudo aptitude -V -D -y install groonga
-sudo aptitude -V -D -y install groonga-tokenizer-mecab
-sudo apt-get -y install libgroonga-dev
-#sudo aptitude -V -D -y install groonga-munin-plugins
-EOF
- cat > tmp/install-aptget-groonga.sh <<EOF
-#!/bin/sh
-sudo apt-get clean
-rm -f /var/lib/apt/lists/packages.groonga.org_*
-rm -f /var/lib/apt/lists/partial/packages.groonga.org_*
-sudo apt-get update
-sudo apt-get -y --allow-unauthenticated install groonga-keyring
-sudo apt-get update
-sudo apt-get -y install groonga
-sudo apt-get -y install groonga-tokenizer-mecab
-sudo apt-get -y install libgroonga-dev
-#sudo apt-get -y install groonga-munin-plugins
-EOF
- INSTALL_SCRIPT=""
- case $code in
- squeeze|unstable)
- INSTALL_SCRIPT=install-aptitude-groonga.sh
- ;;
- *)
- INSTALL_SCRIPT=install-aptget-groonga.sh
- ;;
- esac
- copy_and_exec_script $code-$arch $root_dir $INSTALL_SCRIPT
-}
-
-install_groonga_rpm_packages ()
-{
- dist=$1
- arch=$2
- ver=$3
- root_dir=$4
- cat > tmp/install-centos5-groonga.sh <<EOF
-sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
-sudo yum makecache
-sudo yum install -y groonga
-sudo yum install -y groonga-tokenizer-mecab
-rm -f epel-release-*.rpm
-wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
-sudo rpm -ivh epel-release-5-4.noarch.rpm
-sudo yum install -y groonga-devel
-#sudo yum install -y groonga-munin-plugins
-EOF
- cat > tmp/install-centos6-groonga.sh <<EOF
-sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
-sudo yum makecache
-sudo yum install -y groonga
-sudo yum install -y groonga-tokenizer-mecab
-sudo rpm -ivh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
-sudo yum install -y groonga-devel
-#sudo yum install -y groonga-munin-plugins
-EOF
- cat > tmp/install-fedora-groonga.sh <<EOF
-sudo rpm -ivh http://packages.groonga.org/fedora/groonga-release-1.1.0-1.noarch.rpm
-sudo yum makecache
-sudo yum install -y groonga
-sudo yum install -y groonga-tokenizer-mecab
-sudo yum install -y groonga-devel
-#sudo yum install -y groonga-munin-plugins
-EOF
- case "$dist-$ver" in
- centos-5)
- INSTALL_SCRIPT=install-centos5-groonga.sh
- ;;
- centos-6)
- INSTALL_SCRIPT=install-centos6-groonga.sh
- ;;
- fedora-19)
- INSTALL_SCRIPT=install-fedora-groonga.sh
- ;;
- *)
- ;;
- esac
- copy_and_exec_script $dist-$ver-$arch $root_dir $INSTALL_SCRIPT
-}
-
-uninstall_groonga_packages ()
-{
- UNINSTALL_SCRIPT=uninstall-deb-groonga.sh
- cat > $UNINSTALL_SCRIPT <<EOF
-#!/bin/sh
-sudo apt-get purge -y groonga-* mysql-*
-EOF
- for code in $CODES; do
- for arch in $DEB_ARCHITECTURES; do
- root_dir=$CHROOT_ROOT/$code-$arch
- if [ -d $root_dir ]; then
- echo "copy uninstall script $UNINSTALL_SCRIPT to $root_dir/tmp"
- sudo rm -f $root_dir/tmp/$UNINSTALL_SCRIPT
- cp $UNINSTALL_SCRIPT $root_dir/tmp
- chmod 755 $root_dir/tmp/$UNINSTALL_SCRIPT
- sudo chname $code-$arch chroot $root_dir /tmp/$UNINSTALL_SCRIPT
- fi
- done
- done
- UNINSTALL_SCRIPT=uninstall-rpm-groonga.sh
- cat > $UNINSTALL_SCRIPT <<EOF
-#!/bin/sh
-sudo yum remove -y groonga-* mysql-*
-EOF
- for dist in $DISTRIBUTIONS; do
- case $dist in
- "fedora")
- DISTRIBUTIONS_VERSION="19"
- ;;
- "centos")
- DISTRIBUTIONS_VERSION="5 6"
- ;;
- esac
- for ver in $DISTRIBUTIONS_VERSION; do
- for arch in $RPM_ARCHITECTURES; do
- root_dir=$CHROOT_ROOT/$dist-$ver-$arch
- if [ -d $root_dir ]; then
- echo "copy install script $UNINSTALL_SCRIPT to $root_dir/tmp"
- sudo rm -f $root_dir/tmp/$UNINSTALL_SCRIPT
- cp $UNINSTALL_SCRIPT $root_dir/tmp
- chmod 755 $root_dir/tmp/$UNINSTALL_SCRIPT
- sudo chname $code-$ver-$arch chroot $root_dir /tmp/$UNINSTALL_SCRIPT
- fi
- done
- done
- done
-}
-
-
-
-enable_temporary_groonga_repository ()
-{
- SCRIPT=enable-repository.sh
- cat > tmp/$SCRIPT <<EOF
-#!/bin/sh
-
-grep -v "packages.groonga.org" /etc/hosts > /tmp/hosts
-echo "$HOST_ADDRESS packages.groonga.org" >> /tmp/hosts
-cp -f /tmp/hosts /etc/hosts
-EOF
- common_deb_procedure "enable_temporary_groonga_deb_repository"
- common_rpm_procedure "enable_temporary_groonga_rpm_repository"
- check_packages_repository_address
-}
-
-enable_temporary_groonga_deb_repository ()
-{
- code=$1
- arch=$2
- root_dir=$3
- SCRIPT=enable-repository.sh
- today=`date '+%Y%m%d.%s'`
- copy_and_exec_script $code-$arch $root_dir $SCRIPT
-}
-
-enable_temporary_groonga_rpm_repository ()
-{
- dist=$1
- arch=$2
- ver=$3
- root_dir=$4
- SCRIPT=enable-repository.sh
- today=`date '+%Y%m%d.%s'`
- copy_and_exec_script $dist-$ver-$arch $root_dir $SCRIPT
-}
-
-disable_temporary_groonga_repository ()
-{
- SCRIPT=disable-repository.sh
- cat > tmp/$SCRIPT <<EOF
-#!/bin/sh
-
-grep -v "packages.groonga.org" /etc/hosts > /tmp/hosts
-cp -f /tmp/hosts /etc/hosts
-EOF
- common_deb_procedure "disable_temporary_groonga_deb_repository"
- common_rpm_procedure "disable_temporary_groonga_rpm_repository"
- check_packages_repository_address
-}
-
-disable_temporary_groonga_deb_repository ()
-{
- code=$1
- arch=$2
- root_dir=$3
- copy_and_exec_script $code-$arch $root_dir $SCRIPT
-}
-
-disable_temporary_groonga_rpm_repository ()
-{
- dist=$1
- arch=$2
- ver=$3
- root_dir=$4
- copy_and_exec_script $code-$arch $root_dir $SCRIPT
-}
-
-host_address
-echo $HOST_ADDRESS
-
-while [ $# -ne 0 ]; do
- case $1 in
- --check-install)
- CHECK_INSTALL=1
- shift
- if [ ! -z "$1" ]; then
- case $1 in
- groonga|mroonga|roonga|mecab)
- CHECK_INSTALL_PACKAGE=$1
- ;;
- *)
- ;;
- esac
- fi
- ;;
- --check-address)
- CHECK_ADDRESS=1
- shift
- ;;
- --check-build)
- CHECK_BUILD=1
- shift
- ;;
- --enable-repository)
- ENABLE_REPOSITORY=1
- shift
- ;;
- --disable-repository)
- DISABLE_REPOSITORY=1
- shift
- ;;
- --install-groonga)
- INSTALL_GROONGA=1
- shift
- ;;
- --uninstall-groonga)
- UNINSTALL_GROONGA=1
- shift
- ;;
- --code)
- shift
- if [ "$1" = "all" ]; then
- setup_codes
- else
- CODES=$1
- fi
- shift
- ;;
- --code-arch)
- shift
- if [ "$1" = "all" ]; then
- setup_deb_architectures
- else
- DEB_ARCHITECTURES=$1
- fi
- shift
- ;;
- --dist)
- shift
- if [ "$1" = "all" ]; then
- setup_distributions
- else
- DISTRIBUTIONS=$1
- fi
- shift
- ;;
- --dist-arch)
- shift
- if [ "$1" = "all" ]; then
- setup_rpm_architectures
- else
- RPM_ARCHITECTURES=$1
- fi
- shift
- ;;
- *)
- shift
- ;;
- esac
-done
-
-mkdir -p tmp
-setup_deb_architectures
-setup_rpm_architectures
-
-if [ $CHECK_INSTALL -ne 0 ]; then
- check_installed_groonga_packages
-fi
-if [ $CHECK_ADDRESS -ne 0 ]; then
- check_packages_repository_address
-fi
-if [ $CHECK_BUILD -ne 0 ]; then
- check_build_packages
-fi
-if [ $ENABLE_REPOSITORY -ne 0 ]; then
- enable_temporary_groonga_repository
-fi
-if [ $DISABLE_REPOSITORY -ne 0 ]; then
- disable_temporary_groonga_repository
-fi
-if [ $INSTALL_GROONGA -ne 0 ]; then
- install_groonga_packages
-fi
-if [ $UNINSTALL_GROONGA -ne 0 ]; then
- uninstall_groonga_packages
-fi
-
diff --git a/storage/mroonga/vendor/groonga/packages/debian/changelog b/storage/mroonga/vendor/groonga/packages/debian/changelog
deleted file mode 100644
index d93665d12b7..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/changelog
+++ /dev/null
@@ -1,424 +0,0 @@
-groonga (4.0.6-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@cozmixng.org> Mon, 29 Sep 2014 00:00:00 +0900
-
-groonga (4.0.5-1) unstable; urgency=low
-
- * New upstream release.
- * debian/copyright
- - Add missing copyright about bundled .js and .css
- * debian/missing-sources
- - Add missing-sources for bundled JavaScript.
-
- -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Aug 2014 00:00:00 +0900
-
-groonga (4.0.4-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Jul 2014 00:00:00 +0900
-
-groonga (4.0.3-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Jun 2014 00:00:00 +0900
-
-groonga (4.0.2-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Thu, 29 May 2014 00:00:00 +0900
-
-groonga (4.0.1-2) unstable; urgency=low
-
- * debian/control
- - Add a missing pkg-config dependency to libgroonga-dev.
- - Depend on mecab-naist-jdic instead of mecab-ipadic-utf8 because
- mecab-naist-jdic is a replacement of mecab-ipadic-utf8.
-
- -- Kouhei Sutou <kou@clear-code.com> Thu, 29 May 2014 00:00:00 +0900
-
-groonga (4.0.1-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Mar 2014 00:00:00 +0900
-
-groonga (4.0.0-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 09 Feb 2014 00:00:00 +0900
-
-groonga (3.1.2-1) unstable; urgency=low
-
- * New upstream release.
- * debian/control
- - Add proper description to fix "duplicate-long-description" lintian warning
- for groonga-server-gqtp and groonga-server-http packages.
- - Remove needless period to fix I:description-synopsis-might-not-be-phrased-properly lintian warning.
- - Use "all" in Architecture field to fix I: package-contains-no-arch-dependent-files
- lintian warning for groonga-example package.
- * debian/rules
- - Add DEB_BUILD_HARDENING flag to fix lintian warning "hardening-no-relro" and
- "hardening-no-fortify-functions"
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 Jan 2014 00:00:00 +0900
-
-groonga (3.1.1-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Dec 2013 00:00:00 +0900
-
-groonga (3.1.0-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Nov 2013 00:00:00 +0900
-
-groonga (3.0.9-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Oct 2013 00:00:00 +0900
-
-groonga (3.0.8-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Sep 2013 00:00:00 +0900
-
-groonga (3.0.7-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Aug 2013 00:00:00 +0900
-
-groonga (3.0.6-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Jul 2013 00:00:00 +0900
-
-groonga (3.0.5-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Jun 2013 00:00:00 +0900
-
-groonga (3.0.4-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 May 2013 00:00:00 +0900
-
-groonga (3.0.3-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Apr 2013 00:00:00 +0900
-
-groonga (3.0.2-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Mar 2013 00:00:00 +0900
-
-groonga (3.0.1-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 28 Feb 2013 00:00:00 +0900
-
-groonga (3.0.0-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 09 Feb 2013 00:00:00 +0900
-
-groonga (2.1.2-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Jan 2013 00:00:00 +0900
-
-groonga (2.1.1-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Sat, 29 Dec 2012 15:04:41 +0900
-
-groonga (2.1.0-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Dec 2012 00:00:00 +0900
-
-groonga (2.0.9-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Nov 2012 00:00:00 +0900
-
-groonga (2.0.8-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Mon, 29 Oct 2012 00:00:00 +0900
-
-groonga (2.0.7-1) unstable; urgency=low
-
- * New upstream release.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Sep 2012 00:00:00 +0900
-
-groonga (2.0.6-1) unstable; urgency=low
-
- * New upstream release.
- * Split common tasks for server use into groonga-server-common package.
- * groonga-server and groonga-httpd require groonga-server-common package.
-
- -- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 Aug 2012 00:00:00 +0900
-
-groonga (2.0.5-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Jul 2012 00:00:00 +0900
-
-groonga (2.0.4-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Jun 2012 00:00:00 +0900
-
-groonga (2.0.3-1) unstable; urgency=low
-
- * New upstream release.
- * Fix a bug that log_reopen command in logrotate uses wrong protocol.
-
- -- Kouhei Sutou <kou@clear-code.com> Tue, 29 May 2012 00:00:00 +0900
-
-groonga (2.0.2-1) unstable; urgency=low
-
- * New upstream release.
- * Set missing default values.
-
- -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Apr 2012 00:00:00 +0900
-
-groonga (2.0.1-3) unstable; urgency=low
-
- * Fix default file path: /etc/default/groonga -> /etc/default/groonga-server
- * Use shutdown command for stop.
-
- -- Kouhei Sutou <kou@clear-code.com> Fri, 30 Mar 2012 00:00:00 +0900
-
-groonga (2.0.1-2) unstable; urgency=low
-
- * Fix bind address argument parameter.
- Patch by Masaharu IWAI. Thanks!!!
-
- -- Kouhei Sutou <kou@clear-code.com> Fri, 30 Mar 2012 00:00:00 +0900
-
-groonga (2.0.1-1) unstable; urgency=low
-
- * New upstream release.
- * grntest -> groonga-benchmark.
- * Remove groogna-tools package.
-
- -- Kouhei Sutou <kou@clear-code.com> Thu, 29 Mar 2012 00:00:00 +0900
-
-groonga (2.0.0-1) unstable; urgency=low
-
- * New upstream release.
- * Use HTTP as the default protocol.
-
- -- Kouhei Sutou <kou@clear-code.com> Wed, 29 Feb 2012 00:00:00 +0900
-
-groonga (1.3.0-1) unstable; urgency=low
-
- * New upstream release.
- * groonga-server doesn't require groonga-munin-plugins.
- Suggested by Masaharu IWAI. Thanks!!!
-
- -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Jan 2012 00:00:00 +0900
-
-groonga (1.2.9-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Thu, 29 Dec 2011 00:00:00 +0900
-
-groonga (1.2.8-1) unstable; urgency=low
-
- * New upstream release.
- * Enable zlib support.
- * Enable lzo support.
-
- -- Kouhei Sutou <kou@clear-code.com> Tue, 29 Nov 2011 00:00:00 +0900
-
-groonga (1.2.7-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Sat, 29 Oct 2011 00:00:00 +0900
-
-groonga (1.2.6-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Thu, 29 Sep 2011 00:00:00 +0900
-
-groonga (1.2.5-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Mon, 29 Aug 2011 00:00:00 +0900
-
-groonga (1.2.4-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Jul 2011 00:00:00 +0900
-
-groonga (1.2.3-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Wed, 29 Jun 2011 00:00:00 +0900
-
-groonga (1.2.2-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Sun, 29 May 2011 00:00:00 +0900
-
-groonga (1.2.1-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Apr 2011 00:00:00 +0900
-
-groonga (1.2.0-3) unstable; urgency=low
-
- * libgronga-dev: add missing libgroonga.so.
-
- -- Kouhei Sutou <kou@clear-code.com> Wed, 06 Apr 2011 21:00:00 +0900
-
-groonga (1.2.0-2) unstable; urgency=low
-
- * libgronga-dev: add missing libgroonga.so.
-
- -- Kouhei Sutou <kou@clear-code.com> Tue, 29 Mar 2011 21:00:00 +0900
-
-groonga (1.2.0-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Tue, 29 Mar 2011 00:00:00 +0900
-
-groonga (1.1.0-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Wed, 09 Feb 2011 00:00:00 +0900
-
-groonga (1.0.8-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Wed, 02 Feb 2011 00:00:00 +0900
-
-groonga (1.0.7-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Sat, 29 Jan 2011 00:00:00 +0900
-
-groonga (1.0.6-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Fri, 31 Dec 2010 00:00:00 +0900
-
-groonga (1.0.5-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Wed, 29 Dec 2010 00:00:00 +0900
-
-groonga (1.0.4-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Mon, 29 Nov 2010 00:00:00 +0900
-
-groonga (1.0.3-1) lucid; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Oct 2010 16:00:22 +0900
-
-groonga (1.0.2-1) lucid; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Thu, 09 Sep 2010 15:19:24 +0900
-
-groonga (1.0.1-1) lucid; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Mon, 06 Sep 2010 16:21:35 +0900
-
-groonga (1.0.0-1) lucid; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Aug 2010 00:07:53 +0900
-
-groonga (0.7.7-1) lucid; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Wed, 25 Aug 2010 17:05:58 +0900
-
-groonga (0.7.6-2) unstable; urgency=low
-
- * Split packages.
-
- -- Kouhei Sutou <kou@clear-code.com> Thu, 25 Aug 2010 22:11:14 +0900
-
-groonga (0.7.6) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Thu, 19 Aug 2010 22:11:14 +0900
-
-groonga (0.7.4) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Thu, 29 Jul 2010 14:24:00 +0900
-
-groonga (0.1.9) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Tue, 20 Apr 2010 15:10:04 +0900
-
-groonga (0.1.6) unstable; urgency=low
-
- * New upstream release.
-
- -- Kouhei Sutou <kou@clear-code.com> Wed, 10 Feb 2010 13:00:55 +0900
-
-groonga (0.1.5) unstable; urgency=low
-
- * Initial release.
-
- -- Kouhei Sutou <kou@clear-code.com> Fri, 15 Jan 2010 16:41:04 +0900
diff --git a/storage/mroonga/vendor/groonga/packages/debian/compat b/storage/mroonga/vendor/groonga/packages/debian/compat
deleted file mode 100644
index ec635144f60..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/storage/mroonga/vendor/groonga/packages/debian/control b/storage/mroonga/vendor/groonga/packages/debian/control
deleted file mode 100644
index 1a1ba8c96cb..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/control
+++ /dev/null
@@ -1,210 +0,0 @@
-Source: groonga
-Section: database
-Priority: optional
-Maintainer: Groonga Project <packages@groonga.org>
-Uploaders: HAYASHI Kentaro <hayashi@clear-code.com>
-Build-Depends:
- debhelper (>= 9),
- autotools-dev,
- zlib1g-dev,
- liblzo2-dev,
- libmsgpack-dev,
- libzmq3-dev | libzmq-dev,
- libevent-dev,
- libmecab-dev,
- libpcre3-dev
-Standards-Version: 3.9.5
-Homepage: http://groonga.org/
-
-Package: groonga
-Architecture: any
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- groonga-bin (= ${binary:Version}),
- groonga-plugin-suggest (= ${binary:Version}),
- groonga-doc (= ${source:Version})
-Description: Fulltext search engine (meta-package for library use)
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package depends all Groonga related package for library use.
-
-Package: groonga-server-common
-Architecture: any
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- adduser,
- groonga (= ${binary:Version})
-Description: Fulltext search engine (meta-package for server use)
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides common settings for server use.
-
-Package: groonga-server-http
-Architecture: any
-Replaces: groonga-server (<< 2.0.7-1)
-Breaks: groonga-server (<< 2.0.7-1)
-Conflicts: groonga-httpd
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- adduser,
- curl,
- groonga-server-common (= ${binary:Version})
-Description: Fulltext search engine (meta-package for HTTP server use)
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package depends all Groonga related package for HTTP server use.
-
-Package: groonga-server-gqtp
-Architecture: any
-Replaces: groonga-server (<< 2.0.7-1)
-Breaks: groonga-server (<< 2.0.7-1)
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- adduser,
- groonga-server-common (= ${binary:Version})
-Description: Fulltext search engine (meta-package for GQTP server use)
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package depends all Groonga related package for GQTP server use.
-
-Package: libgroonga-dev
-Section: libdevel
-Architecture: any
-Multi-Arch: same
-Replaces: libgroonga (<< 1.2.0-1)
-Breaks: libgroonga (<< 1.2.0-1)
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- pkg-config,
- libgroonga0 (= ${binary:Version})
-Description: Development files to use Groonga as a library
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides header files to use Groonga as a library.
-
-Package: libgroonga0
-Section: libs
-Architecture: any
-Multi-Arch: same
-Replaces: libgroonga (<< 1.2.0-1)
-Breaks: libgroonga (<< 1.2.0-1)
-Pre-Depends: ${misc:Pre-Depends}
-Depends:
- ${misc:Depends},
- ${shlibs:Depends}
-Description: Library files for Groonga
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides library files.
-
-Package: groonga-tokenizer-mecab
-Section: libs
-Architecture: any
-Replaces: libgroonga-tokenizer-mecab (<< 1.2.0-1)
-Breaks: libgroonga-tokenizer-mecab (<< 1.2.0-1)
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- libgroonga0 (= ${binary:Version}),
- mecab-naist-jdic | mecab-jumandic-utf8
-Description: MeCab tokenizer for Groonga
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides MeCab tokenizer.
-
-Package: groonga-plugin-suggest
-Section: libs
-Architecture: any
-Replaces: libgroonga-plugin-suggest (<< 1.2.0-1)
-Breaks: libgroonga-plugin-suggest (<< 1.2.0-1)
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- libgroonga0 (= ${binary:Version})
-Description: Suggest plugin for Groonga
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides suggest plugin.
-
-Package: groonga-bin
-Architecture: any
-Replaces: groonga (<< 1.2.0-1)
-Breaks: groonga (<< 1.2.0-1)
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- libgroonga0 (= ${binary:Version})
-Description: Commands for Groonga
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides 'groonga' command.
-
-Package: groonga-httpd
-Architecture: any
-Replaces: groonga (<< 1.2.0-1)
-Breaks: groonga (<< 1.2.0-1)
-Conflicts: groonga-server-http
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- curl,
- groonga-server-common (= ${binary:Version})
-Description: Groonga HTTP server
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides 'groonga-httpd' command.
-
-Package: groonga-doc
-Section: doc
-Architecture: all
-Depends:
- ${misc:Depends},
- libjs-underscore,
- libjs-jquery
-Description: Documentation of Groonga
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides documentation of Groonga.
-
-Package: groonga-examples
-Architecture: all
-Depends:
- ${misc:Depends},
- ${shlibs:Depends},
- groonga-bin (>= ${source:Version}),
- ruby
-Description: Examples of Groonga
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides examples of Groonga.
-
-Package: groonga-munin-plugins
-Section: net
-Architecture: any
-Depends:
- ${misc:Depends},
- groonga-bin (= ${binary:Version}),
- munin-node,
- ruby
-Description: munin-node plugins for Groonga
- Groonga is an open-source fulltext search engine and column store.
- It lets you write high-performance applications that requires fulltext search.
- .
- This package provides munin-node plugins to monitor Groonga.
diff --git a/storage/mroonga/vendor/groonga/packages/debian/copyright b/storage/mroonga/vendor/groonga/packages/debian/copyright
deleted file mode 100644
index ba15ed1193c..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/copyright
+++ /dev/null
@@ -1,141 +0,0 @@
-Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: Groonga
-Upstream-Contact: Groonga Project <packages@groonga.org>
-Source: http://packages.groonga.org/source/groonga/
-
-Files: *
-Copyright: 2009-2013 Brazil, Inc.
-License: LGPL-2.1
-
-Files: debian/*
-Copyright: 2011 Kouhei Sutou <kou@clear-code.com>
- HAYASHI Kentaro <hayashi@clear-code.com>
- IWAI, Masaharu <iwaim.sub@gmail.com>
- SATOH Fumiyasu <fumiyas@osstech.co.jp>
- orangain <orangain@gmail.com>
-License: LGPL-2.1
-
-Files: data/html/admin/css/redmond/* examples/dictionary/html/css/smoothness/jquery-ui-1.8.12.custom.css data/html/admin/css/redmond/jquery-ui-1.8.18.custom.css
-Copyright: 2011, Brandon Aaron
- Paul Bakaus (paulbakaus.com)
- David Bolter
- Rich Caloggero
- Chi Cheng (cloudream@gmail.com)
- Colin Clark (http://colin.atrc.utoronto.ca/)
- Michelle D'Souza
- Aaron Eisenberger (aaronchi@gmail.com)
- Ariel Flesler
- Bohdan Ganicky
- Scott González
- Marc Grabanski (m@marcgrabanski.com)
- Klaus Hartl (stilbuero.de)
- Scott Jehl
- Cody Lindley
- Eduardo Lundgren (eduardolundgren@gmail.com)
- Todd Parker
- John Resig
- Patty Toland
- Ca-Phun Ung (yelotofu.com)
- Keith Wood (kbwood@virginbroadband.com.au)
- Maggie Costello Wachs
- Richard D. Worth (rdworth.org)
- Jörn Zaefferer (bassistance.de)
-License: MIT or GPL-2
-
-Files: data/html/admin/js/jquery.flot*
-Copyright: 2007-2009 IOLA and Ole Laursen
-License: MIT
-
-Files: data/html/admin/js/jquery-1.7.2.min.js
-Copyright: 2011, John Resig
-License: MIT or GPL-2
-
-Files: doc/locale/*/jquery.js
-Copyright: 2012 jQuery Foundation
-License: MIT
-
-Files: doc/locale/*/underscore.js
-Copyright: 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
-License: MIT
-
-Files: doc/locale/*/doctools.js
-Copyright: 2007-2014 the Sphinx team
-License: BSD-2-clause
-
-Files: doc/locale/*/searchtools.js
-Copyright: 2007-2014 the Sphinx team
-License: BSD-2-clause
-
-Files: doc/locale/*/websupport.js
-Copyright: 2007-2014 the Sphinx team
-License: BSD-2-clause
-
-Files: doc/locale/*/basic.css doc/locale/*/pygments.css
-Copyright: 2007-2014 the Sphinx team
-License: BSD-2-clause
-
-License: BSD-2-clause
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- .
- 1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- .
- 2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- .
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-License: LGPL-2.1
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- .
- This package is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- .
- You should have received a copy of the GNU Lesser General Public
- License along with this package; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- .
- On Debian systems, the complete text of the GNU Lesser General
- Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
-
-License: MIT
- 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.
-
-License: GPL-2
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2.
- .
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
- .
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- .
- On Debian systems, the complete text of the GNU General Public
- License Version 2 can be found in `/usr/share/common-licenses/GPL-2'.
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-bin.install b/storage/mroonga/vendor/groonga/packages/debian/groonga-bin.install
deleted file mode 100644
index c3e8e2839c3..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-bin.install
+++ /dev/null
@@ -1,6 +0,0 @@
-usr/bin/groonga
-usr/bin/groonga-benchmark
-usr/share/groonga/html/*
-usr/share/man/man1/*
-usr/share/man/*/man1/*
-etc/groonga/groonga.conf
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-doc.install b/storage/mroonga/vendor/groonga/packages/debian/groonga-doc.install
deleted file mode 100644
index b4d750909f1..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-doc.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/doc/groonga-doc/
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-doc.links b/storage/mroonga/vendor/groonga/packages/debian/groonga-doc.links
deleted file mode 100644
index e93c5423d67..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-doc.links
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/share/javascript/jquery/jquery.js usr/share/doc/groonga-doc/en/html/_static/jquery.js
-usr/share/javascript/jquery/jquery.js usr/share/doc/groonga-doc/ja/html/_static/jquery.js
-usr/share/javascript/underscore/underscore.js usr/share/doc/groonga-doc/ja/html/_static/underscore.js
-usr/share/javascript/underscore/underscore.js usr/share/doc/groonga-doc/en/html/_static/underscore.js
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-examples.install b/storage/mroonga/vendor/groonga/packages/debian/groonga-examples.install
deleted file mode 100644
index a107e52d2b1..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-examples.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/share/groonga/examples/*
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default
deleted file mode 100644
index 2d23f1e1552..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.default
+++ /dev/null
@@ -1,5 +0,0 @@
-# Default
-#GROONGA_HTTPD_ARGS=""
-TIMEOUT=3
-# Comment out this to disable groonga-httpd daemon.
-ENABLE=yes
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.dirs b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.dirs
deleted file mode 100644
index 32c730751f2..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.dirs
+++ /dev/null
@@ -1,3 +0,0 @@
-var/log/groonga/httpd
-etc/groonga/httpd
-etc/groonga/httpd/logs
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init
deleted file mode 100755
index b3cba5968fa..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.init
+++ /dev/null
@@ -1,162 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: groonga-httpd
-# Required-Start: $remote_fs $network
-# Required-Stop: $remote_fs $network
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: groonga-httpd's init script
-# Description: groonga-httpd is a HTTP server for groonga.
-### END INIT INFO
-
-# Author: Kouhei Sutou <kou@clear-code.com>
-
-# Do NOT "set -e"
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="a HTTP server for Groonga which provides full-text search engine and column store"
-NAME=groonga-httpd
-DAEMON=/usr/sbin/$NAME
-DAEMON_RESTART=/usr/sbin/$NAME-restart
-SCRIPTNAME=/etc/init.d/$NAME
-GROONGA_HTTPD_ARGS=""
-START_STOP_DAEMON_ARGS=""
-ENABLE="no"
-
-DEFAULT_FILE=/etc/default/$NAME
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
-# Read configuration variable file if it is present
-[ -r $DEFAULT_FILE ] && . $DEFAULT_FILE
-
-[ "$ENABLE" = "yes" ] || exit 0
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
-. /lib/lsb/init-functions
-
-if [ -z "$PID_FILE" ]; then
- PID_FILE=$(grep '^\s*pid\s' /etc/nginx/nginx.conf | sed -re 's/^\s*pid\s+(.+);$/\1/g' | head -n1)
- if [ -z "$PID_FILE" ]; then
- PID_FILE=/run/groonga-httpd.pid
- fi
-fi
-
-#
-# Function that starts the daemon/service
-#
-do_start()
-{
- # Return
- # 0 if daemon has been started
- # 1 if daemon was already running
- # 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $DAEMON \
- ${START_STOP_DAEMON_ARGS} --test > /dev/null || return 1
- start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $DAEMON \
- ${START_STOP_DAEMON_ARGS} -- $GROONGA_HTTPD_ARGS || return 2
- # Add code here, if necessary, that waits for the process to be ready
- # to handle requests from services started subsequently which depend
- # on this one. As a last resort, sleep for some time.
-}
-
-#
-# Function that stops the daemon/service
-#
-do_stop()
-{
- # Return
- # 0 if daemon has been stopped
- # 1 if daemon was already stopped
- # 2 if daemon could not be stopped
- # other if a failure occurred
-
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
- --pidfile $PID_FILE --name $NAME
- RETVAL="$?"
- [ "$RETVAL" = 2 ] && return 2
- # Wait for children to finish too if this is a daemon that forks
- # and if the daemon is only ever run from this initscript.
- # If the above conditions are not satisfied then add some other code
- # that waits for the process to drop all resources that could be
- # needed by services started subsequently. A last resort is to
- # sleep for some time.
- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
- [ "$?" = 2 ] && return 2
- # Many daemons don't delete their pidfiles when they exit.
- rm -f $PID_FILE
- return "$RETVAL"
-}
-
-#
-# Function that sends a SIGHUP to the daemon/service
-#
-do_reload() {
- #
- # If the daemon can reload its configuration without
- # restarting (for example, when it is sent a SIGHUP),
- # then implement that here.
- #
- start-stop-daemon --stop --signal HUP --quiet --pidfile $PID_FILE --name $NAME
- return 0
-}
-
-do_status() {
- status_of_proc -p $PID_FILE "$DAEMON" "$NAME"
- return $?
-}
-
-case "$1" in
- start)
- [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
- do_start
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- stop)
- [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- reload|force-reload)
- log_daemon_msg "Reloading $DESC" "$NAME"
- do_reload
- log_end_msg $?
- ;;
- restart)
- log_daemon_msg "Restarting $DESC" "$NAME"
- if [ -f ${PID_FILE} ]; then
- $DAEMON_RESTART
- else
- do_start
- fi
- case "$?" in
- 0) log_end_msg 0 ;;
- *) log_end_msg 1 ;;
- esac
- ;;
- status)
- do_status
- case "$?" in
- 0) ;; # service is OK
- *) exit 3 ;; # program is not running
- esac
- ;;
- *)
- echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
- exit 3
- ;;
-esac
-
-:
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.install b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.install
deleted file mode 100644
index 7aea2953021..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.install
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/sbin/groonga-httpd
-usr/sbin/groonga-httpd-restart
-etc/groonga/httpd/*
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.logrotate b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.logrotate
deleted file mode 100644
index e1ed8532700..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.logrotate
+++ /dev/null
@@ -1,17 +0,0 @@
-/var/log/groonga/httpd/*.log {
- daily
- missingok
- rotate 30
- compress
- delaycompress
- notifempty
- create 640 groonga groonga
- sharedscripts
- postrotate
- . /etc/default/groonga-httpd
- if x"$ENABLE" = x"yes"; then
- /usr/bin/curl --silent --output /dev/null \
- "http://127.0.0.1:10041/d/log_reopen"
- fi
- endscript
-}
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postinst b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postinst
deleted file mode 100755
index e7a663b4275..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postinst
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /bin/sh
-
-set -e
-
-fixperms() {
- for target in /etc/groonga/httpd /etc/groonga/httpd/logs /var/log/groonga/httpd
- do
- dpkg-statoverride --list $target >/dev/null || \
- dpkg-statoverride --update --add groonga groonga 0755 $target
- done
-}
-
-case "$1" in
- configure)
- fixperms
- ;;
- abort-upgrade|abort-deconfigure|abort-remove)
- :
- ;;
- *)
- echo "Called with unknown argument $1, bailing out."
- exit 1
- ;;
-esac
-
-#DEBHELPER#
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postrm b/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postrm
deleted file mode 100755
index 816a1e6f7da..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-httpd.postrm
+++ /dev/null
@@ -1,12 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if [ "$1" = "purge" ]; then
- for target in /var/log/groonga/httpd /etc/groonga/httpd/logs /etc/groonga/httpd
- do
- dpkg-statoverride --remove $target; rm -rf $target
- done
-fi
-
-#DEBHELPER#
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.conf b/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.conf
deleted file mode 100644
index 4bb7a2aa68f..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-[groonga_*]
- user groonga
- group groonga
- env.PATH /usr/bin:/bin:/usr/local/bin
- env.database_path /var/lib/groonga/db/db
- env.host 127.0.0.1
-
- env.http_host 127.0.0.1
- env.http_port 10041
- env.http_database_path /var/lib/groonga/db/db
- env.http_pid_path /var/run/groonga/groonga-http.pid
- env.http_query_log_path /var/log/groonga/query-http.log
-
- env.httpd_host 127.0.0.1
- env.httpd_port 10041
- env.httpd_database_path /var/lib/groonga/db/db
- env.httpd_pid_path /var/run/groonga/groonga-httpd.pid
- env.httpd_query_log_path /var/log/groonga/httpd/groonga-query.log
-
- env.gqtp_host 127.0.0.1
- env.gqtp_port 10043
- env.gqtp_database_path /var/lib/groonga/db/db
- env.gqtp_pid_path /var/run/groonga/groonga-gqtp.pid
- env.gqtp_query_log_path /var/log/groonga/query-gqtp.log
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.install b/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.install
deleted file mode 100644
index ef12a7ab323..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.install
+++ /dev/null
@@ -1,2 +0,0 @@
-etc/munin/plugin-conf.d/*
-usr/share/groonga/munin/plugins/*
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.links b/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.links
deleted file mode 100644
index 26248a4de70..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.links
+++ /dev/null
@@ -1,8 +0,0 @@
-usr/share/groonga/munin/plugins/groonga_cpu_load_ /usr/share/munin/plugins/groonga_cpu_load_
-usr/share/groonga/munin/plugins/groonga_cpu_time_ /usr/share/munin/plugins/groonga_cpu_time_
-usr/share/groonga/munin/plugins/groonga_disk_ /usr/share/munin/plugins/groonga_disk_
-usr/share/groonga/munin/plugins/groonga_memory_ /usr/share/munin/plugins/groonga_memory_
-usr/share/groonga/munin/plugins/groonga_n_records_ /usr/share/munin/plugins/groonga_n_records_
-usr/share/groonga/munin/plugins/groonga_query_performance_ /usr/share/munin/plugins/groonga_query_performance_
-usr/share/groonga/munin/plugins/groonga_status_ /usr/share/munin/plugins/groonga_status_
-usr/share/groonga/munin/plugins/groonga_throughput_ /usr/share/munin/plugins/groonga_throughput_
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postinst b/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postinst
deleted file mode 100755
index 67ccb90bf59..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postinst
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/sh
-
-set -e
-
-prevver="$2"
-
-init_plugins() {
- munin-node-configure --shell --remove-also | \
- grep -e 'groonga_' | \
- sh
- invoke-rc.d munin-node restart
-}
-
-case "$1" in
- configure)
- init_plugins
- ;;
- abort-upgrade|abort-deconfigure|abort-remove)
- :
- ;;
- *)
- echo "Called with unknown argument $1, bailing out."
- exit 1
- ;;
-esac
-
-#DEBHELPER#
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postrm b/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postrm
deleted file mode 100755
index f800a19c232..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-munin-plugins.postrm
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if [ "$1" = "purge" ]; then
- rm -f /etc/munin/plugins/groonga_* > /dev/null 2>&1
-fi
-
-#DEBHELPER#
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-plugin-suggest.install b/storage/mroonga/vendor/groonga/packages/debian/groonga-plugin-suggest.install
deleted file mode 100644
index 83952d69f01..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-plugin-suggest.install
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin/groonga-suggest-*
-usr/lib/*/groonga/plugins/suggest/*
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postinst b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postinst
deleted file mode 100755
index 7aa3ba8ae88..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postinst
+++ /dev/null
@@ -1,42 +0,0 @@
-#! /bin/sh
-
-set -e
-
-add_system_user() {
- if ! getent passwd groonga >/dev/null; then
- adduser --group --system --home /var/lib/groonga groonga
- fi
-}
-
-fixperms() {
- for target in /var/run/groonga /var/lib/groonga /etc/groonga /var/log/groonga
- do
- dpkg-statoverride --list $target >/dev/null || \
- dpkg-statoverride --update --add groonga groonga 0755 $target
- done
-}
-
-create_database() {
- if [ ! -d /var/lib/groonga/db ]; then
- mkdir -p /var/lib/groonga/db
- groonga -n /var/lib/groonga/db/db shutdown > /dev/null
- chown -R groonga:groonga /var/lib/groonga
- fi
-}
-
-case "$1" in
- configure)
- add_system_user
- create_database
- fixperms
- ;;
- abort-upgrade|abort-deconfigure|abort-remove)
- :
- ;;
- *)
- echo "Called with unknown argument $1, bailing out."
- exit 1
- ;;
-esac
-
-#DEBHELPER#
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postrm b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postrm
deleted file mode 100755
index c0868f60df5..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-common.postrm
+++ /dev/null
@@ -1,13 +0,0 @@
-#! /bin/sh
-
-set -e
-
-if [ "$1" = "purge" ]; then
- for target in /var/run/groonga /var/lib/groonga /var/log/groonga /etc/groonga
- do
- dpkg-statoverride --remove $target
- rm -rf $target
- done
-fi
-
-#DEBHELPER#
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.default b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.default
deleted file mode 100644
index 89ee510b2ec..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.default
+++ /dev/null
@@ -1,15 +0,0 @@
-# Default
-#USER=groonga
-#GROUP=groonga
-#ADDRESS=127.0.0.1
-#PORT=10043
-#DATABASE=/var/lib/groonga/db/db
-#LOG_PATH=/var/log/groonga/groonga-gqtp.log
-#QUERY_LOG_PATH=/var/log/groonga/query-gqtp.log
-#PROTOCOL=gqtp
-#GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
-
-# Comment out this to disable groonga daemon.
-ENABLE=yes
-# Set "no" to disable to skip updating column for same value.
-GRN_JA_SKIP_SAME_VALUE_PUT=yes
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.dirs b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.dirs
deleted file mode 100644
index 52486379889..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-var/log/groonga
-var/lib/groonga
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.init b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.init
deleted file mode 100755
index 279b5dbdc41..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.init
+++ /dev/null
@@ -1,235 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: groonga-server-gqtp
-# Required-Start: $remote_fs $network
-# Required-Stop: $remote_fs $network
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: groonga's init script
-# Description: groonga is a full-text search engine and column store.
-### END INIT INFO
-
-# Author: Kouhei Sutou <kou@clear-code.com>
-
-# Do NOT "set -e"
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="a full-text search engine and column store"
-NAME=groonga
-DAEMON=/usr/bin/$NAME
-USER=groonga
-GROUP=groonga
-DATABASE=/var/lib/groonga/db/db
-ADDRESS=127.0.0.1
-PORT=10043
-PROTOCOL=gqtp
-LOG_PATH=/var/log/groonga/groonga-$PROTOCOL.log
-QUERY_LOG_PATH=/var/log/groonga/query-$PROTOCOL.log
-PIDFILE=/var/run/groonga/$NAME-$PROTOCOL.pid
-SCRIPTNAME=/etc/init.d/$NAME-server-$PROTOCOL
-OPTION_ARGS=""
-START_STOP_DAEMON_ARGS=""
-ENABLE="no"
-
-DEFAULT_FILE=/etc/default/groonga-server-gqtp
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
-# Read configuration variable file if it is present
-[ -r $DEFAULT_FILE ] && . $DEFAULT_FILE
-
-[ "$ENABLE" = "yes" ] || exit 0
-
-export GRN_JA_SKIP_SAME_VALUE_PUT="$GRN_JA_SKIP_SAME_VALUE_PUT"
-
-DAEMON_ARGS="-d --pid-path ${PIDFILE}"
-if [ -n "${ADDRESS}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --bind-address ${ADDRESS}"
-fi
-if [ -n "${PORT}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --port ${PORT}"
-fi
-if [ -n "${LOG_PATH}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --log-path ${LOG_PATH}"
-fi
-if [ -n "${QUERY_LOG_PATH}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --query-log-path ${QUERY_LOG_PATH}"
-fi
-if [ -n "${PROTOCOL}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --protocol ${PROTOCOL}"
-fi
-mkdir -p $(dirname ${PIDFILE})
-if [ -n "${USER}" ]; then
- if ! getent passwd | grep -q "^${USER}:"; then
- echo "$0: user for running groonga doesn't exist: ${USER}" >&2
- exit 1
- fi
- chown -R ${USER} $(dirname ${PIDFILE})
- START_STOP_DAEMON_ARGS="${START_STOP_DAEMON_ARGS} --chuid ${USER}"
-fi
-if [ -n "${GROUP}" ]; then
- if ! getent group | grep -q "^${GROUP}:"; then
- echo "$0: group for running groonga doesn't exist: ${GROUP}" >&2
- exit 1
- fi
- START_STOP_DAEMON_ARGS="${START_STOP_DAEMON_ARGS} --group ${GROUP}"
-fi
-DAEMON_ARGS="${DAEMON_ARGS} ${OPTION_ARGS}"
-
-if [ -z "${DATABASE}" ]; then
- echo "$0: DATABASE should not be empty" >&2
- exit 1
-fi
-
-if [ -f "${DATABASE}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} ${DATABASE}"
-else
- mkdir -p $(dirname ${DATABASE})
- if [ -n "${USER}" ]; then
- chown -R ${USER} $(dirname ${DATABASE})
- fi
- if [ -n "${GROUP}" ]; then
- chgrp -R ${GROUP} $(dirname ${DATABASE})
- fi
- DAEMON_ARGS="${DAEMON_ARGS} -n ${DATABASE}"
-fi
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
-. /lib/lsb/init-functions
-
-send_command()
-{
- command=$1
- $DAEMON --port ${PORT} -c ${ADDRESS} ${command}
-}
-
-#
-# Function that starts the daemon/service
-#
-do_start()
-{
- # Return
- # 0 if daemon has been started
- # 1 if daemon was already running
- # 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
- ${START_STOP_DAEMON_ARGS} --test > /dev/null || return 1
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
- ${START_STOP_DAEMON_ARGS} -- $DAEMON_ARGS || return 2
- # Add code here, if necessary, that waits for the process to be ready
- # to handle requests from services started subsequently which depend
- # on this one. As a last resort, sleep for some time.
-}
-
-#
-# Function that stops the daemon/service
-#
-do_stop()
-{
- # Return
- # 0 if daemon has been stopped
- # 1 if daemon was already stopped
- # 2 if daemon could not be stopped
- # other if a failure occurred
-
- send_command shutdown
-
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
- --pidfile $PIDFILE --name $NAME
- RETVAL="$?"
- [ "$RETVAL" = 2 ] && return 2
- # Wait for children to finish too if this is a daemon that forks
- # and if the daemon is only ever run from this initscript.
- # If the above conditions are not satisfied then add some other code
- # that waits for the process to drop all resources that could be
- # needed by services started subsequently. A last resort is to
- # sleep for some time.
- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 \
- --pidfile $PIDFILE --exec $DAEMON
- [ "$?" = 2 ] && return 2
- # Many daemons don't delete their pidfiles when they exit.
- rm -f $PIDFILE
- return "$RETVAL"
-}
-
-#
-# Function that sends a SIGHUP to the daemon/service
-#
-do_reload() {
- #
- # If the daemon can reload its configuration without
- # restarting (for example, when it is sent a SIGHUP),
- # then implement that here.
- #
- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
- return 0
-}
-
-do_status() {
- if [ -z "${ADDRESS}" ]; then
- ADDRESS="localhost"
- fi
- send_command status
- return $?
-}
-
-case "$1" in
- start)
- [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
- do_start
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- stop)
- [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- reload|force-reload)
- log_daemon_msg "Reloading $DESC" "$NAME"
- do_reload
- log_end_msg $?
- ;;
- restart)
- log_daemon_msg "Restarting $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1)
- do_start
- case "$?" in
- 0) log_end_msg 0 ;;
- 1) log_end_msg 1 ;; # Old process is still running
- *) log_end_msg 1 ;; # Failed to start
- esac
- ;;
- *)
- # Failed to stop
- log_end_msg 1
- ;;
- esac
- ;;
- status)
- do_status
- case "$?" in
- 0) ;; # service is OK
- *) exit 3 ;; # program is not running
- esac
- ;;
- *)
- echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
- exit 3
- ;;
-esac
-
-:
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.logrotate b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.logrotate
deleted file mode 100644
index ba0c32c14f9..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-gqtp.logrotate
+++ /dev/null
@@ -1,17 +0,0 @@
-/var/log/groonga/*-gqtp.log {
- daily
- missingok
- rotate 30
- compress
- delaycompress
- notifempty
- create 640 groonga groonga
- sharedscripts
- postrotate
- . /etc/default/groonga-server-gqtp
- if x"$ENABLE" = x"yes"; then
- /usr/bin/groonga --port "${PORT:-10043}" -c 127.0.0.1 \
- log_reopen > /dev/null
- fi
- endscript
-}
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.default b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.default
deleted file mode 100644
index 4ccbc719c2e..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.default
+++ /dev/null
@@ -1,16 +0,0 @@
-# Default
-#USER=groonga
-#GROUP=groonga
-#ADDRESS=127.0.0.1
-#PORT=10041
-#DATABASE=/var/lib/groonga/db/db
-#LOG_PATH=/var/log/groonga/groonga-http.log
-#QUERY_LOG_PATH=/var/log/groonga/query-http.log
-#PROTOCOL=http
-#GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
-#TIMEOUT=5
-
-# Comment out this to disable groonga daemon.
-ENABLE=yes
-# Set "no" to disable to skip updating column for same value.
-GRN_JA_SKIP_SAME_VALUE_PUT=yes
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.dirs b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.dirs
deleted file mode 100644
index 52486379889..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-var/log/groonga
-var/lib/groonga
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.init b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.init
deleted file mode 100755
index 2e9c96d9016..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.init
+++ /dev/null
@@ -1,250 +0,0 @@
-#! /bin/sh
-### BEGIN INIT INFO
-# Provides: groonga-server-http
-# Required-Start: $remote_fs $network
-# Required-Stop: $remote_fs $network
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: groonga's init script
-# Description: groonga is a full-text search engine and column store.
-### END INIT INFO
-
-# Author: Kouhei Sutou <kou@clear-code.com>
-
-# Do NOT "set -e"
-
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
-PATH=/sbin:/usr/sbin:/bin:/usr/bin
-DESC="a full-text search engine and column store"
-NAME=groonga
-DAEMON=/usr/bin/$NAME
-CURL=/usr/bin/curl
-USER=groonga
-GROUP=groonga
-DATABASE=/var/lib/groonga/db/db
-ADDRESS=127.0.0.1
-PORT=10041
-PROTOCOL=http
-LOG_PATH=/var/log/groonga/groonga-$PROTOCOL.log
-QUERY_LOG_PATH=/var/log/groonga/query-$PROTOCOL.log
-PIDFILE=/var/run/groonga/$NAME-$PROTOCOL.pid
-SCRIPTNAME=/etc/init.d/$NAME-server-$PROTOCOL
-OPTION_ARGS=""
-START_STOP_DAEMON_ARGS=""
-TIMEOUT=5
-ENABLE="no"
-
-DEFAULT_FILE=/etc/default/groonga-server-http
-
-# Exit if the package is not installed
-[ -x "$DAEMON" ] || exit 0
-
-# Read configuration variable file if it is present
-[ -r $DEFAULT_FILE ] && . $DEFAULT_FILE
-
-[ "$ENABLE" = "yes" ] || exit 0
-
-export GRN_JA_SKIP_SAME_VALUE_PUT="$GRN_JA_SKIP_SAME_VALUE_PUT"
-
-DAEMON_ARGS="-d --pid-path ${PIDFILE}"
-if [ -n "${ADDRESS}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --bind-address ${ADDRESS}"
-fi
-if [ -n "${PORT}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --port ${PORT}"
-fi
-if [ -n "${LOG_PATH}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --log-path ${LOG_PATH}"
-fi
-if [ -n "${QUERY_LOG_PATH}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --query-log-path ${QUERY_LOG_PATH}"
-fi
-if [ -n "${PROTOCOL}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} --protocol ${PROTOCOL}"
-fi
-mkdir -p $(dirname ${PIDFILE})
-if [ -n "${USER}" ]; then
- if ! getent passwd | grep -q "^${USER}:"; then
- echo "$0: user for running groonga doesn't exist: ${USER}" >&2
- exit 1
- fi
- chown -R ${USER} $(dirname ${PIDFILE})
- START_STOP_DAEMON_ARGS="${START_STOP_DAEMON_ARGS} --chuid ${USER}"
-fi
-if [ -n "${GROUP}" ]; then
- if ! getent group | grep -q "^${GROUP}:"; then
- echo "$0: group for running groonga doesn't exist: ${GROUP}" >&2
- exit 1
- fi
- START_STOP_DAEMON_ARGS="${START_STOP_DAEMON_ARGS} --group ${GROUP}"
-fi
-DAEMON_ARGS="${DAEMON_ARGS} ${OPTION_ARGS}"
-
-if [ -z "${DATABASE}" ]; then
- echo "$0: DATABASE should not be empty" >&2
- exit 1
-fi
-
-if [ -f "${DATABASE}" ]; then
- DAEMON_ARGS="${DAEMON_ARGS} ${DATABASE}"
-else
- mkdir -p $(dirname ${DATABASE})
- if [ -n "${USER}" ]; then
- chown -R ${USER} $(dirname ${DATABASE})
- fi
- if [ -n "${GROUP}" ]; then
- chgrp -R ${GROUP} $(dirname ${DATABASE})
- fi
- DAEMON_ARGS="${DAEMON_ARGS} -n ${DATABASE}"
-fi
-
-# Load the VERBOSE setting and other rcS variables
-. /lib/init/vars.sh
-
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
-. /lib/lsb/init-functions
-
-send_command()
-{
- command=$1
- if [ "${PROTOCOL}" = "http" ]; then
- $CURL --max-time $TIMEOUT "http://${ADDRESS}:${PORT}/d/${command}"
- else
- $DAEMON --port ${PORT} -c ${ADDRESS} ${command}
- fi
-}
-
-#
-# Function that starts the daemon/service
-#
-do_start()
-{
- # Return
- # 0 if daemon has been started
- # 1 if daemon was already running
- # 2 if daemon could not be started
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
- ${START_STOP_DAEMON_ARGS} --test > /dev/null || return 1
- start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
- ${START_STOP_DAEMON_ARGS} -- $DAEMON_ARGS || return 2
- # Add code here, if necessary, that waits for the process to be ready
- # to handle requests from services started subsequently which depend
- # on this one. As a last resort, sleep for some time.
-}
-
-#
-# Function that stops the daemon/service
-#
-do_stop()
-{
- # Return
- # 0 if daemon has been stopped
- # 1 if daemon was already stopped
- # 2 if daemon could not be stopped
- # other if a failure occurred
-
- send_command shutdown
-
- start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
- --pidfile $PIDFILE --name $NAME
- RETVAL="$?"
- [ "$RETVAL" = 2 ] && return 2
- # Wait for children to finish too if this is a daemon that forks
- # and if the daemon is only ever run from this initscript.
- # If the above conditions are not satisfied then add some other code
- # that waits for the process to drop all resources that could be
- # needed by services started subsequently. A last resort is to
- # sleep for some time.
- start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 \
- --pidfile $PIDFILE --exec $DAEMON
- [ "$?" = 2 ] && return 2
- # Many daemons don't delete their pidfiles when they exit.
- rm -f $PIDFILE
- return "$RETVAL"
-}
-
-#
-# Function that sends a SIGHUP to the daemon/service
-#
-do_reload() {
- #
- # If the daemon can reload its configuration without
- # restarting (for example, when it is sent a SIGHUP),
- # then implement that here.
- #
- start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
- return 0
-}
-
-do_status() {
- if [ -z "${ADDRESS}" ]; then
- ADDRESS="localhost"
- fi
- send_command status
- return $?
-}
-
-case "$1" in
- start)
- [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
- do_start
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- stop)
- [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
- 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
- esac
- ;;
- reload|force-reload)
- log_daemon_msg "Reloading $DESC" "$NAME"
- do_reload
- log_end_msg $?
- ;;
- restart)
- log_daemon_msg "Restarting $DESC" "$NAME"
- do_stop
- case "$?" in
- 0|1)
- do_start
- case "$?" in
- 0) log_end_msg 0 ;;
- 1) log_end_msg 1 ;; # Old process is still running
- *) log_end_msg 1 ;; # Failed to start
- esac
- ;;
- *)
- # Failed to stop
- log_end_msg 1
- ;;
- esac
- ;;
- status)
- do_status
- case "$?" in
- 0)
- # service is OK
- ;;
- 7)
- # curl can't connect to host, program is not running
- exit 3
- ;;
- *)
- # service status is unknown
- exit 4
- ;;
- esac
- ;;
- *)
- echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
- exit 3
- ;;
-esac
-
-:
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.logrotate b/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.logrotate
deleted file mode 100644
index 8138715ef3d..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-server-http.logrotate
+++ /dev/null
@@ -1,17 +0,0 @@
-/var/log/groonga/*-http.log {
- daily
- missingok
- rotate 30
- compress
- delaycompress
- notifempty
- create 640 groonga groonga
- sharedscripts
- postrotate
- . /etc/default/groonga-server-http
- if x"$ENABLE" = x"yes"; then
- /usr/bin/curl --silent --output /dev/null \
- "http://127.0.0.1:${PORT:-10041}/d/log_reopen"
- fi
- endscript
-}
diff --git a/storage/mroonga/vendor/groonga/packages/debian/groonga-tokenizer-mecab.install b/storage/mroonga/vendor/groonga/packages/debian/groonga-tokenizer-mecab.install
deleted file mode 100644
index b15a2153804..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/groonga-tokenizer-mecab.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/*/groonga/plugins/tokenizers/mecab*
diff --git a/storage/mroonga/vendor/groonga/packages/debian/libgroonga-dev.install b/storage/mroonga/vendor/groonga/packages/debian/libgroonga-dev.install
deleted file mode 100644
index 352d7b13ad9..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/libgroonga-dev.install
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/include/groonga/*
-usr/lib/*/pkgconfig/*
-usr/lib/*/libgroonga.so
diff --git a/storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install b/storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install
deleted file mode 100644
index 803d4731df0..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/libgroonga0.install
+++ /dev/null
@@ -1,5 +0,0 @@
-usr/lib/*/libgroonga*.so.*
-usr/lib/*/groonga/plugins/table/*
-usr/lib/*/groonga/plugins/query_expanders/*
-usr/lib/*/groonga/plugins/token_filters/*
-etc/groonga/synonyms.tsv
diff --git a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-1.7.2.js b/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-1.7.2.js
deleted file mode 100644
index 3774ff98613..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-1.7.2.js
+++ /dev/null
@@ -1,9404 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.7.2
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Wed Mar 21 12:46:34 2012 -0700
- */
-(function( window, undefined ) {
-
-// Use the correct document accordingly with window argument (sandbox)
-var document = window.document,
- navigator = window.navigator,
- location = window.location;
-var jQuery = (function() {
-
-// Define a local copy of jQuery
-var jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context, rootjQuery );
- },
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- // A central reference to the root jQuery(document)
- rootjQuery,
-
- // A simple way to check for HTML strings or ID strings
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
- quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
- // Check if a string has a non-whitespace character in it
- rnotwhite = /\S/,
-
- // Used for trimming whitespace
- trimLeft = /^\s+/,
- trimRight = /\s+$/,
-
- // Match a standalone tag
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
- // JSON RegExp
- rvalidchars = /^[\],:{}\s]*$/,
- rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
- rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-
- // Useragent RegExp
- rwebkit = /(webkit)[ \/]([\w.]+)/,
- ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
- rmsie = /(msie) ([\w.]+)/,
- rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
-
- // Matches dashed string for camelizing
- rdashAlpha = /-([a-z]|[0-9])/ig,
- rmsPrefix = /^-ms-/,
-
- // Used by jQuery.camelCase as callback to replace()
- fcamelCase = function( all, letter ) {
- return ( letter + "" ).toUpperCase();
- },
-
- // Keep a UserAgent string for use with jQuery.browser
- userAgent = navigator.userAgent,
-
- // For matching the engine and version of the browser
- browserMatch,
-
- // The deferred used on DOM ready
- readyList,
-
- // The ready event handler
- DOMContentLoaded,
-
- // Save a reference to some core methods
- toString = Object.prototype.toString,
- hasOwn = Object.prototype.hasOwnProperty,
- push = Array.prototype.push,
- slice = Array.prototype.slice,
- trim = String.prototype.trim,
- indexOf = Array.prototype.indexOf,
-
- // [[Class]] -> type pairs
- class2type = {};
-
-jQuery.fn = jQuery.prototype = {
- constructor: jQuery,
- init: function( selector, context, rootjQuery ) {
- var match, elem, ret, doc;
-
- // Handle $(""), $(null), or $(undefined)
- if ( !selector ) {
- return this;
- }
-
- // Handle $(DOMElement)
- if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
- }
-
- // The body element only exists once, optimize finding it
- if ( selector === "body" && !context && document.body ) {
- this.context = document;
- this[0] = document.body;
- this.selector = selector;
- this.length = 1;
- return this;
- }
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- // Are we dealing with HTML string or an ID?
- 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 = quickExpr.exec( selector );
- }
-
- // Verify a match, and that no context was specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] ) {
- context = context instanceof jQuery ? context[0] : context;
- doc = ( context ? context.ownerDocument || context : document );
-
- // If a single string is passed in and it's a single tag
- // just do a createElement and skip the rest
- ret = rsingleTag.exec( selector );
-
- if ( ret ) {
- if ( jQuery.isPlainObject( context ) ) {
- selector = [ document.createElement( ret[1] ) ];
- jQuery.fn.attr.call( selector, context, true );
-
- } else {
- selector = [ doc.createElement( ret[1] ) ];
- }
-
- } else {
- ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
- selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
- }
-
- return jQuery.merge( this, selector );
-
- // 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 || rootjQuery ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return rootjQuery.ready( selector );
- }
-
- if ( selector.selector !== undefined ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.makeArray( selector, this );
- },
-
- // Start with an empty selector
- selector: "",
-
- // The current version of jQuery being used
- jquery: "1.7.2",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
-
- toArray: function() {
- return slice.call( this, 0 );
- },
-
- // 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 a 'clean' array
- this.toArray() :
-
- // Return just the object
- ( num < 0 ? this[ this.length + num ] : this[ num ] );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
- // Build a new jQuery matched element set
- var ret = this.constructor();
-
- if ( jQuery.isArray( elems ) ) {
- push.apply( ret, elems );
-
- } else {
- jQuery.merge( ret, elems );
- }
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- ret.context = this.context;
-
- if ( name === "find" ) {
- ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
- } else if ( name ) {
- ret.selector = this.selector + "." + name + "(" + selector + ")";
- }
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- ready: function( fn ) {
- // Attach the listeners
- jQuery.bindReady();
-
- // Add the callback
- readyList.add( fn );
-
- return this;
- },
-
- eq: function( i ) {
- i = +i;
- return i === -1 ?
- this.slice( i ) :
- this.slice( i, i + 1 );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- slice: function() {
- return this.pushStack( slice.apply( this, arguments ),
- "slice", slice.call(arguments).join(",") );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- end: function() {
- return this.prevObject || this.constructor(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: [].sort,
- splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
-
- // 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 ( length === i ) {
- 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({
- noConflict: function( deep ) {
- if ( window.$ === jQuery ) {
- window.$ = _$;
- }
-
- if ( deep && window.jQuery === jQuery ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- },
-
- // 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 ) {
- // Either a released hold or an DOMready/load event and not yet ready
- if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready, 1 );
- }
-
- // 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.fireWith( document, [ jQuery ] );
-
- // Trigger any bound ready events
- if ( jQuery.fn.trigger ) {
- jQuery( document ).trigger( "ready" ).off( "ready" );
- }
- }
- },
-
- bindReady: function() {
- if ( readyList ) {
- return;
- }
-
- readyList = jQuery.Callbacks( "once memory" );
-
- // Catch cases where $(document).ready() is called after the
- // browser event has already occurred.
- if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- return setTimeout( jQuery.ready, 1 );
- }
-
- // Mozilla, Opera and webkit nightlies currently support this event
- if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", jQuery.ready, false );
-
- // If IE event model is used
- } else if ( document.attachEvent ) {
- // ensure firing before onload,
- // maybe late but safe also for iframes
- document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", jQuery.ready );
-
- // If IE and not a frame
- // continually check to see if the document is ready
- var toplevel = false;
-
- try {
- toplevel = window.frameElement == null;
- } catch(e) {}
-
- if ( document.documentElement.doScroll && toplevel ) {
- doScrollCheck();
- }
- }
- },
-
- // 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 ) {
- return obj != null && obj == obj.window;
- },
-
- isNumeric: function( obj ) {
- return !isNaN( parseFloat(obj) ) && isFinite( obj );
- },
-
- type: function( obj ) {
- return obj == null ?
- String( obj ) :
- class2type[ toString.call(obj) ] || "object";
- },
-
- isPlainObject: function( obj ) {
- // 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;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
-
- var key;
- for ( key in obj ) {}
-
- return key === undefined || hasOwn.call( obj, key );
- },
-
- isEmptyObject: function( obj ) {
- for ( var name in obj ) {
- return false;
- }
- return true;
- },
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- parseJSON: function( data ) {
- if ( typeof data !== "string" || !data ) {
- return null;
- }
-
- // Make sure leading/trailing whitespace is removed (IE can't handle it)
- data = jQuery.trim( data );
-
- // Attempt to parse using the native JSON parser first
- if ( window.JSON && window.JSON.parse ) {
- return window.JSON.parse( data );
- }
-
- // Make sure the incoming data is actual JSON
- // Logic borrowed from http://json.org/json2.js
- if ( rvalidchars.test( data.replace( rvalidescape, "@" )
- .replace( rvalidtokens, "]" )
- .replace( rvalidbraces, "")) ) {
-
- return ( new Function( "return " + data ) )();
-
- }
- jQuery.error( "Invalid JSON: " + data );
- },
-
- // Cross-browser xml parsing
- parseXML: function( data ) {
- if ( typeof data !== "string" || !data ) {
- return null;
- }
- var xml, tmp;
- try {
- if ( window.DOMParser ) { // Standard
- tmp = new DOMParser();
- xml = tmp.parseFromString( data , "text/xml" );
- } else { // IE
- xml = new ActiveXObject( "Microsoft.XMLDOM" );
- xml.async = "false";
- xml.loadXML( data );
- }
- } catch( e ) {
- xml = undefined;
- }
- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
- },
-
- noop: function() {},
-
- // Evaluates a script in a global context
- // 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 && rnotwhite.test( 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 );
- } )( 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.toUpperCase() === name.toUpperCase();
- },
-
- // args is for internal usage only
- each: function( object, callback, args ) {
- var name, i = 0,
- length = object.length,
- isObj = length === undefined || jQuery.isFunction( object );
-
- if ( args ) {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.apply( object[ name ], args ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.apply( object[ i++ ], args ) === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
- break;
- }
- }
- }
- }
-
- return object;
- },
-
- // Use native String.trim function wherever possible
- trim: trim ?
- function( text ) {
- return text == null ?
- "" :
- trim.call( text );
- } :
-
- // Otherwise use our own trimming functionality
- function( text ) {
- return text == null ?
- "" :
- text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
- },
-
- // results is for internal usage only
- makeArray: function( array, results ) {
- var ret = results || [];
-
- if ( array != null ) {
- // The window, strings (and functions) also have 'length'
- // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
- var type = jQuery.type( array );
-
- if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
- push.call( ret, array );
- } else {
- jQuery.merge( ret, array );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, array, i ) {
- var len;
-
- if ( array ) {
- if ( indexOf ) {
- return indexOf.call( array, elem, i );
- }
-
- len = array.length;
- i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
- for ( ; i < len; i++ ) {
- // Skip accessing in sparse arrays
- if ( i in array && array[ i ] === elem ) {
- return i;
- }
- }
- }
-
- return -1;
- },
-
- merge: function( first, second ) {
- var i = first.length,
- j = 0;
-
- if ( typeof second.length === "number" ) {
- for ( var l = second.length; j < l; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- } else {
- while ( second[j] !== undefined ) {
- first[ i++ ] = second[ j++ ];
- }
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, inv ) {
- var ret = [], retVal;
- inv = !!inv;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- retVal = !!callback( elems[ i ], i );
- if ( inv !== retVal ) {
- ret.push( elems[ i ] );
- }
- }
-
- return ret;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var value, key, ret = [],
- i = 0,
- length = elems.length,
- // jquery objects are treated as arrays
- isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
- // Go through the array, translating each of the items to their
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( key in elems ) {
- value = callback( elems[ key ], key, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
- }
-
- // Flatten any nested arrays
- return ret.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 ) {
- if ( typeof context === "string" ) {
- var 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
- var args = slice.call( arguments, 2 ),
- proxy = function() {
- return fn.apply( context, 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 || proxy.guid || jQuery.guid++;
-
- return proxy;
- },
-
- // Mutifunctional method to get and set values to a collection
- // The value/s can optionally be executed if it's a function
- access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
- var exec,
- bulk = key == null,
- i = 0,
- length = elems.length;
-
- // Sets many values
- if ( key && typeof key === "object" ) {
- for ( i in key ) {
- jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
- }
- chainable = 1;
-
- // Sets one value
- } else if ( value !== undefined ) {
- // Optionally, function values get executed if exec is true
- exec = pass === undefined && jQuery.isFunction( value );
-
- if ( bulk ) {
- // Bulk operations only iterate when executing function values
- if ( exec ) {
- exec = fn;
- fn = function( elem, key, value ) {
- return exec.call( jQuery( elem ), value );
- };
-
- // Otherwise they run against the entire set
- } else {
- fn.call( elems, value );
- fn = null;
- }
- }
-
- if ( fn ) {
- for (; i < length; i++ ) {
- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
- }
- }
-
- chainable = 1;
- }
-
- return chainable ?
- elems :
-
- // Gets
- bulk ?
- fn.call( elems ) :
- length ? fn( elems[0], key ) : emptyGet;
- },
-
- now: function() {
- return ( new Date() ).getTime();
- },
-
- // Use of jQuery.browser is frowned upon.
- // More details: http://docs.jquery.com/Utilities/jQuery.browser
- uaMatch: function( ua ) {
- ua = ua.toLowerCase();
-
- var match = rwebkit.exec( ua ) ||
- ropera.exec( ua ) ||
- rmsie.exec( ua ) ||
- ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
- [];
-
- return { browser: match[1] || "", version: match[2] || "0" };
- },
-
- sub: function() {
- function jQuerySub( selector, context ) {
- return new jQuerySub.fn.init( selector, context );
- }
- jQuery.extend( true, jQuerySub, this );
- jQuerySub.superclass = this;
- jQuerySub.fn = jQuerySub.prototype = this();
- jQuerySub.fn.constructor = jQuerySub;
- jQuerySub.sub = this.sub;
- jQuerySub.fn.init = function init( selector, context ) {
- if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
- context = jQuerySub( context );
- }
-
- return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
- };
- jQuerySub.fn.init.prototype = jQuerySub.fn;
- var rootjQuerySub = jQuerySub(document);
- return jQuerySub;
- },
-
- browser: {}
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
- jQuery.browser[ browserMatch.browser ] = true;
- jQuery.browser.version = browserMatch.version;
-}
-
-// Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
- jQuery.browser.safari = true;
-}
-
-// IE doesn't match non-breaking spaces with \s
-if ( rnotwhite.test( "\xA0" ) ) {
- trimLeft = /^[\s\xA0]+/;
- trimRight = /[\s\xA0]+$/;
-}
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
- DOMContentLoaded = function() {
- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- jQuery.ready();
- };
-
-} else if ( document.attachEvent ) {
- DOMContentLoaded = function() {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( document.readyState === "complete" ) {
- document.detachEvent( "onreadystatechange", DOMContentLoaded );
- jQuery.ready();
- }
- };
-}
-
-// The DOM ready check for Internet Explorer
-function doScrollCheck() {
- if ( jQuery.isReady ) {
- return;
- }
-
- try {
- // If IE is used, use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- document.documentElement.doScroll("left");
- } catch(e) {
- setTimeout( doScrollCheck, 1 );
- return;
- }
-
- // and execute any waiting functions
- jQuery.ready();
-}
-
-return jQuery;
-
-})();
-
-
-// String to Object flags format cache
-var flagsCache = {};
-
-// Convert String-formatted flags into Object-formatted ones and store in cache
-function createFlags( flags ) {
- var object = flagsCache[ flags ] = {},
- i, length;
- flags = flags.split( /\s+/ );
- for ( i = 0, length = flags.length; i < length; i++ ) {
- object[ flags[i] ] = true;
- }
- return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- * flags: an optional list of space-separated flags that will change how
- * the callback list behaves
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible flags:
- *
- * 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( flags ) {
-
- // Convert flags from String-formatted to Object-formatted
- // (we check in cache first)
- flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
-
- var // Actual callback list
- list = [],
- // Stack of fire calls for repeatable lists
- stack = [],
- // Last fire value (for non-forgettable lists)
- memory,
- // Flag to know if list was already fired
- fired,
- // Flag to know if list is currently firing
- firing,
- // First callback to fire (used internally by add and fireWith)
- firingStart,
- // End of the loop when firing
- firingLength,
- // Index of currently firing callback (modified by remove if needed)
- firingIndex,
- // Add one or several callbacks to the list
- add = function( args ) {
- var i,
- length,
- elem,
- type,
- actual;
- for ( i = 0, length = args.length; i < length; i++ ) {
- elem = args[ i ];
- type = jQuery.type( elem );
- if ( type === "array" ) {
- // Inspect recursively
- add( elem );
- } else if ( type === "function" ) {
- // Add if not in unique mode and callback is not in
- if ( !flags.unique || !self.has( elem ) ) {
- list.push( elem );
- }
- }
- }
- },
- // Fire callbacks
- fire = function( context, args ) {
- args = args || [];
- memory = !flags.memory || [ context, args ];
- fired = true;
- firing = true;
- firingIndex = firingStart || 0;
- firingStart = 0;
- firingLength = list.length;
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
- if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
- memory = true; // Mark as halted
- break;
- }
- }
- firing = false;
- if ( list ) {
- if ( !flags.once ) {
- if ( stack && stack.length ) {
- memory = stack.shift();
- self.fireWith( memory[ 0 ], memory[ 1 ] );
- }
- } else if ( memory === true ) {
- self.disable();
- } else {
- list = [];
- }
- }
- },
- // Actual Callbacks object
- self = {
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
- var length = list.length;
- add( arguments );
- // Do we need to add the callbacks to the
- // current firing batch?
- if ( firing ) {
- firingLength = list.length;
- // With memory, if we're not firing then
- // we should call right away, unless previous
- // firing was halted (stopOnFalse)
- } else if ( memory && memory !== true ) {
- firingStart = length;
- fire( memory[ 0 ], memory[ 1 ] );
- }
- }
- return this;
- },
- // Remove a callback from the list
- remove: function() {
- if ( list ) {
- var args = arguments,
- argIndex = 0,
- argLength = args.length;
- for ( ; argIndex < argLength ; argIndex++ ) {
- for ( var i = 0; i < list.length; i++ ) {
- if ( args[ argIndex ] === list[ i ] ) {
- // Handle firingIndex and firingLength
- if ( firing ) {
- if ( i <= firingLength ) {
- firingLength--;
- if ( i <= firingIndex ) {
- firingIndex--;
- }
- }
- }
- // Remove the element
- list.splice( i--, 1 );
- // If we have some unicity property then
- // we only need to do this once
- if ( flags.unique ) {
- break;
- }
- }
- }
- }
- }
- return this;
- },
- // Control if a given callback is in the list
- has: function( fn ) {
- if ( list ) {
- var i = 0,
- length = list.length;
- for ( ; i < length; i++ ) {
- if ( fn === list[ i ] ) {
- return true;
- }
- }
- }
- return false;
- },
- // Remove all callbacks from the list
- empty: function() {
- list = [];
- return this;
- },
- // Have the list do nothing anymore
- disable: function() {
- list = stack = memory = undefined;
- return this;
- },
- // Is it disabled?
- disabled: function() {
- return !list;
- },
- // Lock the list in its current state
- lock: function() {
- stack = undefined;
- if ( !memory || memory === true ) {
- self.disable();
- }
- return this;
- },
- // Is it locked?
- locked: function() {
- return !stack;
- },
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- if ( stack ) {
- if ( firing ) {
- if ( !flags.once ) {
- stack.push( [ context, args ] );
- }
- } else if ( !( flags.once && memory ) ) {
- fire( context, args );
- }
- }
- 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;
-};
-
-
-
-
-var // Static reference to slice
- sliceDeferred = [].slice;
-
-jQuery.extend({
-
- Deferred: function( func ) {
- var doneList = jQuery.Callbacks( "once memory" ),
- failList = jQuery.Callbacks( "once memory" ),
- progressList = jQuery.Callbacks( "memory" ),
- state = "pending",
- lists = {
- resolve: doneList,
- reject: failList,
- notify: progressList
- },
- promise = {
- done: doneList.add,
- fail: failList.add,
- progress: progressList.add,
-
- state: function() {
- return state;
- },
-
- // Deprecated
- isResolved: doneList.fired,
- isRejected: failList.fired,
-
- then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
- deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
- return this;
- },
- always: function() {
- deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
- return this;
- },
- pipe: function( fnDone, fnFail, fnProgress ) {
- return jQuery.Deferred(function( newDefer ) {
- jQuery.each( {
- done: [ fnDone, "resolve" ],
- fail: [ fnFail, "reject" ],
- progress: [ fnProgress, "notify" ]
- }, function( handler, data ) {
- var fn = data[ 0 ],
- action = data[ 1 ],
- returned;
- if ( jQuery.isFunction( fn ) ) {
- deferred[ handler ](function() {
- returned = fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
- } else {
- newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
- }
- });
- } else {
- deferred[ handler ]( newDefer[ action ] );
- }
- });
- }).promise();
- },
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function( obj ) {
- if ( obj == null ) {
- obj = promise;
- } else {
- for ( var key in promise ) {
- obj[ key ] = promise[ key ];
- }
- }
- return obj;
- }
- },
- deferred = promise.promise({}),
- key;
-
- for ( key in lists ) {
- deferred[ key ] = lists[ key ].fire;
- deferred[ key + "With" ] = lists[ key ].fireWith;
- }
-
- // Handle state
- deferred.done( function() {
- state = "resolved";
- }, failList.disable, progressList.lock ).fail( function() {
- state = "rejected";
- }, doneList.disable, progressList.lock );
-
- // Call given func if any
- if ( func ) {
- func.call( deferred, deferred );
- }
-
- // All done!
- return deferred;
- },
-
- // Deferred helper
- when: function( firstParam ) {
- var args = sliceDeferred.call( arguments, 0 ),
- i = 0,
- length = args.length,
- pValues = new Array( length ),
- count = length,
- pCount = length,
- deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
- firstParam :
- jQuery.Deferred(),
- promise = deferred.promise();
- function resolveFunc( i ) {
- return function( value ) {
- args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
- if ( !( --count ) ) {
- deferred.resolveWith( deferred, args );
- }
- };
- }
- function progressFunc( i ) {
- return function( value ) {
- pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
- deferred.notifyWith( promise, pValues );
- };
- }
- if ( length > 1 ) {
- for ( ; i < length; i++ ) {
- if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
- args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
- } else {
- --count;
- }
- }
- if ( !count ) {
- deferred.resolveWith( deferred, args );
- }
- } else if ( deferred !== firstParam ) {
- deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
- }
- return promise;
- }
-});
-
-
-
-
-jQuery.support = (function() {
-
- var support,
- all,
- a,
- select,
- opt,
- input,
- fragment,
- tds,
- events,
- eventName,
- i,
- isSupported,
- div = document.createElement( "div" ),
- documentElement = document.documentElement;
-
- // Preliminary tests
- div.setAttribute("className", "t");
- div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
- all = div.getElementsByTagName( "*" );
- a = div.getElementsByTagName( "a" )[ 0 ];
-
- // Can't get basic test support
- if ( !all || !all.length || !a ) {
- return {};
- }
-
- // First batch of supports tests
- select = document.createElement( "select" );
- opt = select.appendChild( document.createElement("option") );
- input = div.getElementsByTagName( "input" )[ 0 ];
-
- support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
-
- // Get the style information from getAttribute
- // (IE uses .cssText instead)
- style: /top/.test( a.getAttribute("style") ),
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: ( a.getAttribute("href") === "/a" ),
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- // Use a regex to work around a WebKit issue. See #5145
- opacity: /^0.55/.test( a.style.opacity ),
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
-
- // Make sure that if no value is specified for a checkbox
- // that it defaults to "on".
- // (WebKit defaults to "" instead)
- checkOn: ( input.value === "on" ),
-
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- optSelected: opt.selected,
-
- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
- getSetAttribute: div.className !== "t",
-
- // Tests for enctype support on a form(#6743)
- enctype: !!document.createElement("form").enctype,
-
- // Makes sure cloning an html5 element does not cause problems
- // Where outerHTML is undefined, this still works
- html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
-
- // Will be defined later
- submitBubbles: true,
- changeBubbles: true,
- focusinBubbles: false,
- deleteExpando: true,
- noCloneEvent: true,
- inlineBlockNeedsLayout: false,
- shrinkWrapBlocks: false,
- reliableMarginRight: true,
- pixelMargin: true
- };
-
- // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
- jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
-
- // Make sure checked status is properly cloned
- input.checked = true;
- support.noCloneChecked = input.cloneNode( true ).checked;
-
- // Make sure that the options inside disabled selects aren't marked as disabled
- // (WebKit marks them as disabled)
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
- // Test to see if it's possible to delete an expando from an element
- // Fails in Internet Explorer
- try {
- delete div.test;
- } catch( e ) {
- support.deleteExpando = false;
- }
-
- if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
- div.attachEvent( "onclick", function() {
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- support.noCloneEvent = false;
- });
- div.cloneNode( true ).fireEvent( "onclick" );
- }
-
- // Check if a radio maintains its value
- // after being appended to the DOM
- input = document.createElement("input");
- input.value = "t";
- input.setAttribute("type", "radio");
- support.radioValue = input.value === "t";
-
- input.setAttribute("checked", "checked");
-
- // #11217 - WebKit loses check when the name is after the checked attribute
- input.setAttribute( "name", "t" );
-
- div.appendChild( input );
- fragment = document.createDocumentFragment();
- fragment.appendChild( div.lastChild );
-
- // WebKit doesn't clone checked state correctly in fragments
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Check if a disconnected checkbox will retain its checked
- // value of true after appended to the DOM (IE6/7)
- support.appendChecked = input.checked;
-
- fragment.removeChild( input );
- fragment.appendChild( div );
-
- // Technique from Juriy Zaytsev
- // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
- // We only care about the case where non-standard event systems
- // are used, namely in IE. Short-circuiting here helps us to
- // avoid an eval call (in setAttribute) which can cause CSP
- // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
- if ( div.attachEvent ) {
- for ( i in {
- submit: 1,
- change: 1,
- focusin: 1
- }) {
- eventName = "on" + i;
- isSupported = ( eventName in div );
- if ( !isSupported ) {
- div.setAttribute( eventName, "return;" );
- isSupported = ( typeof div[ eventName ] === "function" );
- }
- support[ i + "Bubbles" ] = isSupported;
- }
- }
-
- fragment.removeChild( div );
-
- // Null elements to avoid leaks in IE
- fragment = select = opt = div = input = null;
-
- // Run tests that need a body at doc ready
- jQuery(function() {
- var container, outer, inner, table, td, offsetSupport,
- marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
- paddingMarginBorderVisibility, paddingMarginBorder,
- body = document.getElementsByTagName("body")[0];
-
- if ( !body ) {
- // Return for frameset docs that don't have a body
- return;
- }
-
- conMarginTop = 1;
- paddingMarginBorder = "padding:0;margin:0;border:";
- positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
- paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
- style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
- html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
- "<table " + style + "' cellpadding='0' cellspacing='0'>" +
- "<tr><td></td></tr></table>";
-
- container = document.createElement("div");
- container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
- body.insertBefore( container, body.firstChild );
-
- // Construct the test element
- div = document.createElement("div");
- container.appendChild( div );
-
- // Check if table cells still have offsetWidth/Height when they are set
- // to display:none and there are still other visible table cells in a
- // table row; if so, offsetWidth/Height are not reliable for use when
- // determining if an element has been hidden directly using
- // display:none (it is still safe to use offsets if a parent element is
- // hidden; don safety goggles and see bug #4512 for more information).
- // (only IE 8 fails this test)
- div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
- tds = div.getElementsByTagName( "td" );
- isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
- tds[ 0 ].style.display = "";
- tds[ 1 ].style.display = "none";
-
- // Check if empty table cells still have offsetWidth/Height
- // (IE <= 8 fail this test)
- support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. For more
- // info see bug #3333
- // Fails in WebKit before Feb 2011 nightlies
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- if ( window.getComputedStyle ) {
- div.innerHTML = "";
- marginDiv = document.createElement( "div" );
- marginDiv.style.width = "0";
- marginDiv.style.marginRight = "0";
- div.style.width = "2px";
- div.appendChild( marginDiv );
- support.reliableMarginRight =
- ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
- }
-
- if ( typeof div.style.zoom !== "undefined" ) {
- // Check if natively block-level elements act like inline-block
- // elements when setting their display to 'inline' and giving
- // them layout
- // (IE < 8 does this)
- div.innerHTML = "";
- div.style.width = div.style.padding = "1px";
- div.style.border = 0;
- div.style.overflow = "hidden";
- div.style.display = "inline";
- div.style.zoom = 1;
- support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
- // Check if elements with layout shrink-wrap their children
- // (IE 6 does this)
- div.style.display = "block";
- div.style.overflow = "visible";
- div.innerHTML = "<div style='width:5px;'></div>";
- support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
- }
-
- div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
- div.innerHTML = html;
-
- outer = div.firstChild;
- inner = outer.firstChild;
- td = outer.nextSibling.firstChild.firstChild;
-
- offsetSupport = {
- doesNotAddBorder: ( inner.offsetTop !== 5 ),
- doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
- };
-
- inner.style.position = "fixed";
- inner.style.top = "20px";
-
- // safari subtracts parent border width here which is 5px
- offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
- inner.style.position = inner.style.top = "";
-
- outer.style.overflow = "hidden";
- outer.style.position = "relative";
-
- offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
- offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
-
- if ( window.getComputedStyle ) {
- div.style.marginTop = "1%";
- support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
- }
-
- if ( typeof container.style.zoom !== "undefined" ) {
- container.style.zoom = 1;
- }
-
- body.removeChild( container );
- marginDiv = div = container = null;
-
- jQuery.extend( support, offsetSupport );
- });
-
- return support;
-})();
-
-
-
-
-var rbrace = /^(?:\{.*\}|\[.*\])$/,
- rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
- cache: {},
-
- // Please use with caution
- uuid: 0,
-
- // Unique for each copy of jQuery on the page
- // Non-digits removed to match rinlinejQuery
- expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
- // The following elements throw uncatchable exceptions if you
- // attempt to add expando properties to them.
- noData: {
- "embed": true,
- // Ban all objects except for Flash (which handle expandos)
- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- "applet": true
- },
-
- hasData: function( elem ) {
- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
- return !!elem && !isEmptyDataObject( elem );
- },
-
- data: function( elem, name, data, pvt /* Internal Use Only */ ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var privateCache, thisCache, ret,
- internalKey = jQuery.expando,
- getByName = typeof name === "string",
-
- // 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,
- isEvents = name === "events";
-
- // 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] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
- 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 ) {
- elem[ internalKey ] = id = ++jQuery.uuid;
- } else {
- id = internalKey;
- }
- }
-
- if ( !cache[ id ] ) {
- cache[ id ] = {};
-
- // Avoids exposing jQuery metadata on plain JS objects when the object
- // is serialized using JSON.stringify
- if ( !isNode ) {
- cache[ id ].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 );
- }
- }
-
- privateCache = 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;
- }
-
- // Users should not attempt to inspect the internal events object using jQuery.data,
- // it is undocumented and subject to change. But does anyone listen? No.
- if ( isEvents && !thisCache[ name ] ) {
- return privateCache.events;
- }
-
- // Check for both converted-to-camel and non-converted data property names
- // If a data property was specified
- if ( getByName ) {
-
- // 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;
- },
-
- removeData: function( elem, name, pvt /* Internal Use Only */ ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var thisCache, i, l,
-
- // Reference to internal data cache key
- internalKey = jQuery.expando,
-
- isNode = elem.nodeType,
-
- // See jQuery.data for more information
- cache = isNode ? jQuery.cache : elem,
-
- // See jQuery.data for more information
- id = isNode ? elem[ internalKey ] : internalKey;
-
- // 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( " " );
- }
- }
- }
-
- for ( i = 0, l = name.length; i < l; 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 : 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;
- }
- }
-
- // Browsers that fail expando deletion also refuse to delete expandos on
- // the window, but it will allow it on all other JS objects; other browsers
- // don't care
- // Ensure that `cache` is not a window object #10080
- if ( jQuery.support.deleteExpando || !cache.setInterval ) {
- delete cache[ id ];
- } else {
- cache[ id ] = null;
- }
-
- // We destroyed the cache and need to eliminate the expando on the node to avoid
- // false lookups in the cache for entries that no longer exist
- if ( isNode ) {
- // IE does not allow us to delete expando properties from nodes,
- // nor does it have a removeAttribute function on Document nodes;
- // we must handle all of these cases
- if ( jQuery.support.deleteExpando ) {
- delete elem[ internalKey ];
- } else if ( elem.removeAttribute ) {
- elem.removeAttribute( internalKey );
- } else {
- elem[ internalKey ] = null;
- }
- }
- },
-
- // For internal use only.
- _data: function( elem, name, data ) {
- return jQuery.data( elem, name, data, true );
- },
-
- // A method for determining if a DOM node can handle the data expando
- acceptData: function( elem ) {
- if ( elem.nodeName ) {
- var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
- if ( match ) {
- return !(match === true || elem.getAttribute("classid") !== match);
- }
- }
-
- return true;
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ) {
- var parts, part, attr, name, l,
- elem = this[0],
- i = 0,
- data = null;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = jQuery.data( elem );
-
- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
- attr = elem.attributes;
- for ( l = attr.length; i < l; i++ ) {
- name = attr[i].name;
-
- if ( name.indexOf( "data-" ) === 0 ) {
- name = jQuery.camelCase( name.substring(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 );
- });
- }
-
- parts = key.split( ".", 2 );
- parts[1] = parts[1] ? "." + parts[1] : "";
- part = parts[1] + "!";
-
- return jQuery.access( this, function( value ) {
-
- if ( value === undefined ) {
- data = this.triggerHandler( "getData" + part, [ parts[0] ] );
-
- // Try to fetch any internally stored data first
- if ( data === undefined && elem ) {
- data = jQuery.data( elem, key );
- data = dataAttr( elem, key, data );
- }
-
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
- }
-
- parts[1] = value;
- this.each(function() {
- var self = jQuery( this );
-
- self.triggerHandler( "setData" + part, parts );
- jQuery.data( this, key, value );
- self.triggerHandler( "changeData" + part, parts );
- });
- }, null, value, arguments.length > 1, null, false );
- },
-
- removeData: function( key ) {
- return this.each(function() {
- jQuery.removeData( this, key );
- });
- }
-});
-
-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 :
- jQuery.isNumeric( 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 ) {
- for ( var 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 handleQueueMarkDefer( elem, type, src ) {
- var deferDataKey = type + "defer",
- queueDataKey = type + "queue",
- markDataKey = type + "mark",
- defer = jQuery._data( elem, deferDataKey );
- if ( defer &&
- ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
- ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
- // Give room for hard-coded callbacks to fire first
- // and eventually mark/queue something else on the element
- setTimeout( function() {
- if ( !jQuery._data( elem, queueDataKey ) &&
- !jQuery._data( elem, markDataKey ) ) {
- jQuery.removeData( elem, deferDataKey, true );
- defer.fire();
- }
- }, 0 );
- }
-}
-
-jQuery.extend({
-
- _mark: function( elem, type ) {
- if ( elem ) {
- type = ( type || "fx" ) + "mark";
- jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
- }
- },
-
- _unmark: function( force, elem, type ) {
- if ( force !== true ) {
- type = elem;
- elem = force;
- force = false;
- }
- if ( elem ) {
- type = type || "fx";
- var key = type + "mark",
- count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
- if ( count ) {
- jQuery._data( elem, key, count );
- } else {
- jQuery.removeData( elem, key, true );
- handleQueueMarkDefer( elem, type, "mark" );
- }
- }
- },
-
- queue: function( elem, type, data ) {
- var q;
- if ( elem ) {
- type = ( type || "fx" ) + "queue";
- q = jQuery._data( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( data ) {
- if ( !q || jQuery.isArray(data) ) {
- q = jQuery._data( elem, type, jQuery.makeArray(data) );
- } else {
- q.push( data );
- }
- }
- return q || [];
- }
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- fn = queue.shift(),
- hooks = {};
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- }
-
- if ( fn ) {
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift( "inprogress" );
- }
-
- jQuery._data( elem, type + ".run", hooks );
- fn.call( elem, function() {
- jQuery.dequeue( elem, type );
- }, hooks );
- }
-
- if ( !queue.length ) {
- jQuery.removeData( elem, type + "queue " + type + ".run", true );
- handleQueueMarkDefer( elem, type, "queue" );
- }
- }
-});
-
-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 );
-
- if ( type === "fx" && queue[0] !== "inprogress" ) {
- jQuery.dequeue( this, type );
- }
- });
- },
- dequeue: function( type ) {
- return this.each(function() {
- jQuery.dequeue( this, type );
- });
- },
- // Based off of the plugin by Clint Helfers, with permission.
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
- delay: function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = setTimeout( next, time );
- hooks.stop = function() {
- clearTimeout( timeout );
- };
- });
- },
- 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, object ) {
- if ( typeof type !== "string" ) {
- object = type;
- type = undefined;
- }
- type = type || "fx";
- var defer = jQuery.Deferred(),
- elements = this,
- i = elements.length,
- count = 1,
- deferDataKey = type + "defer",
- queueDataKey = type + "queue",
- markDataKey = type + "mark",
- tmp;
- function resolve() {
- if ( !( --count ) ) {
- defer.resolveWith( elements, [ elements ] );
- }
- }
- while( i-- ) {
- if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
- ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
- jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
- jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
- count++;
- tmp.add( resolve );
- }
- }
- resolve();
- return defer.promise( object );
- }
-});
-
-
-
-
-var rclass = /[\n\t\r]/g,
- rspace = /\s+/,
- rreturn = /\r/g,
- rtype = /^(?:button|input)$/i,
- rfocusable = /^(?:button|input|object|select|textarea)$/i,
- rclickable = /^a(?:rea)?$/i,
- rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
- getSetAttribute = jQuery.support.getSetAttribute,
- nodeHook, boolHook, fixSpecified;
-
-jQuery.fn.extend({
- attr: function( name, value ) {
- return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each(function() {
- jQuery.removeAttr( this, name );
- });
- },
-
- prop: function( name, value ) {
- return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- name = jQuery.propFix[ name ] || name;
- return this.each(function() {
- // try/catch handles cases where IE balks (such as removing a property on window)
- try {
- this[ name ] = undefined;
- delete this[ name ];
- } catch( e ) {}
- });
- },
-
- addClass: function( value ) {
- var classNames, i, l, elem,
- setClass, c, cl;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).addClass( value.call(this, j, this.className) );
- });
- }
-
- if ( value && typeof value === "string" ) {
- classNames = value.split( rspace );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- elem = this[ i ];
-
- if ( elem.nodeType === 1 ) {
- if ( !elem.className && classNames.length === 1 ) {
- elem.className = value;
-
- } else {
- setClass = " " + elem.className + " ";
-
- for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
- setClass += classNames[ c ] + " ";
- }
- }
- elem.className = jQuery.trim( setClass );
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var classNames, i, l, elem, className, c, cl;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).removeClass( value.call(this, j, this.className) );
- });
- }
-
- if ( (value && typeof value === "string") || value === undefined ) {
- classNames = ( value || "" ).split( rspace );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- elem = this[ i ];
-
- if ( elem.nodeType === 1 && elem.className ) {
- if ( value ) {
- className = (" " + elem.className + " ").replace( rclass, " " );
- for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- className = className.replace(" " + classNames[ c ] + " ", " ");
- }
- elem.className = jQuery.trim( className );
-
- } else {
- elem.className = "";
- }
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value,
- isBool = typeof stateVal === "boolean";
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( i ) {
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
- });
- }
-
- return this.each(function() {
- if ( type === "string" ) {
- // toggle individual class names
- var className,
- i = 0,
- self = jQuery( this ),
- state = stateVal,
- classNames = value.split( rspace );
-
- while ( (className = classNames[ i++ ]) ) {
- // check each className given, space seperated list
- state = isBool ? state : !self.hasClass( className );
- self[ state ? "addClass" : "removeClass" ]( className );
- }
-
- } else if ( type === "undefined" || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- jQuery._data( this, "__className__", this.className );
- }
-
- // toggle whole className
- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
- }
- });
- },
-
- hasClass: function( selector ) {
- var className = " " + selector + " ",
- i = 0,
- l = this.length;
- for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
- return true;
- }
- }
-
- return false;
- },
-
- val: function( value ) {
- var hooks, ret, isFunction,
- elem = this[0];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
- return ret;
- }
-
- ret = elem.value;
-
- return typeof ret === "string" ?
- // handle most common string cases
- ret.replace(rreturn, "") :
- // handle cases where value is null/undef or number
- ret == null ? "" : ret;
- }
-
- return;
- }
-
- isFunction = jQuery.isFunction( value );
-
- return this.each(function( i ) {
- var self = jQuery(this), val;
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call( this, i, self.val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
- } else if ( typeof val === "number" ) {
- val += "";
- } else if ( jQuery.isArray( val ) ) {
- val = jQuery.map(val, function ( value ) {
- return value == null ? "" : value + "";
- });
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- });
- }
-});
-
-jQuery.extend({
- valHooks: {
- option: {
- get: function( elem ) {
- // attributes.value is undefined in Blackberry 4.7 but
- // uses .value. See #6932
- var val = elem.attributes.value;
- return !val || val.specified ? elem.value : elem.text;
- }
- },
- select: {
- get: function( elem ) {
- var value, i, max, option,
- index = elem.selectedIndex,
- values = [],
- options = elem.options,
- one = elem.type === "select-one";
-
- // Nothing was selected
- if ( index < 0 ) {
- return null;
- }
-
- // Loop through all the selected options
- i = one ? index : 0;
- max = one ? index + 1 : options.length;
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // Don't return options that are disabled or in a disabled optgroup
- if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
- (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
- if ( one && !values.length && options.length ) {
- return jQuery( options[ index ] ).val();
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var values = jQuery.makeArray( value );
-
- jQuery(elem).find("option").each(function() {
- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
- });
-
- if ( !values.length ) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- },
-
- attrFn: {
- val: true,
- css: true,
- html: true,
- text: true,
- data: true,
- width: true,
- height: true,
- offset: true
- },
-
- attr: function( elem, name, value, pass ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set attributes on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- if ( pass && name in jQuery.attrFn ) {
- return jQuery( elem )[ name ]( value );
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === "undefined" ) {
- return jQuery.prop( elem, name, value );
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- // All attributes are lowercase
- // Grab necessary hook if one is defined
- if ( notxml ) {
- name = name.toLowerCase();
- hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
- }
-
- if ( value !== undefined ) {
-
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
- return;
-
- } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- elem.setAttribute( name, "" + value );
- return value;
- }
-
- } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
-
- ret = elem.getAttribute( name );
-
- // Non-existent attributes return null, we normalize to undefined
- return ret === null ?
- undefined :
- ret;
- }
- },
-
- removeAttr: function( elem, value ) {
- var propName, attrNames, name, l, isBool,
- i = 0;
-
- if ( value && elem.nodeType === 1 ) {
- attrNames = value.toLowerCase().split( rspace );
- l = attrNames.length;
-
- for ( ; i < l; i++ ) {
- name = attrNames[ i ];
-
- if ( name ) {
- propName = jQuery.propFix[ name ] || name;
- isBool = rboolean.test( name );
-
- // See #9699 for explanation of this approach (setting first, then removal)
- // Do not do this for boolean attributes (see #10870)
- if ( !isBool ) {
- jQuery.attr( elem, name, "" );
- }
- elem.removeAttribute( getSetAttribute ? name : propName );
-
- // Set corresponding property to false for boolean attributes
- if ( isBool && propName in elem ) {
- elem[ propName ] = false;
- }
- }
- }
- }
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- // We can't allow the type property to be changed (since it causes problems in IE)
- if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
- jQuery.error( "type property can't be changed" );
- } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
- // Setting the type on a radio button after the value resets the value in IE6-9
- // Reset value to it's default in case type is set after value
- // This is for element creation
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- },
- // Use the value property for back compat
- // Use the nodeHook for button elements in IE6/7 (#1954)
- value: {
- get: function( elem, name ) {
- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
- return nodeHook.get( elem, name );
- }
- return name in elem ?
- elem.value :
- null;
- },
- set: function( elem, value, name ) {
- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
- return nodeHook.set( elem, value, name );
- }
- // Does not return so that setAttribute is also used
- elem.value = value;
- }
- }
- },
-
- propFix: {
- tabindex: "tabIndex",
- readonly: "readOnly",
- "for": "htmlFor",
- "class": "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder",
- contenteditable: "contentEditable"
- },
-
- prop: function( elem, name, value ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set properties on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- if ( notxml ) {
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- return ( elem[ name ] = value );
- }
-
- } else {
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
- return elem[ name ];
- }
- }
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- var attributeNode = elem.getAttributeNode("tabindex");
-
- return attributeNode && attributeNode.specified ?
- parseInt( attributeNode.value, 10 ) :
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
- 0 :
- undefined;
- }
- }
- }
-});
-
-// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
-jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
-
-// Hook for boolean attributes
-boolHook = {
- get: function( elem, name ) {
- // Align boolean attributes with corresponding properties
- // Fall back to attribute presence where some booleans are not supported
- var attrNode,
- property = jQuery.prop( elem, name );
- return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
- name.toLowerCase() :
- undefined;
- },
- set: function( elem, value, name ) {
- var propName;
- if ( value === false ) {
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else {
- // value is true since we know at this point it's type boolean and not false
- // Set boolean attributes to the same name and set the DOM property
- propName = jQuery.propFix[ name ] || name;
- if ( propName in elem ) {
- // Only set the IDL specifically if it already exists on the element
- elem[ propName ] = true;
- }
-
- elem.setAttribute( name, name.toLowerCase() );
- }
- return name;
- }
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
- fixSpecified = {
- name: true,
- id: true,
- coords: true
- };
-
- // Use this for any attribute in IE6/7
- // This fixes almost every IE6/7 issue
- nodeHook = jQuery.valHooks.button = {
- get: function( elem, name ) {
- var ret;
- ret = elem.getAttributeNode( name );
- return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
- ret.nodeValue :
- undefined;
- },
- set: function( elem, value, name ) {
- // Set the existing or create a new attribute node
- var ret = elem.getAttributeNode( name );
- if ( !ret ) {
- ret = document.createAttribute( name );
- elem.setAttributeNode( ret );
- }
- return ( ret.nodeValue = value + "" );
- }
- };
-
- // Apply the nodeHook to tabindex
- jQuery.attrHooks.tabindex.set = nodeHook.set;
-
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
- // This is for removals
- jQuery.each([ "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- set: function( elem, value ) {
- if ( value === "" ) {
- elem.setAttribute( name, "auto" );
- return value;
- }
- }
- });
- });
-
- // Set contenteditable to false on removals(#10429)
- // Setting to empty string throws an error as an invalid value
- jQuery.attrHooks.contenteditable = {
- get: nodeHook.get,
- set: function( elem, value, name ) {
- if ( value === "" ) {
- value = "false";
- }
- nodeHook.set( elem, value, name );
- }
- };
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
- jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- get: function( elem ) {
- var ret = elem.getAttribute( name, 2 );
- return ret === null ? undefined : ret;
- }
- });
- });
-}
-
-if ( !jQuery.support.style ) {
- jQuery.attrHooks.style = {
- get: function( elem ) {
- // Return undefined in the case of empty string
- // Normalize to lowercase since IE uppercases css property names
- return elem.style.cssText.toLowerCase() || undefined;
- },
- set: function( elem, value ) {
- return ( elem.style.cssText = "" + value );
- }
- };
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
- jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
- get: function( elem ) {
- var parent = elem.parentNode;
-
- if ( parent ) {
- parent.selectedIndex;
-
- // Make sure that it also works with optgroups, see #5701
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- return null;
- }
- });
-}
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
- jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
- jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- get: function( elem ) {
- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
- return elem.getAttribute("value") === null ? "on" : elem.value;
- }
- };
- });
-}
-jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
- set: function( elem, value ) {
- if ( jQuery.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
- }
- }
- });
-});
-
-
-
-
-var rformElems = /^(?:textarea|input|select)$/i,
- rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
- rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|contextmenu)|click/,
- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
- quickParse = function( selector ) {
- var quick = rquickIs.exec( selector );
- if ( quick ) {
- // 0 1 2 3
- // [ _, tag, id, class ]
- quick[1] = ( quick[1] || "" ).toLowerCase();
- quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
- }
- return quick;
- },
- quickIs = function( elem, m ) {
- var attrs = elem.attributes || {};
- return (
- (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
- (!m[2] || (attrs.id || {}).value === m[2]) &&
- (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
- );
- },
- hoverHack = function( events ) {
- return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
- };
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
- add: function( elem, types, handler, data, selector ) {
-
- var elemData, eventHandle, events,
- t, tns, type, namespaces, handleObj,
- handleObjIn, quick, handlers, special;
-
- // Don't attach events to noData or text/comment nodes (allow plain objects tho)
- if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
- 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
- events = elemData.events;
- if ( !events ) {
- elemData.events = events = {};
- }
- eventHandle = elemData.handle;
- if ( !eventHandle ) {
- elemData.handle = eventHandle = 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
- // jQuery(...).bind("mouseover mouseout", fn);
- types = jQuery.trim( hoverHack(types) ).split( " " );
- for ( t = 0; t < types.length; t++ ) {
-
- tns = rtypenamespace.exec( types[t] ) || [];
- type = tns[1];
- namespaces = ( tns[2] || "" ).split( "." ).sort();
-
- // 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: tns[1],
- data: data,
- handler: handler,
- guid: handler.guid,
- selector: selector,
- quick: selector && quickParse( selector ),
- namespace: namespaces.join(".")
- }, handleObjIn );
-
- // Init the event handler queue if we're the first
- handlers = events[ type ];
- if ( !handlers ) {
- 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;
- },
-
- global: {},
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
-
- var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
- t, tns, type, origType, namespaces, origCount,
- j, events, special, handle, eventType, handleObj;
-
- if ( !elemData || !(events = elemData.events) ) {
- return;
- }
-
- // Once for each type.namespace in types; type may be omitted
- types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
- for ( t = 0; t < types.length; t++ ) {
- tns = rtypenamespace.exec( types[t] ) || [];
- type = origType = tns[1];
- namespaces = tns[2];
-
- // 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;
- eventType = events[ type ] || [];
- origCount = eventType.length;
- namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
-
- // Remove matching events
- for ( j = 0; j < eventType.length; j++ ) {
- handleObj = eventType[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
- eventType.splice( j--, 1 );
-
- if ( handleObj.selector ) {
- eventType.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 ( eventType.length === 0 && origCount !== eventType.length ) {
- if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
- jQuery.removeEvent( elem, type, elemData.handle );
- }
-
- delete events[ type ];
- }
- }
-
- // Remove the expando if it's no longer used
- if ( jQuery.isEmptyObject( events ) ) {
- handle = elemData.handle;
- if ( handle ) {
- handle.elem = null;
- }
-
- // removeData also checks for emptiness and clears the expando if empty
- // so use it instead of delete
- jQuery.removeData( elem, [ "events", "handle" ], true );
- }
- },
-
- // Events that are safe to short-circuit if no handlers are attached.
- // Native DOM events should not be added, they may have inline handlers.
- customEvent: {
- "getData": true,
- "setData": true,
- "changeData": true
- },
-
- trigger: function( event, data, elem, onlyHandlers ) {
- // Don't do events on text and comment nodes
- if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
- return;
- }
-
- // Event object or event type
- var type = event.type || event,
- namespaces = [],
- cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
-
- // 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( "!" ) >= 0 ) {
- // Exclusive events trigger only for the exact event (no namespaces)
- type = type.slice(0, -1);
- exclusive = true;
- }
-
- if ( type.indexOf( "." ) >= 0 ) {
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
-
- if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
- // No jQuery handlers for this event type, and it can't have inline handlers
- return;
- }
-
- // Caller can pass in an Event, Object, or just an event type string
- event = typeof event === "object" ?
- // jQuery.Event object
- event[ jQuery.expando ] ? event :
- // Object literal
- new jQuery.Event( type, event ) :
- // Just the event type (string)
- new jQuery.Event( type );
-
- event.type = type;
- event.isTrigger = true;
- event.exclusive = exclusive;
- event.namespace = namespaces.join( "." );
- event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
- ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
-
- // Handle a global trigger
- if ( !elem ) {
-
- // TODO: Stop taunting the data cache; remove global events and always attach to document
- cache = jQuery.cache;
- for ( i in cache ) {
- if ( cache[ i ].events && cache[ i ].events[ type ] ) {
- jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
- }
- }
- return;
- }
-
- // 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 ? jQuery.makeArray( data ) : [];
- data.unshift( event );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( 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)
- eventPath = [[ elem, special.bindType || type ]];
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
- old = null;
- for ( ; cur; cur = cur.parentNode ) {
- eventPath.push([ cur, bubbleType ]);
- old = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( old && old === elem.ownerDocument ) {
- eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
- }
- }
-
- // Fire handlers on the event path
- for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
-
- cur = eventPath[i][0];
- event.type = eventPath[i][1];
-
- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
- // Note that this is a bare JS function and not a jQuery handler
- handle = ontype && cur[ ontype ];
- if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === 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( elem.ownerDocument, data ) === false) &&
- !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.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)
- // IE<9 dies on focus/blur to hidden element (#1486)
- if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- old = elem[ ontype ];
-
- if ( old ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
- elem[ type ]();
- jQuery.event.triggered = undefined;
-
- if ( old ) {
- elem[ ontype ] = old;
- }
- }
- }
- }
-
- return event.result;
- },
-
- dispatch: function( event ) {
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix( event || window.event );
-
- var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
- delegateCount = handlers.delegateCount,
- args = [].slice.call( arguments, 0 ),
- run_all = !event.exclusive && !event.namespace,
- special = jQuery.event.special[ event.type ] || {},
- handlerQueue = [],
- i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
-
- // 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 that should run if there are delegated events
- // Avoid non-left-click bubbling in Firefox (#3861)
- if ( delegateCount && !(event.button && event.type === "click") ) {
-
- // Pregenerate a single jQuery object for reuse with .is()
- jqcur = jQuery(this);
- jqcur.context = this.ownerDocument || this;
-
- for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
-
- // Don't process events on disabled elements (#6911, #8165)
- if ( cur.disabled !== true ) {
- selMatch = {};
- matches = [];
- jqcur[0] = cur;
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
- sel = handleObj.selector;
-
- if ( selMatch[ sel ] === undefined ) {
- selMatch[ sel ] = (
- handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
- );
- }
- if ( selMatch[ sel ] ) {
- matches.push( handleObj );
- }
- }
- if ( matches.length ) {
- handlerQueue.push({ elem: cur, matches: matches });
- }
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- if ( handlers.length > delegateCount ) {
- handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
- }
-
- // Run delegates first; they may want to stop propagation beneath us
- for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
- matched = handlerQueue[ i ];
- event.currentTarget = matched.elem;
-
- for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
- handleObj = matched.matches[ j ];
-
- // Triggered event must either 1) be non-exclusive and have no namespace, or
- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
- if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
-
- event.data = handleObj.data;
- event.handleObj = handleObj;
-
- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
- .apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- event.result = ret;
- if ( 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;
- },
-
- // Includes some event props shared by KeyEvent and MouseEvent
- // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
- props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget 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 eventDoc, doc, body,
- 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;
- }
- },
-
- fix: function( event ) {
- if ( event[ jQuery.expando ] ) {
- return event;
- }
-
- // Create a writable copy of the event object and normalize some properties
- var i, prop,
- originalEvent = event,
- fixHook = jQuery.event.fixHooks[ event.type ] || {},
- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
- event = jQuery.Event( originalEvent );
-
- for ( i = copy.length; i; ) {
- prop = copy[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
- if ( !event.target ) {
- event.target = originalEvent.srcElement || document;
- }
-
- // Target should not be a text node (#504, Safari)
- if ( event.target.nodeType === 3 ) {
- event.target = event.target.parentNode;
- }
-
- // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
- if ( event.metaKey === undefined ) {
- event.metaKey = event.ctrlKey;
- }
-
- return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
- },
-
- special: {
- ready: {
- // Make sure the ready event is setup
- setup: jQuery.bindReady
- },
-
- load: {
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
-
- focus: {
- delegateType: "focusin"
- },
- blur: {
- delegateType: "focusout"
- },
-
- beforeunload: {
- setup: function( data, namespaces, eventHandle ) {
- // We only want to do this special case on windows
- if ( jQuery.isWindow( this ) ) {
- this.onbeforeunload = eventHandle;
- }
- },
-
- teardown: function( namespaces, eventHandle ) {
- if ( this.onbeforeunload === eventHandle ) {
- this.onbeforeunload = null;
- }
- }
- }
- },
-
- simulate: function( type, elem, event, bubble ) {
- // Piggyback on a donor event to simulate a different one.
- // Fake originalEvent to avoid donor's stopPropagation, but if the
- // simulated event prevents default then we do the same on the donor.
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- { type: type,
- isSimulated: true,
- originalEvent: {}
- }
- );
- if ( bubble ) {
- jQuery.event.trigger( e, null, elem );
- } else {
- jQuery.event.dispatch.call( elem, e );
- }
- if ( e.isDefaultPrevented() ) {
- event.preventDefault();
- }
- }
-};
-
-// Some plugins are using, but it's undocumented/deprecated and will be removed.
-// The 1.7 special event interface should provide all the hooks needed now.
-jQuery.event.handle = jQuery.event.dispatch;
-
-jQuery.removeEvent = document.removeEventListener ?
- function( elem, type, handle ) {
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle, false );
- }
- } :
- function( elem, type, handle ) {
- if ( elem.detachEvent ) {
- elem.detachEvent( "on" + type, 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.returnValue === false ||
- src.getPreventDefault && src.getPreventDefault() ) ? 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;
-};
-
-function returnFalse() {
- return false;
-}
-function returnTrue() {
- return 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 = {
- preventDefault: function() {
- this.isDefaultPrevented = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
-
- // if preventDefault exists run it on the original event
- if ( e.preventDefault ) {
- e.preventDefault();
-
- // otherwise set the returnValue property of the original event to false (IE)
- } else {
- e.returnValue = false;
- }
- },
- stopPropagation: function() {
- this.isPropagationStopped = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
- // if stopPropagation exists run it on the original event
- if ( e.stopPropagation ) {
- e.stopPropagation();
- }
- // otherwise set the cancelBubble property of the original event to true (IE)
- e.cancelBubble = true;
- },
- stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = returnTrue;
- this.stopPropagation();
- },
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
-}, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- delegateType: fix,
- bindType: fix,
-
- handle: function( event ) {
- var target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj,
- selector = handleObj.selector,
- ret;
-
- // For mousenter/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 ( !jQuery.support.submitBubbles ) {
-
- 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" ) ? elem.form : undefined;
- if ( form && !form._submit_attached ) {
- jQuery.event.add( form, "submit._submit", function( event ) {
- event._submit_bubble = true;
- });
- form._submit_attached = 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._submit_bubble ) {
- delete event._submit_bubble;
- if ( this.parentNode && !event.isTrigger ) {
- jQuery.event.simulate( "submit", this.parentNode, event, true );
- }
- }
- },
-
- 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 ( !jQuery.support.changeBubbles ) {
-
- 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._just_changed = true;
- }
- });
- jQuery.event.add( this, "click._change", function( event ) {
- if ( this._just_changed && !event.isTrigger ) {
- this._just_changed = false;
- jQuery.event.simulate( "change", this, event, true );
- }
- });
- }
- 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 ) && !elem._change_attached ) {
- jQuery.event.add( elem, "change._change", function( event ) {
- if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
- jQuery.event.simulate( "change", this.parentNode, event, true );
- }
- });
- elem._change_attached = 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 );
- }
- };
-}
-
-// Create "bubbling" focus and blur events
-if ( !jQuery.support.focusinBubbles ) {
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler while someone wants focusin/focusout
- var attaches = 0,
- handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
- if ( attaches++ === 0 ) {
- document.addEventListener( orig, handler, true );
- }
- },
- teardown: function() {
- if ( --attaches === 0 ) {
- document.removeEventListener( orig, handler, true );
- }
- }
- };
- });
-}
-
-jQuery.fn.extend({
-
- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) { // && selector != null
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- this.on( type, selector, data, types[ type ], one );
- }
- return this;
- }
-
- 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 this;
- }
-
- 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 this.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- });
- },
- one: function( types, selector, data, fn ) {
- return this.on( types, selector, data, fn, 1 );
- },
- off: function( types, selector, fn ) {
- if ( types && types.preventDefault && types.handleObj ) {
- // ( event ) dispatched jQuery.Event
- var 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 ( var 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 );
- });
- },
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
-
- live: function( types, data, fn ) {
- jQuery( this.context ).on( types, this.selector, data, fn );
- return this;
- },
- die: function( types, fn ) {
- jQuery( this.context ).off( types, this.selector || "**", fn );
- return this;
- },
-
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
- },
-
- trigger: function( type, data ) {
- return this.each(function() {
- jQuery.event.trigger( type, data, this );
- });
- },
- triggerHandler: function( type, data ) {
- if ( this[0] ) {
- return jQuery.event.trigger( type, data, this[0], true );
- }
- },
-
- toggle: function( fn ) {
- // Save reference to arguments for access in closure
- var args = arguments,
- guid = fn.guid || jQuery.guid++,
- i = 0,
- toggler = function( event ) {
- // Figure out which function to execute
- var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
- jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ lastToggle ].apply( this, arguments ) || false;
- };
-
- // link all the functions, so any of them can unbind this click handler
- toggler.guid = guid;
- while ( i < args.length ) {
- args[ i++ ].guid = guid;
- }
-
- return this.click( toggler );
- },
-
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- }
-});
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- if ( fn == null ) {
- fn = data;
- data = null;
- }
-
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
-
- if ( jQuery.attrFn ) {
- jQuery.attrFn[ name ] = true;
- }
-
- if ( rkeyEvent.test( name ) ) {
- jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
- }
-
- if ( rmouseEvent.test( name ) ) {
- jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
- }
-});
-
-
-
-/*!
- * Sizzle CSS Selector Engine
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- * More information: http://sizzlejs.com/
- */
-(function(){
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
- expando = "sizcache" + (Math.random() + '').replace('.', ''),
- done = 0,
- toString = Object.prototype.toString,
- hasDuplicate = false,
- baseHasDuplicate = true,
- rBackslash = /\\/g,
- rReturn = /\r\n/g,
- rNonWord = /\W/;
-
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-// Thus far that includes Google Chrome.
-[0, 0].sort(function() {
- baseHasDuplicate = false;
- return 0;
-});
-
-var Sizzle = function( selector, context, results, seed ) {
- results = results || [];
- context = context || document;
-
- var origContext = context;
-
- if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
- return [];
- }
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
- var m, set, checkSet, extra, ret, cur, pop, i,
- prune = true,
- contextXML = Sizzle.isXML( context ),
- parts = [],
- soFar = selector;
-
- // Reset the position of the chunker regexp (start from head)
- do {
- chunker.exec( "" );
- m = chunker.exec( soFar );
-
- if ( m ) {
- soFar = m[3];
-
- parts.push( m[1] );
-
- if ( m[2] ) {
- extra = m[3];
- break;
- }
- }
- } while ( m );
-
- if ( parts.length > 1 && origPOS.exec( selector ) ) {
-
- if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
- set = posProcess( parts[0] + parts[1], context, seed );
-
- } else {
- set = Expr.relative[ parts[0] ] ?
- [ context ] :
- Sizzle( parts.shift(), context );
-
- while ( parts.length ) {
- selector = parts.shift();
-
- if ( Expr.relative[ selector ] ) {
- selector += parts.shift();
- }
-
- set = posProcess( selector, set, seed );
- }
- }
-
- } else {
- // Take a shortcut and set the context if the root selector is an ID
- // (but not if it'll be faster if the inner selector is an ID)
- if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
- Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-
- ret = Sizzle.find( parts.shift(), context, contextXML );
- context = ret.expr ?
- Sizzle.filter( ret.expr, ret.set )[0] :
- ret.set[0];
- }
-
- if ( context ) {
- ret = seed ?
- { expr: parts.pop(), set: makeArray(seed) } :
- Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-
- set = ret.expr ?
- Sizzle.filter( ret.expr, ret.set ) :
- ret.set;
-
- if ( parts.length > 0 ) {
- checkSet = makeArray( set );
-
- } else {
- prune = false;
- }
-
- while ( parts.length ) {
- cur = parts.pop();
- pop = cur;
-
- if ( !Expr.relative[ cur ] ) {
- cur = "";
- } else {
- pop = parts.pop();
- }
-
- if ( pop == null ) {
- pop = context;
- }
-
- Expr.relative[ cur ]( checkSet, pop, contextXML );
- }
-
- } else {
- checkSet = parts = [];
- }
- }
-
- if ( !checkSet ) {
- checkSet = set;
- }
-
- if ( !checkSet ) {
- Sizzle.error( cur || selector );
- }
-
- if ( toString.call(checkSet) === "[object Array]" ) {
- if ( !prune ) {
- results.push.apply( results, checkSet );
-
- } else if ( context && context.nodeType === 1 ) {
- for ( i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
- results.push( set[i] );
- }
- }
-
- } else {
- for ( i = 0; checkSet[i] != null; i++ ) {
- if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
- results.push( set[i] );
- }
- }
- }
-
- } else {
- makeArray( checkSet, results );
- }
-
- if ( extra ) {
- Sizzle( extra, origContext, results, seed );
- Sizzle.uniqueSort( results );
- }
-
- return results;
-};
-
-Sizzle.uniqueSort = function( results ) {
- if ( sortOrder ) {
- hasDuplicate = baseHasDuplicate;
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- for ( var i = 1; i < results.length; i++ ) {
- if ( results[i] === results[ i - 1 ] ) {
- results.splice( i--, 1 );
- }
- }
- }
- }
-
- return results;
-};
-
-Sizzle.matches = function( expr, set ) {
- return Sizzle( expr, null, null, set );
-};
-
-Sizzle.matchesSelector = function( node, expr ) {
- return Sizzle( expr, null, null, [node] ).length > 0;
-};
-
-Sizzle.find = function( expr, context, isXML ) {
- var set, i, len, match, type, left;
-
- if ( !expr ) {
- return [];
- }
-
- for ( i = 0, len = Expr.order.length; i < len; i++ ) {
- type = Expr.order[i];
-
- if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
- left = match[1];
- match.splice( 1, 1 );
-
- if ( left.substr( left.length - 1 ) !== "\\" ) {
- match[1] = (match[1] || "").replace( rBackslash, "" );
- set = Expr.find[ type ]( match, context, isXML );
-
- if ( set != null ) {
- expr = expr.replace( Expr.match[ type ], "" );
- break;
- }
- }
- }
- }
-
- if ( !set ) {
- set = typeof context.getElementsByTagName !== "undefined" ?
- context.getElementsByTagName( "*" ) :
- [];
- }
-
- return { set: set, expr: expr };
-};
-
-Sizzle.filter = function( expr, set, inplace, not ) {
- var match, anyFound,
- type, found, item, filter, left,
- i, pass,
- old = expr,
- result = [],
- curLoop = set,
- isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
-
- while ( expr && set.length ) {
- for ( type in Expr.filter ) {
- if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
- filter = Expr.filter[ type ];
- left = match[1];
-
- anyFound = false;
-
- match.splice(1,1);
-
- if ( left.substr( left.length - 1 ) === "\\" ) {
- continue;
- }
-
- if ( curLoop === result ) {
- result = [];
- }
-
- if ( Expr.preFilter[ type ] ) {
- match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
- if ( !match ) {
- anyFound = found = true;
-
- } else if ( match === true ) {
- continue;
- }
- }
-
- if ( match ) {
- for ( i = 0; (item = curLoop[i]) != null; i++ ) {
- if ( item ) {
- found = filter( item, match, i, curLoop );
- pass = not ^ found;
-
- if ( inplace && found != null ) {
- if ( pass ) {
- anyFound = true;
-
- } else {
- curLoop[i] = false;
- }
-
- } else if ( pass ) {
- result.push( item );
- anyFound = true;
- }
- }
- }
- }
-
- if ( found !== undefined ) {
- if ( !inplace ) {
- curLoop = result;
- }
-
- expr = expr.replace( Expr.match[ type ], "" );
-
- if ( !anyFound ) {
- return [];
- }
-
- break;
- }
- }
- }
-
- // Improper expression
- if ( expr === old ) {
- if ( anyFound == null ) {
- Sizzle.error( expr );
-
- } else {
- break;
- }
- }
-
- old = expr;
- }
-
- return curLoop;
-};
-
-Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Utility function for retreiving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-var getText = Sizzle.getText = function( elem ) {
- var i, node,
- nodeType = elem.nodeType,
- ret = "";
-
- if ( nodeType ) {
- if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent || innerText for elements
- if ( typeof elem.textContent === 'string' ) {
- return elem.textContent;
- } else if ( typeof elem.innerText === 'string' ) {
- // Replace IE's carriage returns
- return elem.innerText.replace( rReturn, '' );
- } else {
- // Traverse it's children
- for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
- ret += getText( elem );
- }
- }
- } else if ( nodeType === 3 || nodeType === 4 ) {
- return elem.nodeValue;
- }
- } else {
-
- // If no nodeType, this is expected to be an array
- for ( i = 0; (node = elem[i]); i++ ) {
- // Do not traverse comment nodes
- if ( node.nodeType !== 8 ) {
- ret += getText( node );
- }
- }
- }
- return ret;
-};
-
-var Expr = Sizzle.selectors = {
- order: [ "ID", "NAME", "TAG" ],
-
- match: {
- ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
- NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
- ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
- TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
- CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
- POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
- PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
- },
-
- leftMatch: {},
-
- attrMap: {
- "class": "className",
- "for": "htmlFor"
- },
-
- attrHandle: {
- href: function( elem ) {
- return elem.getAttribute( "href" );
- },
- type: function( elem ) {
- return elem.getAttribute( "type" );
- }
- },
-
- relative: {
- "+": function(checkSet, part){
- var isPartStr = typeof part === "string",
- isTag = isPartStr && !rNonWord.test( part ),
- isPartStrNotTag = isPartStr && !isTag;
-
- if ( isTag ) {
- part = part.toLowerCase();
- }
-
- for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
- if ( (elem = checkSet[i]) ) {
- while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
- checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
- elem || false :
- elem === part;
- }
- }
-
- if ( isPartStrNotTag ) {
- Sizzle.filter( part, checkSet, true );
- }
- },
-
- ">": function( checkSet, part ) {
- var elem,
- isPartStr = typeof part === "string",
- i = 0,
- l = checkSet.length;
-
- if ( isPartStr && !rNonWord.test( part ) ) {
- part = part.toLowerCase();
-
- for ( ; i < l; i++ ) {
- elem = checkSet[i];
-
- if ( elem ) {
- var parent = elem.parentNode;
- checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
- }
- }
-
- } else {
- for ( ; i < l; i++ ) {
- elem = checkSet[i];
-
- if ( elem ) {
- checkSet[i] = isPartStr ?
- elem.parentNode :
- elem.parentNode === part;
- }
- }
-
- if ( isPartStr ) {
- Sizzle.filter( part, checkSet, true );
- }
- }
- },
-
- "": function(checkSet, part, isXML){
- var nodeCheck,
- doneName = done++,
- checkFn = dirCheck;
-
- if ( typeof part === "string" && !rNonWord.test( part ) ) {
- part = part.toLowerCase();
- nodeCheck = part;
- checkFn = dirNodeCheck;
- }
-
- checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
- },
-
- "~": function( checkSet, part, isXML ) {
- var nodeCheck,
- doneName = done++,
- checkFn = dirCheck;
-
- if ( typeof part === "string" && !rNonWord.test( part ) ) {
- part = part.toLowerCase();
- nodeCheck = part;
- checkFn = dirNodeCheck;
- }
-
- checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
- }
- },
-
- find: {
- ID: function( match, context, isXML ) {
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [m] : [];
- }
- },
-
- NAME: function( match, context ) {
- if ( typeof context.getElementsByName !== "undefined" ) {
- var ret = [],
- results = context.getElementsByName( match[1] );
-
- for ( var i = 0, l = results.length; i < l; i++ ) {
- if ( results[i].getAttribute("name") === match[1] ) {
- ret.push( results[i] );
- }
- }
-
- return ret.length === 0 ? null : ret;
- }
- },
-
- TAG: function( match, context ) {
- if ( typeof context.getElementsByTagName !== "undefined" ) {
- return context.getElementsByTagName( match[1] );
- }
- }
- },
- preFilter: {
- CLASS: function( match, curLoop, inplace, result, not, isXML ) {
- match = " " + match[1].replace( rBackslash, "" ) + " ";
-
- if ( isXML ) {
- return match;
- }
-
- for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
- if ( elem ) {
- if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
- if ( !inplace ) {
- result.push( elem );
- }
-
- } else if ( inplace ) {
- curLoop[i] = false;
- }
- }
- }
-
- return false;
- },
-
- ID: function( match ) {
- return match[1].replace( rBackslash, "" );
- },
-
- TAG: function( match, curLoop ) {
- return match[1].replace( rBackslash, "" ).toLowerCase();
- },
-
- CHILD: function( match ) {
- if ( match[1] === "nth" ) {
- if ( !match[2] ) {
- Sizzle.error( match[0] );
- }
-
- match[2] = match[2].replace(/^\+|\s*/g, '');
-
- // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
- var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
- match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
- !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
- // calculate the numbers (first)n+(last) including if they are negative
- match[2] = (test[1] + (test[2] || 1)) - 0;
- match[3] = test[3] - 0;
- }
- else if ( match[2] ) {
- Sizzle.error( match[0] );
- }
-
- // TODO: Move to normal caching system
- match[0] = done++;
-
- return match;
- },
-
- ATTR: function( match, curLoop, inplace, result, not, isXML ) {
- var name = match[1] = match[1].replace( rBackslash, "" );
-
- if ( !isXML && Expr.attrMap[name] ) {
- match[1] = Expr.attrMap[name];
- }
-
- // Handle if an un-quoted value was used
- match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
-
- if ( match[2] === "~=" ) {
- match[4] = " " + match[4] + " ";
- }
-
- return match;
- },
-
- PSEUDO: function( match, curLoop, inplace, result, not ) {
- if ( match[1] === "not" ) {
- // If we're dealing with a complex expression, or a simple one
- if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
- match[3] = Sizzle(match[3], null, null, curLoop);
-
- } else {
- var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-
- if ( !inplace ) {
- result.push.apply( result, ret );
- }
-
- return false;
- }
-
- } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
- return true;
- }
-
- return match;
- },
-
- POS: function( match ) {
- match.unshift( true );
-
- return match;
- }
- },
-
- filters: {
- enabled: function( elem ) {
- return elem.disabled === false && elem.type !== "hidden";
- },
-
- disabled: function( elem ) {
- return elem.disabled === true;
- },
-
- checked: function( elem ) {
- return elem.checked === true;
- },
-
- 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;
- },
-
- parent: function( elem ) {
- return !!elem.firstChild;
- },
-
- empty: function( elem ) {
- return !elem.firstChild;
- },
-
- has: function( elem, i, match ) {
- return !!Sizzle( match[3], elem ).length;
- },
-
- header: function( elem ) {
- return (/h\d/i).test( elem.nodeName );
- },
-
- text: function( elem ) {
- var attr = elem.getAttribute( "type" ), type = elem.type;
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
- // use getAttribute instead to test this case
- return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
- },
-
- radio: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
- },
-
- checkbox: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
- },
-
- file: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
- },
-
- password: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
- },
-
- submit: function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && "submit" === elem.type;
- },
-
- image: function( elem ) {
- return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
- },
-
- reset: function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return (name === "input" || name === "button") && "reset" === elem.type;
- },
-
- button: function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && "button" === elem.type || name === "button";
- },
-
- input: function( elem ) {
- return (/input|select|textarea|button/i).test( elem.nodeName );
- },
-
- focus: function( elem ) {
- return elem === elem.ownerDocument.activeElement;
- }
- },
- setFilters: {
- first: function( elem, i ) {
- return i === 0;
- },
-
- last: function( elem, i, match, array ) {
- return i === array.length - 1;
- },
-
- even: function( elem, i ) {
- return i % 2 === 0;
- },
-
- odd: function( elem, i ) {
- return i % 2 === 1;
- },
-
- lt: function( elem, i, match ) {
- return i < match[3] - 0;
- },
-
- gt: function( elem, i, match ) {
- return i > match[3] - 0;
- },
-
- nth: function( elem, i, match ) {
- return match[3] - 0 === i;
- },
-
- eq: function( elem, i, match ) {
- return match[3] - 0 === i;
- }
- },
- filter: {
- PSEUDO: function( elem, match, i, array ) {
- var name = match[1],
- filter = Expr.filters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
-
- } else if ( name === "contains" ) {
- return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
-
- } else if ( name === "not" ) {
- var not = match[3];
-
- for ( var j = 0, l = not.length; j < l; j++ ) {
- if ( not[j] === elem ) {
- return false;
- }
- }
-
- return true;
-
- } else {
- Sizzle.error( name );
- }
- },
-
- CHILD: function( elem, match ) {
- var first, last,
- doneName, parent, cache,
- count, diff,
- type = match[1],
- node = elem;
-
- switch ( type ) {
- case "only":
- case "first":
- while ( (node = node.previousSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- if ( type === "first" ) {
- return true;
- }
-
- node = elem;
-
- /* falls through */
- case "last":
- while ( (node = node.nextSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- return true;
-
- case "nth":
- first = match[2];
- last = match[3];
-
- if ( first === 1 && last === 0 ) {
- return true;
- }
-
- doneName = match[0];
- parent = elem.parentNode;
-
- if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
- count = 0;
-
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- node.nodeIndex = ++count;
- }
- }
-
- parent[ expando ] = doneName;
- }
-
- diff = elem.nodeIndex - last;
-
- if ( first === 0 ) {
- return diff === 0;
-
- } else {
- return ( diff % first === 0 && diff / first >= 0 );
- }
- }
- },
-
- ID: function( elem, match ) {
- return elem.nodeType === 1 && elem.getAttribute("id") === match;
- },
-
- TAG: function( elem, match ) {
- return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
- },
-
- CLASS: function( elem, match ) {
- return (" " + (elem.className || elem.getAttribute("class")) + " ")
- .indexOf( match ) > -1;
- },
-
- ATTR: function( elem, match ) {
- var name = match[1],
- result = Sizzle.attr ?
- Sizzle.attr( elem, name ) :
- Expr.attrHandle[ name ] ?
- Expr.attrHandle[ name ]( elem ) :
- elem[ name ] != null ?
- elem[ name ] :
- elem.getAttribute( name ),
- value = result + "",
- type = match[2],
- check = match[4];
-
- return result == null ?
- type === "!=" :
- !type && Sizzle.attr ?
- result != null :
- type === "=" ?
- value === check :
- type === "*=" ?
- value.indexOf(check) >= 0 :
- type === "~=" ?
- (" " + value + " ").indexOf(check) >= 0 :
- !check ?
- value && result !== false :
- type === "!=" ?
- value !== check :
- type === "^=" ?
- value.indexOf(check) === 0 :
- type === "$=" ?
- value.substr(value.length - check.length) === check :
- type === "|=" ?
- value === check || value.substr(0, check.length + 1) === check + "-" :
- false;
- },
-
- POS: function( elem, match, i, array ) {
- var name = match[2],
- filter = Expr.setFilters[ name ];
-
- if ( filter ) {
- return filter( elem, i, match, array );
- }
- }
- }
-};
-
-var origPOS = Expr.match.POS,
- fescape = function(all, num){
- return "\\" + (num - 0 + 1);
- };
-
-for ( var type in Expr.match ) {
- Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
- Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
-}
-// Expose origPOS
-// "global" as in regardless of relation to brackets/parens
-Expr.match.globalPOS = origPOS;
-
-var makeArray = function( array, results ) {
- array = Array.prototype.slice.call( array, 0 );
-
- if ( results ) {
- results.push.apply( results, array );
- return results;
- }
-
- return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-// Also verifies that the returned array holds DOM nodes
-// (which is not the case in the Blackberry browser)
-try {
- Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
-
-// Provide a fallback method if it does not work
-} catch( e ) {
- makeArray = function( array, results ) {
- var i = 0,
- ret = results || [];
-
- if ( toString.call(array) === "[object Array]" ) {
- Array.prototype.push.apply( ret, array );
-
- } else {
- if ( typeof array.length === "number" ) {
- for ( var l = array.length; i < l; i++ ) {
- ret.push( array[i] );
- }
-
- } else {
- for ( ; array[i]; i++ ) {
- ret.push( array[i] );
- }
- }
- }
-
- return ret;
- };
-}
-
-var sortOrder, siblingCheck;
-
-if ( document.documentElement.compareDocumentPosition ) {
- sortOrder = function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
- return a.compareDocumentPosition ? -1 : 1;
- }
-
- return a.compareDocumentPosition(b) & 4 ? -1 : 1;
- };
-
-} else {
- sortOrder = function( a, b ) {
- // The nodes are identical, we can exit early
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
-
- // Fallback to using sourceIndex (in IE) if it's available on both nodes
- } else if ( a.sourceIndex && b.sourceIndex ) {
- return a.sourceIndex - b.sourceIndex;
- }
-
- var al, bl,
- ap = [],
- bp = [],
- aup = a.parentNode,
- bup = b.parentNode,
- cur = aup;
-
- // If the nodes are siblings (or identical) we can do a quick check
- if ( aup === bup ) {
- return siblingCheck( a, b );
-
- // If no parents were found then the nodes are disconnected
- } else if ( !aup ) {
- return -1;
-
- } else if ( !bup ) {
- return 1;
- }
-
- // Otherwise they're somewhere else in the tree so we need
- // to build up a full list of the parentNodes for comparison
- while ( cur ) {
- ap.unshift( cur );
- cur = cur.parentNode;
- }
-
- cur = bup;
-
- while ( cur ) {
- bp.unshift( cur );
- cur = cur.parentNode;
- }
-
- al = ap.length;
- bl = bp.length;
-
- // Start walking down the tree looking for a discrepancy
- for ( var i = 0; i < al && i < bl; i++ ) {
- if ( ap[i] !== bp[i] ) {
- return siblingCheck( ap[i], bp[i] );
- }
- }
-
- // We ended someplace up the tree so do a sibling check
- return i === al ?
- siblingCheck( a, bp[i], -1 ) :
- siblingCheck( ap[i], b, 1 );
- };
-
- siblingCheck = function( a, b, ret ) {
- if ( a === b ) {
- return ret;
- }
-
- var cur = a.nextSibling;
-
- while ( cur ) {
- if ( cur === b ) {
- return -1;
- }
-
- cur = cur.nextSibling;
- }
-
- return 1;
- };
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
- // We're going to inject a fake input element with a specified name
- var form = document.createElement("div"),
- id = "script" + (new Date()).getTime(),
- root = document.documentElement;
-
- form.innerHTML = "<a name='" + id + "'/>";
-
- // Inject it into the root element, check its status, and remove it quickly
- root.insertBefore( form, root.firstChild );
-
- // The workaround has to do additional checks after a getElementById
- // Which slows things down for other browsers (hence the branching)
- if ( document.getElementById( id ) ) {
- Expr.find.ID = function( match, context, isXML ) {
- if ( typeof context.getElementById !== "undefined" && !isXML ) {
- var m = context.getElementById(match[1]);
-
- return m ?
- m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
- [m] :
- undefined :
- [];
- }
- };
-
- Expr.filter.ID = function( elem, match ) {
- var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-
- return elem.nodeType === 1 && node && node.nodeValue === match;
- };
- }
-
- root.removeChild( form );
-
- // release memory in IE
- root = form = null;
-})();
-
-(function(){
- // Check to see if the browser returns only elements
- // when doing getElementsByTagName("*")
-
- // Create a fake element
- var div = document.createElement("div");
- div.appendChild( document.createComment("") );
-
- // Make sure no comments are found
- if ( div.getElementsByTagName("*").length > 0 ) {
- Expr.find.TAG = function( match, context ) {
- var results = context.getElementsByTagName( match[1] );
-
- // Filter out possible comments
- if ( match[1] === "*" ) {
- var tmp = [];
-
- for ( var i = 0; results[i]; i++ ) {
- if ( results[i].nodeType === 1 ) {
- tmp.push( results[i] );
- }
- }
-
- results = tmp;
- }
-
- return results;
- };
- }
-
- // Check to see if an attribute returns normalized href attributes
- div.innerHTML = "<a href='#'></a>";
-
- if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
- div.firstChild.getAttribute("href") !== "#" ) {
-
- Expr.attrHandle.href = function( elem ) {
- return elem.getAttribute( "href", 2 );
- };
- }
-
- // release memory in IE
- div = null;
-})();
-
-if ( document.querySelectorAll ) {
- (function(){
- var oldSizzle = Sizzle,
- div = document.createElement("div"),
- id = "__sizzle__";
-
- div.innerHTML = "<p class='TEST'></p>";
-
- // Safari can't handle uppercase or unicode characters when
- // in quirks mode.
- if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
- return;
- }
-
- Sizzle = function( query, context, extra, seed ) {
- context = context || document;
-
- // Only use querySelectorAll on non-XML documents
- // (ID selectors don't work in non-HTML documents)
- if ( !seed && !Sizzle.isXML(context) ) {
- // See if we find a selector to speed up
- var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
-
- if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
- // Speed-up: Sizzle("TAG")
- if ( match[1] ) {
- return makeArray( context.getElementsByTagName( query ), extra );
-
- // Speed-up: Sizzle(".CLASS")
- } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
- return makeArray( context.getElementsByClassName( match[2] ), extra );
- }
- }
-
- if ( context.nodeType === 9 ) {
- // Speed-up: Sizzle("body")
- // The body element only exists once, optimize finding it
- if ( query === "body" && context.body ) {
- return makeArray( [ context.body ], extra );
-
- // Speed-up: Sizzle("#ID")
- } else if ( match && match[3] ) {
- var elem = context.getElementById( match[3] );
-
- // 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[3] ) {
- return makeArray( [ elem ], extra );
- }
-
- } else {
- return makeArray( [], extra );
- }
- }
-
- try {
- return makeArray( context.querySelectorAll(query), extra );
- } catch(qsaError) {}
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- var oldContext = context,
- old = context.getAttribute( "id" ),
- nid = old || id,
- hasParent = context.parentNode,
- relativeHierarchySelector = /^\s*[+~]/.test( query );
-
- if ( !old ) {
- context.setAttribute( "id", nid );
- } else {
- nid = nid.replace( /'/g, "\\$&" );
- }
- if ( relativeHierarchySelector && hasParent ) {
- context = context.parentNode;
- }
-
- try {
- if ( !relativeHierarchySelector || hasParent ) {
- return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
- }
-
- } catch(pseudoError) {
- } finally {
- if ( !old ) {
- oldContext.removeAttribute( "id" );
- }
- }
- }
- }
-
- return oldSizzle(query, context, extra, seed);
- };
-
- for ( var prop in oldSizzle ) {
- Sizzle[ prop ] = oldSizzle[ prop ];
- }
-
- // release memory in IE
- div = null;
- })();
-}
-
-(function(){
- var html = document.documentElement,
- matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
-
- if ( matches ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9 fails this)
- var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
- pseudoWorks = false;
-
- try {
- // This should fail with an exception
- // Gecko does not error, returns false instead
- matches.call( document.documentElement, "[test!='']:sizzle" );
-
- } catch( pseudoError ) {
- pseudoWorks = true;
- }
-
- Sizzle.matchesSelector = function( node, expr ) {
- // Make sure that attribute selectors are quoted
- expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
-
- if ( !Sizzle.isXML( node ) ) {
- try {
- if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
- var ret = matches.call( node, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || !disconnectedMatch ||
- // As well, disconnected nodes are said to be in a document
- // fragment in IE 9, so check for that
- node.document && node.document.nodeType !== 11 ) {
- return ret;
- }
- }
- } catch(e) {}
- }
-
- return Sizzle(expr, null, null, [node]).length > 0;
- };
- }
-})();
-
-(function(){
- var div = document.createElement("div");
-
- div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
- // Opera can't find a second classname (in 9.6)
- // Also, make sure that getElementsByClassName actually exists
- if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
- return;
- }
-
- // Safari caches class attributes, doesn't catch changes (in 3.2)
- div.lastChild.className = "e";
-
- if ( div.getElementsByClassName("e").length === 1 ) {
- return;
- }
-
- Expr.order.splice(1, 0, "CLASS");
- Expr.find.CLASS = function( match, context, isXML ) {
- if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
- return context.getElementsByClassName(match[1]);
- }
- };
-
- // release memory in IE
- div = null;
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
-
- if ( elem ) {
- var match = false;
-
- elem = elem[dir];
-
- while ( elem ) {
- if ( elem[ expando ] === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 && !isXML ){
- elem[ expando ] = doneName;
- elem.sizset = i;
- }
-
- if ( elem.nodeName.toLowerCase() === cur ) {
- match = elem;
- break;
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
- for ( var i = 0, l = checkSet.length; i < l; i++ ) {
- var elem = checkSet[i];
-
- if ( elem ) {
- var match = false;
-
- elem = elem[dir];
-
- while ( elem ) {
- if ( elem[ expando ] === doneName ) {
- match = checkSet[elem.sizset];
- break;
- }
-
- if ( elem.nodeType === 1 ) {
- if ( !isXML ) {
- elem[ expando ] = doneName;
- elem.sizset = i;
- }
-
- if ( typeof cur !== "string" ) {
- if ( elem === cur ) {
- match = true;
- break;
- }
-
- } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
- match = elem;
- break;
- }
- }
-
- elem = elem[dir];
- }
-
- checkSet[i] = match;
- }
- }
-}
-
-if ( document.documentElement.contains ) {
- Sizzle.contains = function( a, b ) {
- return a !== b && (a.contains ? a.contains(b) : true);
- };
-
-} else if ( document.documentElement.compareDocumentPosition ) {
- Sizzle.contains = function( a, b ) {
- return !!(a.compareDocumentPosition(b) & 16);
- };
-
-} else {
- Sizzle.contains = function() {
- return false;
- };
-}
-
-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 : 0).documentElement;
-
- return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-var posProcess = function( selector, context, seed ) {
- var match,
- tmpSet = [],
- later = "",
- root = context.nodeType ? [context] : context;
-
- // Position selectors must be done after the filter
- // And so must :not(positional) so we move all PSEUDOs to the end
- while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
- later += match[0];
- selector = selector.replace( Expr.match.PSEUDO, "" );
- }
-
- selector = Expr.relative[selector] ? selector + "*" : selector;
-
- for ( var i = 0, l = root.length; i < l; i++ ) {
- Sizzle( selector, root[i], tmpSet, seed );
- }
-
- return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-// Override sizzle attribute retrieval
-Sizzle.attr = jQuery.attr;
-Sizzle.selectors.attrMap = {};
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-})();
-
-
-var runtil = /Until$/,
- rparentsprev = /^(?:parents|prevUntil|prevAll)/,
- // Note: This RegExp should be improved, or likely pulled from Sizzle
- rmultiselector = /,/,
- isSimple = /^.[^:#\[\.,]*$/,
- slice = Array.prototype.slice,
- POS = jQuery.expr.match.globalPOS,
- // 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({
- find: function( selector ) {
- var self = this,
- i, l;
-
- if ( typeof selector !== "string" ) {
- return jQuery( selector ).filter(function() {
- for ( i = 0, l = self.length; i < l; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- });
- }
-
- var ret = this.pushStack( "", "find", selector ),
- length, n, r;
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- length = ret.length;
- jQuery.find( selector, this[i], ret );
-
- if ( i > 0 ) {
- // Make sure that the results are unique
- for ( n = length; n < ret.length; n++ ) {
- for ( r = 0; r < length; r++ ) {
- if ( ret[r] === ret[n] ) {
- ret.splice(n--, 1);
- break;
- }
- }
- }
- }
- }
-
- return ret;
- },
-
- has: function( target ) {
- var targets = jQuery( target );
- return this.filter(function() {
- for ( var i = 0, l = targets.length; i < l; i++ ) {
- if ( jQuery.contains( this, targets[i] ) ) {
- return true;
- }
- }
- });
- },
-
- not: function( selector ) {
- return this.pushStack( winnow(this, selector, false), "not", selector);
- },
-
- filter: function( selector ) {
- return this.pushStack( winnow(this, selector, true), "filter", selector );
- },
-
- is: function( selector ) {
- return !!selector && (
- typeof selector === "string" ?
- // If this is a positional selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- POS.test( selector ) ?
- jQuery( selector, this.context ).index( this[0] ) >= 0 :
- jQuery.filter( selector, this ).length > 0 :
- this.filter( selector ).length > 0 );
- },
-
- closest: function( selectors, context ) {
- var ret = [], i, l, cur = this[0];
-
- // Array (deprecated as of jQuery 1.7)
- if ( jQuery.isArray( selectors ) ) {
- var level = 1;
-
- while ( cur && cur.ownerDocument && cur !== context ) {
- for ( i = 0; i < selectors.length; i++ ) {
-
- if ( jQuery( cur ).is( selectors[ i ] ) ) {
- ret.push({ selector: selectors[ i ], elem: cur, level: level });
- }
- }
-
- cur = cur.parentNode;
- level++;
- }
-
- return ret;
- }
-
- // String
- var pos = POS.test( selectors ) || typeof selectors !== "string" ?
- jQuery( selectors, context || this.context ) :
- 0;
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- cur = this[i];
-
- while ( cur ) {
- if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
- ret.push( cur );
- break;
-
- } else {
- cur = cur.parentNode;
- if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
- break;
- }
- }
- }
- }
-
- ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
-
- return this.pushStack( ret, "closest", selectors );
- },
-
- // 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.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 ) {
- var set = typeof selector === "string" ?
- jQuery( selector, context ) :
- jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
- all = jQuery.merge( this.get(), set );
-
- return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
- all :
- jQuery.unique( all ) );
- },
-
- andSelf: function() {
- return this.add( this.prevObject );
- }
-});
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
-function isDisconnected( node ) {
- return !node || !node.parentNode || node.parentNode.nodeType === 11;
-}
-
-jQuery.each({
- parent: function( elem ) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function( elem ) {
- return jQuery.dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return jQuery.nth( elem, 2, "nextSibling" );
- },
- prev: function( elem ) {
- return jQuery.nth( elem, 2, "previousSibling" );
- },
- nextAll: function( elem ) {
- return jQuery.dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return jQuery.dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return jQuery.sibling( elem.firstChild );
- },
- contents: function( elem ) {
- return jQuery.nodeName( elem, "iframe" ) ?
- elem.contentDocument || elem.contentWindow.document :
- jQuery.makeArray( elem.childNodes );
- }
-}, function( name, fn ) {
- jQuery.fn[ name ] = function( until, selector ) {
- var ret = jQuery.map( this, fn, until );
-
- if ( !runtil.test( name ) ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- ret = jQuery.filter( selector, ret );
- }
-
- ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
-
- if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
- ret = ret.reverse();
- }
-
- return this.pushStack( ret, name, slice.call( arguments ).join(",") );
- };
-});
-
-jQuery.extend({
- filter: function( expr, elems, not ) {
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return elems.length === 1 ?
- jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
- jQuery.find.matches(expr, elems);
- },
-
- dir: function( elem, dir, until ) {
- var matched = [],
- cur = elem[ dir ];
-
- while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
- if ( cur.nodeType === 1 ) {
- matched.push( cur );
- }
- cur = cur[dir];
- }
- return matched;
- },
-
- nth: function( cur, result, dir, elem ) {
- result = result || 1;
- var num = 0;
-
- for ( ; cur; cur = cur[dir] ) {
- if ( cur.nodeType === 1 && ++num === result ) {
- break;
- }
- }
-
- return cur;
- },
-
- sibling: function( n, elem ) {
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- r.push( n );
- }
- }
-
- return r;
- }
-});
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, keep ) {
-
- // Can't pass null or undefined to indexOf in Firefox 4
- // Set to 0 to skip string check
- qualifier = qualifier || 0;
-
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep(elements, function( elem, i ) {
- var retVal = !!qualifier.call( elem, i, elem );
- return retVal === keep;
- });
-
- } else if ( qualifier.nodeType ) {
- return jQuery.grep(elements, function( elem, i ) {
- return ( elem === qualifier ) === keep;
- });
-
- } else if ( typeof qualifier === "string" ) {
- var filtered = jQuery.grep(elements, function( elem ) {
- return elem.nodeType === 1;
- });
-
- if ( isSimple.test( qualifier ) ) {
- return jQuery.filter(qualifier, filtered, !keep);
- } else {
- qualifier = jQuery.filter( qualifier, filtered );
- }
- }
-
- return jQuery.grep(elements, function( elem, i ) {
- return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
- });
-}
-
-
-
-
-function createSafeFragment( document ) {
- var list = nodeNames.split( "|" ),
- safeFrag = document.createDocumentFragment();
-
- if ( safeFrag.createElement ) {
- while ( list.length ) {
- safeFrag.createElement(
- list.pop()
- );
- }
- }
- return safeFrag;
-}
-
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
- "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
- rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
- rleadingWhitespace = /^\s+/,
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
- rtagName = /<([\w:]+)/,
- rtbody = /<tbody/i,
- rhtml = /<|&#?\w+;/,
- rnoInnerhtml = /<(?:script|style)/i,
- rnocache = /<(?:script|object|embed|option|style)/i,
- rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
- // checked="checked" or checked
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rscriptType = /\/(java|ecma)script/i,
- rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
- wrapMap = {
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
- legend: [ 1, "<fieldset>", "</fieldset>" ],
- thead: [ 1, "<table>", "</table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
- area: [ 1, "<map>", "</map>" ],
- _default: [ 0, "", "" ]
- },
- safeFragment = createSafeFragment( document );
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// IE can't serialize <link> and <script> tags normally
-if ( !jQuery.support.htmlSerialize ) {
- wrapMap._default = [ 1, "div<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
- text: function( value ) {
- return jQuery.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 );
- },
-
- wrapAll: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapAll( html.call(this, i) );
- });
- }
-
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
- if ( this[0].parentNode ) {
- wrap.insertBefore( this[0] );
- }
-
- wrap.map(function() {
- var elem = this;
-
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
- elem = elem.firstChild;
- }
-
- return elem;
- }).append( this );
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapInner( html.call(this, i) );
- });
- }
-
- return this.each(function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- });
- },
-
- wrap: function( html ) {
- var isFunction = jQuery.isFunction( html );
-
- return this.each(function(i) {
- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
- });
- },
-
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
- },
-
- append: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.appendChild( elem );
- }
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 ) {
- this.insertBefore( elem, this.firstChild );
- }
- });
- },
-
- before: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this );
- });
- } else if ( arguments.length ) {
- var set = jQuery.clean( arguments );
- set.push.apply( set, this.toArray() );
- return this.pushStack( set, "before", arguments );
- }
- },
-
- after: function() {
- if ( this[0] && this[0].parentNode ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- });
- } else if ( arguments.length ) {
- var set = this.pushStack( this, "after", arguments );
- set.push.apply( set, jQuery.clean(arguments) );
- return set;
- }
- },
-
- // keepData is for internal use only--do not document
- remove: function( selector, keepData ) {
- for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
- if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
- if ( !keepData && elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName("*") );
- jQuery.cleanData( [ elem ] );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
- }
- }
-
- return this;
- },
-
- empty: function() {
- for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
- // Remove element nodes and prevent memory leaks
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName("*") );
- }
-
- // Remove any remaining nodes
- while ( elem.firstChild ) {
- elem.removeChild( elem.firstChild );
- }
- }
-
- 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 jQuery.access( this, function( value ) {
- var elem = this[0] || {},
- i = 0,
- l = this.length;
-
- if ( value === undefined ) {
- return elem.nodeType === 1 ?
- elem.innerHTML.replace( rinlinejQuery, "" ) :
- null;
- }
-
-
- if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
- ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
- !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
-
- value = value.replace( rxhtmlTag, "<$1></$2>" );
-
- try {
- for (; i < l; i++ ) {
- // Remove element nodes and prevent memory leaks
- elem = this[i] || {};
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName( "*" ) );
- 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( value ) {
- if ( this[0] && this[0].parentNode ) {
- // Make sure that the elements are removed from the DOM before they are inserted
- // this can help fix replacing a parent with child elements
- if ( jQuery.isFunction( value ) ) {
- return this.each(function(i) {
- var self = jQuery(this), old = self.html();
- self.replaceWith( value.call( this, i, old ) );
- });
- }
-
- if ( typeof value !== "string" ) {
- value = jQuery( value ).detach();
- }
-
- return this.each(function() {
- var next = this.nextSibling,
- parent = this.parentNode;
-
- jQuery( this ).remove();
-
- if ( next ) {
- jQuery(next).before( value );
- } else {
- jQuery(parent).append( value );
- }
- });
- } else {
- return this.length ?
- this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
- this;
- }
- },
-
- detach: function( selector ) {
- return this.remove( selector, true );
- },
-
- domManip: function( args, table, callback ) {
- var results, first, fragment, parent,
- value = args[0],
- scripts = [];
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
- return this.each(function() {
- jQuery(this).domManip( args, table, callback, true );
- });
- }
-
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- args[0] = value.call(this, i, table ? self.html() : undefined);
- self.domManip( args, table, callback );
- });
- }
-
- if ( this[0] ) {
- parent = value && value.parentNode;
-
- // If we're in a fragment, just use that instead of building a new one
- if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
- results = { fragment: parent };
-
- } else {
- results = jQuery.buildFragment( args, this, scripts );
- }
-
- fragment = results.fragment;
-
- if ( fragment.childNodes.length === 1 ) {
- first = fragment = fragment.firstChild;
- } else {
- first = fragment.firstChild;
- }
-
- if ( first ) {
- table = table && jQuery.nodeName( first, "tr" );
-
- for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
- callback.call(
- table ?
- root(this[i], first) :
- this[i],
- // Make sure that we do not leak memory by inadvertently discarding
- // the original fragment (which might have attached data) instead of
- // using it; in addition, use the original fragment object for the last
- // item instead of first because it can end up being emptied incorrectly
- // in certain situations (Bug #8070).
- // Fragments from the fragment cache must always be cloned and never used
- // in place.
- results.cacheable || ( l > 1 && i < lastIndex ) ?
- jQuery.clone( fragment, true, true ) :
- fragment
- );
- }
- }
-
- if ( scripts.length ) {
- jQuery.each( scripts, function( i, elem ) {
- if ( elem.src ) {
- jQuery.ajax({
- type: "GET",
- global: false,
- url: elem.src,
- async: false,
- dataType: "script"
- });
- } else {
- jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
- });
- }
- }
-
- return this;
- }
-});
-
-function root( elem, cur ) {
- return jQuery.nodeName(elem, "table") ?
- (elem.getElementsByTagName("tbody")[0] ||
- elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
- 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 cloneFixAttributes( src, dest ) {
- var nodeName;
-
- // We do not need to do anything for non-Elements
- if ( dest.nodeType !== 1 ) {
- return;
- }
-
- // clearAttributes removes the attributes, which we don't want,
- // but also removes the attachEvent events, which we *do* want
- if ( dest.clearAttributes ) {
- dest.clearAttributes();
- }
-
- // mergeAttributes, in contrast, only merges back on the
- // original attributes, not the events
- if ( dest.mergeAttributes ) {
- dest.mergeAttributes( src );
- }
-
- nodeName = dest.nodeName.toLowerCase();
-
- // IE6-8 fail to clone children inside object elements that use
- // the proprietary classid attribute value (rather than the type
- // attribute) to identify the type of content to display
- if ( nodeName === "object" ) {
- dest.outerHTML = src.outerHTML;
-
- } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
- // 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
- if ( src.checked ) {
- 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.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;
-
- // IE blanks contents when cloning scripts
- } else if ( nodeName === "script" && dest.text !== src.text ) {
- dest.text = src.text;
- }
-
- // Event data gets referenced instead of copied if the expando
- // gets copied too
- dest.removeAttribute( jQuery.expando );
-
- // Clear flags for bubbling special change/submit events, they must
- // be reattached when the newly cloned events are first activated
- dest.removeAttribute( "_submit_attached" );
- dest.removeAttribute( "_change_attached" );
-}
-
-jQuery.buildFragment = function( args, nodes, scripts ) {
- var fragment, cacheable, cacheresults, doc,
- first = args[ 0 ];
-
- // nodes may contain either an explicit document object,
- // a jQuery collection or context object.
- // If nodes[0] contains a valid object to assign to doc
- if ( nodes && nodes[0] ) {
- doc = nodes[0].ownerDocument || nodes[0];
- }
-
- // Ensure that an attr object doesn't incorrectly stand in as a document object
- // Chrome and Firefox seem to allow this to occur and will throw exception
- // Fixes #8950
- if ( !doc.createDocumentFragment ) {
- doc = document;
- }
-
- // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
- // Cloning options loses the selected state, so don't cache them
- // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
- // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
- // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
- if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
- first.charAt(0) === "<" && !rnocache.test( first ) &&
- (jQuery.support.checkClone || !rchecked.test( first )) &&
- (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
-
- cacheable = true;
-
- cacheresults = jQuery.fragments[ first ];
- if ( cacheresults && cacheresults !== 1 ) {
- fragment = cacheresults;
- }
- }
-
- if ( !fragment ) {
- fragment = doc.createDocumentFragment();
- jQuery.clean( args, doc, fragment, scripts );
- }
-
- if ( cacheable ) {
- jQuery.fragments[ first ] = cacheresults ? fragment : 1;
- }
-
- return { fragment: fragment, cacheable: cacheable };
-};
-
-jQuery.fragments = {};
-
-jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
-}, function( name, original ) {
- jQuery.fn[ name ] = function( selector ) {
- var ret = [],
- insert = jQuery( selector ),
- parent = this.length === 1 && this[0].parentNode;
-
- if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
- insert[ original ]( this[0] );
- return this;
-
- } else {
- for ( var i = 0, l = insert.length; i < l; i++ ) {
- var elems = ( i > 0 ? this.clone(true) : this ).get();
- jQuery( insert[i] )[ original ]( elems );
- ret = ret.concat( elems );
- }
-
- return this.pushStack( ret, name, insert.selector );
- }
- };
-});
-
-function getAll( elem ) {
- if ( typeof elem.getElementsByTagName !== "undefined" ) {
- return elem.getElementsByTagName( "*" );
-
- } else if ( typeof elem.querySelectorAll !== "undefined" ) {
- return elem.querySelectorAll( "*" );
-
- } else {
- return [];
- }
-}
-
-// Used in clean, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
- if ( elem.type === "checkbox" || elem.type === "radio" ) {
- elem.defaultChecked = elem.checked;
- }
-}
-// Finds all inputs and passes them to fixDefaultChecked
-function findInputs( elem ) {
- var nodeName = ( elem.nodeName || "" ).toLowerCase();
- if ( nodeName === "input" ) {
- fixDefaultChecked( elem );
- // Skip scripts, get other children
- } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
- jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
- }
-}
-
-// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
-function shimCloneNode( elem ) {
- var div = document.createElement( "div" );
- safeFragment.appendChild( div );
-
- div.innerHTML = elem.outerHTML;
- return div.firstChild;
-}
-
-jQuery.extend({
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
- var srcElements,
- destElements,
- i,
- // IE<=8 does not properly clone detached, unknown element nodes
- clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
- elem.cloneNode( true ) :
- shimCloneNode( elem );
-
- if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
- (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
- // IE copies events bound via attachEvent when using cloneNode.
- // Calling detachEvent on the clone will also remove the events
- // from the original. In order to get around this, we use some
- // proprietary methods to clear the events. Thanks to MooTools
- // guys for this hotness.
-
- cloneFixAttributes( elem, clone );
-
- // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
- srcElements = getAll( elem );
- destElements = getAll( clone );
-
- // Weird iteration because IE will replace the length property
- // with an element if you are cloning the body and one of the
- // elements on the page has a name or id of "length"
- for ( i = 0; srcElements[i]; ++i ) {
- // Ensure that the destination node is not null; Fixes #9587
- if ( destElements[i] ) {
- cloneFixAttributes( srcElements[i], destElements[i] );
- }
- }
- }
-
- // Copy the events from the original to the clone
- if ( dataAndEvents ) {
- cloneCopyEvent( elem, clone );
-
- if ( deepDataAndEvents ) {
- srcElements = getAll( elem );
- destElements = getAll( clone );
-
- for ( i = 0; srcElements[i]; ++i ) {
- cloneCopyEvent( srcElements[i], destElements[i] );
- }
- }
- }
-
- srcElements = destElements = null;
-
- // Return the cloned set
- return clone;
- },
-
- clean: function( elems, context, fragment, scripts ) {
- var checkScriptType, script, j,
- ret = [];
-
- context = context || document;
-
- // !context.createElement fails in IE with an error but returns typeof 'object'
- if ( typeof context.createElement === "undefined" ) {
- context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
- }
-
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
- if ( typeof elem === "number" ) {
- elem += "";
- }
-
- if ( !elem ) {
- continue;
- }
-
- // Convert html string into DOM nodes
- if ( typeof elem === "string" ) {
- if ( !rhtml.test( elem ) ) {
- elem = context.createTextNode( elem );
- } else {
- // Fix "XHTML"-style tags in all browsers
- elem = elem.replace(rxhtmlTag, "<$1></$2>");
-
- // Trim whitespace, otherwise indexOf won't work as expected
- var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
- wrap = wrapMap[ tag ] || wrapMap._default,
- depth = wrap[0],
- div = context.createElement("div"),
- safeChildNodes = safeFragment.childNodes,
- remove;
-
- // Append wrapper element to unknown element safe doc fragment
- if ( context === document ) {
- // Use the fragment we've already created for this document
- safeFragment.appendChild( div );
- } else {
- // Use a fragment created with the owner document
- createSafeFragment( context ).appendChild( div );
- }
-
- // Go to html and back, then peel off extra wrappers
- div.innerHTML = wrap[1] + elem + wrap[2];
-
- // Move to the right depth
- while ( depth-- ) {
- div = div.lastChild;
- }
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( !jQuery.support.tbody ) {
-
- // String was a <table>, *may* have spurious <tbody>
- var hasBody = rtbody.test(elem),
- tbody = tag === "table" && !hasBody ?
- div.firstChild && div.firstChild.childNodes :
-
- // String was a bare <thead> or <tfoot>
- wrap[1] === "<table>" && !hasBody ?
- div.childNodes :
- [];
-
- for ( j = tbody.length - 1; j >= 0 ; --j ) {
- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
- tbody[ j ].parentNode.removeChild( tbody[ j ] );
- }
- }
- }
-
- // IE completely kills leading whitespace when innerHTML is used
- if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
- div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
- }
-
- elem = div.childNodes;
-
- // Clear elements from DocumentFragment (safeFragment or otherwise)
- // to avoid hoarding elements. Fixes #11356
- if ( div ) {
- div.parentNode.removeChild( div );
-
- // Guard against -1 index exceptions in FF3.6
- if ( safeChildNodes.length > 0 ) {
- remove = safeChildNodes[ safeChildNodes.length - 1 ];
-
- if ( remove && remove.parentNode ) {
- remove.parentNode.removeChild( remove );
- }
- }
- }
- }
- }
-
- // Resets defaultChecked for any radios and checkboxes
- // about to be appended to the DOM in IE 6/7 (#8060)
- var len;
- if ( !jQuery.support.appendChecked ) {
- if ( elem[0] && typeof (len = elem.length) === "number" ) {
- for ( j = 0; j < len; j++ ) {
- findInputs( elem[j] );
- }
- } else {
- findInputs( elem );
- }
- }
-
- if ( elem.nodeType ) {
- ret.push( elem );
- } else {
- ret = jQuery.merge( ret, elem );
- }
- }
-
- if ( fragment ) {
- checkScriptType = function( elem ) {
- return !elem.type || rscriptType.test( elem.type );
- };
- for ( i = 0; ret[i]; i++ ) {
- script = ret[i];
- if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
- scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
-
- } else {
- if ( script.nodeType === 1 ) {
- var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
-
- ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
- }
- fragment.appendChild( script );
- }
- }
- }
-
- return ret;
- },
-
- cleanData: function( elems ) {
- var data, id,
- cache = jQuery.cache,
- special = jQuery.event.special,
- deleteExpando = jQuery.support.deleteExpando;
-
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
- if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
- continue;
- }
-
- id = elem[ jQuery.expando ];
-
- if ( id ) {
- data = cache[ id ];
-
- if ( data && data.events ) {
- for ( var 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 );
- }
- }
-
- // Null the DOM reference to avoid IE6/7/8 leak (#7054)
- if ( data.handle ) {
- data.handle.elem = null;
- }
- }
-
- if ( deleteExpando ) {
- delete elem[ jQuery.expando ];
-
- } else if ( elem.removeAttribute ) {
- elem.removeAttribute( jQuery.expando );
- }
-
- delete cache[ id ];
- }
- }
- }
-});
-
-
-
-
-var ralpha = /alpha\([^)]*\)/i,
- ropacity = /opacity=([^)]*)/,
- // fixed for IE9, see #8346
- rupper = /([A-Z]|^ms)/g,
- rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
- rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
- rrelNum = /^([\-+])=([\-+.\de]+)/,
- rmargin = /^margin/,
-
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-
- // order is important!
- cssExpand = [ "Top", "Right", "Bottom", "Left" ],
-
- curCSS,
-
- getComputedStyle,
- currentStyle;
-
-jQuery.fn.css = function( name, value ) {
- return jQuery.access( this, function( elem, name, value ) {
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- }, name, value, arguments.length > 1 );
-};
-
-jQuery.extend({
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function( elem, computed ) {
- if ( computed ) {
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity" );
- return ret === "" ? "1" : ret;
-
- } else {
- return elem.style.opacity;
- }
- }
- }
- },
-
- // Exclude the following css properties to add px
- cssNumber: {
- "fillOpacity": true,
- "fontWeight": true,
- "lineHeight": true,
- "opacity": true,
- "orphans": true,
- "widows": true,
- "zIndex": true,
- "zoom": true
- },
-
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {
- // normalize float css property
- "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
- },
-
- // Get and set the style property on a DOM Node
- style: function( elem, name, value, extra ) {
- // Don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
- return;
- }
-
- // Make sure that we're working with the right name
- var ret, type, origName = jQuery.camelCase( name ),
- style = elem.style, hooks = jQuery.cssHooks[ origName ];
-
- name = jQuery.cssProps[ origName ] || origName;
-
- // Check if we're setting a value
- if ( value !== undefined ) {
- type = typeof value;
-
- // convert relative number strings (+= or -=) to relative numbers. #7345
- if ( type === "string" && (ret = rrelNum.exec( value )) ) {
- value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
- // Fixes bug #9237
- type = "number";
- }
-
- // Make sure that NaN and null values aren't set. See: #7116
- if ( value == null || type === "number" && isNaN( value ) ) {
- return;
- }
-
- // If a number was passed in, add 'px' to the (except for certain CSS properties)
- if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
- value += "px";
- }
-
- // If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
- // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
- // Fixes bug #5509
- try {
- style[ name ] = value;
- } catch(e) {}
- }
-
- } else {
- // If a hook was provided get the non-computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
- return ret;
- }
-
- // Otherwise just get the value from the style object
- return style[ name ];
- }
- },
-
- css: function( elem, name, extra ) {
- var ret, hooks;
-
- // Make sure that we're working with the right name
- name = jQuery.camelCase( name );
- hooks = jQuery.cssHooks[ name ];
- name = jQuery.cssProps[ name ] || name;
-
- // cssFloat needs a special treatment
- if ( name === "cssFloat" ) {
- name = "float";
- }
-
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
- return ret;
-
- // Otherwise, if a way to get the computed value exists, use that
- } else if ( curCSS ) {
- return curCSS( elem, name );
- }
- },
-
- // A method for quickly swapping in/out CSS properties to get correct calculations
- swap: function( elem, options, callback ) {
- var old = {},
- ret, name;
-
- // Remember the old values, and insert the new ones
- for ( name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- ret = callback.call( elem );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
-
- return ret;
- }
-});
-
-// DEPRECATED in 1.3, Use jQuery.css() instead
-jQuery.curCSS = jQuery.css;
-
-if ( document.defaultView && document.defaultView.getComputedStyle ) {
- getComputedStyle = function( elem, name ) {
- var ret, defaultView, computedStyle, width,
- style = elem.style;
-
- name = name.replace( rupper, "-$1" ).toLowerCase();
-
- if ( (defaultView = elem.ownerDocument.defaultView) &&
- (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
-
- ret = computedStyle.getPropertyValue( name );
- if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
- ret = jQuery.style( elem, name );
- }
- }
-
- // A tribute to the "awesome hack by Dean Edwards"
- // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
- // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
- if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
- width = style.width;
- style.width = ret;
- ret = computedStyle.width;
- style.width = width;
- }
-
- return ret;
- };
-}
-
-if ( document.documentElement.currentStyle ) {
- currentStyle = function( elem, name ) {
- var left, rsLeft, uncomputed,
- ret = elem.currentStyle && elem.currentStyle[ name ],
- style = elem.style;
-
- // Avoid setting ret to empty string here
- // so we don't default to auto
- if ( ret == null && style && (uncomputed = style[ name ]) ) {
- ret = uncomputed;
- }
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- if ( rnumnonpx.test( ret ) ) {
-
- // Remember the original values
- left = style.left;
- rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
-
- // Put in the new values to get a computed value out
- if ( rsLeft ) {
- elem.runtimeStyle.left = elem.currentStyle.left;
- }
- style.left = name === "fontSize" ? "1em" : ret;
- ret = style.pixelLeft + "px";
-
- // Revert the changed values
- style.left = left;
- if ( rsLeft ) {
- elem.runtimeStyle.left = rsLeft;
- }
- }
-
- return ret === "" ? "auto" : ret;
- };
-}
-
-curCSS = getComputedStyle || currentStyle;
-
-function getWidthOrHeight( elem, name, extra ) {
-
- // Start with offset property
- var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
- i = name === "width" ? 1 : 0,
- len = 4;
-
- if ( val > 0 ) {
- if ( extra !== "border" ) {
- for ( ; i < len; i += 2 ) {
- if ( !extra ) {
- val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
- }
- if ( extra === "margin" ) {
- val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
- } else {
- val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
- }
- }
- }
-
- return val + "px";
- }
-
- // Fall back to computed then uncomputed css if necessary
- val = curCSS( elem, name );
- if ( val < 0 || val == null ) {
- val = elem.style[ name ];
- }
-
- // Computed unit is not pixels. Stop here and return.
- if ( rnumnonpx.test(val) ) {
- return val;
- }
-
- // Normalize "", auto, and prepare for extra
- val = parseFloat( val ) || 0;
-
- // Add padding, border, margin
- if ( extra ) {
- for ( ; i < len; i += 2 ) {
- val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
- if ( extra !== "padding" ) {
- val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
- }
- if ( extra === "margin" ) {
- val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
- }
- }
- }
-
- return val + "px";
-}
-
-jQuery.each([ "height", "width" ], function( i, name ) {
- jQuery.cssHooks[ name ] = {
- get: function( elem, computed, extra ) {
- if ( computed ) {
- if ( elem.offsetWidth !== 0 ) {
- return getWidthOrHeight( elem, name, extra );
- } else {
- return jQuery.swap( elem, cssShow, function() {
- return getWidthOrHeight( elem, name, extra );
- });
- }
- }
- },
-
- set: function( elem, value ) {
- return rnum.test( value ) ?
- value + "px" :
- value;
- }
- };
-});
-
-if ( !jQuery.support.opacity ) {
- jQuery.cssHooks.opacity = {
- get: function( elem, computed ) {
- // IE uses filters for opacity
- return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
- ( parseFloat( RegExp.$1 ) / 100 ) + "" :
- computed ? "1" : "";
- },
-
- set: function( elem, value ) {
- var style = elem.style,
- currentStyle = elem.currentStyle,
- opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
- filter = currentStyle && currentStyle.filter || style.filter || "";
-
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- style.zoom = 1;
-
- // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
- if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
-
- // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
- // if "filter:" is present at all, clearType is disabled, we want to avoid this
- // style.removeAttribute is IE Only, but so apparently is this code path...
- style.removeAttribute( "filter" );
-
- // if there there is no filter style applied in a css rule, we are done
- if ( currentStyle && !currentStyle.filter ) {
- return;
- }
- }
-
- // otherwise, set new filter values
- style.filter = ralpha.test( filter ) ?
- filter.replace( ralpha, opacity ) :
- filter + " " + opacity;
- }
- };
-}
-
-jQuery(function() {
- // This hook cannot be added until DOM ready because the support test
- // for it is not run until after DOM ready
- if ( !jQuery.support.reliableMarginRight ) {
- jQuery.cssHooks.marginRight = {
- get: function( elem, computed ) {
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- // Work around by temporarily setting element display to inline-block
- return jQuery.swap( elem, { "display": "inline-block" }, function() {
- if ( computed ) {
- return curCSS( elem, "margin-right" );
- } else {
- return elem.style.marginRight;
- }
- });
- }
- };
- }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.hidden = function( elem ) {
- var width = elem.offsetWidth,
- height = elem.offsetHeight;
-
- return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
- };
-
- jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
- };
-}
-
-// These hooks are used by animate to expand properties
-jQuery.each({
- margin: "",
- padding: "",
- border: "Width"
-}, function( prefix, suffix ) {
-
- jQuery.cssHooks[ prefix + suffix ] = {
- expand: function( value ) {
- var i,
-
- // assumes a single number if not a string
- parts = typeof value === "string" ? value.split(" ") : [ value ],
- expanded = {};
-
- for ( i = 0; i < 4; i++ ) {
- expanded[ prefix + cssExpand[ i ] + suffix ] =
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
- }
-
- return expanded;
- }
- };
-});
-
-
-
-
-var r20 = /%20/g,
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
- rhash = /#.*$/,
- rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
- rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
- // #7653, #8125, #8152: local protocol detection
- rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
- rnoContent = /^(?:GET|HEAD)$/,
- rprotocol = /^\/\//,
- rquery = /\?/,
- rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
- rselectTextarea = /^(?:select|textarea)/i,
- rspacesAjax = /\s+/,
- rts = /([?&])_=[^&]*/,
- rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
-
- // Keep a copy of the old load method
- _load = jQuery.fn.load,
-
- /* Prefilters
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
- * 2) These are called:
- * - BEFORE asking for a transport
- * - AFTER param serialization (s.data is a string if s.processData is true)
- * 3) key is the dataType
- * 4) the catchall symbol "*" can be used
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
- */
- prefilters = {},
-
- /* Transports bindings
- * 1) key is the dataType
- * 2) the catchall symbol "*" can be used
- * 3) selection will start with transport dataType and THEN go to "*" if needed
- */
- transports = {},
-
- // Document location
- ajaxLocation,
-
- // Document location segments
- ajaxLocParts,
-
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
- allTypes = ["*/"] + ["*"];
-
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
- ajaxLocation = location.href;
-} catch( e ) {
- // Use the href attribute of an A element
- // since IE will modify it given document.location
- ajaxLocation = document.createElement( "a" );
- ajaxLocation.href = "";
- ajaxLocation = ajaxLocation.href;
-}
-
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
- // dataTypeExpression is optional and defaults to "*"
- return function( dataTypeExpression, func ) {
-
- if ( typeof dataTypeExpression !== "string" ) {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
-
- if ( jQuery.isFunction( func ) ) {
- var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
- i = 0,
- length = dataTypes.length,
- dataType,
- list,
- placeBefore;
-
- // For each dataType in the dataTypeExpression
- for ( ; i < length; i++ ) {
- dataType = dataTypes[ i ];
- // We control if we're asked to add before
- // any existing element
- placeBefore = /^\+/.test( dataType );
- if ( placeBefore ) {
- dataType = dataType.substr( 1 ) || "*";
- }
- list = structure[ dataType ] = structure[ dataType ] || [];
- // then we add to the structure accordingly
- list[ placeBefore ? "unshift" : "push" ]( func );
- }
- }
- };
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
- dataType /* internal */, inspected /* internal */ ) {
-
- dataType = dataType || options.dataTypes[ 0 ];
- inspected = inspected || {};
-
- inspected[ dataType ] = true;
-
- var list = structure[ dataType ],
- i = 0,
- length = list ? list.length : 0,
- executeOnly = ( structure === prefilters ),
- selection;
-
- for ( ; i < length && ( executeOnly || !selection ); i++ ) {
- selection = list[ i ]( options, originalOptions, jqXHR );
- // If we got redirected to another dataType
- // we try there if executing only and not done already
- if ( typeof selection === "string" ) {
- if ( !executeOnly || inspected[ selection ] ) {
- selection = undefined;
- } else {
- options.dataTypes.unshift( selection );
- selection = inspectPrefiltersOrTransports(
- structure, options, originalOptions, jqXHR, selection, inspected );
- }
- }
- }
- // If we're only executing or nothing was selected
- // we try the catchall dataType if not done already
- if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
- selection = inspectPrefiltersOrTransports(
- structure, options, originalOptions, jqXHR, "*", inspected );
- }
- // unnecessary when only executing (prefilters)
- // but it'll be ignored by the caller in that case
- return selection;
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
- var key, deep,
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
- for ( key in src ) {
- if ( src[ key ] !== undefined ) {
- ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
- }
- }
- if ( deep ) {
- jQuery.extend( true, target, deep );
- }
-}
-
-jQuery.fn.extend({
- load: function( url, params, callback ) {
- if ( typeof url !== "string" && _load ) {
- return _load.apply( this, arguments );
-
- // Don't do a request if no elements are being requested
- } else if ( !this.length ) {
- return this;
- }
-
- var off = url.indexOf( " " );
- if ( off >= 0 ) {
- var selector = url.slice( off, url.length );
- url = url.slice( 0, off );
- }
-
- // Default to a GET request
- var type = "GET";
-
- // If the second parameter was provided
- if ( params ) {
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
- // We assume that it's the callback
- callback = params;
- params = undefined;
-
- // Otherwise, build a param string
- } else if ( typeof params === "object" ) {
- params = jQuery.param( params, jQuery.ajaxSettings.traditional );
- type = "POST";
- }
- }
-
- var self = this;
-
- // Request the remote document
- jQuery.ajax({
- url: url,
- type: type,
- dataType: "html",
- data: params,
- // Complete callback (responseText is used internally)
- complete: function( jqXHR, status, responseText ) {
- // Store the response as specified by the jqXHR object
- responseText = jqXHR.responseText;
- // If successful, inject the HTML into all the matched elements
- if ( jqXHR.isResolved() ) {
- // #4825: Get the actual response in case
- // a dataFilter is present in ajaxSettings
- jqXHR.done(function( r ) {
- responseText = r;
- });
- // See if a selector was specified
- self.html( selector ?
- // Create a dummy div to hold the results
- jQuery("<div>")
- // inject the contents of the document in, removing the scripts
- // to avoid any 'Permission Denied' errors in IE
- .append(responseText.replace(rscript, ""))
-
- // Locate the specified elements
- .find(selector) :
-
- // If not, just inject the full result
- responseText );
- }
-
- if ( callback ) {
- self.each( callback, [ responseText, status, jqXHR ] );
- }
- }
- });
-
- return this;
- },
-
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
-
- serializeArray: function() {
- return this.map(function(){
- return this.elements ? jQuery.makeArray( this.elements ) : this;
- })
- .filter(function(){
- return this.name && !this.disabled &&
- ( this.checked || rselectTextarea.test( this.nodeName ) ||
- rinput.test( this.type ) );
- })
- .map(function( i, elem ){
- var val = jQuery( this ).val();
-
- return val == null ?
- null :
- jQuery.isArray( val ) ?
- jQuery.map( val, function( val, i ){
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }) :
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }).get();
- }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
- jQuery.fn[ o ] = function( f ){
- return this.on( o, f );
- };
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
- jQuery[ method ] = function( url, data, callback, type ) {
- // shift arguments if data argument was omitted
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
-
- return jQuery.ajax({
- type: method,
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- };
-});
-
-jQuery.extend({
-
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- },
-
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function( target, settings ) {
- if ( settings ) {
- // Building a settings object
- ajaxExtend( target, jQuery.ajaxSettings );
- } else {
- // Extending ajaxSettings
- settings = target;
- target = jQuery.ajaxSettings;
- }
- ajaxExtend( target, settings );
- return target;
- },
-
- ajaxSettings: {
- url: ajaxLocation,
- isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
- global: true,
- type: "GET",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- processData: true,
- async: true,
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- traditional: false,
- headers: {},
- */
-
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- text: "text/plain",
- json: "application/json, text/javascript",
- "*": allTypes
- },
-
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
-
- responseFields: {
- xml: "responseXML",
- text: "responseText"
- },
-
- // List of data converters
- // 1) key format is "source_type destination_type" (a single space in-between)
- // 2) the catchall symbol "*" can be used for source_type
- converters: {
-
- // Convert anything to text
- "* text": window.String,
-
- // Text to html (true = no transformation)
- "text html": true,
-
- // Evaluate text as a json expression
- "text json": jQuery.parseJSON,
-
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
-
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- context: true,
- url: true
- }
- },
-
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
-
- // Main method
- ajax: function( url, options ) {
-
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
-
- // Force options to be an object
- options = options || {};
-
- var // Create the final options object
- s = jQuery.ajaxSetup( {}, options ),
- // Callbacks context
- callbackContext = s.context || s,
- // Context for global events
- // It's the callbackContext if one was provided in the options
- // and if it's a DOM node or a jQuery collection
- globalEventContext = callbackContext !== s &&
- ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
- jQuery( callbackContext ) : jQuery.event,
- // Deferreds
- deferred = jQuery.Deferred(),
- completeDeferred = jQuery.Callbacks( "once memory" ),
- // Status-dependent callbacks
- statusCode = s.statusCode || {},
- // ifModified key
- ifModifiedKey,
- // Headers (they are sent all at once)
- requestHeaders = {},
- requestHeadersNames = {},
- // Response headers
- responseHeadersString,
- responseHeaders,
- // transport
- transport,
- // timeout handle
- timeoutTimer,
- // Cross-domain detection vars
- parts,
- // The jqXHR state
- state = 0,
- // To know if global events are to be dispatched
- fireGlobals,
- // Loop variable
- i,
- // Fake xhr
- jqXHR = {
-
- readyState: 0,
-
- // Caches the header
- setRequestHeader: function( name, value ) {
- if ( !state ) {
- var lname = name.toLowerCase();
- name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
- requestHeaders[ name ] = value;
- }
- return this;
- },
-
- // Raw string
- getAllResponseHeaders: function() {
- return state === 2 ? responseHeadersString : null;
- },
-
- // Builds headers hashtable if needed
- getResponseHeader: function( key ) {
- var match;
- if ( state === 2 ) {
- if ( !responseHeaders ) {
- responseHeaders = {};
- while( ( match = rheaders.exec( responseHeadersString ) ) ) {
- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
- }
- }
- match = responseHeaders[ key.toLowerCase() ];
- }
- return match === undefined ? null : match;
- },
-
- // Overrides response content-type header
- overrideMimeType: function( type ) {
- if ( !state ) {
- s.mimeType = type;
- }
- return this;
- },
-
- // Cancel the request
- abort: function( statusText ) {
- statusText = statusText || "abort";
- if ( transport ) {
- transport.abort( statusText );
- }
- done( 0, statusText );
- return this;
- }
- };
-
- // Callback for when everything is done
- // It is defined here because jslint complains if it is declared
- // at the end of the function (which would be more logical and readable)
- function done( status, nativeStatusText, responses, headers ) {
-
- // Called once
- if ( state === 2 ) {
- return;
- }
-
- // State is "done" now
- state = 2;
-
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- clearTimeout( timeoutTimer );
- }
-
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
-
- // Cache response headers
- responseHeadersString = headers || "";
-
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
-
- var isSuccess,
- success,
- error,
- statusText = nativeStatusText,
- response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
- lastModified,
- etag;
-
- // If successful, handle type chaining
- if ( status >= 200 && status < 300 || status === 304 ) {
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
-
- if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
- jQuery.lastModified[ ifModifiedKey ] = lastModified;
- }
- if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
- jQuery.etag[ ifModifiedKey ] = etag;
- }
- }
-
- // If not modified
- if ( status === 304 ) {
-
- statusText = "notmodified";
- isSuccess = true;
-
- // If we have data
- } else {
-
- try {
- success = ajaxConvert( s, response );
- statusText = "success";
- isSuccess = true;
- } catch(e) {
- // We have a parsererror
- statusText = "parsererror";
- error = e;
- }
- }
- } else {
- // We extract error from statusText
- // then normalize statusText and status for non-aborts
- error = statusText;
- if ( !statusText || status ) {
- statusText = "error";
- if ( status < 0 ) {
- status = 0;
- }
- }
- }
-
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = "" + ( nativeStatusText || statusText );
-
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
-
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
- [ jqXHR, s, isSuccess ? success : error ] );
- }
-
- // Complete
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
- // Handle the global AJAX counter
- if ( !( --jQuery.active ) ) {
- jQuery.event.trigger( "ajaxStop" );
- }
- }
- }
-
- // Attach deferreds
- deferred.promise( jqXHR );
- jqXHR.success = jqXHR.done;
- jqXHR.error = jqXHR.fail;
- jqXHR.complete = completeDeferred.add;
-
- // Status-dependent callbacks
- jqXHR.statusCode = function( map ) {
- if ( map ) {
- var tmp;
- if ( state < 2 ) {
- for ( tmp in map ) {
- statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
- }
- } else {
- tmp = map[ jqXHR.status ];
- jqXHR.then( tmp, tmp );
- }
- }
- return this;
- };
-
- // Remove hash character (#7531: and string promotion)
- // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
- // We also use the url parameter if available
- s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
- // Extract dataTypes list
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
-
- // Determine if a cross-domain request is in order
- if ( s.crossDomain == null ) {
- parts = rurl.exec( s.url.toLowerCase() );
- s.crossDomain = !!( parts &&
- ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
- );
- }
-
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
- // If request was aborted inside a prefilter, stop there
- if ( state === 2 ) {
- return false;
- }
-
- // We can fire global events as of now if asked to
- fireGlobals = s.global;
-
- // Uppercase the type
- s.type = s.type.toUpperCase();
-
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
-
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger( "ajaxStart" );
- }
-
- // More options handling for requests with no content
- if ( !s.hasContent ) {
-
- // If data is available, append data to url
- if ( s.data ) {
- s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
- // #9682: remove data so that it's not used in an eventual retry
- delete s.data;
- }
-
- // Get ifModifiedKey before adding the anti-cache parameter
- ifModifiedKey = s.url;
-
- // Add anti-cache in url if needed
- if ( s.cache === false ) {
-
- var ts = jQuery.now(),
- // try replacing _= if it is there
- ret = s.url.replace( rts, "$1_=" + ts );
-
- // if nothing was replaced, add timestamp to the end
- s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
- }
- }
-
- // Set the correct header, if data is being sent
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- ifModifiedKey = ifModifiedKey || s.url;
- if ( jQuery.lastModified[ ifModifiedKey ] ) {
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
- }
- if ( jQuery.etag[ ifModifiedKey ] ) {
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
- }
- }
-
- // Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
-
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
- // Abort if not done already
- jqXHR.abort();
- return false;
-
- }
-
- // Install callbacks on deferreds
- for ( i in { success: 1, error: 1, complete: 1 } ) {
- jqXHR[ i ]( s[ i ] );
- }
-
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
- // Send global event
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
- }
- // Timeout
- if ( s.async && s.timeout > 0 ) {
- timeoutTimer = setTimeout( function(){
- jqXHR.abort( "timeout" );
- }, s.timeout );
- }
-
- try {
- state = 1;
- transport.send( requestHeaders, done );
- } catch (e) {
- // Propagate exception as error if not done
- if ( state < 2 ) {
- done( -1, e );
- // Simply rethrow otherwise
- } else {
- throw e;
- }
- }
- }
-
- return jqXHR;
- },
-
- // Serialize an array of form elements or a set of
- // key/values into a query string
- param: function( a, traditional ) {
- var s = [],
- add = function( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction( value ) ? value() : value;
- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
- };
-
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings.traditional;
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
-
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( var prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join( "&" ).replace( r20, "+" );
- }
-});
-
-function buildParams( prefix, obj, traditional, add ) {
- if ( jQuery.isArray( obj ) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
- // If array item is non-scalar (array or object), encode its
- // numeric index to resolve deserialization ambiguity issues.
- // Note that rack (as of 1.0.0) can't currently deserialize
- // nested arrays properly, and attempting to do so may cause
- // a server error. Possible fixes are to modify rack's
- // deserialization algorithm or to provide an option or flag
- // to force array serialization to be shallow.
- buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
- }
- });
-
- } else if ( !traditional && jQuery.type( obj ) === "object" ) {
- // Serialize object item.
- for ( var name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
- }
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
-}
-
-// This is still on the jQuery object... for now
-// Want to move this to jQuery.ajax some day
-jQuery.extend({
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {}
-
-});
-
-/* Handles responses to an ajax request:
- * - sets all responseXXX fields accordingly
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-
- var contents = s.contents,
- dataTypes = s.dataTypes,
- responseFields = s.responseFields,
- ct,
- type,
- finalDataType,
- firstDataType;
-
- // Fill responseXXX fields
- for ( type in responseFields ) {
- if ( type in responses ) {
- jqXHR[ responseFields[type] ] = responses[ type ];
- }
- }
-
- // Remove auto dataType and get content-type in the process
- while( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
- }
- }
-
- // Check if we're dealing with a known content-type
- if ( ct ) {
- for ( type in contents ) {
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
- dataTypes.unshift( type );
- break;
- }
- }
- }
-
- // Check to see if we have a response for the expected dataType
- if ( dataTypes[ 0 ] in responses ) {
- finalDataType = dataTypes[ 0 ];
- } else {
- // Try convertible dataTypes
- for ( type in responses ) {
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
- finalDataType = type;
- break;
- }
- if ( !firstDataType ) {
- firstDataType = type;
- }
- }
- // Or just use first one
- finalDataType = finalDataType || firstDataType;
- }
-
- // If we found a dataType
- // We add the dataType to the list if needed
- // and return the corresponding response
- if ( finalDataType ) {
- if ( finalDataType !== dataTypes[ 0 ] ) {
- dataTypes.unshift( finalDataType );
- }
- return responses[ finalDataType ];
- }
-}
-
-// Chain conversions given the request and the original response
-function ajaxConvert( s, response ) {
-
- // Apply the dataFilter if provided
- if ( s.dataFilter ) {
- response = s.dataFilter( response, s.dataType );
- }
-
- var dataTypes = s.dataTypes,
- converters = {},
- i,
- key,
- length = dataTypes.length,
- tmp,
- // Current and previous dataTypes
- current = dataTypes[ 0 ],
- prev,
- // Conversion expression
- conversion,
- // Conversion function
- conv,
- // Conversion functions (transitive conversion)
- conv1,
- conv2;
-
- // For each dataType in the chain
- for ( i = 1; i < length; i++ ) {
-
- // Create converters map
- // with lowercased keys
- if ( i === 1 ) {
- for ( key in s.converters ) {
- if ( typeof key === "string" ) {
- converters[ key.toLowerCase() ] = s.converters[ key ];
- }
- }
- }
-
- // Get the dataTypes
- prev = current;
- current = dataTypes[ i ];
-
- // If current is auto dataType, update it to prev
- if ( current === "*" ) {
- current = prev;
- // If no auto and dataTypes are actually different
- } else if ( prev !== "*" && prev !== current ) {
-
- // Get the converter
- conversion = prev + " " + current;
- conv = converters[ conversion ] || converters[ "* " + current ];
-
- // If there is no direct converter, search transitively
- if ( !conv ) {
- conv2 = undefined;
- for ( conv1 in converters ) {
- tmp = conv1.split( " " );
- if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
- conv2 = converters[ tmp[1] + " " + current ];
- if ( conv2 ) {
- conv1 = converters[ conv1 ];
- if ( conv1 === true ) {
- conv = conv2;
- } else if ( conv2 === true ) {
- conv = conv1;
- }
- break;
- }
- }
- }
- }
- // If we found no converter, dispatch an error
- if ( !( conv || conv2 ) ) {
- jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
- }
- // If found converter is not an equivalence
- if ( conv !== true ) {
- // Convert with 1 or 2 converters accordingly
- response = conv ? conv( response ) : conv2( conv1(response) );
- }
- }
- }
- return response;
-}
-
-
-
-
-var jsc = jQuery.now(),
- jsre = /(\=)\?(&|$)|\?\?/i;
-
-// Default jsonp settings
-jQuery.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- return jQuery.expando + "_" + ( jsc++ );
- }
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
- var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
-
- if ( s.dataTypes[ 0 ] === "jsonp" ||
- s.jsonp !== false && ( jsre.test( s.url ) ||
- inspectData && jsre.test( s.data ) ) ) {
-
- var responseContainer,
- jsonpCallback = s.jsonpCallback =
- jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
- previous = window[ jsonpCallback ],
- url = s.url,
- data = s.data,
- replace = "$1" + jsonpCallback + "$2";
-
- if ( s.jsonp !== false ) {
- url = url.replace( jsre, replace );
- if ( s.url === url ) {
- if ( inspectData ) {
- data = data.replace( jsre, replace );
- }
- if ( s.data === data ) {
- // Add callback manually
- url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
- }
- }
- }
-
- s.url = url;
- s.data = data;
-
- // Install callback
- window[ jsonpCallback ] = function( response ) {
- responseContainer = [ response ];
- };
-
- // Clean-up function
- jqXHR.always(function() {
- // Set callback back to previous value
- window[ jsonpCallback ] = previous;
- // Call if it was a function and we have a response
- if ( responseContainer && jQuery.isFunction( previous ) ) {
- window[ jsonpCallback ]( responseContainer[ 0 ] );
- }
- });
-
- // Use data converter to retrieve json after script execution
- s.converters["script json"] = function() {
- if ( !responseContainer ) {
- jQuery.error( jsonpCallback + " was not called" );
- }
- return responseContainer[ 0 ];
- };
-
- // force json dataType
- s.dataTypes[ 0 ] = "json";
-
- // Delegate to script
- return "script";
- }
-});
-
-
-
-
-// Install script dataType
-jQuery.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /javascript|ecmascript/
- },
- converters: {
- "text script": function( text ) {
- jQuery.globalEval( text );
- return text;
- }
- }
-});
-
-// Handle cache's special case and global
-jQuery.ajaxPrefilter( "script", function( s ) {
- if ( s.cache === undefined ) {
- s.cache = false;
- }
- if ( s.crossDomain ) {
- s.type = "GET";
- s.global = false;
- }
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
-
- // This transport only deals with cross domain requests
- if ( s.crossDomain ) {
-
- var script,
- head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
-
- return {
-
- send: function( _, callback ) {
-
- script = document.createElement( "script" );
-
- script.async = "async";
-
- if ( s.scriptCharset ) {
- script.charset = s.scriptCharset;
- }
-
- script.src = s.url;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function( _, isAbort ) {
-
- if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
-
- // Remove the script
- if ( head && script.parentNode ) {
- head.removeChild( script );
- }
-
- // Dereference the script
- script = undefined;
-
- // Callback if not abort
- if ( !isAbort ) {
- callback( 200, "success" );
- }
- }
- };
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709 and #4378).
- head.insertBefore( script, head.firstChild );
- },
-
- abort: function() {
- if ( script ) {
- script.onload( 0, 1 );
- }
- }
- };
- }
-});
-
-
-
-
-var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
- xhrOnUnloadAbort = window.ActiveXObject ? function() {
- // Abort all pending requests
- for ( var key in xhrCallbacks ) {
- xhrCallbacks[ key ]( 0, 1 );
- }
- } : false,
- xhrId = 0,
- xhrCallbacks;
-
-// Functions to create xhrs
-function createStandardXHR() {
- try {
- return new window.XMLHttpRequest();
- } catch( e ) {}
-}
-
-function createActiveXHR() {
- try {
- return new window.ActiveXObject( "Microsoft.XMLHTTP" );
- } catch( e ) {}
-}
-
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject ?
- /* Microsoft failed to properly
- * implement the XMLHttpRequest in IE7 (can't request local files),
- * so we use the ActiveXObject when it is available
- * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
- * we need a fallback.
- */
- function() {
- return !this.isLocal && createStandardXHR() || createActiveXHR();
- } :
- // For all other browsers, use the standard XMLHttpRequest object
- createStandardXHR;
-
-// Determine support properties
-(function( xhr ) {
- jQuery.extend( jQuery.support, {
- ajax: !!xhr,
- cors: !!xhr && ( "withCredentials" in xhr )
- });
-})( jQuery.ajaxSettings.xhr() );
-
-// Create transport if the browser can provide an xhr
-if ( jQuery.support.ajax ) {
-
- jQuery.ajaxTransport(function( s ) {
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( !s.crossDomain || jQuery.support.cors ) {
-
- var callback;
-
- return {
- send: function( headers, complete ) {
-
- // Get a new xhr
- var xhr = s.xhr(),
- handle,
- i;
-
- // Open the socket
- // Passing null username, generates a login popup on Opera (#2865)
- if ( s.username ) {
- xhr.open( s.type, s.url, s.async, s.username, s.password );
- } else {
- xhr.open( s.type, s.url, s.async );
- }
-
- // Apply custom fields if provided
- if ( s.xhrFields ) {
- for ( i in s.xhrFields ) {
- xhr[ i ] = s.xhrFields[ i ];
- }
- }
-
- // Override mime type if needed
- if ( s.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( s.mimeType );
- }
-
- // X-Requested-With header
- // For cross-domain requests, seeing as conditions for a preflight are
- // akin to a jigsaw puzzle, we simply never set it to be sure.
- // (it can always be set on a per-request basis or even using ajaxSetup)
- // For same-domain requests, won't change header if already provided.
- if ( !s.crossDomain && !headers["X-Requested-With"] ) {
- headers[ "X-Requested-With" ] = "XMLHttpRequest";
- }
-
- // Need an extra try/catch for cross domain requests in Firefox 3
- try {
- for ( i in headers ) {
- xhr.setRequestHeader( i, headers[ i ] );
- }
- } catch( _ ) {}
-
- // Do send the request
- // This may raise an exception which is actually
- // handled in jQuery.ajax (so no try/catch here)
- xhr.send( ( s.hasContent && s.data ) || null );
-
- // Listener
- callback = function( _, isAbort ) {
-
- var status,
- statusText,
- responseHeaders,
- responses,
- xml;
-
- // Firefox throws exceptions when accessing properties
- // of an xhr when a network error occured
- // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
- try {
-
- // Was never called and is aborted or complete
- if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
-
- // Only called once
- callback = undefined;
-
- // Do not keep as active anymore
- if ( handle ) {
- xhr.onreadystatechange = jQuery.noop;
- if ( xhrOnUnloadAbort ) {
- delete xhrCallbacks[ handle ];
- }
- }
-
- // If it's an abort
- if ( isAbort ) {
- // Abort it manually if needed
- if ( xhr.readyState !== 4 ) {
- xhr.abort();
- }
- } else {
- status = xhr.status;
- responseHeaders = xhr.getAllResponseHeaders();
- responses = {};
- xml = xhr.responseXML;
-
- // Construct response list
- if ( xml && xml.documentElement /* #4958 */ ) {
- responses.xml = xml;
- }
-
- // When requesting binary data, IE6-9 will throw an exception
- // on any attempt to access responseText (#11426)
- try {
- responses.text = xhr.responseText;
- } catch( _ ) {
- }
-
- // Firefox throws an exception when accessing
- // statusText for faulty cross-domain requests
- try {
- statusText = xhr.statusText;
- } catch( e ) {
- // We normalize with Webkit giving an empty statusText
- statusText = "";
- }
-
- // Filter status for non standard behaviors
-
- // If the request is local and we have data: assume a success
- // (success with no data won't get notified, that's the best we
- // can do given current implementations)
- if ( !status && s.isLocal && !s.crossDomain ) {
- status = responses.text ? 200 : 404;
- // IE - #1450: sometimes returns 1223 when it should be 204
- } else if ( status === 1223 ) {
- status = 204;
- }
- }
- }
- } catch( firefoxAccessException ) {
- if ( !isAbort ) {
- complete( -1, firefoxAccessException );
- }
- }
-
- // Call complete if needed
- if ( responses ) {
- complete( status, statusText, responses, responseHeaders );
- }
- };
-
- // if we're in sync mode or it's in cache
- // and has been retrieved directly (IE6 & IE7)
- // we need to manually fire the callback
- if ( !s.async || xhr.readyState === 4 ) {
- callback();
- } else {
- handle = ++xhrId;
- if ( xhrOnUnloadAbort ) {
- // Create the active xhrs callbacks list if needed
- // and attach the unload handler
- if ( !xhrCallbacks ) {
- xhrCallbacks = {};
- jQuery( window ).unload( xhrOnUnloadAbort );
- }
- // Add to list of active xhrs callbacks
- xhrCallbacks[ handle ] = callback;
- }
- xhr.onreadystatechange = callback;
- }
- },
-
- abort: function() {
- if ( callback ) {
- callback(0,1);
- }
- }
- };
- }
- });
-}
-
-
-
-
-var elemdisplay = {},
- iframe, iframeDoc,
- rfxtypes = /^(?:toggle|show|hide)$/,
- rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
- timerId,
- fxAttrs = [
- // height animations
- [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
- // width animations
- [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
- // opacity animations
- [ "opacity" ]
- ],
- fxNow;
-
-jQuery.fn.extend({
- show: function( speed, easing, callback ) {
- var elem, display;
-
- if ( speed || speed === 0 ) {
- return this.animate( genFx("show", 3), speed, easing, callback );
-
- } else {
- for ( var i = 0, j = this.length; i < j; i++ ) {
- elem = this[ i ];
-
- if ( elem.style ) {
- display = elem.style.display;
-
- // Reset the inline display of this element to learn if it is
- // being hidden by cascaded rules or not
- if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
- display = elem.style.display = "";
- }
-
- // Set elements which have been overridden with display: none
- // in a stylesheet to whatever the default browser style is
- // for such an element
- if ( (display === "" && jQuery.css(elem, "display") === "none") ||
- !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
- jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
- }
- }
- }
-
- // Set the display of most of the elements in a second loop
- // to avoid the constant reflow
- for ( i = 0; i < j; i++ ) {
- elem = this[ i ];
-
- if ( elem.style ) {
- display = elem.style.display;
-
- if ( display === "" || display === "none" ) {
- elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
- }
- }
- }
-
- return this;
- }
- },
-
- hide: function( speed, easing, callback ) {
- if ( speed || speed === 0 ) {
- return this.animate( genFx("hide", 3), speed, easing, callback);
-
- } else {
- var elem, display,
- i = 0,
- j = this.length;
-
- for ( ; i < j; i++ ) {
- elem = this[i];
- if ( elem.style ) {
- display = jQuery.css( elem, "display" );
-
- if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
- jQuery._data( elem, "olddisplay", display );
- }
- }
- }
-
- // Set the display of the elements in a second loop
- // to avoid the constant reflow
- for ( i = 0; i < j; i++ ) {
- if ( this[i].style ) {
- this[i].style.display = "none";
- }
- }
-
- return this;
- }
- },
-
- // Save the old toggle function
- _toggle: jQuery.fn.toggle,
-
- toggle: function( fn, fn2, callback ) {
- var bool = typeof fn === "boolean";
-
- if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
- this._toggle.apply( this, arguments );
-
- } else if ( fn == null || bool ) {
- this.each(function() {
- var state = bool ? fn : jQuery(this).is(":hidden");
- jQuery(this)[ state ? "show" : "hide" ]();
- });
-
- } else {
- this.animate(genFx("toggle", 3), fn, fn2, callback);
- }
-
- return this;
- },
-
- fadeTo: function( speed, to, easing, callback ) {
- return this.filter(":hidden").css("opacity", 0).show().end()
- .animate({opacity: to}, speed, easing, callback);
- },
-
- animate: function( prop, speed, easing, callback ) {
- var optall = jQuery.speed( speed, easing, callback );
-
- if ( jQuery.isEmptyObject( prop ) ) {
- return this.each( optall.complete, [ false ] );
- }
-
- // Do not change referenced properties as per-property easing will be lost
- prop = jQuery.extend( {}, prop );
-
- function doAnimation() {
- // XXX 'this' does not always have a nodeName when running the
- // test suite
-
- if ( optall.queue === false ) {
- jQuery._mark( this );
- }
-
- var opt = jQuery.extend( {}, optall ),
- isElement = this.nodeType === 1,
- hidden = isElement && jQuery(this).is(":hidden"),
- name, val, p, e, hooks, replace,
- parts, start, end, unit,
- method;
-
- // will store per property easing and be used to determine when an animation is complete
- opt.animatedProperties = {};
-
- // first pass over propertys to expand / normalize
- for ( p in prop ) {
- name = jQuery.camelCase( p );
- if ( p !== name ) {
- prop[ name ] = prop[ p ];
- delete prop[ p ];
- }
-
- if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
- replace = hooks.expand( prop[ name ] );
- delete prop[ name ];
-
- // not quite $.extend, this wont overwrite keys already present.
- // also - reusing 'p' from above because we have the correct "name"
- for ( p in replace ) {
- if ( ! ( p in prop ) ) {
- prop[ p ] = replace[ p ];
- }
- }
- }
- }
-
- for ( name in prop ) {
- val = prop[ name ];
- // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
- if ( jQuery.isArray( val ) ) {
- opt.animatedProperties[ name ] = val[ 1 ];
- val = prop[ name ] = val[ 0 ];
- } else {
- opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
- }
-
- if ( val === "hide" && hidden || val === "show" && !hidden ) {
- return opt.complete.call( this );
- }
-
- if ( isElement && ( name === "height" || name === "width" ) ) {
- // Make sure that nothing sneaks out
- // Record all 3 overflow attributes because IE does not
- // change the overflow attribute when overflowX and
- // overflowY are set to the same value
- opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
-
- // Set display property to inline-block for height/width
- // animations on inline elements that are having width/height animated
- if ( jQuery.css( this, "display" ) === "inline" &&
- jQuery.css( this, "float" ) === "none" ) {
-
- // inline-level elements accept inline-block;
- // block-level elements need to be inline with layout
- if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
- this.style.display = "inline-block";
-
- } else {
- this.style.zoom = 1;
- }
- }
- }
- }
-
- if ( opt.overflow != null ) {
- this.style.overflow = "hidden";
- }
-
- for ( p in prop ) {
- e = new jQuery.fx( this, opt, p );
- val = prop[ p ];
-
- if ( rfxtypes.test( val ) ) {
-
- // Tracks whether to show or hide based on private
- // data attached to the element
- method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
- if ( method ) {
- jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
- e[ method ]();
- } else {
- e[ val ]();
- }
-
- } else {
- parts = rfxnum.exec( val );
- start = e.cur();
-
- if ( parts ) {
- end = parseFloat( parts[2] );
- unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
-
- // We need to compute starting value
- if ( unit !== "px" ) {
- jQuery.style( this, p, (end || 1) + unit);
- start = ( (end || 1) / e.cur() ) * start;
- jQuery.style( this, p, start + unit);
- }
-
- // If a +=/-= token was provided, we're doing a relative animation
- if ( parts[1] ) {
- end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
- }
-
- e.custom( start, end, unit );
-
- } else {
- e.custom( start, val, "" );
- }
- }
- }
-
- // For JS strict compliance
- return true;
- }
-
- return optall.queue === false ?
- this.each( doAnimation ) :
- this.queue( optall.queue, doAnimation );
- },
-
- stop: function( type, clearQueue, gotoEnd ) {
- if ( typeof type !== "string" ) {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = undefined;
- }
- if ( clearQueue && type !== false ) {
- this.queue( type || "fx", [] );
- }
-
- return this.each(function() {
- var index,
- hadTimers = false,
- timers = jQuery.timers,
- data = jQuery._data( this );
-
- // clear marker counters if we know they won't be
- if ( !gotoEnd ) {
- jQuery._unmark( true, this );
- }
-
- function stopQueue( elem, data, index ) {
- var hooks = data[ index ];
- jQuery.removeData( elem, index, true );
- hooks.stop( gotoEnd );
- }
-
- if ( type == null ) {
- for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
- stopQueue( this, data, index );
- }
- }
- } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
- stopQueue( this, data, index );
- }
-
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
- if ( gotoEnd ) {
-
- // force the next step to be the last
- timers[ index ]( true );
- } else {
- timers[ index ].saveState();
- }
- hadTimers = true;
- timers.splice( index, 1 );
- }
- }
-
- // start the next in the queue if the last step wasn't forced
- // timers currently will call their complete callbacks, which will dequeue
- // but only if they were gotoEnd
- if ( !( gotoEnd && hadTimers ) ) {
- jQuery.dequeue( this, type );
- }
- });
- }
-
-});
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
- setTimeout( clearFxNow, 0 );
- return ( fxNow = jQuery.now() );
-}
-
-function clearFxNow() {
- fxNow = undefined;
-}
-
-// Generate parameters to create a standard animation
-function genFx( type, num ) {
- var obj = {};
-
- jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
- obj[ this ] = type;
- });
-
- return obj;
-}
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx( "show", 1 ),
- slideUp: genFx( "hide", 1 ),
- slideToggle: genFx( "toggle", 1 ),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
-});
-
-jQuery.extend({
- speed: function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
- // normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function( noUnmark ) {
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- } else if ( noUnmark !== false ) {
- jQuery._unmark( this );
- }
- };
-
- return opt;
- },
-
- easing: {
- linear: function( p ) {
- return p;
- },
- swing: function( p ) {
- return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
- }
- },
-
- timers: [],
-
- fx: function( elem, options, prop ) {
- this.options = options;
- this.elem = elem;
- this.prop = prop;
-
- options.orig = options.orig || {};
- }
-
-});
-
-jQuery.fx.prototype = {
- // Simple function for setting a style value
- update: function() {
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
- },
-
- // Get the current size
- cur: function() {
- if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
- return this.elem[ this.prop ];
- }
-
- var parsed,
- r = jQuery.css( this.elem, this.prop );
- // Empty strings, null, undefined and "auto" are converted to 0,
- // complex values such as "rotate(1rad)" are returned as is,
- // simple values such as "10px" are parsed to Float.
- return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
- },
-
- // Start an animation from one number to another
- custom: function( from, to, unit ) {
- var self = this,
- fx = jQuery.fx;
-
- this.startTime = fxNow || createFxNow();
- this.end = to;
- this.now = this.start = from;
- this.pos = this.state = 0;
- this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
-
- function t( gotoEnd ) {
- return self.step( gotoEnd );
- }
-
- t.queue = this.options.queue;
- t.elem = this.elem;
- t.saveState = function() {
- if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
- if ( self.options.hide ) {
- jQuery._data( self.elem, "fxshow" + self.prop, self.start );
- } else if ( self.options.show ) {
- jQuery._data( self.elem, "fxshow" + self.prop, self.end );
- }
- }
- };
-
- if ( t() && jQuery.timers.push(t) && !timerId ) {
- timerId = setInterval( fx.tick, fx.interval );
- }
- },
-
- // Simple 'show' function
- show: function() {
- var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
-
- // Remember where we started, so that we can go back to it later
- this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
- this.options.show = true;
-
- // Begin the animation
- // Make sure that we start at a small width/height to avoid any flash of content
- if ( dataShow !== undefined ) {
- // This show is picking up where a previous hide or show left off
- this.custom( this.cur(), dataShow );
- } else {
- this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
- }
-
- // Start by showing the element
- jQuery( this.elem ).show();
- },
-
- // Simple 'hide' function
- hide: function() {
- // Remember where we started, so that we can go back to it later
- this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
- this.options.hide = true;
-
- // Begin the animation
- this.custom( this.cur(), 0 );
- },
-
- // Each step of an animation
- step: function( gotoEnd ) {
- var p, n, complete,
- t = fxNow || createFxNow(),
- done = true,
- elem = this.elem,
- options = this.options;
-
- if ( gotoEnd || t >= options.duration + this.startTime ) {
- this.now = this.end;
- this.pos = this.state = 1;
- this.update();
-
- options.animatedProperties[ this.prop ] = true;
-
- for ( p in options.animatedProperties ) {
- if ( options.animatedProperties[ p ] !== true ) {
- done = false;
- }
- }
-
- if ( done ) {
- // Reset the overflow
- if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
-
- jQuery.each( [ "", "X", "Y" ], function( index, value ) {
- elem.style[ "overflow" + value ] = options.overflow[ index ];
- });
- }
-
- // Hide the element if the "hide" operation was done
- if ( options.hide ) {
- jQuery( elem ).hide();
- }
-
- // Reset the properties, if the item has been hidden or shown
- if ( options.hide || options.show ) {
- for ( p in options.animatedProperties ) {
- jQuery.style( elem, p, options.orig[ p ] );
- jQuery.removeData( elem, "fxshow" + p, true );
- // Toggle data is no longer needed
- jQuery.removeData( elem, "toggle" + p, true );
- }
- }
-
- // Execute the complete function
- // in the event that the complete function throws an exception
- // we must ensure it won't be called twice. #5684
-
- complete = options.complete;
- if ( complete ) {
-
- options.complete = false;
- complete.call( elem );
- }
- }
-
- return false;
-
- } else {
- // classical easing cannot be used with an Infinity duration
- if ( options.duration == Infinity ) {
- this.now = t;
- } else {
- n = t - this.startTime;
- this.state = n / options.duration;
-
- // Perform the easing function, defaults to swing
- this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
- this.now = this.start + ( (this.end - this.start) * this.pos );
- }
- // Perform the next step of the animation
- this.update();
- }
-
- return true;
- }
-};
-
-jQuery.extend( jQuery.fx, {
- tick: function() {
- var timer,
- timers = jQuery.timers,
- i = 0;
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
- // Checks the timer has not already been removed
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- },
-
- interval: 13,
-
- stop: function() {
- clearInterval( timerId );
- timerId = null;
- },
-
- speeds: {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- },
-
- step: {
- opacity: function( fx ) {
- jQuery.style( fx.elem, "opacity", fx.now );
- },
-
- _default: function( fx ) {
- if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
- fx.elem.style[ fx.prop ] = fx.now + fx.unit;
- } else {
- fx.elem[ fx.prop ] = fx.now;
- }
- }
- }
-});
-
-// Ensure props that can't be negative don't go there on undershoot easing
-jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
- // exclude marginTop, marginLeft, marginBottom and marginRight from this list
- if ( prop.indexOf( "margin" ) ) {
- jQuery.fx.step[ prop ] = function( fx ) {
- jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
- };
- }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.animated = function( elem ) {
- return jQuery.grep(jQuery.timers, function( fn ) {
- return elem === fn.elem;
- }).length;
- };
-}
-
-// Try to restore the default display value of an element
-function defaultDisplay( nodeName ) {
-
- if ( !elemdisplay[ nodeName ] ) {
-
- var body = document.body,
- elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
- display = elem.css( "display" );
- elem.remove();
-
- // If the simple way fails,
- // get element's real default display by attaching it to a temp iframe
- if ( display === "none" || display === "" ) {
- // No iframe to use yet, so create it
- if ( !iframe ) {
- iframe = document.createElement( "iframe" );
- iframe.frameBorder = iframe.width = iframe.height = 0;
- }
-
- body.appendChild( iframe );
-
- // Create a cacheable copy of the iframe document on first call.
- // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
- // document to it; WebKit & Firefox won't allow reusing the iframe document.
- if ( !iframeDoc || !iframe.createElement ) {
- iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
- iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
- iframeDoc.close();
- }
-
- elem = iframeDoc.createElement( nodeName );
-
- iframeDoc.body.appendChild( elem );
-
- display = jQuery.css( elem, "display" );
- body.removeChild( iframe );
- }
-
- // Store the correct default display
- elemdisplay[ nodeName ] = display;
- }
-
- return elemdisplay[ nodeName ];
-}
-
-
-
-
-var getOffset,
- rtable = /^t(?:able|d|h)$/i,
- rroot = /^(?:body|html)$/i;
-
-if ( "getBoundingClientRect" in document.documentElement ) {
- getOffset = function( elem, doc, docElem, box ) {
- try {
- box = elem.getBoundingClientRect();
- } catch(e) {}
-
- // Make sure we're not dealing with a disconnected DOM node
- if ( !box || !jQuery.contains( docElem, elem ) ) {
- return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
- }
-
- var body = doc.body,
- win = getWindow( doc ),
- clientTop = docElem.clientTop || body.clientTop || 0,
- clientLeft = docElem.clientLeft || body.clientLeft || 0,
- scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
- scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
- top = box.top + scrollTop - clientTop,
- left = box.left + scrollLeft - clientLeft;
-
- return { top: top, left: left };
- };
-
-} else {
- getOffset = function( elem, doc, docElem ) {
- var computedStyle,
- offsetParent = elem.offsetParent,
- prevOffsetParent = elem,
- body = doc.body,
- defaultView = doc.defaultView,
- prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
- top = elem.offsetTop,
- left = elem.offsetLeft;
-
- while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
- if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
- break;
- }
-
- computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
- top -= elem.scrollTop;
- left -= elem.scrollLeft;
-
- if ( elem === offsetParent ) {
- top += elem.offsetTop;
- left += elem.offsetLeft;
-
- if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevOffsetParent = offsetParent;
- offsetParent = elem.offsetParent;
- }
-
- if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
- top += parseFloat( computedStyle.borderTopWidth ) || 0;
- left += parseFloat( computedStyle.borderLeftWidth ) || 0;
- }
-
- prevComputedStyle = computedStyle;
- }
-
- if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
- top += body.offsetTop;
- left += body.offsetLeft;
- }
-
- if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
- top += Math.max( docElem.scrollTop, body.scrollTop );
- left += Math.max( docElem.scrollLeft, body.scrollLeft );
- }
-
- return { top: top, left: left };
- };
-}
-
-jQuery.fn.offset = function( options ) {
- if ( arguments.length ) {
- return options === undefined ?
- this :
- this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- var elem = this[0],
- doc = elem && elem.ownerDocument;
-
- if ( !doc ) {
- return null;
- }
-
- if ( elem === doc.body ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- return getOffset( elem, doc, doc.documentElement );
-};
-
-jQuery.offset = {
-
- bodyOffset: function( body ) {
- var top = body.offsetTop,
- left = body.offsetLeft;
-
- if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
- top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
- left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
- }
-
- return { top: top, left: left };
- },
-
- setOffset: function( elem, options, i ) {
- var position = jQuery.css( elem, "position" );
-
- // set position first, in-case top/left are set even on static elem
- if ( position === "static" ) {
- elem.style.position = "relative";
- }
-
- var curElem = jQuery( elem ),
- curOffset = curElem.offset(),
- curCSSTop = jQuery.css( elem, "top" ),
- curCSSLeft = jQuery.css( elem, "left" ),
- calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
- props = {}, curPosition = {}, curTop, curLeft;
-
- // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
- if ( calculatePosition ) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
- } else {
- curTop = parseFloat( curCSSTop ) || 0;
- curLeft = parseFloat( curCSSLeft ) || 0;
- }
-
- if ( jQuery.isFunction( options ) ) {
- options = options.call( elem, i, curOffset );
- }
-
- if ( options.top != null ) {
- props.top = ( options.top - curOffset.top ) + curTop;
- }
- if ( options.left != null ) {
- props.left = ( options.left - curOffset.left ) + curLeft;
- }
-
- if ( "using" in options ) {
- options.using.call( elem, props );
- } else {
- curElem.css( props );
- }
- }
-};
-
-
-jQuery.fn.extend({
-
- position: function() {
- if ( !this[0] ) {
- return null;
- }
-
- var elem = this[0],
-
- // Get *real* offsetParent
- offsetParent = this.offsetParent(),
-
- // Get correct offsets
- offset = this.offset(),
- parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
-
- // Subtract element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
- offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
-
- // Add offsetParent borders
- parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
- parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
-
- // Subtract the two offsets
- return {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- };
- },
-
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || document.body;
- while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent;
- });
- }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
- var top = /Y/.test( prop );
-
- jQuery.fn[ method ] = function( val ) {
- return jQuery.access( this, function( elem, method, val ) {
- var win = getWindow( elem );
-
- if ( val === undefined ) {
- return win ? (prop in win) ? win[ prop ] :
- jQuery.support.boxModel && win.document.documentElement[ method ] ||
- win.document.body[ method ] :
- elem[ method ];
- }
-
- if ( win ) {
- win.scrollTo(
- !top ? val : jQuery( win ).scrollLeft(),
- top ? val : jQuery( win ).scrollTop()
- );
-
- } else {
- elem[ method ] = val;
- }
- }, method, val, arguments.length, null );
- };
-});
-
-function getWindow( elem ) {
- return jQuery.isWindow( elem ) ?
- elem :
- elem.nodeType === 9 ?
- elem.defaultView || elem.parentWindow :
- false;
-}
-
-
-
-
-// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
- var clientProp = "client" + name,
- scrollProp = "scroll" + name,
- offsetProp = "offset" + name;
-
- // innerHeight and innerWidth
- jQuery.fn[ "inner" + name ] = function() {
- var elem = this[0];
- return elem ?
- elem.style ?
- parseFloat( jQuery.css( elem, type, "padding" ) ) :
- this[ type ]() :
- null;
- };
-
- // outerHeight and outerWidth
- jQuery.fn[ "outer" + name ] = function( margin ) {
- var elem = this[0];
- return elem ?
- elem.style ?
- parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
- this[ type ]() :
- null;
- };
-
- jQuery.fn[ type ] = function( value ) {
- return jQuery.access( this, function( elem, type, value ) {
- var doc, docElemProp, orig, ret;
-
- if ( jQuery.isWindow( elem ) ) {
- // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
- doc = elem.document;
- docElemProp = doc.documentElement[ clientProp ];
- return jQuery.support.boxModel && docElemProp ||
- doc.body && doc.body[ clientProp ] || docElemProp;
- }
-
- // Get document width or height
- if ( elem.nodeType === 9 ) {
- // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
- doc = elem.documentElement;
-
- // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
- // so we can't use max, as it'll choose the incorrect offset[Width/Height]
- // instead we use the correct client[Width/Height]
- // support:IE6
- if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
- return doc[ clientProp ];
- }
-
- return Math.max(
- elem.body[ scrollProp ], doc[ scrollProp ],
- elem.body[ offsetProp ], doc[ offsetProp ]
- );
- }
-
- // Get width or height on the element
- if ( value === undefined ) {
- orig = jQuery.css( elem, type );
- ret = parseFloat( orig );
- return jQuery.isNumeric( ret ) ? ret : orig;
- }
-
- // Set the width or height on the element
- jQuery( elem ).css( type, value );
- }, type, value, arguments.length, null );
- };
-});
-
-
-
-
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
-// Expose jQuery as an AMD module, but only for AMD loaders that
-// understand the issues with loading multiple versions of jQuery
-// in a page that all might call define(). The loader will indicate
-// they have special allowances for multiple jQuery versions by
-// specifying define.amd.jQuery = true. Register as a named module,
-// since jQuery can be concatenated with other files that may use define,
-// but not use a proper concatenation script that understands anonymous
-// AMD modules. A named AMD is safest and most robust way to register.
-// Lowercase jquery is used because AMD module names are derived from
-// file names, and jQuery is normally delivered in a lowercase file name.
-// Do this after creating the global so that if an AMD module wants to call
-// noConflict to hide this version of jQuery, it will work.
-if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
- define( "jquery", [], function () { return jQuery; } );
-}
-
-
-
-})( window );
diff --git a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-ui-1.8.18.custom.js b/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-ui-1.8.18.custom.js
deleted file mode 100644
index d4444b2bd11..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery-ui-1.8.18.custom.js
+++ /dev/null
@@ -1,11802 +0,0 @@
-/*!
- * jQuery UI 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI
- */
-(function( $, undefined ) {
-
-// prevent duplicate loading
-// this is only a problem because we proxy existing functions
-// and we don't want to double proxy them
-$.ui = $.ui || {};
-if ( $.ui.version ) {
- return;
-}
-
-$.extend( $.ui, {
- version: "1.8.18",
-
- keyCode: {
- ALT: 18,
- BACKSPACE: 8,
- CAPS_LOCK: 20,
- COMMA: 188,
- COMMAND: 91,
- COMMAND_LEFT: 91, // COMMAND
- COMMAND_RIGHT: 93,
- CONTROL: 17,
- DELETE: 46,
- DOWN: 40,
- END: 35,
- ENTER: 13,
- ESCAPE: 27,
- HOME: 36,
- INSERT: 45,
- LEFT: 37,
- MENU: 93, // COMMAND_RIGHT
- NUMPAD_ADD: 107,
- NUMPAD_DECIMAL: 110,
- NUMPAD_DIVIDE: 111,
- NUMPAD_ENTER: 108,
- NUMPAD_MULTIPLY: 106,
- NUMPAD_SUBTRACT: 109,
- PAGE_DOWN: 34,
- PAGE_UP: 33,
- PERIOD: 190,
- RIGHT: 39,
- SHIFT: 16,
- SPACE: 32,
- TAB: 9,
- UP: 38,
- WINDOWS: 91 // COMMAND
- }
-});
-
-// plugins
-$.fn.extend({
- propAttr: $.fn.prop || $.fn.attr,
-
- _focus: $.fn.focus,
- focus: function( delay, fn ) {
- return typeof delay === "number" ?
- this.each(function() {
- var elem = this;
- setTimeout(function() {
- $( elem ).focus();
- if ( fn ) {
- fn.call( elem );
- }
- }, delay );
- }) :
- this._focus.apply( this, arguments );
- },
-
- scrollParent: function() {
- var scrollParent;
- if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
- scrollParent = this.parents().filter(function() {
- return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- } else {
- scrollParent = this.parents().filter(function() {
- return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
- }).eq(0);
- }
-
- return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
- },
-
- zIndex: function( zIndex ) {
- if ( zIndex !== undefined ) {
- return this.css( "zIndex", zIndex );
- }
-
- if ( this.length ) {
- var elem = $( this[ 0 ] ), position, value;
- while ( elem.length && elem[ 0 ] !== document ) {
- // Ignore z-index if position is set to a value where z-index is ignored by the browser
- // This makes behavior of this function consistent across browsers
- // WebKit always returns auto if the element is positioned
- position = elem.css( "position" );
- if ( position === "absolute" || position === "relative" || position === "fixed" ) {
- // IE returns 0 when zIndex is not specified
- // other browsers return a string
- // we ignore the case of nested elements with an explicit value of 0
- // <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
- value = parseInt( elem.css( "zIndex" ), 10 );
- if ( !isNaN( value ) && value !== 0 ) {
- return value;
- }
- }
- elem = elem.parent();
- }
- }
-
- return 0;
- },
-
- disableSelection: function() {
- return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
- ".ui-disableSelection", function( event ) {
- event.preventDefault();
- });
- },
-
- enableSelection: function() {
- return this.unbind( ".ui-disableSelection" );
- }
-});
-
-$.each( [ "Width", "Height" ], function( i, name ) {
- var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
- type = name.toLowerCase(),
- orig = {
- innerWidth: $.fn.innerWidth,
- innerHeight: $.fn.innerHeight,
- outerWidth: $.fn.outerWidth,
- outerHeight: $.fn.outerHeight
- };
-
- function reduce( elem, size, border, margin ) {
- $.each( side, function() {
- size -= parseFloat( $.curCSS( elem, "padding" + this, true) ) || 0;
- if ( border ) {
- size -= parseFloat( $.curCSS( elem, "border" + this + "Width", true) ) || 0;
- }
- if ( margin ) {
- size -= parseFloat( $.curCSS( elem, "margin" + this, true) ) || 0;
- }
- });
- return size;
- }
-
- $.fn[ "inner" + name ] = function( size ) {
- if ( size === undefined ) {
- return orig[ "inner" + name ].call( this );
- }
-
- return this.each(function() {
- $( this ).css( type, reduce( this, size ) + "px" );
- });
- };
-
- $.fn[ "outer" + name] = function( size, margin ) {
- if ( typeof size !== "number" ) {
- return orig[ "outer" + name ].call( this, size );
- }
-
- return this.each(function() {
- $( this).css( type, reduce( this, size, true, margin ) + "px" );
- });
- };
-});
-
-// selectors
-function focusable( element, isTabIndexNotNaN ) {
- var nodeName = element.nodeName.toLowerCase();
- if ( "area" === nodeName ) {
- var map = element.parentNode,
- mapName = map.name,
- img;
- if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
- return false;
- }
- img = $( "img[usemap=#" + mapName + "]" )[0];
- return !!img && visible( img );
- }
- return ( /input|select|textarea|button|object/.test( nodeName )
- ? !element.disabled
- : "a" == nodeName
- ? element.href || isTabIndexNotNaN
- : isTabIndexNotNaN)
- // the element and all of its ancestors must be visible
- && visible( element );
-}
-
-function visible( element ) {
- return !$( element ).parents().andSelf().filter(function() {
- return $.curCSS( this, "visibility" ) === "hidden" ||
- $.expr.filters.hidden( this );
- }).length;
-}
-
-$.extend( $.expr[ ":" ], {
- data: function( elem, i, match ) {
- return !!$.data( elem, match[ 3 ] );
- },
-
- focusable: function( element ) {
- return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
- },
-
- tabbable: function( element ) {
- var tabIndex = $.attr( element, "tabindex" ),
- isTabIndexNaN = isNaN( tabIndex );
- return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
- }
-});
-
-// support
-$(function() {
- var body = document.body,
- div = body.appendChild( div = document.createElement( "div" ) );
-
- // access offsetHeight before setting the style to prevent a layout bug
- // in IE 9 which causes the elemnt to continue to take up space even
- // after it is removed from the DOM (#8026)
- div.offsetHeight;
-
- $.extend( div.style, {
- minHeight: "100px",
- height: "auto",
- padding: 0,
- borderWidth: 0
- });
-
- $.support.minHeight = div.offsetHeight === 100;
- $.support.selectstart = "onselectstart" in div;
-
- // set display to none to avoid a layout bug in IE
- // http://dev.jquery.com/ticket/4014
- body.removeChild( div ).style.display = "none";
-});
-
-
-
-
-
-// deprecated
-$.extend( $.ui, {
- // $.ui.plugin is deprecated. Use the proxy pattern instead.
- plugin: {
- add: function( module, option, set ) {
- var proto = $.ui[ module ].prototype;
- for ( var i in set ) {
- proto.plugins[ i ] = proto.plugins[ i ] || [];
- proto.plugins[ i ].push( [ option, set[ i ] ] );
- }
- },
- call: function( instance, name, args ) {
- var set = instance.plugins[ name ];
- if ( !set || !instance.element[ 0 ].parentNode ) {
- return;
- }
-
- for ( var i = 0; i < set.length; i++ ) {
- if ( instance.options[ set[ i ][ 0 ] ] ) {
- set[ i ][ 1 ].apply( instance.element, args );
- }
- }
- }
- },
-
- // will be deprecated when we switch to jQuery 1.4 - use jQuery.contains()
- contains: function( a, b ) {
- return document.compareDocumentPosition ?
- a.compareDocumentPosition( b ) & 16 :
- a !== b && a.contains( b );
- },
-
- // only used by resizable
- hasScroll: function( el, a ) {
-
- //If overflow is hidden, the element might have extra content, but the user wants to hide it
- if ( $( el ).css( "overflow" ) === "hidden") {
- return false;
- }
-
- var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
- has = false;
-
- if ( el[ scroll ] > 0 ) {
- return true;
- }
-
- // TODO: determine which cases actually cause this to happen
- // if the element doesn't have the scroll set, see if it's possible to
- // set the scroll
- el[ scroll ] = 1;
- has = ( el[ scroll ] > 0 );
- el[ scroll ] = 0;
- return has;
- },
-
- // these are odd functions, fix the API or move into individual plugins
- isOverAxis: function( x, reference, size ) {
- //Determines when x coordinate is over "b" element axis
- return ( x > reference ) && ( x < ( reference + size ) );
- },
- isOver: function( y, x, top, left, height, width ) {
- //Determines when x, y coordinates is over "b" element
- return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
- }
-});
-
-})( jQuery );
-/*!
- * jQuery UI Widget 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
-(function( $, undefined ) {
-
-// jQuery 1.4+
-if ( $.cleanData ) {
- var _cleanData = $.cleanData;
- $.cleanData = function( elems ) {
- for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
- try {
- $( elem ).triggerHandler( "remove" );
- // http://bugs.jquery.com/ticket/8235
- } catch( e ) {}
- }
- _cleanData( elems );
- };
-} else {
- var _remove = $.fn.remove;
- $.fn.remove = function( selector, keepData ) {
- return this.each(function() {
- if ( !keepData ) {
- if ( !selector || $.filter( selector, [ this ] ).length ) {
- $( "*", this ).add( [ this ] ).each(function() {
- try {
- $( this ).triggerHandler( "remove" );
- // http://bugs.jquery.com/ticket/8235
- } catch( e ) {}
- });
- }
- }
- return _remove.call( $(this), selector, keepData );
- });
- };
-}
-
-$.widget = function( name, base, prototype ) {
- var namespace = name.split( "." )[ 0 ],
- fullName;
- name = name.split( "." )[ 1 ];
- fullName = namespace + "-" + name;
-
- if ( !prototype ) {
- prototype = base;
- base = $.Widget;
- }
-
- // create selector for plugin
- $.expr[ ":" ][ fullName ] = function( elem ) {
- return !!$.data( elem, name );
- };
-
- $[ namespace ] = $[ namespace ] || {};
- $[ namespace ][ name ] = function( options, element ) {
- // allow instantiation without initializing for simple inheritance
- if ( arguments.length ) {
- this._createWidget( options, element );
- }
- };
-
- var basePrototype = new base();
- // we need to make the options hash a property directly on the new instance
- // otherwise we'll modify the options hash on the prototype that we're
- // inheriting from
-// $.each( basePrototype, function( key, val ) {
-// if ( $.isPlainObject(val) ) {
-// basePrototype[ key ] = $.extend( {}, val );
-// }
-// });
- basePrototype.options = $.extend( true, {}, basePrototype.options );
- $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
- namespace: namespace,
- widgetName: name,
- widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
- widgetBaseClass: fullName
- }, prototype );
-
- $.widget.bridge( name, $[ namespace ][ name ] );
-};
-
-$.widget.bridge = function( name, object ) {
- $.fn[ name ] = function( options ) {
- var isMethodCall = typeof options === "string",
- args = Array.prototype.slice.call( arguments, 1 ),
- returnValue = this;
-
- // allow multiple hashes to be passed on init
- options = !isMethodCall && args.length ?
- $.extend.apply( null, [ true, options ].concat(args) ) :
- options;
-
- // prevent calls to internal methods
- if ( isMethodCall && options.charAt( 0 ) === "_" ) {
- return returnValue;
- }
-
- if ( isMethodCall ) {
- this.each(function() {
- var instance = $.data( this, name ),
- methodValue = instance && $.isFunction( instance[options] ) ?
- instance[ options ].apply( instance, args ) :
- instance;
- // TODO: add this back in 1.9 and use $.error() (see #5972)
-// if ( !instance ) {
-// throw "cannot call methods on " + name + " prior to initialization; " +
-// "attempted to call method '" + options + "'";
-// }
-// if ( !$.isFunction( instance[options] ) ) {
-// throw "no such method '" + options + "' for " + name + " widget instance";
-// }
-// var methodValue = instance[ options ].apply( instance, args );
- if ( methodValue !== instance && methodValue !== undefined ) {
- returnValue = methodValue;
- return false;
- }
- });
- } else {
- this.each(function() {
- var instance = $.data( this, name );
- if ( instance ) {
- instance.option( options || {} )._init();
- } else {
- $.data( this, name, new object( options, this ) );
- }
- });
- }
-
- return returnValue;
- };
-};
-
-$.Widget = function( options, element ) {
- // allow instantiation without initializing for simple inheritance
- if ( arguments.length ) {
- this._createWidget( options, element );
- }
-};
-
-$.Widget.prototype = {
- widgetName: "widget",
- widgetEventPrefix: "",
- options: {
- disabled: false
- },
- _createWidget: function( options, element ) {
- // $.widget.bridge stores the plugin instance, but we do it anyway
- // so that it's stored even before the _create function runs
- $.data( element, this.widgetName, this );
- this.element = $( element );
- this.options = $.extend( true, {},
- this.options,
- this._getCreateOptions(),
- options );
-
- var self = this;
- this.element.bind( "remove." + this.widgetName, function() {
- self.destroy();
- });
-
- this._create();
- this._trigger( "create" );
- this._init();
- },
- _getCreateOptions: function() {
- return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
- },
- _create: function() {},
- _init: function() {},
-
- destroy: function() {
- this.element
- .unbind( "." + this.widgetName )
- .removeData( this.widgetName );
- this.widget()
- .unbind( "." + this.widgetName )
- .removeAttr( "aria-disabled" )
- .removeClass(
- this.widgetBaseClass + "-disabled " +
- "ui-state-disabled" );
- },
-
- widget: function() {
- return this.element;
- },
-
- option: function( key, value ) {
- var options = key;
-
- if ( arguments.length === 0 ) {
- // don't return a reference to the internal hash
- return $.extend( {}, this.options );
- }
-
- if (typeof key === "string" ) {
- if ( value === undefined ) {
- return this.options[ key ];
- }
- options = {};
- options[ key ] = value;
- }
-
- this._setOptions( options );
-
- return this;
- },
- _setOptions: function( options ) {
- var self = this;
- $.each( options, function( key, value ) {
- self._setOption( key, value );
- });
-
- return this;
- },
- _setOption: function( key, value ) {
- this.options[ key ] = value;
-
- if ( key === "disabled" ) {
- this.widget()
- [ value ? "addClass" : "removeClass"](
- this.widgetBaseClass + "-disabled" + " " +
- "ui-state-disabled" )
- .attr( "aria-disabled", value );
- }
-
- return this;
- },
-
- enable: function() {
- return this._setOption( "disabled", false );
- },
- disable: function() {
- return this._setOption( "disabled", true );
- },
-
- _trigger: function( type, event, data ) {
- var prop, orig,
- callback = this.options[ type ];
-
- data = data || {};
- event = $.Event( event );
- event.type = ( type === this.widgetEventPrefix ?
- type :
- this.widgetEventPrefix + type ).toLowerCase();
- // the original event may come from any element
- // so we need to reset the target on the new event
- event.target = this.element[ 0 ];
-
- // copy original event properties over to the new event
- orig = event.originalEvent;
- if ( orig ) {
- for ( prop in orig ) {
- if ( !( prop in event ) ) {
- event[ prop ] = orig[ prop ];
- }
- }
- }
-
- this.element.trigger( event, data );
-
- return !( $.isFunction(callback) &&
- callback.call( this.element[0], event, data ) === false ||
- event.isDefaultPrevented() );
- }
-};
-
-})( jQuery );
-/*!
- * jQuery UI Mouse 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Mouse
- *
- * Depends:
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-var mouseHandled = false;
-$( document ).mouseup( function( e ) {
- mouseHandled = false;
-});
-
-$.widget("ui.mouse", {
- options: {
- cancel: ':input,option',
- distance: 1,
- delay: 0
- },
- _mouseInit: function() {
- var self = this;
-
- this.element
- .bind('mousedown.'+this.widgetName, function(event) {
- return self._mouseDown(event);
- })
- .bind('click.'+this.widgetName, function(event) {
- if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {
- $.removeData(event.target, self.widgetName + '.preventClickEvent');
- event.stopImmediatePropagation();
- return false;
- }
- });
-
- this.started = false;
- },
-
- // TODO: make sure destroying one instance of mouse doesn't mess with
- // other instances of mouse
- _mouseDestroy: function() {
- this.element.unbind('.'+this.widgetName);
- },
-
- _mouseDown: function(event) {
- // don't let more than one widget handle mouseStart
- if( mouseHandled ) { return };
-
- // we may have missed mouseup (out of window)
- (this._mouseStarted && this._mouseUp(event));
-
- this._mouseDownEvent = event;
-
- var self = this,
- btnIsLeft = (event.which == 1),
- // event.target.nodeName works around a bug in IE 8 with
- // disabled inputs (#7620)
- elIsCancel = (typeof this.options.cancel == "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
- if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
- return true;
- }
-
- this.mouseDelayMet = !this.options.delay;
- if (!this.mouseDelayMet) {
- this._mouseDelayTimer = setTimeout(function() {
- self.mouseDelayMet = true;
- }, this.options.delay);
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted = (this._mouseStart(event) !== false);
- if (!this._mouseStarted) {
- event.preventDefault();
- return true;
- }
- }
-
- // Click event may never have fired (Gecko & Opera)
- if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
- $.removeData(event.target, this.widgetName + '.preventClickEvent');
- }
-
- // these delegates are required to keep context
- this._mouseMoveDelegate = function(event) {
- return self._mouseMove(event);
- };
- this._mouseUpDelegate = function(event) {
- return self._mouseUp(event);
- };
- $(document)
- .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- event.preventDefault();
-
- mouseHandled = true;
- return true;
- },
-
- _mouseMove: function(event) {
- // IE mouseup check - mouseup happened when mouse was out of window
- if ($.browser.msie && !(document.documentMode >= 9) && !event.button) {
- return this._mouseUp(event);
- }
-
- if (this._mouseStarted) {
- this._mouseDrag(event);
- return event.preventDefault();
- }
-
- if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
- this._mouseStarted =
- (this._mouseStart(this._mouseDownEvent, event) !== false);
- (this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
- }
-
- return !this._mouseStarted;
- },
-
- _mouseUp: function(event) {
- $(document)
- .unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
- .unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
- if (this._mouseStarted) {
- this._mouseStarted = false;
-
- if (event.target == this._mouseDownEvent.target) {
- $.data(event.target, this.widgetName + '.preventClickEvent', true);
- }
-
- this._mouseStop(event);
- }
-
- return false;
- },
-
- _mouseDistanceMet: function(event) {
- return (Math.max(
- Math.abs(this._mouseDownEvent.pageX - event.pageX),
- Math.abs(this._mouseDownEvent.pageY - event.pageY)
- ) >= this.options.distance
- );
- },
-
- _mouseDelayMet: function(event) {
- return this.mouseDelayMet;
- },
-
- // These are placeholder methods, to be overriden by extending plugin
- _mouseStart: function(event) {},
- _mouseDrag: function(event) {},
- _mouseStop: function(event) {},
- _mouseCapture: function(event) { return true; }
-});
-
-})(jQuery);
-/*
- * jQuery UI Draggable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Draggables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-$.widget("ui.draggable", $.ui.mouse, {
- widgetEventPrefix: "drag",
- options: {
- addClasses: true,
- appendTo: "parent",
- axis: false,
- connectToSortable: false,
- containment: false,
- cursor: "auto",
- cursorAt: false,
- grid: false,
- handle: false,
- helper: "original",
- iframeFix: false,
- opacity: false,
- refreshPositions: false,
- revert: false,
- revertDuration: 500,
- scope: "default",
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- snap: false,
- snapMode: "both",
- snapTolerance: 20,
- stack: false,
- zIndex: false
- },
- _create: function() {
-
- if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position")))
- this.element[0].style.position = 'relative';
-
- (this.options.addClasses && this.element.addClass("ui-draggable"));
- (this.options.disabled && this.element.addClass("ui-draggable-disabled"));
-
- this._mouseInit();
-
- },
-
- destroy: function() {
- if(!this.element.data('draggable')) return;
- this.element
- .removeData("draggable")
- .unbind(".draggable")
- .removeClass("ui-draggable"
- + " ui-draggable-dragging"
- + " ui-draggable-disabled");
- this._mouseDestroy();
-
- return this;
- },
-
- _mouseCapture: function(event) {
-
- var o = this.options;
-
- // among others, prevent a drag on a resizable-handle
- if (this.helper || o.disabled || $(event.target).is('.ui-resizable-handle'))
- return false;
-
- //Quit if we're not on a valid handle
- this.handle = this._getHandle(event);
- if (!this.handle)
- return false;
-
- if ( o.iframeFix ) {
- $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
- $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>')
- .css({
- width: this.offsetWidth+"px", height: this.offsetHeight+"px",
- position: "absolute", opacity: "0.001", zIndex: 1000
- })
- .css($(this).offset())
- .appendTo("body");
- });
- }
-
- return true;
-
- },
-
- _mouseStart: function(event) {
-
- var o = this.options;
-
- //Create and append the visible helper
- this.helper = this._createHelper(event);
-
- //Cache the helper size
- this._cacheHelperProportions();
-
- //If ddmanager is used for droppables, set the global draggable
- if($.ui.ddmanager)
- $.ui.ddmanager.current = this;
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- //Cache the margins of the original element
- this._cacheMargins();
-
- //Store the helper's css position
- this.cssPosition = this.helper.css("position");
- this.scrollParent = this.helper.scrollParent();
-
- //The element's absolute position on the page minus margins
- this.offset = this.positionAbs = this.element.offset();
- this.offset = {
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- $.extend(this.offset, {
- click: { //Where the click happened, relative to the element
- left: event.pageX - this.offset.left,
- top: event.pageY - this.offset.top
- },
- parent: this._getParentOffset(),
- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
- });
-
- //Generate the original position
- this.originalPosition = this.position = this._generatePosition(event);
- this.originalPageX = event.pageX;
- this.originalPageY = event.pageY;
-
- //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
- (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
-
- //Set a containment if given in the options
- if(o.containment)
- this._setContainment();
-
- //Trigger event + callbacks
- if(this._trigger("start", event) === false) {
- this._clear();
- return false;
- }
-
- //Recache the helper size
- this._cacheHelperProportions();
-
- //Prepare the droppable offsets
- if ($.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(this, event);
-
- this.helper.addClass("ui-draggable-dragging");
- this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
-
- //If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
- if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event);
-
- return true;
- },
-
- _mouseDrag: function(event, noPropagation) {
-
- //Compute the helpers position
- this.position = this._generatePosition(event);
- this.positionAbs = this._convertPositionTo("absolute");
-
- //Call plugins and callbacks and use the resulting position if something is returned
- if (!noPropagation) {
- var ui = this._uiHash();
- if(this._trigger('drag', event, ui) === false) {
- this._mouseUp({});
- return false;
- }
- this.position = ui.position;
- }
-
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- //If we are using droppables, inform the manager about the drop
- var dropped = false;
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- dropped = $.ui.ddmanager.drop(this, event);
-
- //if a drop comes from outside (a sortable)
- if(this.dropped) {
- dropped = this.dropped;
- this.dropped = false;
- }
-
- //if the original element is removed, don't bother to continue if helper is set to "original"
- if((!this.element[0] || !this.element[0].parentNode) && this.options.helper == "original")
- return false;
-
- if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
- var self = this;
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
- if(self._trigger("stop", event) !== false) {
- self._clear();
- }
- });
- } else {
- if(this._trigger("stop", event) !== false) {
- this._clear();
- }
- }
-
- return false;
- },
-
- _mouseUp: function(event) {
- if (this.options.iframeFix === true) {
- $("div.ui-draggable-iframeFix").each(function() {
- this.parentNode.removeChild(this);
- }); //Remove frame helpers
- }
-
- //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
- if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event);
-
- return $.ui.mouse.prototype._mouseUp.call(this, event);
- },
-
- cancel: function() {
-
- if(this.helper.is(".ui-draggable-dragging")) {
- this._mouseUp({});
- } else {
- this._clear();
- }
-
- return this;
-
- },
-
- _getHandle: function(event) {
-
- var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false;
- $(this.options.handle, this.element)
- .find("*")
- .andSelf()
- .each(function() {
- if(this == event.target) handle = true;
- });
-
- return handle;
-
- },
-
- _createHelper: function(event) {
-
- var o = this.options;
- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper == 'clone' ? this.element.clone().removeAttr('id') : this.element);
-
- if(!helper.parents('body').length)
- helper.appendTo((o.appendTo == 'parent' ? this.element[0].parentNode : o.appendTo));
-
- if(helper[0] != this.element[0] && !(/(fixed|absolute)/).test(helper.css("position")))
- helper.css("position", "absolute");
-
- return helper;
-
- },
-
- _adjustOffsetFromHelper: function(obj) {
- if (typeof obj == 'string') {
- obj = obj.split(' ');
- }
- if ($.isArray(obj)) {
- obj = {left: +obj[0], top: +obj[1] || 0};
- }
- if ('left' in obj) {
- this.offset.click.left = obj.left + this.margins.left;
- }
- if ('right' in obj) {
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
- }
- if ('top' in obj) {
- this.offset.click.top = obj.top + this.margins.top;
- }
- if ('bottom' in obj) {
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
- }
- },
-
- _getParentOffset: function() {
-
- //Get the offsetParent and cache its position
- this.offsetParent = this.helper.offsetParent();
- var po = this.offsetParent.offset();
-
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
- if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
- po.left += this.scrollParent.scrollLeft();
- po.top += this.scrollParent.scrollTop();
- }
-
- if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
- || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
- po = { top: 0, left: 0 };
-
- return {
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- },
-
- _getRelativeOffset: function() {
-
- if(this.cssPosition == "relative") {
- var p = this.element.position();
- return {
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
- };
- } else {
- return { top: 0, left: 0 };
- }
-
- },
-
- _cacheMargins: function() {
- this.margins = {
- left: (parseInt(this.element.css("marginLeft"),10) || 0),
- top: (parseInt(this.element.css("marginTop"),10) || 0),
- right: (parseInt(this.element.css("marginRight"),10) || 0),
- bottom: (parseInt(this.element.css("marginBottom"),10) || 0)
- };
- },
-
- _cacheHelperProportions: function() {
- this.helperProportions = {
- width: this.helper.outerWidth(),
- height: this.helper.outerHeight()
- };
- },
-
- _setContainment: function() {
-
- var o = this.options;
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- o.containment == 'document' ? 0 : $(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
- o.containment == 'document' ? 0 : $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top,
- (o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
- (o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
- var c = $(o.containment);
- var ce = c[0]; if(!ce) return;
- var co = c.offset();
- var over = ($(ce).css("overflow") != 'hidden');
-
- this.containment = [
- (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0),
- (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0),
- (over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right,
- (over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom
- ];
- this.relative_container = c;
-
- } else if(o.containment.constructor == Array) {
- this.containment = o.containment;
- }
-
- },
-
- _convertPositionTo: function(d, pos) {
-
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- return {
- top: (
- pos.top // The absolute mouse position
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
- ),
- left: (
- pos.left // The absolute mouse position
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
- )
- };
-
- },
-
- _generatePosition: function(event) {
-
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
- var pageX = event.pageX;
- var pageY = event.pageY;
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
-
- if(this.originalPosition) { //If we are not dragging yet, we won't check for options
- var containment;
- if(this.containment) {
- if (this.relative_container){
- var co = this.relative_container.offset();
- containment = [ this.containment[0] + co.left,
- this.containment[1] + co.top,
- this.containment[2] + co.left,
- this.containment[3] + co.top ];
- }
- else {
- containment = this.containment;
- }
-
- if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left;
- if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top;
- if(event.pageX - this.offset.click.left > containment[2]) pageX = containment[2] + this.offset.click.left;
- if(event.pageY - this.offset.click.top > containment[3]) pageY = containment[3] + this.offset.click.top;
- }
-
- if(o.grid) {
- //Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
- var top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
- pageY = containment ? (!(top - this.offset.click.top < containment[1] || top - this.offset.click.top > containment[3]) ? top : (!(top - this.offset.click.top < containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
- pageX = containment ? (!(left - this.offset.click.left < containment[0] || left - this.offset.click.left > containment[2]) ? left : (!(left - this.offset.click.left < containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- }
-
- return {
- top: (
- pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
- ),
- left: (
- pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
- )
- };
-
- },
-
- _clear: function() {
- this.helper.removeClass("ui-draggable-dragging");
- if(this.helper[0] != this.element[0] && !this.cancelHelperRemoval) this.helper.remove();
- //if($.ui.ddmanager) $.ui.ddmanager.current = null;
- this.helper = null;
- this.cancelHelperRemoval = false;
- },
-
- // From now on bulk stuff - mainly helpers
-
- _trigger: function(type, event, ui) {
- ui = ui || this._uiHash();
- $.ui.plugin.call(this, type, [event, ui]);
- if(type == "drag") this.positionAbs = this._convertPositionTo("absolute"); //The absolute position has to be recalculated after plugins
- return $.Widget.prototype._trigger.call(this, type, event, ui);
- },
-
- plugins: {},
-
- _uiHash: function(event) {
- return {
- helper: this.helper,
- position: this.position,
- originalPosition: this.originalPosition,
- offset: this.positionAbs
- };
- }
-
-});
-
-$.extend($.ui.draggable, {
- version: "1.8.18"
-});
-
-$.ui.plugin.add("draggable", "connectToSortable", {
- start: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options,
- uiSortable = $.extend({}, ui, { item: inst.element });
- inst.sortables = [];
- $(o.connectToSortable).each(function() {
- var sortable = $.data(this, 'sortable');
- if (sortable && !sortable.options.disabled) {
- inst.sortables.push({
- instance: sortable,
- shouldRevert: sortable.options.revert
- });
- sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
- sortable._trigger("activate", event, uiSortable);
- }
- });
-
- },
- stop: function(event, ui) {
-
- //If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
- var inst = $(this).data("draggable"),
- uiSortable = $.extend({}, ui, { item: inst.element });
-
- $.each(inst.sortables, function() {
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
-
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
-
- //The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: 'valid/invalid'
- if(this.shouldRevert) this.instance.options.revert = true;
-
- //Trigger the stop of the sortable
- this.instance._mouseStop(event);
-
- this.instance.options.helper = this.instance.options._helper;
-
- //If the helper has been the original item, restore properties in the sortable
- if(inst.options.helper == 'original')
- this.instance.currentItem.css({ top: 'auto', left: 'auto' });
-
- } else {
- this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
- this.instance._trigger("deactivate", event, uiSortable);
- }
-
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), self = this;
-
- var checkPos = function(o) {
- var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
- var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
- var itemHeight = o.height, itemWidth = o.width;
- var itemTop = o.top, itemLeft = o.left;
-
- return $.ui.isOver(helperTop + dyClick, helperLeft + dxClick, itemTop, itemLeft, itemHeight, itemWidth);
- };
-
- $.each(inst.sortables, function(i) {
-
- //Copy over some variables to allow calling the sortable's native _intersectsWith
- this.instance.positionAbs = inst.positionAbs;
- this.instance.helperProportions = inst.helperProportions;
- this.instance.offset.click = inst.offset.click;
-
- if(this.instance._intersectsWith(this.instance.containerCache)) {
-
- //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
- if(!this.instance.isOver) {
-
- this.instance.isOver = 1;
- //Now we fake the start of dragging for the sortable instance,
- //by cloning the list group item, appending it to the sortable and using it as inst.currentItem
- //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
- this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true);
- this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
- this.instance.options.helper = function() { return ui.helper[0]; };
-
- event.target = this.instance.currentItem[0];
- this.instance._mouseCapture(event, true);
- this.instance._mouseStart(event, true, true);
-
- //Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
- this.instance.offset.click.top = inst.offset.click.top;
- this.instance.offset.click.left = inst.offset.click.left;
- this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
- this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
-
- inst._trigger("toSortable", event);
- inst.dropped = this.instance.element; //draggable revert needs that
- //hack so receive/update callbacks work (mostly)
- inst.currentItem = inst.element;
- this.instance.fromOutside = inst;
-
- }
-
- //Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
- if(this.instance.currentItem) this.instance._mouseDrag(event);
-
- } else {
-
- //If it doesn't intersect with the sortable, and it intersected before,
- //we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
- if(this.instance.isOver) {
-
- this.instance.isOver = 0;
- this.instance.cancelHelperRemoval = true;
-
- //Prevent reverting on this forced stop
- this.instance.options.revert = false;
-
- // The out event needs to be triggered independently
- this.instance._trigger('out', event, this.instance._uiHash(this.instance));
-
- this.instance._mouseStop(event, true);
- this.instance.options.helper = this.instance.options._helper;
-
- //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
- this.instance.currentItem.remove();
- if(this.instance.placeholder) this.instance.placeholder.remove();
-
- inst._trigger("fromSortable", event);
- inst.dropped = false; //draggable revert needs that
- }
-
- };
-
- });
-
- }
-});
-
-$.ui.plugin.add("draggable", "cursor", {
- start: function(event, ui) {
- var t = $('body'), o = $(this).data('draggable').options;
- if (t.css("cursor")) o._cursor = t.css("cursor");
- t.css("cursor", o.cursor);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if (o._cursor) $('body').css("cursor", o._cursor);
- }
-});
-
-$.ui.plugin.add("draggable", "opacity", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data('draggable').options;
- if(t.css("opacity")) o._opacity = t.css("opacity");
- t.css('opacity', o.opacity);
- },
- stop: function(event, ui) {
- var o = $(this).data('draggable').options;
- if(o._opacity) $(ui.helper).css('opacity', o._opacity);
- }
-});
-
-$.ui.plugin.add("draggable", "scroll", {
- start: function(event, ui) {
- var i = $(this).data("draggable");
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') i.overflowOffset = i.scrollParent.offset();
- },
- drag: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options, scrolled = false;
-
- if(i.scrollParent[0] != document && i.scrollParent[0].tagName != 'HTML') {
-
- if(!o.axis || o.axis != 'x') {
- if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
- else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity)
- i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
- }
-
- if(!o.axis || o.axis != 'y') {
- if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
- else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity)
- i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
- }
-
- } else {
-
- if(!o.axis || o.axis != 'x') {
- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
- }
-
- if(!o.axis || o.axis != 'y') {
- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
- }
-
- }
-
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(i, event);
-
- }
-});
-
-$.ui.plugin.add("draggable", "snap", {
- start: function(event, ui) {
-
- var i = $(this).data("draggable"), o = i.options;
- i.snapElements = [];
-
- $(o.snap.constructor != String ? ( o.snap.items || ':data(draggable)' ) : o.snap).each(function() {
- var $t = $(this); var $o = $t.offset();
- if(this != i.element[0]) i.snapElements.push({
- item: this,
- width: $t.outerWidth(), height: $t.outerHeight(),
- top: $o.top, left: $o.left
- });
- });
-
- },
- drag: function(event, ui) {
-
- var inst = $(this).data("draggable"), o = inst.options;
- var d = o.snapTolerance;
-
- var x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
- y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
-
- for (var i = inst.snapElements.length - 1; i >= 0; i--){
-
- var l = inst.snapElements[i].left, r = l + inst.snapElements[i].width,
- t = inst.snapElements[i].top, b = t + inst.snapElements[i].height;
-
- //Yes, I know, this is insane ;)
- if(!((l-d < x1 && x1 < r+d && t-d < y1 && y1 < b+d) || (l-d < x1 && x1 < r+d && t-d < y2 && y2 < b+d) || (l-d < x2 && x2 < r+d && t-d < y1 && y1 < b+d) || (l-d < x2 && x2 < r+d && t-d < y2 && y2 < b+d))) {
- if(inst.snapElements[i].snapping) (inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = false;
- continue;
- }
-
- if(o.snapMode != 'inner') {
- var ts = Math.abs(t - y2) <= d;
- var bs = Math.abs(b - y1) <= d;
- var ls = Math.abs(l - x2) <= d;
- var rs = Math.abs(r - x1) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
- }
-
- var first = (ts || bs || ls || rs);
-
- if(o.snapMode != 'outer') {
- var ts = Math.abs(t - y1) <= d;
- var bs = Math.abs(b - y2) <= d;
- var ls = Math.abs(l - x1) <= d;
- var rs = Math.abs(r - x2) <= d;
- if(ts) ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
- if(bs) ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
- if(ls) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
- if(rs) ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
- }
-
- if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first))
- (inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
- inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
-
- };
-
- }
-});
-
-$.ui.plugin.add("draggable", "stack", {
- start: function(event, ui) {
-
- var o = $(this).data("draggable").options;
-
- var group = $.makeArray($(o.stack)).sort(function(a,b) {
- return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
- });
- if (!group.length) { return; }
-
- var min = parseInt(group[0].style.zIndex) || 0;
- $(group).each(function(i) {
- this.style.zIndex = min + i;
- });
-
- this[0].style.zIndex = min + group.length;
-
- }
-});
-
-$.ui.plugin.add("draggable", "zIndex", {
- start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data("draggable").options;
- if(t.css("zIndex")) o._zIndex = t.css("zIndex");
- t.css('zIndex', o.zIndex);
- },
- stop: function(event, ui) {
- var o = $(this).data("draggable").options;
- if(o._zIndex) $(ui.helper).css('zIndex', o._zIndex);
- }
-});
-
-})(jQuery);
-/*
- * jQuery UI Droppable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Droppables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * jquery.ui.mouse.js
- * jquery.ui.draggable.js
- */
-(function( $, undefined ) {
-
-$.widget("ui.droppable", {
- widgetEventPrefix: "drop",
- options: {
- accept: '*',
- activeClass: false,
- addClasses: true,
- greedy: false,
- hoverClass: false,
- scope: 'default',
- tolerance: 'intersect'
- },
- _create: function() {
-
- var o = this.options, accept = o.accept;
- this.isover = 0; this.isout = 1;
-
- this.accept = $.isFunction(accept) ? accept : function(d) {
- return d.is(accept);
- };
-
- //Store the droppable's proportions
- this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight };
-
- // Add the reference and positions to the manager
- $.ui.ddmanager.droppables[o.scope] = $.ui.ddmanager.droppables[o.scope] || [];
- $.ui.ddmanager.droppables[o.scope].push(this);
-
- (o.addClasses && this.element.addClass("ui-droppable"));
-
- },
-
- destroy: function() {
- var drop = $.ui.ddmanager.droppables[this.options.scope];
- for ( var i = 0; i < drop.length; i++ )
- if ( drop[i] == this )
- drop.splice(i, 1);
-
- this.element
- .removeClass("ui-droppable ui-droppable-disabled")
- .removeData("droppable")
- .unbind(".droppable");
-
- return this;
- },
-
- _setOption: function(key, value) {
-
- if(key == 'accept') {
- this.accept = $.isFunction(value) ? value : function(d) {
- return d.is(value);
- };
- }
- $.Widget.prototype._setOption.apply(this, arguments);
- },
-
- _activate: function(event) {
- var draggable = $.ui.ddmanager.current;
- if(this.options.activeClass) this.element.addClass(this.options.activeClass);
- (draggable && this._trigger('activate', event, this.ui(draggable)));
- },
-
- _deactivate: function(event) {
- var draggable = $.ui.ddmanager.current;
- if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
- (draggable && this._trigger('deactivate', event, this.ui(draggable)));
- },
-
- _over: function(event) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- if(this.options.hoverClass) this.element.addClass(this.options.hoverClass);
- this._trigger('over', event, this.ui(draggable));
- }
-
- },
-
- _out: function(event) {
-
- var draggable = $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return; // Bail if draggable and droppable are same element
-
- if (this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
- this._trigger('out', event, this.ui(draggable));
- }
-
- },
-
- _drop: function(event,custom) {
-
- var draggable = custom || $.ui.ddmanager.current;
- if (!draggable || (draggable.currentItem || draggable.element)[0] == this.element[0]) return false; // Bail if draggable and droppable are same element
-
- var childrenIntersection = false;
- this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function() {
- var inst = $.data(this, 'droppable');
- if(
- inst.options.greedy
- && !inst.options.disabled
- && inst.options.scope == draggable.options.scope
- && inst.accept.call(inst.element[0], (draggable.currentItem || draggable.element))
- && $.ui.intersect(draggable, $.extend(inst, { offset: inst.element.offset() }), inst.options.tolerance)
- ) { childrenIntersection = true; return false; }
- });
- if(childrenIntersection) return false;
-
- if(this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- if(this.options.activeClass) this.element.removeClass(this.options.activeClass);
- if(this.options.hoverClass) this.element.removeClass(this.options.hoverClass);
- this._trigger('drop', event, this.ui(draggable));
- return this.element;
- }
-
- return false;
-
- },
-
- ui: function(c) {
- return {
- draggable: (c.currentItem || c.element),
- helper: c.helper,
- position: c.position,
- offset: c.positionAbs
- };
- }
-
-});
-
-$.extend($.ui.droppable, {
- version: "1.8.18"
-});
-
-$.ui.intersect = function(draggable, droppable, toleranceMode) {
-
- if (!droppable.offset) return false;
-
- var x1 = (draggable.positionAbs || draggable.position.absolute).left, x2 = x1 + draggable.helperProportions.width,
- y1 = (draggable.positionAbs || draggable.position.absolute).top, y2 = y1 + draggable.helperProportions.height;
- var l = droppable.offset.left, r = l + droppable.proportions.width,
- t = droppable.offset.top, b = t + droppable.proportions.height;
-
- switch (toleranceMode) {
- case 'fit':
- return (l <= x1 && x2 <= r
- && t <= y1 && y2 <= b);
- break;
- case 'intersect':
- return (l < x1 + (draggable.helperProportions.width / 2) // Right Half
- && x2 - (draggable.helperProportions.width / 2) < r // Left Half
- && t < y1 + (draggable.helperProportions.height / 2) // Bottom Half
- && y2 - (draggable.helperProportions.height / 2) < b ); // Top Half
- break;
- case 'pointer':
- var draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left),
- draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top),
- isOver = $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
- return isOver;
- break;
- case 'touch':
- return (
- (y1 >= t && y1 <= b) || // Top edge touching
- (y2 >= t && y2 <= b) || // Bottom edge touching
- (y1 < t && y2 > b) // Surrounded vertically
- ) && (
- (x1 >= l && x1 <= r) || // Left edge touching
- (x2 >= l && x2 <= r) || // Right edge touching
- (x1 < l && x2 > r) // Surrounded horizontally
- );
- break;
- default:
- return false;
- break;
- }
-
-};
-
-/*
- This manager tracks offsets of draggables and droppables
-*/
-$.ui.ddmanager = {
- current: null,
- droppables: { 'default': [] },
- prepareOffsets: function(t, event) {
-
- var m = $.ui.ddmanager.droppables[t.options.scope] || [];
- var type = event ? event.type : null; // workaround for #2317
- var list = (t.currentItem || t.element).find(":data(droppable)").andSelf();
-
- droppablesLoop: for (var i = 0; i < m.length; i++) {
-
- if(m[i].options.disabled || (t && !m[i].accept.call(m[i].element[0],(t.currentItem || t.element)))) continue; //No disabled and non-accepted
- for (var j=0; j < list.length; j++) { if(list[j] == m[i].element[0]) { m[i].proportions.height = 0; continue droppablesLoop; } }; //Filter out elements in the current dragged item
- m[i].visible = m[i].element.css("display") != "none"; if(!m[i].visible) continue; //If the element is not visible, continue
-
- if(type == "mousedown") m[i]._activate.call(m[i], event); //Activate the droppable if used directly from draggables
-
- m[i].offset = m[i].element.offset();
- m[i].proportions = { width: m[i].element[0].offsetWidth, height: m[i].element[0].offsetHeight };
-
- }
-
- },
- drop: function(draggable, event) {
-
- var dropped = false;
- $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
-
- if(!this.options) return;
- if (!this.options.disabled && this.visible && $.ui.intersect(draggable, this, this.options.tolerance))
- dropped = this._drop.call(this, event) || dropped;
-
- if (!this.options.disabled && this.visible && this.accept.call(this.element[0],(draggable.currentItem || draggable.element))) {
- this.isout = 1; this.isover = 0;
- this._deactivate.call(this, event);
- }
-
- });
- return dropped;
-
- },
- dragStart: function( draggable, event ) {
- //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003)
- draggable.element.parents( ":not(body,html)" ).bind( "scroll.droppable", function() {
- if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );
- });
- },
- drag: function(draggable, event) {
-
- //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
- if(draggable.options.refreshPositions) $.ui.ddmanager.prepareOffsets(draggable, event);
-
- //Run through all droppables and check their positions based on specific tolerance options
- $.each($.ui.ddmanager.droppables[draggable.options.scope] || [], function() {
-
- if(this.options.disabled || this.greedyChild || !this.visible) return;
- var intersects = $.ui.intersect(draggable, this, this.options.tolerance);
-
- var c = !intersects && this.isover == 1 ? 'isout' : (intersects && this.isover == 0 ? 'isover' : null);
- if(!c) return;
-
- var parentInstance;
- if (this.options.greedy) {
- var parent = this.element.parents(':data(droppable):eq(0)');
- if (parent.length) {
- parentInstance = $.data(parent[0], 'droppable');
- parentInstance.greedyChild = (c == 'isover' ? 1 : 0);
- }
- }
-
- // we just moved into a greedy child
- if (parentInstance && c == 'isover') {
- parentInstance['isover'] = 0;
- parentInstance['isout'] = 1;
- parentInstance._out.call(parentInstance, event);
- }
-
- this[c] = 1; this[c == 'isout' ? 'isover' : 'isout'] = 0;
- this[c == "isover" ? "_over" : "_out"].call(this, event);
-
- // we just moved out of a greedy child
- if (parentInstance && c == 'isout') {
- parentInstance['isout'] = 0;
- parentInstance['isover'] = 1;
- parentInstance._over.call(parentInstance, event);
- }
- });
-
- },
- dragStop: function( draggable, event ) {
- draggable.element.parents( ":not(body,html)" ).unbind( "scroll.droppable" );
- //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003)
- if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event );
- }
-};
-
-})(jQuery);
-/*
- * jQuery UI Resizable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Resizables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-$.widget("ui.resizable", $.ui.mouse, {
- widgetEventPrefix: "resize",
- options: {
- alsoResize: false,
- animate: false,
- animateDuration: "slow",
- animateEasing: "swing",
- aspectRatio: false,
- autoHide: false,
- containment: false,
- ghost: false,
- grid: false,
- handles: "e,s,se",
- helper: false,
- maxHeight: null,
- maxWidth: null,
- minHeight: 10,
- minWidth: 10,
- zIndex: 1000
- },
- _create: function() {
-
- var self = this, o = this.options;
- this.element.addClass("ui-resizable");
-
- $.extend(this, {
- _aspectRatio: !!(o.aspectRatio),
- aspectRatio: o.aspectRatio,
- originalElement: this.element,
- _proportionallyResizeElements: [],
- _helper: o.helper || o.ghost || o.animate ? o.helper || 'ui-resizable-helper' : null
- });
-
- //Wrap the element if it cannot hold child nodes
- if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
-
- //Create a wrapper element and set the wrapper to the new current internal element
- this.element.wrap(
- $('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({
- position: this.element.css('position'),
- width: this.element.outerWidth(),
- height: this.element.outerHeight(),
- top: this.element.css('top'),
- left: this.element.css('left')
- })
- );
-
- //Overwrite the original this.element
- this.element = this.element.parent().data(
- "resizable", this.element.data('resizable')
- );
-
- this.elementIsWrapper = true;
-
- //Move margins to the wrapper
- this.element.css({ marginLeft: this.originalElement.css("marginLeft"), marginTop: this.originalElement.css("marginTop"), marginRight: this.originalElement.css("marginRight"), marginBottom: this.originalElement.css("marginBottom") });
- this.originalElement.css({ marginLeft: 0, marginTop: 0, marginRight: 0, marginBottom: 0});
-
- //Prevent Safari textarea resize
- this.originalResizeStyle = this.originalElement.css('resize');
- this.originalElement.css('resize', 'none');
-
- //Push the actual element to our proportionallyResize internal array
- this._proportionallyResizeElements.push(this.originalElement.css({ position: 'static', zoom: 1, display: 'block' }));
-
- // avoid IE jump (hard set the margin)
- this.originalElement.css({ margin: this.originalElement.css('margin') });
-
- // fix handlers offset
- this._proportionallyResize();
-
- }
-
- this.handles = o.handles || (!$('.ui-resizable-handle', this.element).length ? "e,s,se" : { n: '.ui-resizable-n', e: '.ui-resizable-e', s: '.ui-resizable-s', w: '.ui-resizable-w', se: '.ui-resizable-se', sw: '.ui-resizable-sw', ne: '.ui-resizable-ne', nw: '.ui-resizable-nw' });
- if(this.handles.constructor == String) {
-
- if(this.handles == 'all') this.handles = 'n,e,s,w,se,sw,ne,nw';
- var n = this.handles.split(","); this.handles = {};
-
- for(var i = 0; i < n.length; i++) {
-
- var handle = $.trim(n[i]), hname = 'ui-resizable-'+handle;
- var axis = $('<div class="ui-resizable-handle ' + hname + '"></div>');
-
- // increase zIndex of sw, se, ne, nw axis
- //TODO : this modifies original option
- if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex });
-
- //TODO : What's going on here?
- if ('se' == handle) {
- axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
- };
-
- //Insert into internal handles object and append to element
- this.handles[handle] = '.ui-resizable-'+handle;
- this.element.append(axis);
- }
-
- }
-
- this._renderAxis = function(target) {
-
- target = target || this.element;
-
- for(var i in this.handles) {
-
- if(this.handles[i].constructor == String)
- this.handles[i] = $(this.handles[i], this.element).show();
-
- //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
- if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
-
- var axis = $(this.handles[i], this.element), padWrapper = 0;
-
- //Checking the correct pad and border
- padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
-
- //The padding type i have to apply...
- var padPos = [ 'padding',
- /ne|nw|n/.test(i) ? 'Top' :
- /se|sw|s/.test(i) ? 'Bottom' :
- /^e$/.test(i) ? 'Right' : 'Left' ].join("");
-
- target.css(padPos, padWrapper);
-
- this._proportionallyResize();
-
- }
-
- //TODO: What's that good for? There's not anything to be executed left
- if(!$(this.handles[i]).length)
- continue;
-
- }
- };
-
- //TODO: make renderAxis a prototype function
- this._renderAxis(this.element);
-
- this._handles = $('.ui-resizable-handle', this.element)
- .disableSelection();
-
- //Matching axis name
- this._handles.mouseover(function() {
- if (!self.resizing) {
- if (this.className)
- var axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
- //Axis, default = se
- self.axis = axis && axis[1] ? axis[1] : 'se';
- }
- });
-
- //If we want to auto hide the elements
- if (o.autoHide) {
- this._handles.hide();
- $(this.element)
- .addClass("ui-resizable-autohide")
- .hover(function() {
- if (o.disabled) return;
- $(this).removeClass("ui-resizable-autohide");
- self._handles.show();
- },
- function(){
- if (o.disabled) return;
- if (!self.resizing) {
- $(this).addClass("ui-resizable-autohide");
- self._handles.hide();
- }
- });
- }
-
- //Initialize the mouse interaction
- this._mouseInit();
-
- },
-
- destroy: function() {
-
- this._mouseDestroy();
-
- var _destroy = function(exp) {
- $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
- .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
- };
-
- //TODO: Unwrap at same DOM position
- if (this.elementIsWrapper) {
- _destroy(this.element);
- var wrapper = this.element;
- wrapper.after(
- this.originalElement.css({
- position: wrapper.css('position'),
- width: wrapper.outerWidth(),
- height: wrapper.outerHeight(),
- top: wrapper.css('top'),
- left: wrapper.css('left')
- })
- ).remove();
- }
-
- this.originalElement.css('resize', this.originalResizeStyle);
- _destroy(this.originalElement);
-
- return this;
- },
-
- _mouseCapture: function(event) {
- var handle = false;
- for (var i in this.handles) {
- if ($(this.handles[i])[0] == event.target) {
- handle = true;
- }
- }
-
- return !this.options.disabled && handle;
- },
-
- _mouseStart: function(event) {
-
- var o = this.options, iniPos = this.element.position(), el = this.element;
-
- this.resizing = true;
- this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft() };
-
- // bugfix for http://dev.jquery.com/ticket/1749
- if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
- el.css({ position: 'absolute', top: iniPos.top, left: iniPos.left });
- }
-
- this._renderProxy();
-
- var curleft = num(this.helper.css('left')), curtop = num(this.helper.css('top'));
-
- if (o.containment) {
- curleft += $(o.containment).scrollLeft() || 0;
- curtop += $(o.containment).scrollTop() || 0;
- }
-
- //Store needed variables
- this.offset = this.helper.offset();
- this.position = { left: curleft, top: curtop };
- this.size = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() };
- this.originalPosition = { left: curleft, top: curtop };
- this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() };
- this.originalMousePosition = { left: event.pageX, top: event.pageY };
-
- //Aspect Ratio
- this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width / this.originalSize.height) || 1);
-
- var cursor = $('.ui-resizable-' + this.axis).css('cursor');
- $('body').css('cursor', cursor == 'auto' ? this.axis + '-resize' : cursor);
-
- el.addClass("ui-resizable-resizing");
- this._propagate("start", event);
- return true;
- },
-
- _mouseDrag: function(event) {
-
- //Increase performance, avoid regex
- var el = this.helper, o = this.options, props = {},
- self = this, smp = this.originalMousePosition, a = this.axis;
-
- var dx = (event.pageX-smp.left)||0, dy = (event.pageY-smp.top)||0;
- var trigger = this._change[a];
- if (!trigger) return false;
-
- // Calculate the attrs that will be change
- var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
-
- // Put this in the mouseDrag handler since the user can start pressing shift while resizing
- this._updateVirtualBoundaries(event.shiftKey);
- if (this._aspectRatio || event.shiftKey)
- data = this._updateRatio(data, event);
-
- data = this._respectSize(data, event);
-
- // plugins callbacks need to be called first
- this._propagate("resize", event);
-
- el.css({
- top: this.position.top + "px", left: this.position.left + "px",
- width: this.size.width + "px", height: this.size.height + "px"
- });
-
- if (!this._helper && this._proportionallyResizeElements.length)
- this._proportionallyResize();
-
- this._updateCache(data);
-
- // calling the user callback at the end
- this._trigger('resize', event, this.ui());
-
- return false;
- },
-
- _mouseStop: function(event) {
-
- this.resizing = false;
- var o = this.options, self = this;
-
- if(this._helper) {
- var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var s = { width: (self.helper.width() - soffsetw), height: (self.helper.height() - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- if (!o.animate)
- this.element.css($.extend(s, { top: top, left: left }));
-
- self.helper.height(self.size.height);
- self.helper.width(self.size.width);
-
- if (this._helper && !o.animate) this._proportionallyResize();
- }
-
- $('body').css('cursor', 'auto');
-
- this.element.removeClass("ui-resizable-resizing");
-
- this._propagate("stop", event);
-
- if (this._helper) this.helper.remove();
- return false;
-
- },
-
- _updateVirtualBoundaries: function(forceAspectRatio) {
- var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;
-
- b = {
- minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
- maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
- minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
- maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
- };
-
- if(this._aspectRatio || forceAspectRatio) {
- // We want to create an enclosing box whose aspect ration is the requested one
- // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
- pMinWidth = b.minHeight * this.aspectRatio;
- pMinHeight = b.minWidth / this.aspectRatio;
- pMaxWidth = b.maxHeight * this.aspectRatio;
- pMaxHeight = b.maxWidth / this.aspectRatio;
-
- if(pMinWidth > b.minWidth) b.minWidth = pMinWidth;
- if(pMinHeight > b.minHeight) b.minHeight = pMinHeight;
- if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth;
- if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight;
- }
- this._vBoundaries = b;
- },
-
- _updateCache: function(data) {
- var o = this.options;
- this.offset = this.helper.offset();
- if (isNumber(data.left)) this.position.left = data.left;
- if (isNumber(data.top)) this.position.top = data.top;
- if (isNumber(data.height)) this.size.height = data.height;
- if (isNumber(data.width)) this.size.width = data.width;
- },
-
- _updateRatio: function(data, event) {
-
- var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
-
- if (isNumber(data.height)) data.width = (data.height * this.aspectRatio);
- else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio);
-
- if (a == 'sw') {
- data.left = cpos.left + (csize.width - data.width);
- data.top = null;
- }
- if (a == 'nw') {
- data.top = cpos.top + (csize.height - data.height);
- data.left = cpos.left + (csize.width - data.width);
- }
-
- return data;
- },
-
- _respectSize: function(data, event) {
-
- var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
- ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
- isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
-
- if (isminw) data.width = o.minWidth;
- if (isminh) data.height = o.minHeight;
- if (ismaxw) data.width = o.maxWidth;
- if (ismaxh) data.height = o.maxHeight;
-
- var dw = this.originalPosition.left + this.originalSize.width, dh = this.position.top + this.size.height;
- var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
-
- if (isminw && cw) data.left = dw - o.minWidth;
- if (ismaxw && cw) data.left = dw - o.maxWidth;
- if (isminh && ch) data.top = dh - o.minHeight;
- if (ismaxh && ch) data.top = dh - o.maxHeight;
-
- // fixing jump error on top/left - bug #2330
- var isNotwh = !data.width && !data.height;
- if (isNotwh && !data.left && data.top) data.top = null;
- else if (isNotwh && !data.top && data.left) data.left = null;
-
- return data;
- },
-
- _proportionallyResize: function() {
-
- var o = this.options;
- if (!this._proportionallyResizeElements.length) return;
- var element = this.helper || this.element;
-
- for (var i=0; i < this._proportionallyResizeElements.length; i++) {
-
- var prel = this._proportionallyResizeElements[i];
-
- if (!this.borderDif) {
- var b = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
- p = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
-
- this.borderDif = $.map(b, function(v, i) {
- var border = parseInt(v,10)||0, padding = parseInt(p[i],10)||0;
- return border + padding;
- });
- }
-
- if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
- continue;
-
- prel.css({
- height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
- width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
- });
-
- };
-
- },
-
- _renderProxy: function() {
-
- var el = this.element, o = this.options;
- this.elementOffset = el.offset();
-
- if(this._helper) {
-
- this.helper = this.helper || $('<div style="overflow:hidden;"></div>');
-
- // fix ie6 offset TODO: This seems broken
- var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0),
- pxyoffset = ( ie6 ? 2 : -1 );
-
- this.helper.addClass(this._helper).css({
- width: this.element.outerWidth() + pxyoffset,
- height: this.element.outerHeight() + pxyoffset,
- position: 'absolute',
- left: this.elementOffset.left - ie6offset +'px',
- top: this.elementOffset.top - ie6offset +'px',
- zIndex: ++o.zIndex //TODO: Don't modify option
- });
-
- this.helper
- .appendTo("body")
- .disableSelection();
-
- } else {
- this.helper = this.element;
- }
-
- },
-
- _change: {
- e: function(event, dx, dy) {
- return { width: this.originalSize.width + dx };
- },
- w: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { left: sp.left + dx, width: cs.width - dx };
- },
- n: function(event, dx, dy) {
- var o = this.options, cs = this.originalSize, sp = this.originalPosition;
- return { top: sp.top + dy, height: cs.height - dy };
- },
- s: function(event, dx, dy) {
- return { height: this.originalSize.height + dy };
- },
- se: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- sw: function(event, dx, dy) {
- return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- },
- ne: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
- },
- nw: function(event, dx, dy) {
- return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]));
- }
- },
-
- _propagate: function(n, event) {
- $.ui.plugin.call(this, n, [event, this.ui()]);
- (n != "resize" && this._trigger(n, event, this.ui()));
- },
-
- plugins: {},
-
- ui: function() {
- return {
- originalElement: this.originalElement,
- element: this.element,
- helper: this.helper,
- position: this.position,
- size: this.size,
- originalSize: this.originalSize,
- originalPosition: this.originalPosition
- };
- }
-
-});
-
-$.extend($.ui.resizable, {
- version: "1.8.18"
-});
-
-/*
- * Resizable Extensions
- */
-
-$.ui.plugin.add("resizable", "alsoResize", {
-
- start: function (event, ui) {
- var self = $(this).data("resizable"), o = self.options;
-
- var _store = function (exp) {
- $(exp).each(function() {
- var el = $(this);
- el.data("resizable-alsoresize", {
- width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
- left: parseInt(el.css('left'), 10), top: parseInt(el.css('top'), 10)
- });
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
- if (o.alsoResize.length) { o.alsoResize = o.alsoResize[0]; _store(o.alsoResize); }
- else { $.each(o.alsoResize, function (exp) { _store(exp); }); }
- }else{
- _store(o.alsoResize);
- }
- },
-
- resize: function (event, ui) {
- var self = $(this).data("resizable"), o = self.options, os = self.originalSize, op = self.originalPosition;
-
- var delta = {
- height: (self.size.height - os.height) || 0, width: (self.size.width - os.width) || 0,
- top: (self.position.top - op.top) || 0, left: (self.position.left - op.left) || 0
- },
-
- _alsoResize = function (exp, c) {
- $(exp).each(function() {
- var el = $(this), start = $(this).data("resizable-alsoresize"), style = {},
- css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];
-
- $.each(css, function (i, prop) {
- var sum = (start[prop]||0) + (delta[prop]||0);
- if (sum && sum >= 0)
- style[prop] = sum || null;
- });
-
- el.css(style);
- });
- };
-
- if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
- $.each(o.alsoResize, function (exp, c) { _alsoResize(exp, c); });
- }else{
- _alsoResize(o.alsoResize);
- }
- },
-
- stop: function (event, ui) {
- $(this).removeData("resizable-alsoresize");
- }
-});
-
-$.ui.plugin.add("resizable", "animate", {
-
- stop: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options;
-
- var pr = self._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName),
- soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height,
- soffsetw = ista ? 0 : self.sizeDiff.width;
-
- var style = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) },
- left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null,
- top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null;
-
- self.element.animate(
- $.extend(style, top && left ? { top: top, left: left } : {}), {
- duration: o.animateDuration,
- easing: o.animateEasing,
- step: function() {
-
- var data = {
- width: parseInt(self.element.css('width'), 10),
- height: parseInt(self.element.css('height'), 10),
- top: parseInt(self.element.css('top'), 10),
- left: parseInt(self.element.css('left'), 10)
- };
-
- if (pr && pr.length) $(pr[0]).css({ width: data.width, height: data.height });
-
- // propagating resize, and updating values for each animation step
- self._updateCache(data);
- self._propagate("resize", event);
-
- }
- }
- );
- }
-
-});
-
-$.ui.plugin.add("resizable", "containment", {
-
- start: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, el = self.element;
- var oc = o.containment, ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
- if (!ce) return;
-
- self.containerElement = $(ce);
-
- if (/document/.test(oc) || oc == document) {
- self.containerOffset = { left: 0, top: 0 };
- self.containerPosition = { left: 0, top: 0 };
-
- self.parentData = {
- element: $(document), left: 0, top: 0,
- width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
- };
- }
-
- // i'm a node, so compute top, left, right, bottom
- else {
- var element = $(ce), p = [];
- $([ "Top", "Right", "Left", "Bottom" ]).each(function(i, name) { p[i] = num(element.css("padding" + name)); });
-
- self.containerOffset = element.offset();
- self.containerPosition = element.position();
- self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1]) };
-
- var co = self.containerOffset, ch = self.containerSize.height, cw = self.containerSize.width,
- width = ($.ui.hasScroll(ce, "left") ? ce.scrollWidth : cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight : ch);
-
- self.parentData = {
- element: ce, left: co.left, top: co.top, width: width, height: height
- };
- }
- },
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options,
- ps = self.containerSize, co = self.containerOffset, cs = self.size, cp = self.position,
- pRatio = self._aspectRatio || event.shiftKey, cop = { top:0, left:0 }, ce = self.containerElement;
-
- if (ce[0] != document && (/static/).test(ce.css('position'))) cop = co;
-
- if (cp.left < (self._helper ? co.left : 0)) {
- self.size.width = self.size.width + (self._helper ? (self.position.left - co.left) : (self.position.left - cop.left));
- if (pRatio) self.size.height = self.size.width / o.aspectRatio;
- self.position.left = o.helper ? co.left : 0;
- }
-
- if (cp.top < (self._helper ? co.top : 0)) {
- self.size.height = self.size.height + (self._helper ? (self.position.top - co.top) : self.position.top);
- if (pRatio) self.size.width = self.size.height * o.aspectRatio;
- self.position.top = self._helper ? co.top : 0;
- }
-
- self.offset.left = self.parentData.left+self.position.left;
- self.offset.top = self.parentData.top+self.position.top;
-
- var woset = Math.abs( (self._helper ? self.offset.left - cop.left : (self.offset.left - cop.left)) + self.sizeDiff.width ),
- hoset = Math.abs( (self._helper ? self.offset.top - cop.top : (self.offset.top - co.top)) + self.sizeDiff.height );
-
- var isParent = self.containerElement.get(0) == self.element.parent().get(0),
- isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
-
- if(isParent && isOffsetRelative) woset -= self.parentData.left;
-
- if (woset + self.size.width >= self.parentData.width) {
- self.size.width = self.parentData.width - woset;
- if (pRatio) self.size.height = self.size.width / self.aspectRatio;
- }
-
- if (hoset + self.size.height >= self.parentData.height) {
- self.size.height = self.parentData.height - hoset;
- if (pRatio) self.size.width = self.size.height * self.aspectRatio;
- }
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options, cp = self.position,
- co = self.containerOffset, cop = self.containerPosition, ce = self.containerElement;
-
- var helper = $(self.helper), ho = helper.offset(), w = helper.outerWidth() - self.sizeDiff.width, h = helper.outerHeight() - self.sizeDiff.height;
-
- if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- if (self._helper && !o.animate && (/static/).test(ce.css('position')))
- $(this).css({ left: ho.left - cop.left - co.left, width: w, height: h });
-
- }
-});
-
-$.ui.plugin.add("resizable", "ghost", {
-
- start: function(event, ui) {
-
- var self = $(this).data("resizable"), o = self.options, cs = self.size;
-
- self.ghost = self.originalElement.clone();
- self.ghost
- .css({ opacity: .25, display: 'block', position: 'relative', height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 })
- .addClass('ui-resizable-ghost')
- .addClass(typeof o.ghost == 'string' ? o.ghost : '');
-
- self.ghost.appendTo(self.helper);
-
- },
-
- resize: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost) self.ghost.css({ position: 'relative', height: self.size.height, width: self.size.width });
- },
-
- stop: function(event, ui){
- var self = $(this).data("resizable"), o = self.options;
- if (self.ghost && self.helper) self.helper.get(0).removeChild(self.ghost.get(0));
- }
-
-});
-
-$.ui.plugin.add("resizable", "grid", {
-
- resize: function(event, ui) {
- var self = $(this).data("resizable"), o = self.options, cs = self.size, os = self.originalSize, op = self.originalPosition, a = self.axis, ratio = o._aspectRatio || event.shiftKey;
- o.grid = typeof o.grid == "number" ? [o.grid, o.grid] : o.grid;
- var ox = Math.round((cs.width - os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy = Math.round((cs.height - os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
-
- if (/^(se|s|e)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- }
- else if (/^(ne)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- }
- else if (/^(sw)$/.test(a)) {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.left = op.left - ox;
- }
- else {
- self.size.width = os.width + ox;
- self.size.height = os.height + oy;
- self.position.top = op.top - oy;
- self.position.left = op.left - ox;
- }
- }
-
-});
-
-var num = function(v) {
- return parseInt(v, 10) || 0;
-};
-
-var isNumber = function(value) {
- return !isNaN(parseInt(value, 10));
-};
-
-})(jQuery);
-/*
- * jQuery UI Selectable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Selectables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-$.widget("ui.selectable", $.ui.mouse, {
- options: {
- appendTo: 'body',
- autoRefresh: true,
- distance: 0,
- filter: '*',
- tolerance: 'touch'
- },
- _create: function() {
- var self = this;
-
- this.element.addClass("ui-selectable");
-
- this.dragged = false;
-
- // cache selectee children based on filter
- var selectees;
- this.refresh = function() {
- selectees = $(self.options.filter, self.element[0]);
- selectees.addClass("ui-selectee");
- selectees.each(function() {
- var $this = $(this);
- var pos = $this.offset();
- $.data(this, "selectable-item", {
- element: this,
- $element: $this,
- left: pos.left,
- top: pos.top,
- right: pos.left + $this.outerWidth(),
- bottom: pos.top + $this.outerHeight(),
- startselected: false,
- selected: $this.hasClass('ui-selected'),
- selecting: $this.hasClass('ui-selecting'),
- unselecting: $this.hasClass('ui-unselecting')
- });
- });
- };
- this.refresh();
-
- this.selectees = selectees.addClass("ui-selectee");
-
- this._mouseInit();
-
- this.helper = $("<div class='ui-selectable-helper'></div>");
- },
-
- destroy: function() {
- this.selectees
- .removeClass("ui-selectee")
- .removeData("selectable-item");
- this.element
- .removeClass("ui-selectable ui-selectable-disabled")
- .removeData("selectable")
- .unbind(".selectable");
- this._mouseDestroy();
-
- return this;
- },
-
- _mouseStart: function(event) {
- var self = this;
-
- this.opos = [event.pageX, event.pageY];
-
- if (this.options.disabled)
- return;
-
- var options = this.options;
-
- this.selectees = $(options.filter, this.element[0]);
-
- this._trigger("start", event);
-
- $(options.appendTo).append(this.helper);
- // position helper (lasso)
- this.helper.css({
- "left": event.clientX,
- "top": event.clientY,
- "width": 0,
- "height": 0
- });
-
- if (options.autoRefresh) {
- this.refresh();
- }
-
- this.selectees.filter('.ui-selected').each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.startselected = true;
- if (!event.metaKey && !event.ctrlKey) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- // selectable UNSELECTING callback
- self._trigger("unselecting", event, {
- unselecting: selectee.element
- });
- }
- });
-
- $(event.target).parents().andSelf().each(function() {
- var selectee = $.data(this, "selectable-item");
- if (selectee) {
- var doSelect = (!event.metaKey && !event.ctrlKey) || !selectee.$element.hasClass('ui-selected');
- selectee.$element
- .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
- .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
- selectee.unselecting = !doSelect;
- selectee.selecting = doSelect;
- selectee.selected = doSelect;
- // selectable (UN)SELECTING callback
- if (doSelect) {
- self._trigger("selecting", event, {
- selecting: selectee.element
- });
- } else {
- self._trigger("unselecting", event, {
- unselecting: selectee.element
- });
- }
- return false;
- }
- });
-
- },
-
- _mouseDrag: function(event) {
- var self = this;
- this.dragged = true;
-
- if (this.options.disabled)
- return;
-
- var options = this.options;
-
- var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
- if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
- if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
- this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
-
- this.selectees.each(function() {
- var selectee = $.data(this, "selectable-item");
- //prevent helper from being selected if appendTo: selectable
- if (!selectee || selectee.element == self.element[0])
- return;
- var hit = false;
- if (options.tolerance == 'touch') {
- hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
- } else if (options.tolerance == 'fit') {
- hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
- }
-
- if (hit) {
- // SELECT
- if (selectee.selected) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
- }
- if (selectee.unselecting) {
- selectee.$element.removeClass('ui-unselecting');
- selectee.unselecting = false;
- }
- if (!selectee.selecting) {
- selectee.$element.addClass('ui-selecting');
- selectee.selecting = true;
- // selectable SELECTING callback
- self._trigger("selecting", event, {
- selecting: selectee.element
- });
- }
- } else {
- // UNSELECT
- if (selectee.selecting) {
- if ((event.metaKey || event.ctrlKey) && selectee.startselected) {
- selectee.$element.removeClass('ui-selecting');
- selectee.selecting = false;
- selectee.$element.addClass('ui-selected');
- selectee.selected = true;
- } else {
- selectee.$element.removeClass('ui-selecting');
- selectee.selecting = false;
- if (selectee.startselected) {
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- }
- // selectable UNSELECTING callback
- self._trigger("unselecting", event, {
- unselecting: selectee.element
- });
- }
- }
- if (selectee.selected) {
- if (!event.metaKey && !event.ctrlKey && !selectee.startselected) {
- selectee.$element.removeClass('ui-selected');
- selectee.selected = false;
-
- selectee.$element.addClass('ui-unselecting');
- selectee.unselecting = true;
- // selectable UNSELECTING callback
- self._trigger("unselecting", event, {
- unselecting: selectee.element
- });
- }
- }
- }
- });
-
- return false;
- },
-
- _mouseStop: function(event) {
- var self = this;
-
- this.dragged = false;
-
- var options = this.options;
-
- $('.ui-unselecting', this.element[0]).each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.$element.removeClass('ui-unselecting');
- selectee.unselecting = false;
- selectee.startselected = false;
- self._trigger("unselected", event, {
- unselected: selectee.element
- });
- });
- $('.ui-selecting', this.element[0]).each(function() {
- var selectee = $.data(this, "selectable-item");
- selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
- selectee.selecting = false;
- selectee.selected = true;
- selectee.startselected = true;
- self._trigger("selected", event, {
- selected: selectee.element
- });
- });
- this._trigger("stop", event);
-
- this.helper.remove();
-
- return false;
- }
-
-});
-
-$.extend($.ui.selectable, {
- version: "1.8.18"
-});
-
-})(jQuery);
-/*
- * jQuery UI Sortable 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Sortables
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-$.widget("ui.sortable", $.ui.mouse, {
- widgetEventPrefix: "sort",
- ready: false,
- options: {
- appendTo: "parent",
- axis: false,
- connectWith: false,
- containment: false,
- cursor: 'auto',
- cursorAt: false,
- dropOnEmpty: true,
- forcePlaceholderSize: false,
- forceHelperSize: false,
- grid: false,
- handle: false,
- helper: "original",
- items: '> *',
- opacity: false,
- placeholder: false,
- revert: false,
- scroll: true,
- scrollSensitivity: 20,
- scrollSpeed: 20,
- scope: "default",
- tolerance: "intersect",
- zIndex: 1000
- },
- _create: function() {
-
- var o = this.options;
- this.containerCache = {};
- this.element.addClass("ui-sortable");
-
- //Get the items
- this.refresh();
-
- //Let's determine if the items are being displayed horizontally
- this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;
-
- //Let's determine the parent's offset
- this.offset = this.element.offset();
-
- //Initialize mouse events for interaction
- this._mouseInit();
-
- //We're ready to go
- this.ready = true
-
- },
-
- destroy: function() {
- $.Widget.prototype.destroy.call( this );
- this.element
- .removeClass("ui-sortable ui-sortable-disabled");
- this._mouseDestroy();
-
- for ( var i = this.items.length - 1; i >= 0; i-- )
- this.items[i].item.removeData(this.widgetName + "-item");
-
- return this;
- },
-
- _setOption: function(key, value){
- if ( key === "disabled" ) {
- this.options[ key ] = value;
-
- this.widget()
- [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" );
- } else {
- // Don't call widget base _setOption for disable as it adds ui-state-disabled class
- $.Widget.prototype._setOption.apply(this, arguments);
- }
- },
-
- _mouseCapture: function(event, overrideHandle) {
- var that = this;
-
- if (this.reverting) {
- return false;
- }
-
- if(this.options.disabled || this.options.type == 'static') return false;
-
- //We have to refresh the items data once first
- this._refreshItems(event);
-
- //Find out if the clicked node (or one of its parents) is a actual item in this.items
- var currentItem = null, self = this, nodes = $(event.target).parents().each(function() {
- if($.data(this, that.widgetName + '-item') == self) {
- currentItem = $(this);
- return false;
- }
- });
- if($.data(event.target, that.widgetName + '-item') == self) currentItem = $(event.target);
-
- if(!currentItem) return false;
- if(this.options.handle && !overrideHandle) {
- var validHandle = false;
-
- $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
- if(!validHandle) return false;
- }
-
- this.currentItem = currentItem;
- this._removeCurrentsFromItems();
- return true;
-
- },
-
- _mouseStart: function(event, overrideHandle, noActivation) {
-
- var o = this.options, self = this;
- this.currentContainer = this;
-
- //We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
- this.refreshPositions();
-
- //Create and append the visible helper
- this.helper = this._createHelper(event);
-
- //Cache the helper size
- this._cacheHelperProportions();
-
- /*
- * - Position generation -
- * This block generates everything position related - it's the core of draggables.
- */
-
- //Cache the margins of the original element
- this._cacheMargins();
-
- //Get the next scrolling parent
- this.scrollParent = this.helper.scrollParent();
-
- //The element's absolute position on the page minus margins
- this.offset = this.currentItem.offset();
- this.offset = {
- top: this.offset.top - this.margins.top,
- left: this.offset.left - this.margins.left
- };
-
- // Only after we got the offset, we can change the helper's position to absolute
- // TODO: Still need to figure out a way to make relative sorting possible
- this.helper.css("position", "absolute");
- this.cssPosition = this.helper.css("position");
-
- $.extend(this.offset, {
- click: { //Where the click happened, relative to the element
- left: event.pageX - this.offset.left,
- top: event.pageY - this.offset.top
- },
- parent: this._getParentOffset(),
- relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
- });
-
- //Generate the original position
- this.originalPosition = this._generatePosition(event);
- this.originalPageX = event.pageX;
- this.originalPageY = event.pageY;
-
- //Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
- (o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
-
- //Cache the former DOM position
- this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
-
- //If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
- if(this.helper[0] != this.currentItem[0]) {
- this.currentItem.hide();
- }
-
- //Create the placeholder
- this._createPlaceholder();
-
- //Set a containment if given in the options
- if(o.containment)
- this._setContainment();
-
- if(o.cursor) { // cursor option
- if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
- $('body').css("cursor", o.cursor);
- }
-
- if(o.opacity) { // opacity option
- if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
- this.helper.css("opacity", o.opacity);
- }
-
- if(o.zIndex) { // zIndex option
- if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
- this.helper.css("zIndex", o.zIndex);
- }
-
- //Prepare scrolling
- if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
- this.overflowOffset = this.scrollParent.offset();
-
- //Call callbacks
- this._trigger("start", event, this._uiHash());
-
- //Recache the helper size
- if(!this._preserveHelperProportions)
- this._cacheHelperProportions();
-
-
- //Post 'activate' events to possible containers
- if(!noActivation) {
- for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, self._uiHash(this)); }
- }
-
- //Prepare possible droppables
- if($.ui.ddmanager)
- $.ui.ddmanager.current = this;
-
- if ($.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(this, event);
-
- this.dragging = true;
-
- this.helper.addClass("ui-sortable-helper");
- this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
- return true;
-
- },
-
- _mouseDrag: function(event) {
-
- //Compute the helpers position
- this.position = this._generatePosition(event);
- this.positionAbs = this._convertPositionTo("absolute");
-
- if (!this.lastPositionAbs) {
- this.lastPositionAbs = this.positionAbs;
- }
-
- //Do scrolling
- if(this.options.scroll) {
- var o = this.options, scrolled = false;
- if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
-
- if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
- else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
- this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
-
- if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
- else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
- this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
-
- } else {
-
- if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
- else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
- scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
-
- if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
- else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
- scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
-
- }
-
- if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
- $.ui.ddmanager.prepareOffsets(this, event);
- }
-
- //Regenerate the absolute position used for position checks
- this.positionAbs = this._convertPositionTo("absolute");
-
- //Set the helper position
- if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
- if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
-
- //Rearrange
- for (var i = this.items.length - 1; i >= 0; i--) {
-
- //Cache variables and intersection, continue if no intersection
- var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
- if (!intersection) continue;
-
- if(itemElement != this.currentItem[0] //cannot intersect with itself
- && this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
- && !$.ui.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
- && (this.options.type == 'semi-dynamic' ? !$.ui.contains(this.element[0], itemElement) : true)
- //&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
- ) {
-
- this.direction = intersection == 1 ? "down" : "up";
-
- if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
- this._rearrange(event, item);
- } else {
- break;
- }
-
- this._trigger("change", event, this._uiHash());
- break;
- }
- }
-
- //Post events to containers
- this._contactContainers(event);
-
- //Interconnect with droppables
- if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
-
- //Call callbacks
- this._trigger('sort', event, this._uiHash());
-
- this.lastPositionAbs = this.positionAbs;
- return false;
-
- },
-
- _mouseStop: function(event, noPropagation) {
-
- if(!event) return;
-
- //If we are using droppables, inform the manager about the drop
- if ($.ui.ddmanager && !this.options.dropBehaviour)
- $.ui.ddmanager.drop(this, event);
-
- if(this.options.revert) {
- var self = this;
- var cur = self.placeholder.offset();
-
- self.reverting = true;
-
- $(this.helper).animate({
- left: cur.left - this.offset.parent.left - self.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
- top: cur.top - this.offset.parent.top - self.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
- }, parseInt(this.options.revert, 10) || 500, function() {
- self._clear(event);
- });
- } else {
- this._clear(event, noPropagation);
- }
-
- return false;
-
- },
-
- cancel: function() {
-
- var self = this;
-
- if(this.dragging) {
-
- this._mouseUp({ target: null });
-
- if(this.options.helper == "original")
- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
- else
- this.currentItem.show();
-
- //Post deactivating events to containers
- for (var i = this.containers.length - 1; i >= 0; i--){
- this.containers[i]._trigger("deactivate", null, self._uiHash(this));
- if(this.containers[i].containerCache.over) {
- this.containers[i]._trigger("out", null, self._uiHash(this));
- this.containers[i].containerCache.over = 0;
- }
- }
-
- }
-
- if (this.placeholder) {
- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
- if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
- if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();
-
- $.extend(this, {
- helper: null,
- dragging: false,
- reverting: false,
- _noFinalSort: null
- });
-
- if(this.domPosition.prev) {
- $(this.domPosition.prev).after(this.currentItem);
- } else {
- $(this.domPosition.parent).prepend(this.currentItem);
- }
- }
-
- return this;
-
- },
-
- serialize: function(o) {
-
- var items = this._getItemsAsjQuery(o && o.connected);
- var str = []; o = o || {};
-
- $(items).each(function() {
- var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
- if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
- });
-
- if(!str.length && o.key) {
- str.push(o.key + '=');
- }
-
- return str.join('&');
-
- },
-
- toArray: function(o) {
-
- var items = this._getItemsAsjQuery(o && o.connected);
- var ret = []; o = o || {};
-
- items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
- return ret;
-
- },
-
- /* Be careful with the following core functions */
- _intersectsWith: function(item) {
-
- var x1 = this.positionAbs.left,
- x2 = x1 + this.helperProportions.width,
- y1 = this.positionAbs.top,
- y2 = y1 + this.helperProportions.height;
-
- var l = item.left,
- r = l + item.width,
- t = item.top,
- b = t + item.height;
-
- var dyClick = this.offset.click.top,
- dxClick = this.offset.click.left;
-
- var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
-
- if( this.options.tolerance == "pointer"
- || this.options.forcePointerForContainers
- || (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
- ) {
- return isOverElement;
- } else {
-
- return (l < x1 + (this.helperProportions.width / 2) // Right Half
- && x2 - (this.helperProportions.width / 2) < r // Left Half
- && t < y1 + (this.helperProportions.height / 2) // Bottom Half
- && y2 - (this.helperProportions.height / 2) < b ); // Top Half
-
- }
- },
-
- _intersectsWithPointer: function(item) {
-
- var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
- isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
- isOverElement = isOverElementHeight && isOverElementWidth,
- verticalDirection = this._getDragVerticalDirection(),
- horizontalDirection = this._getDragHorizontalDirection();
-
- if (!isOverElement)
- return false;
-
- return this.floating ?
- ( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
- : ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );
-
- },
-
- _intersectsWithSides: function(item) {
-
- var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
- isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
- verticalDirection = this._getDragVerticalDirection(),
- horizontalDirection = this._getDragHorizontalDirection();
-
- if (this.floating && horizontalDirection) {
- return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
- } else {
- return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
- }
-
- },
-
- _getDragVerticalDirection: function() {
- var delta = this.positionAbs.top - this.lastPositionAbs.top;
- return delta != 0 && (delta > 0 ? "down" : "up");
- },
-
- _getDragHorizontalDirection: function() {
- var delta = this.positionAbs.left - this.lastPositionAbs.left;
- return delta != 0 && (delta > 0 ? "right" : "left");
- },
-
- refresh: function(event) {
- this._refreshItems(event);
- this.refreshPositions();
- return this;
- },
-
- _connectWith: function() {
- var options = this.options;
- return options.connectWith.constructor == String
- ? [options.connectWith]
- : options.connectWith;
- },
-
- _getItemsAsjQuery: function(connected) {
-
- var self = this;
- var items = [];
- var queries = [];
- var connectWith = this._connectWith();
-
- if(connectWith && connected) {
- for (var i = connectWith.length - 1; i >= 0; i--){
- var cur = $(connectWith[i]);
- for (var j = cur.length - 1; j >= 0; j--){
- var inst = $.data(cur[j], this.widgetName);
- if(inst && inst != this && !inst.options.disabled) {
- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]);
- }
- };
- };
- }
-
- queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]);
-
- for (var i = queries.length - 1; i >= 0; i--){
- queries[i][0].each(function() {
- items.push(this);
- });
- };
-
- return $(items);
-
- },
-
- _removeCurrentsFromItems: function() {
-
- var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
-
- for (var i=0; i < this.items.length; i++) {
-
- for (var j=0; j < list.length; j++) {
- if(list[j] == this.items[i].item[0])
- this.items.splice(i,1);
- };
-
- };
-
- },
-
- _refreshItems: function(event) {
-
- this.items = [];
- this.containers = [this];
- var items = this.items;
- var self = this;
- var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
- var connectWith = this._connectWith();
-
- if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
- for (var i = connectWith.length - 1; i >= 0; i--){
- var cur = $(connectWith[i]);
- for (var j = cur.length - 1; j >= 0; j--){
- var inst = $.data(cur[j], this.widgetName);
- if(inst && inst != this && !inst.options.disabled) {
- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
- this.containers.push(inst);
- }
- };
- };
- }
-
- for (var i = queries.length - 1; i >= 0; i--) {
- var targetData = queries[i][1];
- var _queries = queries[i][0];
-
- for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
- var item = $(_queries[j]);
-
- item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)
-
- items.push({
- item: item,
- instance: targetData,
- width: 0, height: 0,
- left: 0, top: 0
- });
- };
- };
-
- },
-
- refreshPositions: function(fast) {
-
- //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
- if(this.offsetParent && this.helper) {
- this.offset.parent = this._getParentOffset();
- }
-
- for (var i = this.items.length - 1; i >= 0; i--){
- var item = this.items[i];
-
- //We ignore calculating positions of all connected containers when we're not over them
- if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
- continue;
-
- var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
-
- if (!fast) {
- item.width = t.outerWidth();
- item.height = t.outerHeight();
- }
-
- var p = t.offset();
- item.left = p.left;
- item.top = p.top;
- };
-
- if(this.options.custom && this.options.custom.refreshContainers) {
- this.options.custom.refreshContainers.call(this);
- } else {
- for (var i = this.containers.length - 1; i >= 0; i--){
- var p = this.containers[i].element.offset();
- this.containers[i].containerCache.left = p.left;
- this.containers[i].containerCache.top = p.top;
- this.containers[i].containerCache.width = this.containers[i].element.outerWidth();
- this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
- };
- }
-
- return this;
- },
-
- _createPlaceholder: function(that) {
-
- var self = that || this, o = self.options;
-
- if(!o.placeholder || o.placeholder.constructor == String) {
- var className = o.placeholder;
- o.placeholder = {
- element: function() {
-
- var el = $(document.createElement(self.currentItem[0].nodeName))
- .addClass(className || self.currentItem[0].className+" ui-sortable-placeholder")
- .removeClass("ui-sortable-helper")[0];
-
- if(!className)
- el.style.visibility = "hidden";
-
- return el;
- },
- update: function(container, p) {
-
- // 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
- // 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
- if(className && !o.forcePlaceholderSize) return;
-
- //If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
- if(!p.height()) { p.height(self.currentItem.innerHeight() - parseInt(self.currentItem.css('paddingTop')||0, 10) - parseInt(self.currentItem.css('paddingBottom')||0, 10)); };
- if(!p.width()) { p.width(self.currentItem.innerWidth() - parseInt(self.currentItem.css('paddingLeft')||0, 10) - parseInt(self.currentItem.css('paddingRight')||0, 10)); };
- }
- };
- }
-
- //Create the placeholder
- self.placeholder = $(o.placeholder.element.call(self.element, self.currentItem));
-
- //Append it after the actual current item
- self.currentItem.after(self.placeholder);
-
- //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
- o.placeholder.update(self, self.placeholder);
-
- },
-
- _contactContainers: function(event) {
-
- // get innermost container that intersects with item
- var innermostContainer = null, innermostIndex = null;
-
-
- for (var i = this.containers.length - 1; i >= 0; i--){
-
- // never consider a container that's located within the item itself
- if($.ui.contains(this.currentItem[0], this.containers[i].element[0]))
- continue;
-
- if(this._intersectsWith(this.containers[i].containerCache)) {
-
- // if we've already found a container and it's more "inner" than this, then continue
- if(innermostContainer && $.ui.contains(this.containers[i].element[0], innermostContainer.element[0]))
- continue;
-
- innermostContainer = this.containers[i];
- innermostIndex = i;
-
- } else {
- // container doesn't intersect. trigger "out" event if necessary
- if(this.containers[i].containerCache.over) {
- this.containers[i]._trigger("out", event, this._uiHash(this));
- this.containers[i].containerCache.over = 0;
- }
- }
-
- }
-
- // if no intersecting containers found, return
- if(!innermostContainer) return;
-
- // move the item into the container if it's not there already
- if(this.containers.length === 1) {
- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
- this.containers[innermostIndex].containerCache.over = 1;
- } else if(this.currentContainer != this.containers[innermostIndex]) {
-
- //When entering a new container, we will find the item with the least distance and append our item near it
- var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top'];
- for (var j = this.items.length - 1; j >= 0; j--) {
- if(!$.ui.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;
- var cur = this.items[j][this.containers[innermostIndex].floating ? 'left' : 'top'];
- if(Math.abs(cur - base) < dist) {
- dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
- }
- }
-
- if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
- return;
-
- this.currentContainer = this.containers[innermostIndex];
- itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
- this._trigger("change", event, this._uiHash());
- this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
-
- //Update the placeholder
- this.options.placeholder.update(this.currentContainer, this.placeholder);
-
- this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
- this.containers[innermostIndex].containerCache.over = 1;
- }
-
-
- },
-
- _createHelper: function(event) {
-
- var o = this.options;
- var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);
-
- if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
- $(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
-
- if(helper[0] == this.currentItem[0])
- this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
-
- if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
- if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());
-
- return helper;
-
- },
-
- _adjustOffsetFromHelper: function(obj) {
- if (typeof obj == 'string') {
- obj = obj.split(' ');
- }
- if ($.isArray(obj)) {
- obj = {left: +obj[0], top: +obj[1] || 0};
- }
- if ('left' in obj) {
- this.offset.click.left = obj.left + this.margins.left;
- }
- if ('right' in obj) {
- this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
- }
- if ('top' in obj) {
- this.offset.click.top = obj.top + this.margins.top;
- }
- if ('bottom' in obj) {
- this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
- }
- },
-
- _getParentOffset: function() {
-
-
- //Get the offsetParent and cache its position
- this.offsetParent = this.helper.offsetParent();
- var po = this.offsetParent.offset();
-
- // This is a special case where we need to modify a offset calculated on start, since the following happened:
- // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
- // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
- // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
- if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) {
- po.left += this.scrollParent.scrollLeft();
- po.top += this.scrollParent.scrollTop();
- }
-
- if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
- || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix
- po = { top: 0, left: 0 };
-
- return {
- top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
- left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
- };
-
- },
-
- _getRelativeOffset: function() {
-
- if(this.cssPosition == "relative") {
- var p = this.currentItem.position();
- return {
- top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
- left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
- };
- } else {
- return { top: 0, left: 0 };
- }
-
- },
-
- _cacheMargins: function() {
- this.margins = {
- left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
- top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
- };
- },
-
- _cacheHelperProportions: function() {
- this.helperProportions = {
- width: this.helper.outerWidth(),
- height: this.helper.outerHeight()
- };
- },
-
- _setContainment: function() {
-
- var o = this.options;
- if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
- if(o.containment == 'document' || o.containment == 'window') this.containment = [
- 0 - this.offset.relative.left - this.offset.parent.left,
- 0 - this.offset.relative.top - this.offset.parent.top,
- $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
- ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
- ];
-
- if(!(/^(document|window|parent)$/).test(o.containment)) {
- var ce = $(o.containment)[0];
- var co = $(o.containment).offset();
- var over = ($(ce).css("overflow") != 'hidden');
-
- this.containment = [
- co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
- co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
- co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
- co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
- ];
- }
-
- },
-
- _convertPositionTo: function(d, pos) {
-
- if(!pos) pos = this.position;
- var mod = d == "absolute" ? 1 : -1;
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- return {
- top: (
- pos.top // The absolute mouse position
- + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
- ),
- left: (
- pos.left // The absolute mouse position
- + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent
- + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border)
- - ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
- )
- };
-
- },
-
- _generatePosition: function(event) {
-
- var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
- // This is another very weird special case that only happens for relative elements:
- // 1. If the css position is relative
- // 2. and the scroll parent is the document or similar to the offset parent
- // we have to refresh the relative offset during the scroll so there are no jumps
- if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
- this.offset.relative = this._getRelativeOffset();
- }
-
- var pageX = event.pageX;
- var pageY = event.pageY;
-
- /*
- * - Position constraining -
- * Constrain the position to a mix of grid, containment.
- */
-
- if(this.originalPosition) { //If we are not dragging yet, we won't check for options
-
- if(this.containment) {
- if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
- if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
- if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
- if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
- }
-
- if(o.grid) {
- var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
- pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
- var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
- pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
- }
-
- }
-
- return {
- top: (
- pageY // The absolute mouse position
- - this.offset.click.top // Click offset (relative to the element)
- - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.top // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
- ),
- left: (
- pageX // The absolute mouse position
- - this.offset.click.left // Click offset (relative to the element)
- - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent
- - this.offset.parent.left // The offsetParent's offset without borders (offset + border)
- + ($.browser.safari && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
- )
- };
-
- },
-
- _rearrange: function(event, i, a, hardRefresh) {
-
- a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));
-
- //Various things done here to improve the performance:
- // 1. we create a setTimeout, that calls refreshPositions
- // 2. on the instance, we have a counter variable, that get's higher after every append
- // 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
- // 4. this lets only the last addition to the timeout stack through
- this.counter = this.counter ? ++this.counter : 1;
- var self = this, counter = this.counter;
-
- window.setTimeout(function() {
- if(counter == self.counter) self.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
- },0);
-
- },
-
- _clear: function(event, noPropagation) {
-
- this.reverting = false;
- // We delay all events that have to be triggered to after the point where the placeholder has been removed and
- // everything else normalized again
- var delayedTriggers = [], self = this;
-
- // We first have to update the dom position of the actual currentItem
- // Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
- if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
- this._noFinalSort = null;
-
- if(this.helper[0] == this.currentItem[0]) {
- for(var i in this._storedCSS) {
- if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
- }
- this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
- } else {
- this.currentItem.show();
- }
-
- if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
- if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
- if(!$.ui.contains(this.element[0], this.currentItem[0])) { //Node was moved out of the current element
- if(!noPropagation) delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
- for (var i = this.containers.length - 1; i >= 0; i--){
- if($.ui.contains(this.containers[i].element[0], this.currentItem[0]) && !noPropagation) {
- delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
- delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
- }
- };
- };
-
- //Post events to containers
- for (var i = this.containers.length - 1; i >= 0; i--){
- if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
- if(this.containers[i].containerCache.over) {
- delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i]));
- this.containers[i].containerCache.over = 0;
- }
- }
-
- //Do what was originally in plugins
- if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
- if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity
- if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index
-
- this.dragging = false;
- if(this.cancelHelperRemoval) {
- if(!noPropagation) {
- this._trigger("beforeStop", event, this._uiHash());
- for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
- this._trigger("stop", event, this._uiHash());
- }
- return false;
- }
-
- if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());
-
- //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
- this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
-
- if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;
-
- if(!noPropagation) {
- for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
- this._trigger("stop", event, this._uiHash());
- }
-
- this.fromOutside = false;
- return true;
-
- },
-
- _trigger: function() {
- if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
- this.cancel();
- }
- },
-
- _uiHash: function(inst) {
- var self = inst || this;
- return {
- helper: self.helper,
- placeholder: self.placeholder || $([]),
- position: self.position,
- originalPosition: self.originalPosition,
- offset: self.positionAbs,
- item: self.currentItem,
- sender: inst ? inst.element : null
- };
- }
-
-});
-
-$.extend($.ui.sortable, {
- version: "1.8.18"
-});
-
-})(jQuery);
-/*
- * jQuery UI Effects 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/
- */
-;jQuery.effects || (function($, undefined) {
-
-$.effects = {};
-
-
-
-/******************************************************************************/
-/****************************** COLOR ANIMATIONS ******************************/
-/******************************************************************************/
-
-// override the animation for color styles
-$.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor',
- 'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'],
-function(i, attr) {
- $.fx.step[attr] = function(fx) {
- if (!fx.colorInit) {
- fx.start = getColor(fx.elem, attr);
- fx.end = getRGB(fx.end);
- fx.colorInit = true;
- }
-
- fx.elem.style[attr] = 'rgb(' +
- Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0], 10), 255), 0) + ',' +
- Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1], 10), 255), 0) + ',' +
- Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2], 10), 255), 0) + ')';
- };
-});
-
-// Color Conversion functions from highlightFade
-// By Blair Mitchelmore
-// http://jquery.offput.ca/highlightFade/
-
-// Parse strings looking for color tuples [255,255,255]
-function getRGB(color) {
- var result;
-
- // Check if we're already dealing with an array of colors
- if ( color && color.constructor == Array && color.length == 3 )
- return color;
-
- // Look for rgb(num,num,num)
- if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
- return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];
-
- // Look for rgb(num%,num%,num%)
- if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
- return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
-
- // Look for #a0b1c2
- if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
- return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
-
- // Look for #fff
- if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
- return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
-
- // Look for rgba(0, 0, 0, 0) == transparent in Safari 3
- if (result = /rgba\(0, 0, 0, 0\)/.exec(color))
- return colors['transparent'];
-
- // Otherwise, we're most likely dealing with a named color
- return colors[$.trim(color).toLowerCase()];
-}
-
-function getColor(elem, attr) {
- var color;
-
- do {
- color = $.curCSS(elem, attr);
-
- // Keep going until we find an element that has color, or we hit the body
- if ( color != '' && color != 'transparent' || $.nodeName(elem, "body") )
- break;
-
- attr = "backgroundColor";
- } while ( elem = elem.parentNode );
-
- return getRGB(color);
-};
-
-// Some named colors to work with
-// From Interface by Stefan Petre
-// http://interface.eyecon.ro/
-
-var colors = {
- aqua:[0,255,255],
- azure:[240,255,255],
- beige:[245,245,220],
- black:[0,0,0],
- blue:[0,0,255],
- brown:[165,42,42],
- cyan:[0,255,255],
- darkblue:[0,0,139],
- darkcyan:[0,139,139],
- darkgrey:[169,169,169],
- darkgreen:[0,100,0],
- darkkhaki:[189,183,107],
- darkmagenta:[139,0,139],
- darkolivegreen:[85,107,47],
- darkorange:[255,140,0],
- darkorchid:[153,50,204],
- darkred:[139,0,0],
- darksalmon:[233,150,122],
- darkviolet:[148,0,211],
- fuchsia:[255,0,255],
- gold:[255,215,0],
- green:[0,128,0],
- indigo:[75,0,130],
- khaki:[240,230,140],
- lightblue:[173,216,230],
- lightcyan:[224,255,255],
- lightgreen:[144,238,144],
- lightgrey:[211,211,211],
- lightpink:[255,182,193],
- lightyellow:[255,255,224],
- lime:[0,255,0],
- magenta:[255,0,255],
- maroon:[128,0,0],
- navy:[0,0,128],
- olive:[128,128,0],
- orange:[255,165,0],
- pink:[255,192,203],
- purple:[128,0,128],
- violet:[128,0,128],
- red:[255,0,0],
- silver:[192,192,192],
- white:[255,255,255],
- yellow:[255,255,0],
- transparent: [255,255,255]
-};
-
-
-
-/******************************************************************************/
-/****************************** CLASS ANIMATIONS ******************************/
-/******************************************************************************/
-
-var classAnimationActions = ['add', 'remove', 'toggle'],
- shorthandStyles = {
- border: 1,
- borderBottom: 1,
- borderColor: 1,
- borderLeft: 1,
- borderRight: 1,
- borderTop: 1,
- borderWidth: 1,
- margin: 1,
- padding: 1
- };
-
-function getElementStyles() {
- var style = document.defaultView
- ? document.defaultView.getComputedStyle(this, null)
- : this.currentStyle,
- newStyle = {},
- key,
- camelCase;
-
- // webkit enumerates style porperties
- if (style && style.length && style[0] && style[style[0]]) {
- var len = style.length;
- while (len--) {
- key = style[len];
- if (typeof style[key] == 'string') {
- camelCase = key.replace(/\-(\w)/g, function(all, letter){
- return letter.toUpperCase();
- });
- newStyle[camelCase] = style[key];
- }
- }
- } else {
- for (key in style) {
- if (typeof style[key] === 'string') {
- newStyle[key] = style[key];
- }
- }
- }
-
- return newStyle;
-}
-
-function filterStyles(styles) {
- var name, value;
- for (name in styles) {
- value = styles[name];
- if (
- // ignore null and undefined values
- value == null ||
- // ignore functions (when does this occur?)
- $.isFunction(value) ||
- // shorthand styles that need to be expanded
- name in shorthandStyles ||
- // ignore scrollbars (break in IE)
- (/scrollbar/).test(name) ||
-
- // only colors or values that can be converted to numbers
- (!(/color/i).test(name) && isNaN(parseFloat(value)))
- ) {
- delete styles[name];
- }
- }
-
- return styles;
-}
-
-function styleDifference(oldStyle, newStyle) {
- var diff = { _: 0 }, // http://dev.jquery.com/ticket/5459
- name;
-
- for (name in newStyle) {
- if (oldStyle[name] != newStyle[name]) {
- diff[name] = newStyle[name];
- }
- }
-
- return diff;
-}
-
-$.effects.animateClass = function(value, duration, easing, callback) {
- if ($.isFunction(easing)) {
- callback = easing;
- easing = null;
- }
-
- return this.queue(function() {
- var that = $(this),
- originalStyleAttr = that.attr('style') || ' ',
- originalStyle = filterStyles(getElementStyles.call(this)),
- newStyle,
- className = that.attr('class');
-
- $.each(classAnimationActions, function(i, action) {
- if (value[action]) {
- that[action + 'Class'](value[action]);
- }
- });
- newStyle = filterStyles(getElementStyles.call(this));
- that.attr('class', className);
-
- that.animate(styleDifference(originalStyle, newStyle), {
- queue: false,
- duration: duration,
- easing: easing,
- complete: function() {
- $.each(classAnimationActions, function(i, action) {
- if (value[action]) { that[action + 'Class'](value[action]); }
- });
- // work around bug in IE by clearing the cssText before setting it
- if (typeof that.attr('style') == 'object') {
- that.attr('style').cssText = '';
- that.attr('style').cssText = originalStyleAttr;
- } else {
- that.attr('style', originalStyleAttr);
- }
- if (callback) { callback.apply(this, arguments); }
- $.dequeue( this );
- }
- });
- });
-};
-
-$.fn.extend({
- _addClass: $.fn.addClass,
- addClass: function(classNames, speed, easing, callback) {
- return speed ? $.effects.animateClass.apply(this, [{ add: classNames },speed,easing,callback]) : this._addClass(classNames);
- },
-
- _removeClass: $.fn.removeClass,
- removeClass: function(classNames,speed,easing,callback) {
- return speed ? $.effects.animateClass.apply(this, [{ remove: classNames },speed,easing,callback]) : this._removeClass(classNames);
- },
-
- _toggleClass: $.fn.toggleClass,
- toggleClass: function(classNames, force, speed, easing, callback) {
- if ( typeof force == "boolean" || force === undefined ) {
- if ( !speed ) {
- // without speed parameter;
- return this._toggleClass(classNames, force);
- } else {
- return $.effects.animateClass.apply(this, [(force?{add:classNames}:{remove:classNames}),speed,easing,callback]);
- }
- } else {
- // without switch parameter;
- return $.effects.animateClass.apply(this, [{ toggle: classNames },force,speed,easing]);
- }
- },
-
- switchClass: function(remove,add,speed,easing,callback) {
- return $.effects.animateClass.apply(this, [{ add: add, remove: remove },speed,easing,callback]);
- }
-});
-
-
-
-/******************************************************************************/
-/*********************************** EFFECTS **********************************/
-/******************************************************************************/
-
-$.extend($.effects, {
- version: "1.8.18",
-
- // Saves a set of properties in a data storage
- save: function(element, set) {
- for(var i=0; i < set.length; i++) {
- if(set[i] !== null) element.data("ec.storage."+set[i], element[0].style[set[i]]);
- }
- },
-
- // Restores a set of previously saved properties from a data storage
- restore: function(element, set) {
- for(var i=0; i < set.length; i++) {
- if(set[i] !== null) element.css(set[i], element.data("ec.storage."+set[i]));
- }
- },
-
- setMode: function(el, mode) {
- if (mode == 'toggle') mode = el.is(':hidden') ? 'show' : 'hide'; // Set for toggle
- return mode;
- },
-
- getBaseline: function(origin, original) { // Translates a [top,left] array into a baseline value
- // this should be a little more flexible in the future to handle a string & hash
- var y, x;
- switch (origin[0]) {
- case 'top': y = 0; break;
- case 'middle': y = 0.5; break;
- case 'bottom': y = 1; break;
- default: y = origin[0] / original.height;
- };
- switch (origin[1]) {
- case 'left': x = 0; break;
- case 'center': x = 0.5; break;
- case 'right': x = 1; break;
- default: x = origin[1] / original.width;
- };
- return {x: x, y: y};
- },
-
- // Wraps the element around a wrapper that copies position properties
- createWrapper: function(element) {
-
- // if the element is already wrapped, return it
- if (element.parent().is('.ui-effects-wrapper')) {
- return element.parent();
- }
-
- // wrap the element
- var props = {
- width: element.outerWidth(true),
- height: element.outerHeight(true),
- 'float': element.css('float')
- },
- wrapper = $('<div></div>')
- .addClass('ui-effects-wrapper')
- .css({
- fontSize: '100%',
- background: 'transparent',
- border: 'none',
- margin: 0,
- padding: 0
- }),
- active = document.activeElement;
-
- element.wrap(wrapper);
-
- // Fixes #7595 - Elements lose focus when wrapped.
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
- $( active ).focus();
- }
-
- wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element
-
- // transfer positioning properties to the wrapper
- if (element.css('position') == 'static') {
- wrapper.css({ position: 'relative' });
- element.css({ position: 'relative' });
- } else {
- $.extend(props, {
- position: element.css('position'),
- zIndex: element.css('z-index')
- });
- $.each(['top', 'left', 'bottom', 'right'], function(i, pos) {
- props[pos] = element.css(pos);
- if (isNaN(parseInt(props[pos], 10))) {
- props[pos] = 'auto';
- }
- });
- element.css({position: 'relative', top: 0, left: 0, right: 'auto', bottom: 'auto' });
- }
-
- return wrapper.css(props).show();
- },
-
- removeWrapper: function(element) {
- var parent,
- active = document.activeElement;
-
- if (element.parent().is('.ui-effects-wrapper')) {
- parent = element.parent().replaceWith(element);
- // Fixes #7595 - Elements lose focus when wrapped.
- if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
- $( active ).focus();
- }
- return parent;
- }
-
- return element;
- },
-
- setTransition: function(element, list, factor, value) {
- value = value || {};
- $.each(list, function(i, x){
- unit = element.cssUnit(x);
- if (unit[0] > 0) value[x] = unit[0] * factor + unit[1];
- });
- return value;
- }
-});
-
-
-function _normalizeArguments(effect, options, speed, callback) {
- // shift params for method overloading
- if (typeof effect == 'object') {
- callback = options;
- speed = null;
- options = effect;
- effect = options.effect;
- }
- if ($.isFunction(options)) {
- callback = options;
- speed = null;
- options = {};
- }
- if (typeof options == 'number' || $.fx.speeds[options]) {
- callback = speed;
- speed = options;
- options = {};
- }
- if ($.isFunction(speed)) {
- callback = speed;
- speed = null;
- }
-
- options = options || {};
-
- speed = speed || options.duration;
- speed = $.fx.off ? 0 : typeof speed == 'number'
- ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;
-
- callback = callback || options.complete;
-
- return [effect, options, speed, callback];
-}
-
-function standardSpeed( speed ) {
- // valid standard speeds
- if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) {
- return true;
- }
-
- // invalid strings - treat as "normal" speed
- if ( typeof speed === "string" && !$.effects[ speed ] ) {
- return true;
- }
-
- return false;
-}
-
-$.fn.extend({
- effect: function(effect, options, speed, callback) {
- var args = _normalizeArguments.apply(this, arguments),
- // TODO: make effects take actual parameters instead of a hash
- args2 = {
- options: args[1],
- duration: args[2],
- callback: args[3]
- },
- mode = args2.options.mode,
- effectMethod = $.effects[effect];
-
- if ( $.fx.off || !effectMethod ) {
- // delegate to the original method (e.g., .show()) if possible
- if ( mode ) {
- return this[ mode ]( args2.duration, args2.callback );
- } else {
- return this.each(function() {
- if ( args2.callback ) {
- args2.callback.call( this );
- }
- });
- }
- }
-
- return effectMethod.call(this, args2);
- },
-
- _show: $.fn.show,
- show: function(speed) {
- if ( standardSpeed( speed ) ) {
- return this._show.apply(this, arguments);
- } else {
- var args = _normalizeArguments.apply(this, arguments);
- args[1].mode = 'show';
- return this.effect.apply(this, args);
- }
- },
-
- _hide: $.fn.hide,
- hide: function(speed) {
- if ( standardSpeed( speed ) ) {
- return this._hide.apply(this, arguments);
- } else {
- var args = _normalizeArguments.apply(this, arguments);
- args[1].mode = 'hide';
- return this.effect.apply(this, args);
- }
- },
-
- // jQuery core overloads toggle and creates _toggle
- __toggle: $.fn.toggle,
- toggle: function(speed) {
- if ( standardSpeed( speed ) || typeof speed === "boolean" || $.isFunction( speed ) ) {
- return this.__toggle.apply(this, arguments);
- } else {
- var args = _normalizeArguments.apply(this, arguments);
- args[1].mode = 'toggle';
- return this.effect.apply(this, args);
- }
- },
-
- // helper functions
- cssUnit: function(key) {
- var style = this.css(key), val = [];
- $.each( ['em','px','%','pt'], function(i, unit){
- if(style.indexOf(unit) > 0)
- val = [parseFloat(style), unit];
- });
- return val;
- }
-});
-
-
-
-/******************************************************************************/
-/*********************************** EASING ***********************************/
-/******************************************************************************/
-
-/*
- * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
- *
- * Uses the built in easing capabilities added In jQuery 1.1
- * to offer multiple easing options
- *
- * TERMS OF USE - jQuery Easing
- *
- * Open source under the BSD License.
- *
- * Copyright 2008 George McGinley Smith
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * Neither the name of the author nor the names of contributors may be used to endorse
- * or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER 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.
- *
-*/
-
-// t: current time, b: begInnIng value, c: change In value, d: duration
-$.easing.jswing = $.easing.swing;
-
-$.extend($.easing,
-{
- def: 'easeOutQuad',
- swing: function (x, t, b, c, d) {
- //alert($.easing.default);
- return $.easing[$.easing.def](x, t, b, c, d);
- },
- easeInQuad: function (x, t, b, c, d) {
- return c*(t/=d)*t + b;
- },
- easeOutQuad: function (x, t, b, c, d) {
- return -c *(t/=d)*(t-2) + b;
- },
- easeInOutQuad: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t + b;
- return -c/2 * ((--t)*(t-2) - 1) + b;
- },
- easeInCubic: function (x, t, b, c, d) {
- return c*(t/=d)*t*t + b;
- },
- easeOutCubic: function (x, t, b, c, d) {
- return c*((t=t/d-1)*t*t + 1) + b;
- },
- easeInOutCubic: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
- return c/2*((t-=2)*t*t + 2) + b;
- },
- easeInQuart: function (x, t, b, c, d) {
- return c*(t/=d)*t*t*t + b;
- },
- easeOutQuart: function (x, t, b, c, d) {
- return -c * ((t=t/d-1)*t*t*t - 1) + b;
- },
- easeInOutQuart: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
- return -c/2 * ((t-=2)*t*t*t - 2) + b;
- },
- easeInQuint: function (x, t, b, c, d) {
- return c*(t/=d)*t*t*t*t + b;
- },
- easeOutQuint: function (x, t, b, c, d) {
- return c*((t=t/d-1)*t*t*t*t + 1) + b;
- },
- easeInOutQuint: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
- return c/2*((t-=2)*t*t*t*t + 2) + b;
- },
- easeInSine: function (x, t, b, c, d) {
- return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
- },
- easeOutSine: function (x, t, b, c, d) {
- return c * Math.sin(t/d * (Math.PI/2)) + b;
- },
- easeInOutSine: function (x, t, b, c, d) {
- return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
- },
- easeInExpo: function (x, t, b, c, d) {
- return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
- },
- easeOutExpo: function (x, t, b, c, d) {
- return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
- },
- easeInOutExpo: function (x, t, b, c, d) {
- if (t==0) return b;
- if (t==d) return b+c;
- if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
- return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
- },
- easeInCirc: function (x, t, b, c, d) {
- return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
- },
- easeOutCirc: function (x, t, b, c, d) {
- return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
- },
- easeInOutCirc: function (x, t, b, c, d) {
- if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
- return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
- },
- easeInElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- },
- easeOutElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
- },
- easeInOutElastic: function (x, t, b, c, d) {
- var s=1.70158;var p=0;var a=c;
- if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
- if (a < Math.abs(c)) { a=c; var s=p/4; }
- else var s = p/(2*Math.PI) * Math.asin (c/a);
- if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
- },
- easeInBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- return c*(t/=d)*t*((s+1)*t - s) + b;
- },
- easeOutBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
- },
- easeInOutBack: function (x, t, b, c, d, s) {
- if (s == undefined) s = 1.70158;
- if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
- },
- easeInBounce: function (x, t, b, c, d) {
- return c - $.easing.easeOutBounce (x, d-t, 0, c, d) + b;
- },
- easeOutBounce: function (x, t, b, c, d) {
- if ((t/=d) < (1/2.75)) {
- return c*(7.5625*t*t) + b;
- } else if (t < (2/2.75)) {
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
- } else if (t < (2.5/2.75)) {
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
- } else {
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
- }
- },
- easeInOutBounce: function (x, t, b, c, d) {
- if (t < d/2) return $.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
- return $.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
- }
-});
-
-/*
- *
- * TERMS OF USE - EASING EQUATIONS
- *
- * Open source under the BSD License.
- *
- * Copyright 2001 Robert Penner
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- *
- * Neither the name of the author nor the names of contributors may be used to endorse
- * or promote products derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER 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.
- *
- */
-
-})(jQuery);
-/*
- * jQuery UI Effects Blind 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Blind
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.blind = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','bottom','left','right'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'vertical'; // Default direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var ref = (direction == 'vertical') ? 'height' : 'width';
- var distance = (direction == 'vertical') ? wrapper.height() : wrapper.width();
- if(mode == 'show') wrapper.css(ref, 0); // Shift
-
- // Animation
- var animation = {};
- animation[ref] = mode == 'show' ? distance : 0;
-
- // Animate
- wrapper.animate(animation, o.duration, o.options.easing, function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- });
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Bounce 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Bounce
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.bounce = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','bottom','left','right'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var direction = o.options.direction || 'up'; // Default direction
- var distance = o.options.distance || 20; // Default distance
- var times = o.options.times || 5; // Default # of times
- var speed = o.duration || 250; // Default speed per bounce
- if (/show|hide/.test(mode)) props.push('opacity'); // Avoid touching opacity to prevent clearType and PNG issues in IE
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 3 : el.outerWidth({margin:true}) / 3);
- if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
- if (mode == 'hide') distance = distance / (times * 2);
- if (mode != 'hide') times--;
-
- // Animate
- if (mode == 'show') { // Show Bounce
- var animation = {opacity: 1};
- animation[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
- el.animate(animation, speed / 2, o.options.easing);
- distance = distance / 2;
- times--;
- };
- for (var i = 0; i < times; i++) { // Bounces
- var animation1 = {}, animation2 = {};
- animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
- el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing);
- distance = (mode == 'hide') ? distance * 2 : distance / 2;
- };
- if (mode == 'hide') { // Last Bounce
- var animation = {opacity: 0};
- animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- el.animate(animation, speed / 2, o.options.easing, function(){
- el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- } else {
- var animation1 = {}, animation2 = {};
- animation1[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation2[ref] = (motion == 'pos' ? '+=' : '-=') + distance;
- el.animate(animation1, speed / 2, o.options.easing).animate(animation2, speed / 2, o.options.easing, function(){
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- };
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Clip 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Clip
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.clip = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','bottom','left','right','height','width'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'vertical'; // Default direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var animate = el[0].tagName == 'IMG' ? wrapper : el;
- var ref = {
- size: (direction == 'vertical') ? 'height' : 'width',
- position: (direction == 'vertical') ? 'top' : 'left'
- };
- var distance = (direction == 'vertical') ? animate.height() : animate.width();
- if(mode == 'show') { animate.css(ref.size, 0); animate.css(ref.position, distance / 2); } // Shift
-
- // Animation
- var animation = {};
- animation[ref.size] = mode == 'show' ? distance : 0;
- animation[ref.position] = mode == 'show' ? 0 : distance / 2;
-
- // Animate
- animate.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Drop 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Drop
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.drop = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','bottom','left','right','opacity'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var direction = o.options.direction || 'left'; // Default Direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) / 2 : el.outerWidth({margin:true}) / 2);
- if (mode == 'show') el.css('opacity', 0).css(ref, motion == 'pos' ? -distance : distance); // Shift
-
- // Animation
- var animation = {opacity: mode == 'show' ? 1 : 0};
- animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Explode 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Explode
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.explode = function(o) {
-
- return this.queue(function() {
-
- var rows = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
- var cells = o.options.pieces ? Math.round(Math.sqrt(o.options.pieces)) : 3;
-
- o.options.mode = o.options.mode == 'toggle' ? ($(this).is(':visible') ? 'hide' : 'show') : o.options.mode;
- var el = $(this).show().css('visibility', 'hidden');
- var offset = el.offset();
-
- //Substract the margins - not fixing the problem yet.
- offset.top -= parseInt(el.css("marginTop"),10) || 0;
- offset.left -= parseInt(el.css("marginLeft"),10) || 0;
-
- var width = el.outerWidth(true);
- var height = el.outerHeight(true);
-
- for(var i=0;i<rows;i++) { // =
- for(var j=0;j<cells;j++) { // ||
- el
- .clone()
- .appendTo('body')
- .wrap('<div></div>')
- .css({
- position: 'absolute',
- visibility: 'visible',
- left: -j*(width/cells),
- top: -i*(height/rows)
- })
- .parent()
- .addClass('ui-effects-explode')
- .css({
- position: 'absolute',
- overflow: 'hidden',
- width: width/cells,
- height: height/rows,
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? (j-Math.floor(cells/2))*(width/cells) : 0),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? (i-Math.floor(rows/2))*(height/rows) : 0),
- opacity: o.options.mode == 'show' ? 0 : 1
- }).animate({
- left: offset.left + j*(width/cells) + (o.options.mode == 'show' ? 0 : (j-Math.floor(cells/2))*(width/cells)),
- top: offset.top + i*(height/rows) + (o.options.mode == 'show' ? 0 : (i-Math.floor(rows/2))*(height/rows)),
- opacity: o.options.mode == 'show' ? 1 : 0
- }, o.duration || 500);
- }
- }
-
- // Set a timeout, to call the callback approx. when the other animations have finished
- setTimeout(function() {
-
- o.options.mode == 'show' ? el.css({ visibility: 'visible' }) : el.css({ visibility: 'visible' }).hide();
- if(o.callback) o.callback.apply(el[0]); // Callback
- el.dequeue();
-
- $('div.ui-effects-explode').remove();
-
- }, o.duration || 500);
-
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Fade 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Fade
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.fade = function(o) {
- return this.queue(function() {
- var elem = $(this),
- mode = $.effects.setMode(elem, o.options.mode || 'hide');
-
- elem.animate({ opacity: mode }, {
- queue: false,
- duration: o.duration,
- easing: o.options.easing,
- complete: function() {
- (o.callback && o.callback.apply(this, arguments));
- elem.dequeue();
- }
- });
- });
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Fold 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Fold
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.fold = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','bottom','left','right'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'hide'); // Set Mode
- var size = o.options.size || 15; // Default fold size
- var horizFirst = !(!o.options.horizFirst); // Ensure a boolean value
- var duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2;
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- var wrapper = $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var widthFirst = ((mode == 'show') != horizFirst);
- var ref = widthFirst ? ['width', 'height'] : ['height', 'width'];
- var distance = widthFirst ? [wrapper.width(), wrapper.height()] : [wrapper.height(), wrapper.width()];
- var percent = /([0-9]+)%/.exec(size);
- if(percent) size = parseInt(percent[1],10) / 100 * distance[mode == 'hide' ? 0 : 1];
- if(mode == 'show') wrapper.css(horizFirst ? {height: 0, width: size} : {height: size, width: 0}); // Shift
-
- // Animation
- var animation1 = {}, animation2 = {};
- animation1[ref[0]] = mode == 'show' ? distance[0] : size;
- animation2[ref[1]] = mode == 'show' ? distance[1] : 0;
-
- // Animate
- wrapper.animate(animation1, duration, o.options.easing)
- .animate(animation2, duration, o.options.easing, function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(el[0], arguments); // Callback
- el.dequeue();
- });
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Highlight 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Highlight
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.highlight = function(o) {
- return this.queue(function() {
- var elem = $(this),
- props = ['backgroundImage', 'backgroundColor', 'opacity'],
- mode = $.effects.setMode(elem, o.options.mode || 'show'),
- animation = {
- backgroundColor: elem.css('backgroundColor')
- };
-
- if (mode == 'hide') {
- animation.opacity = 0;
- }
-
- $.effects.save(elem, props);
- elem
- .show()
- .css({
- backgroundImage: 'none',
- backgroundColor: o.options.color || '#ffff99'
- })
- .animate(animation, {
- queue: false,
- duration: o.duration,
- easing: o.options.easing,
- complete: function() {
- (mode == 'hide' && elem.hide());
- $.effects.restore(elem, props);
- (mode == 'show' && !$.support.opacity && this.style.removeAttribute('filter'));
- (o.callback && o.callback.apply(this, arguments));
- elem.dequeue();
- }
- });
- });
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Pulsate 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Pulsate
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.pulsate = function(o) {
- return this.queue(function() {
- var elem = $(this),
- mode = $.effects.setMode(elem, o.options.mode || 'show');
- times = ((o.options.times || 5) * 2) - 1;
- duration = o.duration ? o.duration / 2 : $.fx.speeds._default / 2,
- isVisible = elem.is(':visible'),
- animateTo = 0;
-
- if (!isVisible) {
- elem.css('opacity', 0).show();
- animateTo = 1;
- }
-
- if ((mode == 'hide' && isVisible) || (mode == 'show' && !isVisible)) {
- times--;
- }
-
- for (var i = 0; i < times; i++) {
- elem.animate({ opacity: animateTo }, duration, o.options.easing);
- animateTo = (animateTo + 1) % 2;
- }
-
- elem.animate({ opacity: animateTo }, duration, o.options.easing, function() {
- if (animateTo == 0) {
- elem.hide();
- }
- (o.callback && o.callback.apply(this, arguments));
- });
-
- elem
- .queue('fx', function() { elem.dequeue(); })
- .dequeue();
- });
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Scale 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Scale
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.puff = function(o) {
- return this.queue(function() {
- var elem = $(this),
- mode = $.effects.setMode(elem, o.options.mode || 'hide'),
- percent = parseInt(o.options.percent, 10) || 150,
- factor = percent / 100,
- original = { height: elem.height(), width: elem.width() };
-
- $.extend(o.options, {
- fade: true,
- mode: mode,
- percent: mode == 'hide' ? percent : 100,
- from: mode == 'hide'
- ? original
- : {
- height: original.height * factor,
- width: original.width * factor
- }
- });
-
- elem.effect('scale', o.options, o.duration, o.callback);
- elem.dequeue();
- });
-};
-
-$.effects.scale = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this);
-
- // Set options
- var options = $.extend(true, {}, o.options);
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var percent = parseInt(o.options.percent,10) || (parseInt(o.options.percent,10) == 0 ? 0 : (mode == 'hide' ? 0 : 100)); // Set default scaling percent
- var direction = o.options.direction || 'both'; // Set default axis
- var origin = o.options.origin; // The origin of the scaling
- if (mode != 'effect') { // Set default origin and restore for show/hide
- options.origin = origin || ['middle','center'];
- options.restore = true;
- }
- var original = {height: el.height(), width: el.width()}; // Save original
- el.from = o.options.from || (mode == 'show' ? {height: 0, width: 0} : original); // Default from state
-
- // Adjust
- var factor = { // Set scaling factor
- y: direction != 'horizontal' ? (percent / 100) : 1,
- x: direction != 'vertical' ? (percent / 100) : 1
- };
- el.to = {height: original.height * factor.y, width: original.width * factor.x}; // Set to state
-
- if (o.options.fade) { // Fade option to support puff
- if (mode == 'show') {el.from.opacity = 0; el.to.opacity = 1;};
- if (mode == 'hide') {el.from.opacity = 1; el.to.opacity = 0;};
- };
-
- // Animation
- options.from = el.from; options.to = el.to; options.mode = mode;
-
- // Animate
- el.effect('size', options, o.duration, o.callback);
- el.dequeue();
- });
-
-};
-
-$.effects.size = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','bottom','left','right','width','height','overflow','opacity'];
- var props1 = ['position','top','bottom','left','right','overflow','opacity']; // Always restore
- var props2 = ['width','height','overflow']; // Copy for children
- var cProps = ['fontSize'];
- var vProps = ['borderTopWidth', 'borderBottomWidth', 'paddingTop', 'paddingBottom'];
- var hProps = ['borderLeftWidth', 'borderRightWidth', 'paddingLeft', 'paddingRight'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var restore = o.options.restore || false; // Default restore
- var scale = o.options.scale || 'both'; // Default scale mode
- var origin = o.options.origin; // The origin of the sizing
- var original = {height: el.height(), width: el.width()}; // Save original
- el.from = o.options.from || original; // Default from state
- el.to = o.options.to || original; // Default to state
- // Adjust
- if (origin) { // Calculate baseline shifts
- var baseline = $.effects.getBaseline(origin, original);
- el.from.top = (original.height - el.from.height) * baseline.y;
- el.from.left = (original.width - el.from.width) * baseline.x;
- el.to.top = (original.height - el.to.height) * baseline.y;
- el.to.left = (original.width - el.to.width) * baseline.x;
- };
- var factor = { // Set scaling factor
- from: {y: el.from.height / original.height, x: el.from.width / original.width},
- to: {y: el.to.height / original.height, x: el.to.width / original.width}
- };
- if (scale == 'box' || scale == 'both') { // Scale the css box
- if (factor.from.y != factor.to.y) { // Vertical props scaling
- props = props.concat(vProps);
- el.from = $.effects.setTransition(el, vProps, factor.from.y, el.from);
- el.to = $.effects.setTransition(el, vProps, factor.to.y, el.to);
- };
- if (factor.from.x != factor.to.x) { // Horizontal props scaling
- props = props.concat(hProps);
- el.from = $.effects.setTransition(el, hProps, factor.from.x, el.from);
- el.to = $.effects.setTransition(el, hProps, factor.to.x, el.to);
- };
- };
- if (scale == 'content' || scale == 'both') { // Scale the content
- if (factor.from.y != factor.to.y) { // Vertical props scaling
- props = props.concat(cProps);
- el.from = $.effects.setTransition(el, cProps, factor.from.y, el.from);
- el.to = $.effects.setTransition(el, cProps, factor.to.y, el.to);
- };
- };
- $.effects.save(el, restore ? props : props1); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- el.css('overflow','hidden').css(el.from); // Shift
-
- // Animate
- if (scale == 'content' || scale == 'both') { // Scale the children
- vProps = vProps.concat(['marginTop','marginBottom']).concat(cProps); // Add margins/font-size
- hProps = hProps.concat(['marginLeft','marginRight']); // Add margins
- props2 = props.concat(vProps).concat(hProps); // Concat
- el.find("*[width]").each(function(){
- child = $(this);
- if (restore) $.effects.save(child, props2);
- var c_original = {height: child.height(), width: child.width()}; // Save original
- child.from = {height: c_original.height * factor.from.y, width: c_original.width * factor.from.x};
- child.to = {height: c_original.height * factor.to.y, width: c_original.width * factor.to.x};
- if (factor.from.y != factor.to.y) { // Vertical props scaling
- child.from = $.effects.setTransition(child, vProps, factor.from.y, child.from);
- child.to = $.effects.setTransition(child, vProps, factor.to.y, child.to);
- };
- if (factor.from.x != factor.to.x) { // Horizontal props scaling
- child.from = $.effects.setTransition(child, hProps, factor.from.x, child.from);
- child.to = $.effects.setTransition(child, hProps, factor.to.x, child.to);
- };
- child.css(child.from); // Shift children
- child.animate(child.to, o.duration, o.options.easing, function(){
- if (restore) $.effects.restore(child, props2); // Restore children
- }); // Animate children
- });
- };
-
- // Animate
- el.animate(el.to, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if (el.to.opacity === 0) {
- el.css('opacity', el.from.opacity);
- }
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, restore ? props : props1); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Shake 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Shake
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.shake = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','bottom','left','right'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
- var direction = o.options.direction || 'left'; // Default direction
- var distance = o.options.distance || 20; // Default distance
- var times = o.options.times || 3; // Default # of times
- var speed = o.duration || o.options.duration || 140; // Default speed per shake
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
-
- // Animation
- var animation = {}, animation1 = {}, animation2 = {};
- animation[ref] = (motion == 'pos' ? '-=' : '+=') + distance;
- animation1[ref] = (motion == 'pos' ? '+=' : '-=') + distance * 2;
- animation2[ref] = (motion == 'pos' ? '-=' : '+=') + distance * 2;
-
- // Animate
- el.animate(animation, speed, o.options.easing);
- for (var i = 1; i < times; i++) { // Shakes
- el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
- };
- el.animate(animation1, speed, o.options.easing).
- animate(animation, speed / 2, o.options.easing, function(){ // Last shake
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- });
- el.queue('fx', function() { el.dequeue(); });
- el.dequeue();
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Slide 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Slide
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.slide = function(o) {
-
- return this.queue(function() {
-
- // Create element
- var el = $(this), props = ['position','top','bottom','left','right'];
-
- // Set options
- var mode = $.effects.setMode(el, o.options.mode || 'show'); // Set Mode
- var direction = o.options.direction || 'left'; // Default Direction
-
- // Adjust
- $.effects.save(el, props); el.show(); // Save & Show
- $.effects.createWrapper(el).css({overflow:'hidden'}); // Create Wrapper
- var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
- var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';
- var distance = o.options.distance || (ref == 'top' ? el.outerHeight({margin:true}) : el.outerWidth({margin:true}));
- if (mode == 'show') el.css(ref, motion == 'pos' ? (isNaN(distance) ? "-" + distance : -distance) : distance); // Shift
-
- // Animation
- var animation = {};
- animation[ref] = (mode == 'show' ? (motion == 'pos' ? '+=' : '-=') : (motion == 'pos' ? '-=' : '+=')) + distance;
-
- // Animate
- el.animate(animation, { queue: false, duration: o.duration, easing: o.options.easing, complete: function() {
- if(mode == 'hide') el.hide(); // Hide
- $.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
- if(o.callback) o.callback.apply(this, arguments); // Callback
- el.dequeue();
- }});
-
- });
-
-};
-
-})(jQuery);
-/*
- * jQuery UI Effects Transfer 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Effects/Transfer
- *
- * Depends:
- * jquery.effects.core.js
- */
-(function( $, undefined ) {
-
-$.effects.transfer = function(o) {
- return this.queue(function() {
- var elem = $(this),
- target = $(o.options.to),
- endPosition = target.offset(),
- animation = {
- top: endPosition.top,
- left: endPosition.left,
- height: target.innerHeight(),
- width: target.innerWidth()
- },
- startPosition = elem.offset(),
- transfer = $('<div class="ui-effects-transfer"></div>')
- .appendTo(document.body)
- .addClass(o.options.className)
- .css({
- top: startPosition.top,
- left: startPosition.left,
- height: elem.innerHeight(),
- width: elem.innerWidth(),
- position: 'absolute'
- })
- .animate(animation, o.duration, o.options.easing, function() {
- transfer.remove();
- (o.callback && o.callback.apply(elem[0], arguments));
- elem.dequeue();
- });
- });
-};
-
-})(jQuery);
-/*
- * jQuery UI Accordion 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Accordion
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-$.widget( "ui.accordion", {
- options: {
- active: 0,
- animated: "slide",
- autoHeight: true,
- clearStyle: false,
- collapsible: false,
- event: "click",
- fillSpace: false,
- header: "> li > :first-child,> :not(li):even",
- icons: {
- header: "ui-icon-triangle-1-e",
- headerSelected: "ui-icon-triangle-1-s"
- },
- navigation: false,
- navigationFilter: function() {
- return this.href.toLowerCase() === location.href.toLowerCase();
- }
- },
-
- _create: function() {
- var self = this,
- options = self.options;
-
- self.running = 0;
-
- self.element
- .addClass( "ui-accordion ui-widget ui-helper-reset" )
- // in lack of child-selectors in CSS
- // we need to mark top-LIs in a UL-accordion for some IE-fix
- .children( "li" )
- .addClass( "ui-accordion-li-fix" );
-
- self.headers = self.element.find( options.header )
- .addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" )
- .bind( "mouseenter.accordion", function() {
- if ( options.disabled ) {
- return;
- }
- $( this ).addClass( "ui-state-hover" );
- })
- .bind( "mouseleave.accordion", function() {
- if ( options.disabled ) {
- return;
- }
- $( this ).removeClass( "ui-state-hover" );
- })
- .bind( "focus.accordion", function() {
- if ( options.disabled ) {
- return;
- }
- $( this ).addClass( "ui-state-focus" );
- })
- .bind( "blur.accordion", function() {
- if ( options.disabled ) {
- return;
- }
- $( this ).removeClass( "ui-state-focus" );
- });
-
- self.headers.next()
- .addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" );
-
- if ( options.navigation ) {
- var current = self.element.find( "a" ).filter( options.navigationFilter ).eq( 0 );
- if ( current.length ) {
- var header = current.closest( ".ui-accordion-header" );
- if ( header.length ) {
- // anchor within header
- self.active = header;
- } else {
- // anchor within content
- self.active = current.closest( ".ui-accordion-content" ).prev();
- }
- }
- }
-
- self.active = self._findActive( self.active || options.active )
- .addClass( "ui-state-default ui-state-active" )
- .toggleClass( "ui-corner-all" )
- .toggleClass( "ui-corner-top" );
- self.active.next().addClass( "ui-accordion-content-active" );
-
- self._createIcons();
- self.resize();
-
- // ARIA
- self.element.attr( "role", "tablist" );
-
- self.headers
- .attr( "role", "tab" )
- .bind( "keydown.accordion", function( event ) {
- return self._keydown( event );
- })
- .next()
- .attr( "role", "tabpanel" );
-
- self.headers
- .not( self.active || "" )
- .attr({
- "aria-expanded": "false",
- "aria-selected": "false",
- tabIndex: -1
- })
- .next()
- .hide();
-
- // make sure at least one header is in the tab order
- if ( !self.active.length ) {
- self.headers.eq( 0 ).attr( "tabIndex", 0 );
- } else {
- self.active
- .attr({
- "aria-expanded": "true",
- "aria-selected": "true",
- tabIndex: 0
- });
- }
-
- // only need links in tab order for Safari
- if ( !$.browser.safari ) {
- self.headers.find( "a" ).attr( "tabIndex", -1 );
- }
-
- if ( options.event ) {
- self.headers.bind( options.event.split(" ").join(".accordion ") + ".accordion", function(event) {
- self._clickHandler.call( self, event, this );
- event.preventDefault();
- });
- }
- },
-
- _createIcons: function() {
- var options = this.options;
- if ( options.icons ) {
- $( "<span></span>" )
- .addClass( "ui-icon " + options.icons.header )
- .prependTo( this.headers );
- this.active.children( ".ui-icon" )
- .toggleClass(options.icons.header)
- .toggleClass(options.icons.headerSelected);
- this.element.addClass( "ui-accordion-icons" );
- }
- },
-
- _destroyIcons: function() {
- this.headers.children( ".ui-icon" ).remove();
- this.element.removeClass( "ui-accordion-icons" );
- },
-
- destroy: function() {
- var options = this.options;
-
- this.element
- .removeClass( "ui-accordion ui-widget ui-helper-reset" )
- .removeAttr( "role" );
-
- this.headers
- .unbind( ".accordion" )
- .removeClass( "ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
- .removeAttr( "role" )
- .removeAttr( "aria-expanded" )
- .removeAttr( "aria-selected" )
- .removeAttr( "tabIndex" );
-
- this.headers.find( "a" ).removeAttr( "tabIndex" );
- this._destroyIcons();
- var contents = this.headers.next()
- .css( "display", "" )
- .removeAttr( "role" )
- .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" );
- if ( options.autoHeight || options.fillHeight ) {
- contents.css( "height", "" );
- }
-
- return $.Widget.prototype.destroy.call( this );
- },
-
- _setOption: function( key, value ) {
- $.Widget.prototype._setOption.apply( this, arguments );
-
- if ( key == "active" ) {
- this.activate( value );
- }
- if ( key == "icons" ) {
- this._destroyIcons();
- if ( value ) {
- this._createIcons();
- }
- }
- // #5332 - opacity doesn't cascade to positioned elements in IE
- // so we need to add the disabled class to the headers and panels
- if ( key == "disabled" ) {
- this.headers.add(this.headers.next())
- [ value ? "addClass" : "removeClass" ](
- "ui-accordion-disabled ui-state-disabled" );
- }
- },
-
- _keydown: function( event ) {
- if ( this.options.disabled || event.altKey || event.ctrlKey ) {
- return;
- }
-
- var keyCode = $.ui.keyCode,
- length = this.headers.length,
- currentIndex = this.headers.index( event.target ),
- toFocus = false;
-
- switch ( event.keyCode ) {
- case keyCode.RIGHT:
- case keyCode.DOWN:
- toFocus = this.headers[ ( currentIndex + 1 ) % length ];
- break;
- case keyCode.LEFT:
- case keyCode.UP:
- toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
- break;
- case keyCode.SPACE:
- case keyCode.ENTER:
- this._clickHandler( { target: event.target }, event.target );
- event.preventDefault();
- }
-
- if ( toFocus ) {
- $( event.target ).attr( "tabIndex", -1 );
- $( toFocus ).attr( "tabIndex", 0 );
- toFocus.focus();
- return false;
- }
-
- return true;
- },
-
- resize: function() {
- var options = this.options,
- maxHeight;
-
- if ( options.fillSpace ) {
- if ( $.browser.msie ) {
- var defOverflow = this.element.parent().css( "overflow" );
- this.element.parent().css( "overflow", "hidden");
- }
- maxHeight = this.element.parent().height();
- if ($.browser.msie) {
- this.element.parent().css( "overflow", defOverflow );
- }
-
- this.headers.each(function() {
- maxHeight -= $( this ).outerHeight( true );
- });
-
- this.headers.next()
- .each(function() {
- $( this ).height( Math.max( 0, maxHeight -
- $( this ).innerHeight() + $( this ).height() ) );
- })
- .css( "overflow", "auto" );
- } else if ( options.autoHeight ) {
- maxHeight = 0;
- this.headers.next()
- .each(function() {
- maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() );
- })
- .height( maxHeight );
- }
-
- return this;
- },
-
- activate: function( index ) {
- // TODO this gets called on init, changing the option without an explicit call for that
- this.options.active = index;
- // call clickHandler with custom event
- var active = this._findActive( index )[ 0 ];
- this._clickHandler( { target: active }, active );
-
- return this;
- },
-
- _findActive: function( selector ) {
- return selector
- ? typeof selector === "number"
- ? this.headers.filter( ":eq(" + selector + ")" )
- : this.headers.not( this.headers.not( selector ) )
- : selector === false
- ? $( [] )
- : this.headers.filter( ":eq(0)" );
- },
-
- // TODO isn't event.target enough? why the separate target argument?
- _clickHandler: function( event, target ) {
- var options = this.options;
- if ( options.disabled ) {
- return;
- }
-
- // called only when using activate(false) to close all parts programmatically
- if ( !event.target ) {
- if ( !options.collapsible ) {
- return;
- }
- this.active
- .removeClass( "ui-state-active ui-corner-top" )
- .addClass( "ui-state-default ui-corner-all" )
- .children( ".ui-icon" )
- .removeClass( options.icons.headerSelected )
- .addClass( options.icons.header );
- this.active.next().addClass( "ui-accordion-content-active" );
- var toHide = this.active.next(),
- data = {
- options: options,
- newHeader: $( [] ),
- oldHeader: options.active,
- newContent: $( [] ),
- oldContent: toHide
- },
- toShow = ( this.active = $( [] ) );
- this._toggle( toShow, toHide, data );
- return;
- }
-
- // get the click target
- var clicked = $( event.currentTarget || target ),
- clickedIsActive = clicked[0] === this.active[0];
-
- // TODO the option is changed, is that correct?
- // TODO if it is correct, shouldn't that happen after determining that the click is valid?
- options.active = options.collapsible && clickedIsActive ?
- false :
- this.headers.index( clicked );
-
- // if animations are still active, or the active header is the target, ignore click
- if ( this.running || ( !options.collapsible && clickedIsActive ) ) {
- return;
- }
-
- // find elements to show and hide
- var active = this.active,
- toShow = clicked.next(),
- toHide = this.active.next(),
- data = {
- options: options,
- newHeader: clickedIsActive && options.collapsible ? $([]) : clicked,
- oldHeader: this.active,
- newContent: clickedIsActive && options.collapsible ? $([]) : toShow,
- oldContent: toHide
- },
- down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] );
-
- // when the call to ._toggle() comes after the class changes
- // it causes a very odd bug in IE 8 (see #6720)
- this.active = clickedIsActive ? $([]) : clicked;
- this._toggle( toShow, toHide, data, clickedIsActive, down );
-
- // switch classes
- active
- .removeClass( "ui-state-active ui-corner-top" )
- .addClass( "ui-state-default ui-corner-all" )
- .children( ".ui-icon" )
- .removeClass( options.icons.headerSelected )
- .addClass( options.icons.header );
- if ( !clickedIsActive ) {
- clicked
- .removeClass( "ui-state-default ui-corner-all" )
- .addClass( "ui-state-active ui-corner-top" )
- .children( ".ui-icon" )
- .removeClass( options.icons.header )
- .addClass( options.icons.headerSelected );
- clicked
- .next()
- .addClass( "ui-accordion-content-active" );
- }
-
- return;
- },
-
- _toggle: function( toShow, toHide, data, clickedIsActive, down ) {
- var self = this,
- options = self.options;
-
- self.toShow = toShow;
- self.toHide = toHide;
- self.data = data;
-
- var complete = function() {
- if ( !self ) {
- return;
- }
- return self._completed.apply( self, arguments );
- };
-
- // trigger changestart event
- self._trigger( "changestart", null, self.data );
-
- // count elements to animate
- self.running = toHide.size() === 0 ? toShow.size() : toHide.size();
-
- if ( options.animated ) {
- var animOptions = {};
-
- if ( options.collapsible && clickedIsActive ) {
- animOptions = {
- toShow: $( [] ),
- toHide: toHide,
- complete: complete,
- down: down,
- autoHeight: options.autoHeight || options.fillSpace
- };
- } else {
- animOptions = {
- toShow: toShow,
- toHide: toHide,
- complete: complete,
- down: down,
- autoHeight: options.autoHeight || options.fillSpace
- };
- }
-
- if ( !options.proxied ) {
- options.proxied = options.animated;
- }
-
- if ( !options.proxiedDuration ) {
- options.proxiedDuration = options.duration;
- }
-
- options.animated = $.isFunction( options.proxied ) ?
- options.proxied( animOptions ) :
- options.proxied;
-
- options.duration = $.isFunction( options.proxiedDuration ) ?
- options.proxiedDuration( animOptions ) :
- options.proxiedDuration;
-
- var animations = $.ui.accordion.animations,
- duration = options.duration,
- easing = options.animated;
-
- if ( easing && !animations[ easing ] && !$.easing[ easing ] ) {
- easing = "slide";
- }
- if ( !animations[ easing ] ) {
- animations[ easing ] = function( options ) {
- this.slide( options, {
- easing: easing,
- duration: duration || 700
- });
- };
- }
-
- animations[ easing ]( animOptions );
- } else {
- if ( options.collapsible && clickedIsActive ) {
- toShow.toggle();
- } else {
- toHide.hide();
- toShow.show();
- }
-
- complete( true );
- }
-
- // TODO assert that the blur and focus triggers are really necessary, remove otherwise
- toHide.prev()
- .attr({
- "aria-expanded": "false",
- "aria-selected": "false",
- tabIndex: -1
- })
- .blur();
- toShow.prev()
- .attr({
- "aria-expanded": "true",
- "aria-selected": "true",
- tabIndex: 0
- })
- .focus();
- },
-
- _completed: function( cancel ) {
- this.running = cancel ? 0 : --this.running;
- if ( this.running ) {
- return;
- }
-
- if ( this.options.clearStyle ) {
- this.toShow.add( this.toHide ).css({
- height: "",
- overflow: ""
- });
- }
-
- // other classes are removed before the animation; this one needs to stay until completed
- this.toHide.removeClass( "ui-accordion-content-active" );
- // Work around for rendering bug in IE (#5421)
- if ( this.toHide.length ) {
- this.toHide.parent()[0].className = this.toHide.parent()[0].className;
- }
-
- this._trigger( "change", null, this.data );
- }
-});
-
-$.extend( $.ui.accordion, {
- version: "1.8.18",
- animations: {
- slide: function( options, additions ) {
- options = $.extend({
- easing: "swing",
- duration: 300
- }, options, additions );
- if ( !options.toHide.size() ) {
- options.toShow.animate({
- height: "show",
- paddingTop: "show",
- paddingBottom: "show"
- }, options );
- return;
- }
- if ( !options.toShow.size() ) {
- options.toHide.animate({
- height: "hide",
- paddingTop: "hide",
- paddingBottom: "hide"
- }, options );
- return;
- }
- var overflow = options.toShow.css( "overflow" ),
- percentDone = 0,
- showProps = {},
- hideProps = {},
- fxAttrs = [ "height", "paddingTop", "paddingBottom" ],
- originalWidth;
- // fix width before calculating height of hidden element
- var s = options.toShow;
- originalWidth = s[0].style.width;
- s.width( s.parent().width()
- - parseFloat( s.css( "paddingLeft" ) )
- - parseFloat( s.css( "paddingRight" ) )
- - ( parseFloat( s.css( "borderLeftWidth" ) ) || 0 )
- - ( parseFloat( s.css( "borderRightWidth" ) ) || 0 ) );
-
- $.each( fxAttrs, function( i, prop ) {
- hideProps[ prop ] = "hide";
-
- var parts = ( "" + $.css( options.toShow[0], prop ) ).match( /^([\d+-.]+)(.*)$/ );
- showProps[ prop ] = {
- value: parts[ 1 ],
- unit: parts[ 2 ] || "px"
- };
- });
- options.toShow.css({ height: 0, overflow: "hidden" }).show();
- options.toHide
- .filter( ":hidden" )
- .each( options.complete )
- .end()
- .filter( ":visible" )
- .animate( hideProps, {
- step: function( now, settings ) {
- // only calculate the percent when animating height
- // IE gets very inconsistent results when animating elements
- // with small values, which is common for padding
- if ( settings.prop == "height" ) {
- percentDone = ( settings.end - settings.start === 0 ) ? 0 :
- ( settings.now - settings.start ) / ( settings.end - settings.start );
- }
-
- options.toShow[ 0 ].style[ settings.prop ] =
- ( percentDone * showProps[ settings.prop ].value )
- + showProps[ settings.prop ].unit;
- },
- duration: options.duration,
- easing: options.easing,
- complete: function() {
- if ( !options.autoHeight ) {
- options.toShow.css( "height", "" );
- }
- options.toShow.css({
- width: originalWidth,
- overflow: overflow
- });
- options.complete();
- }
- });
- },
- bounceslide: function( options ) {
- this.slide( options, {
- easing: options.down ? "easeOutBounce" : "swing",
- duration: options.down ? 1000 : 200
- });
- }
- }
-});
-
-})( jQuery );
-/*
- * jQuery UI Autocomplete 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Autocomplete
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * jquery.ui.position.js
- */
-(function( $, undefined ) {
-
-// used to prevent race conditions with remote data sources
-var requestIndex = 0;
-
-$.widget( "ui.autocomplete", {
- options: {
- appendTo: "body",
- autoFocus: false,
- delay: 300,
- minLength: 1,
- position: {
- my: "left top",
- at: "left bottom",
- collision: "none"
- },
- source: null
- },
-
- pending: 0,
-
- _create: function() {
- var self = this,
- doc = this.element[ 0 ].ownerDocument,
- suppressKeyPress;
-
- this.element
- .addClass( "ui-autocomplete-input" )
- .attr( "autocomplete", "off" )
- // TODO verify these actually work as intended
- .attr({
- role: "textbox",
- "aria-autocomplete": "list",
- "aria-haspopup": "true"
- })
- .bind( "keydown.autocomplete", function( event ) {
- if ( self.options.disabled || self.element.propAttr( "readOnly" ) ) {
- return;
- }
-
- suppressKeyPress = false;
- var keyCode = $.ui.keyCode;
- switch( event.keyCode ) {
- case keyCode.PAGE_UP:
- self._move( "previousPage", event );
- break;
- case keyCode.PAGE_DOWN:
- self._move( "nextPage", event );
- break;
- case keyCode.UP:
- self._move( "previous", event );
- // prevent moving cursor to beginning of text field in some browsers
- event.preventDefault();
- break;
- case keyCode.DOWN:
- self._move( "next", event );
- // prevent moving cursor to end of text field in some browsers
- event.preventDefault();
- break;
- case keyCode.ENTER:
- case keyCode.NUMPAD_ENTER:
- // when menu is open and has focus
- if ( self.menu.active ) {
- // #6055 - Opera still allows the keypress to occur
- // which causes forms to submit
- suppressKeyPress = true;
- event.preventDefault();
- }
- //passthrough - ENTER and TAB both select the current element
- case keyCode.TAB:
- if ( !self.menu.active ) {
- return;
- }
- self.menu.select( event );
- break;
- case keyCode.ESCAPE:
- self.element.val( self.term );
- self.close( event );
- break;
- default:
- // keypress is triggered before the input value is changed
- clearTimeout( self.searching );
- self.searching = setTimeout(function() {
- // only search if the value has changed
- if ( self.term != self.element.val() ) {
- self.selectedItem = null;
- self.search( null, event );
- }
- }, self.options.delay );
- break;
- }
- })
- .bind( "keypress.autocomplete", function( event ) {
- if ( suppressKeyPress ) {
- suppressKeyPress = false;
- event.preventDefault();
- }
- })
- .bind( "focus.autocomplete", function() {
- if ( self.options.disabled ) {
- return;
- }
-
- self.selectedItem = null;
- self.previous = self.element.val();
- })
- .bind( "blur.autocomplete", function( event ) {
- if ( self.options.disabled ) {
- return;
- }
-
- clearTimeout( self.searching );
- // clicks on the menu (or a button to trigger a search) will cause a blur event
- self.closing = setTimeout(function() {
- self.close( event );
- self._change( event );
- }, 150 );
- });
- this._initSource();
- this.response = function() {
- return self._response.apply( self, arguments );
- };
- this.menu = $( "<ul></ul>" )
- .addClass( "ui-autocomplete" )
- .appendTo( $( this.options.appendTo || "body", doc )[0] )
- // prevent the close-on-blur in case of a "slow" click on the menu (long mousedown)
- .mousedown(function( event ) {
- // clicking on the scrollbar causes focus to shift to the body
- // but we can't detect a mouseup or a click immediately afterward
- // so we have to track the next mousedown and close the menu if
- // the user clicks somewhere outside of the autocomplete
- var menuElement = self.menu.element[ 0 ];
- if ( !$( event.target ).closest( ".ui-menu-item" ).length ) {
- setTimeout(function() {
- $( document ).one( 'mousedown', function( event ) {
- if ( event.target !== self.element[ 0 ] &&
- event.target !== menuElement &&
- !$.ui.contains( menuElement, event.target ) ) {
- self.close();
- }
- });
- }, 1 );
- }
-
- // use another timeout to make sure the blur-event-handler on the input was already triggered
- setTimeout(function() {
- clearTimeout( self.closing );
- }, 13);
- })
- .menu({
- focus: function( event, ui ) {
- var item = ui.item.data( "item.autocomplete" );
- if ( false !== self._trigger( "focus", event, { item: item } ) ) {
- // use value to match what will end up in the input, if it was a key event
- if ( /^key/.test(event.originalEvent.type) ) {
- self.element.val( item.value );
- }
- }
- },
- selected: function( event, ui ) {
- var item = ui.item.data( "item.autocomplete" ),
- previous = self.previous;
-
- // only trigger when focus was lost (click on menu)
- if ( self.element[0] !== doc.activeElement ) {
- self.element.focus();
- self.previous = previous;
- // #6109 - IE triggers two focus events and the second
- // is asynchronous, so we need to reset the previous
- // term synchronously and asynchronously :-(
- setTimeout(function() {
- self.previous = previous;
- self.selectedItem = item;
- }, 1);
- }
-
- if ( false !== self._trigger( "select", event, { item: item } ) ) {
- self.element.val( item.value );
- }
- // reset the term after the select event
- // this allows custom select handling to work properly
- self.term = self.element.val();
-
- self.close( event );
- self.selectedItem = item;
- },
- blur: function( event, ui ) {
- // don't set the value of the text field if it's already correct
- // this prevents moving the cursor unnecessarily
- if ( self.menu.element.is(":visible") &&
- ( self.element.val() !== self.term ) ) {
- self.element.val( self.term );
- }
- }
- })
- .zIndex( this.element.zIndex() + 1 )
- // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781
- .css({ top: 0, left: 0 })
- .hide()
- .data( "menu" );
- if ( $.fn.bgiframe ) {
- this.menu.element.bgiframe();
- }
- // turning off autocomplete prevents the browser from remembering the
- // value when navigating through history, so we re-enable autocomplete
- // if the page is unloaded before the widget is destroyed. #7790
- self.beforeunloadHandler = function() {
- self.element.removeAttr( "autocomplete" );
- };
- $( window ).bind( "beforeunload", self.beforeunloadHandler );
- },
-
- destroy: function() {
- this.element
- .removeClass( "ui-autocomplete-input" )
- .removeAttr( "autocomplete" )
- .removeAttr( "role" )
- .removeAttr( "aria-autocomplete" )
- .removeAttr( "aria-haspopup" );
- this.menu.element.remove();
- $( window ).unbind( "beforeunload", this.beforeunloadHandler );
- $.Widget.prototype.destroy.call( this );
- },
-
- _setOption: function( key, value ) {
- $.Widget.prototype._setOption.apply( this, arguments );
- if ( key === "source" ) {
- this._initSource();
- }
- if ( key === "appendTo" ) {
- this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] )
- }
- if ( key === "disabled" && value && this.xhr ) {
- this.xhr.abort();
- }
- },
-
- _initSource: function() {
- var self = this,
- array,
- url;
- if ( $.isArray(this.options.source) ) {
- array = this.options.source;
- this.source = function( request, response ) {
- response( $.ui.autocomplete.filter(array, request.term) );
- };
- } else if ( typeof this.options.source === "string" ) {
- url = this.options.source;
- this.source = function( request, response ) {
- if ( self.xhr ) {
- self.xhr.abort();
- }
- self.xhr = $.ajax({
- url: url,
- data: request,
- dataType: "json",
- context: {
- autocompleteRequest: ++requestIndex
- },
- success: function( data, status ) {
- if ( this.autocompleteRequest === requestIndex ) {
- response( data );
- }
- },
- error: function() {
- if ( this.autocompleteRequest === requestIndex ) {
- response( [] );
- }
- }
- });
- };
- } else {
- this.source = this.options.source;
- }
- },
-
- search: function( value, event ) {
- value = value != null ? value : this.element.val();
-
- // always save the actual value, not the one passed as an argument
- this.term = this.element.val();
-
- if ( value.length < this.options.minLength ) {
- return this.close( event );
- }
-
- clearTimeout( this.closing );
- if ( this._trigger( "search", event ) === false ) {
- return;
- }
-
- return this._search( value );
- },
-
- _search: function( value ) {
- this.pending++;
- this.element.addClass( "ui-autocomplete-loading" );
-
- this.source( { term: value }, this.response );
- },
-
- _response: function( content ) {
- if ( !this.options.disabled && content && content.length ) {
- content = this._normalize( content );
- this._suggest( content );
- this._trigger( "open" );
- } else {
- this.close();
- }
- this.pending--;
- if ( !this.pending ) {
- this.element.removeClass( "ui-autocomplete-loading" );
- }
- },
-
- close: function( event ) {
- clearTimeout( this.closing );
- if ( this.menu.element.is(":visible") ) {
- this.menu.element.hide();
- this.menu.deactivate();
- this._trigger( "close", event );
- }
- },
-
- _change: function( event ) {
- if ( this.previous !== this.element.val() ) {
- this._trigger( "change", event, { item: this.selectedItem } );
- }
- },
-
- _normalize: function( items ) {
- // assume all items have the right format when the first item is complete
- if ( items.length && items[0].label && items[0].value ) {
- return items;
- }
- return $.map( items, function(item) {
- if ( typeof item === "string" ) {
- return {
- label: item,
- value: item
- };
- }
- return $.extend({
- label: item.label || item.value,
- value: item.value || item.label
- }, item );
- });
- },
-
- _suggest: function( items ) {
- var ul = this.menu.element
- .empty()
- .zIndex( this.element.zIndex() + 1 );
- this._renderMenu( ul, items );
- // TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate
- this.menu.deactivate();
- this.menu.refresh();
-
- // size and position menu
- ul.show();
- this._resizeMenu();
- ul.position( $.extend({
- of: this.element
- }, this.options.position ));
-
- if ( this.options.autoFocus ) {
- this.menu.next( new $.Event("mouseover") );
- }
- },
-
- _resizeMenu: function() {
- var ul = this.menu.element;
- ul.outerWidth( Math.max(
- // Firefox wraps long text (possibly a rounding bug)
- // so we add 1px to avoid the wrapping (#7513)
- ul.width( "" ).outerWidth() + 1,
- this.element.outerWidth()
- ) );
- },
-
- _renderMenu: function( ul, items ) {
- var self = this;
- $.each( items, function( index, item ) {
- self._renderItem( ul, item );
- });
- },
-
- _renderItem: function( ul, item) {
- return $( "<li></li>" )
- .data( "item.autocomplete", item )
- .append( $( "<a></a>" ).text( item.label ) )
- .appendTo( ul );
- },
-
- _move: function( direction, event ) {
- if ( !this.menu.element.is(":visible") ) {
- this.search( null, event );
- return;
- }
- if ( this.menu.first() && /^previous/.test(direction) ||
- this.menu.last() && /^next/.test(direction) ) {
- this.element.val( this.term );
- this.menu.deactivate();
- return;
- }
- this.menu[ direction ]( event );
- },
-
- widget: function() {
- return this.menu.element;
- }
-});
-
-$.extend( $.ui.autocomplete, {
- escapeRegex: function( value ) {
- return value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
- },
- filter: function(array, term) {
- var matcher = new RegExp( $.ui.autocomplete.escapeRegex(term), "i" );
- return $.grep( array, function(value) {
- return matcher.test( value.label || value.value || value );
- });
- }
-});
-
-}( jQuery ));
-
-/*
- * jQuery UI Menu (not officially released)
- *
- * This widget isn't yet finished and the API is subject to change. We plan to finish
- * it for the next release. You're welcome to give it a try anyway and give us feedback,
- * as long as you're okay with migrating your code later on. We can help with that, too.
- *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Menu
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */
-(function($) {
-
-$.widget("ui.menu", {
- _create: function() {
- var self = this;
- this.element
- .addClass("ui-menu ui-widget ui-widget-content ui-corner-all")
- .attr({
- role: "listbox",
- "aria-activedescendant": "ui-active-menuitem"
- })
- .click(function( event ) {
- if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) {
- return;
- }
- // temporary
- event.preventDefault();
- self.select( event );
- });
- this.refresh();
- },
-
- refresh: function() {
- var self = this;
-
- // don't refresh list items that are already adapted
- var items = this.element.children("li:not(.ui-menu-item):has(a)")
- .addClass("ui-menu-item")
- .attr("role", "menuitem");
-
- items.children("a")
- .addClass("ui-corner-all")
- .attr("tabindex", -1)
- // mouseenter doesn't work with event delegation
- .mouseenter(function( event ) {
- self.activate( event, $(this).parent() );
- })
- .mouseleave(function() {
- self.deactivate();
- });
- },
-
- activate: function( event, item ) {
- this.deactivate();
- if (this.hasScroll()) {
- var offset = item.offset().top - this.element.offset().top,
- scroll = this.element.scrollTop(),
- elementHeight = this.element.height();
- if (offset < 0) {
- this.element.scrollTop( scroll + offset);
- } else if (offset >= elementHeight) {
- this.element.scrollTop( scroll + offset - elementHeight + item.height());
- }
- }
- this.active = item.eq(0)
- .children("a")
- .addClass("ui-state-hover")
- .attr("id", "ui-active-menuitem")
- .end();
- this._trigger("focus", event, { item: item });
- },
-
- deactivate: function() {
- if (!this.active) { return; }
-
- this.active.children("a")
- .removeClass("ui-state-hover")
- .removeAttr("id");
- this._trigger("blur");
- this.active = null;
- },
-
- next: function(event) {
- this.move("next", ".ui-menu-item:first", event);
- },
-
- previous: function(event) {
- this.move("prev", ".ui-menu-item:last", event);
- },
-
- first: function() {
- return this.active && !this.active.prevAll(".ui-menu-item").length;
- },
-
- last: function() {
- return this.active && !this.active.nextAll(".ui-menu-item").length;
- },
-
- move: function(direction, edge, event) {
- if (!this.active) {
- this.activate(event, this.element.children(edge));
- return;
- }
- var next = this.active[direction + "All"](".ui-menu-item").eq(0);
- if (next.length) {
- this.activate(event, next);
- } else {
- this.activate(event, this.element.children(edge));
- }
- },
-
- // TODO merge with previousPage
- nextPage: function(event) {
- if (this.hasScroll()) {
- // TODO merge with no-scroll-else
- if (!this.active || this.last()) {
- this.activate(event, this.element.children(".ui-menu-item:first"));
- return;
- }
- var base = this.active.offset().top,
- height = this.element.height(),
- result = this.element.children(".ui-menu-item").filter(function() {
- var close = $(this).offset().top - base - height + $(this).height();
- // TODO improve approximation
- return close < 10 && close > -10;
- });
-
- // TODO try to catch this earlier when scrollTop indicates the last page anyway
- if (!result.length) {
- result = this.element.children(".ui-menu-item:last");
- }
- this.activate(event, result);
- } else {
- this.activate(event, this.element.children(".ui-menu-item")
- .filter(!this.active || this.last() ? ":first" : ":last"));
- }
- },
-
- // TODO merge with nextPage
- previousPage: function(event) {
- if (this.hasScroll()) {
- // TODO merge with no-scroll-else
- if (!this.active || this.first()) {
- this.activate(event, this.element.children(".ui-menu-item:last"));
- return;
- }
-
- var base = this.active.offset().top,
- height = this.element.height();
- result = this.element.children(".ui-menu-item").filter(function() {
- var close = $(this).offset().top - base + height - $(this).height();
- // TODO improve approximation
- return close < 10 && close > -10;
- });
-
- // TODO try to catch this earlier when scrollTop indicates the last page anyway
- if (!result.length) {
- result = this.element.children(".ui-menu-item:first");
- }
- this.activate(event, result);
- } else {
- this.activate(event, this.element.children(".ui-menu-item")
- .filter(!this.active || this.first() ? ":last" : ":first"));
- }
- },
-
- hasScroll: function() {
- return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]("scrollHeight");
- },
-
- select: function( event ) {
- this._trigger("selected", event, { item: this.active });
- }
-});
-
-}(jQuery));
-/*
- * jQuery UI Button 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Button
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-var lastActive, startXPos, startYPos, clickDragged,
- baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
- stateClasses = "ui-state-hover ui-state-active ",
- typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
- formResetHandler = function() {
- var buttons = $( this ).find( ":ui-button" );
- setTimeout(function() {
- buttons.button( "refresh" );
- }, 1 );
- },
- radioGroup = function( radio ) {
- var name = radio.name,
- form = radio.form,
- radios = $( [] );
- if ( name ) {
- if ( form ) {
- radios = $( form ).find( "[name='" + name + "']" );
- } else {
- radios = $( "[name='" + name + "']", radio.ownerDocument )
- .filter(function() {
- return !this.form;
- });
- }
- }
- return radios;
- };
-
-$.widget( "ui.button", {
- options: {
- disabled: null,
- text: true,
- label: null,
- icons: {
- primary: null,
- secondary: null
- }
- },
- _create: function() {
- this.element.closest( "form" )
- .unbind( "reset.button" )
- .bind( "reset.button", formResetHandler );
-
- if ( typeof this.options.disabled !== "boolean" ) {
- this.options.disabled = !!this.element.propAttr( "disabled" );
- } else {
- this.element.propAttr( "disabled", this.options.disabled );
- }
-
- this._determineButtonType();
- this.hasTitle = !!this.buttonElement.attr( "title" );
-
- var self = this,
- options = this.options,
- toggleButton = this.type === "checkbox" || this.type === "radio",
- hoverClass = "ui-state-hover" + ( !toggleButton ? " ui-state-active" : "" ),
- focusClass = "ui-state-focus";
-
- if ( options.label === null ) {
- options.label = this.buttonElement.html();
- }
-
- this.buttonElement
- .addClass( baseClasses )
- .attr( "role", "button" )
- .bind( "mouseenter.button", function() {
- if ( options.disabled ) {
- return;
- }
- $( this ).addClass( "ui-state-hover" );
- if ( this === lastActive ) {
- $( this ).addClass( "ui-state-active" );
- }
- })
- .bind( "mouseleave.button", function() {
- if ( options.disabled ) {
- return;
- }
- $( this ).removeClass( hoverClass );
- })
- .bind( "click.button", function( event ) {
- if ( options.disabled ) {
- event.preventDefault();
- event.stopImmediatePropagation();
- }
- });
-
- this.element
- .bind( "focus.button", function() {
- // no need to check disabled, focus won't be triggered anyway
- self.buttonElement.addClass( focusClass );
- })
- .bind( "blur.button", function() {
- self.buttonElement.removeClass( focusClass );
- });
-
- if ( toggleButton ) {
- this.element.bind( "change.button", function() {
- if ( clickDragged ) {
- return;
- }
- self.refresh();
- });
- // if mouse moves between mousedown and mouseup (drag) set clickDragged flag
- // prevents issue where button state changes but checkbox/radio checked state
- // does not in Firefox (see ticket #6970)
- this.buttonElement
- .bind( "mousedown.button", function( event ) {
- if ( options.disabled ) {
- return;
- }
- clickDragged = false;
- startXPos = event.pageX;
- startYPos = event.pageY;
- })
- .bind( "mouseup.button", function( event ) {
- if ( options.disabled ) {
- return;
- }
- if ( startXPos !== event.pageX || startYPos !== event.pageY ) {
- clickDragged = true;
- }
- });
- }
-
- if ( this.type === "checkbox" ) {
- this.buttonElement.bind( "click.button", function() {
- if ( options.disabled || clickDragged ) {
- return false;
- }
- $( this ).toggleClass( "ui-state-active" );
- self.buttonElement.attr( "aria-pressed", self.element[0].checked );
- });
- } else if ( this.type === "radio" ) {
- this.buttonElement.bind( "click.button", function() {
- if ( options.disabled || clickDragged ) {
- return false;
- }
- $( this ).addClass( "ui-state-active" );
- self.buttonElement.attr( "aria-pressed", "true" );
-
- var radio = self.element[ 0 ];
- radioGroup( radio )
- .not( radio )
- .map(function() {
- return $( this ).button( "widget" )[ 0 ];
- })
- .removeClass( "ui-state-active" )
- .attr( "aria-pressed", "false" );
- });
- } else {
- this.buttonElement
- .bind( "mousedown.button", function() {
- if ( options.disabled ) {
- return false;
- }
- $( this ).addClass( "ui-state-active" );
- lastActive = this;
- $( document ).one( "mouseup", function() {
- lastActive = null;
- });
- })
- .bind( "mouseup.button", function() {
- if ( options.disabled ) {
- return false;
- }
- $( this ).removeClass( "ui-state-active" );
- })
- .bind( "keydown.button", function(event) {
- if ( options.disabled ) {
- return false;
- }
- if ( event.keyCode == $.ui.keyCode.SPACE || event.keyCode == $.ui.keyCode.ENTER ) {
- $( this ).addClass( "ui-state-active" );
- }
- })
- .bind( "keyup.button", function() {
- $( this ).removeClass( "ui-state-active" );
- });
-
- if ( this.buttonElement.is("a") ) {
- this.buttonElement.keyup(function(event) {
- if ( event.keyCode === $.ui.keyCode.SPACE ) {
- // TODO pass through original event correctly (just as 2nd argument doesn't work)
- $( this ).click();
- }
- });
- }
- }
-
- // TODO: pull out $.Widget's handling for the disabled option into
- // $.Widget.prototype._setOptionDisabled so it's easy to proxy and can
- // be overridden by individual plugins
- this._setOption( "disabled", options.disabled );
- this._resetButton();
- },
-
- _determineButtonType: function() {
-
- if ( this.element.is(":checkbox") ) {
- this.type = "checkbox";
- } else if ( this.element.is(":radio") ) {
- this.type = "radio";
- } else if ( this.element.is("input") ) {
- this.type = "input";
- } else {
- this.type = "button";
- }
-
- if ( this.type === "checkbox" || this.type === "radio" ) {
- // we don't search against the document in case the element
- // is disconnected from the DOM
- var ancestor = this.element.parents().filter(":last"),
- labelSelector = "label[for='" + this.element.attr("id") + "']";
- this.buttonElement = ancestor.find( labelSelector );
- if ( !this.buttonElement.length ) {
- ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
- this.buttonElement = ancestor.filter( labelSelector );
- if ( !this.buttonElement.length ) {
- this.buttonElement = ancestor.find( labelSelector );
- }
- }
- this.element.addClass( "ui-helper-hidden-accessible" );
-
- var checked = this.element.is( ":checked" );
- if ( checked ) {
- this.buttonElement.addClass( "ui-state-active" );
- }
- this.buttonElement.attr( "aria-pressed", checked );
- } else {
- this.buttonElement = this.element;
- }
- },
-
- widget: function() {
- return this.buttonElement;
- },
-
- destroy: function() {
- this.element
- .removeClass( "ui-helper-hidden-accessible" );
- this.buttonElement
- .removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
- .removeAttr( "role" )
- .removeAttr( "aria-pressed" )
- .html( this.buttonElement.find(".ui-button-text").html() );
-
- if ( !this.hasTitle ) {
- this.buttonElement.removeAttr( "title" );
- }
-
- $.Widget.prototype.destroy.call( this );
- },
-
- _setOption: function( key, value ) {
- $.Widget.prototype._setOption.apply( this, arguments );
- if ( key === "disabled" ) {
- if ( value ) {
- this.element.propAttr( "disabled", true );
- } else {
- this.element.propAttr( "disabled", false );
- }
- return;
- }
- this._resetButton();
- },
-
- refresh: function() {
- var isDisabled = this.element.is( ":disabled" );
- if ( isDisabled !== this.options.disabled ) {
- this._setOption( "disabled", isDisabled );
- }
- if ( this.type === "radio" ) {
- radioGroup( this.element[0] ).each(function() {
- if ( $( this ).is( ":checked" ) ) {
- $( this ).button( "widget" )
- .addClass( "ui-state-active" )
- .attr( "aria-pressed", "true" );
- } else {
- $( this ).button( "widget" )
- .removeClass( "ui-state-active" )
- .attr( "aria-pressed", "false" );
- }
- });
- } else if ( this.type === "checkbox" ) {
- if ( this.element.is( ":checked" ) ) {
- this.buttonElement
- .addClass( "ui-state-active" )
- .attr( "aria-pressed", "true" );
- } else {
- this.buttonElement
- .removeClass( "ui-state-active" )
- .attr( "aria-pressed", "false" );
- }
- }
- },
-
- _resetButton: function() {
- if ( this.type === "input" ) {
- if ( this.options.label ) {
- this.element.val( this.options.label );
- }
- return;
- }
- var buttonElement = this.buttonElement.removeClass( typeClasses ),
- buttonText = $( "<span></span>", this.element[0].ownerDocument )
- .addClass( "ui-button-text" )
- .html( this.options.label )
- .appendTo( buttonElement.empty() )
- .text(),
- icons = this.options.icons,
- multipleIcons = icons.primary && icons.secondary,
- buttonClasses = [];
-
- if ( icons.primary || icons.secondary ) {
- if ( this.options.text ) {
- buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) );
- }
-
- if ( icons.primary ) {
- buttonElement.prepend( "<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>" );
- }
-
- if ( icons.secondary ) {
- buttonElement.append( "<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>" );
- }
-
- if ( !this.options.text ) {
- buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" );
-
- if ( !this.hasTitle ) {
- buttonElement.attr( "title", buttonText );
- }
- }
- } else {
- buttonClasses.push( "ui-button-text-only" );
- }
- buttonElement.addClass( buttonClasses.join( " " ) );
- }
-});
-
-$.widget( "ui.buttonset", {
- options: {
- items: ":button, :submit, :reset, :checkbox, :radio, a, :data(button)"
- },
-
- _create: function() {
- this.element.addClass( "ui-buttonset" );
- },
-
- _init: function() {
- this.refresh();
- },
-
- _setOption: function( key, value ) {
- if ( key === "disabled" ) {
- this.buttons.button( "option", key, value );
- }
-
- $.Widget.prototype._setOption.apply( this, arguments );
- },
-
- refresh: function() {
- var rtl = this.element.css( "direction" ) === "rtl";
-
- this.buttons = this.element.find( this.options.items )
- .filter( ":ui-button" )
- .button( "refresh" )
- .end()
- .not( ":ui-button" )
- .button()
- .end()
- .map(function() {
- return $( this ).button( "widget" )[ 0 ];
- })
- .removeClass( "ui-corner-all ui-corner-left ui-corner-right" )
- .filter( ":first" )
- .addClass( rtl ? "ui-corner-right" : "ui-corner-left" )
- .end()
- .filter( ":last" )
- .addClass( rtl ? "ui-corner-left" : "ui-corner-right" )
- .end()
- .end();
- },
-
- destroy: function() {
- this.element.removeClass( "ui-buttonset" );
- this.buttons
- .map(function() {
- return $( this ).button( "widget" )[ 0 ];
- })
- .removeClass( "ui-corner-left ui-corner-right" )
- .end()
- .button( "destroy" );
-
- $.Widget.prototype.destroy.call( this );
- }
-});
-
-}( jQuery ) );
-/*
- * jQuery UI Datepicker 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Datepicker
- *
- * Depends:
- * jquery.ui.core.js
- */
-(function( $, undefined ) {
-
-$.extend($.ui, { datepicker: { version: "1.8.18" } });
-
-var PROP_NAME = 'datepicker';
-var dpuuid = new Date().getTime();
-var instActive;
-
-/* Date picker manager.
- Use the singleton instance of this class, $.datepicker, to interact with the date picker.
- Settings for (groups of) date pickers are maintained in an instance object,
- allowing multiple different settings on the same page. */
-
-function Datepicker() {
- this.debug = false; // Change this to true to start debugging
- this._curInst = null; // The current instance in use
- this._keyEvent = false; // If the last event was a key event
- this._disabledInputs = []; // List of date picker inputs that have been disabled
- this._datepickerShowing = false; // True if the popup picker is showing , false if not
- this._inDialog = false; // True if showing within a "dialog", false if not
- this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division
- this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class
- this._appendClass = 'ui-datepicker-append'; // The name of the append marker class
- this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class
- this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class
- this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class
- this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class
- this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class
- this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class
- this.regional = []; // Available regional settings, indexed by language code
- this.regional[''] = { // Default regional settings
- closeText: 'Done', // Display text for close link
- prevText: 'Prev', // Display text for previous month link
- nextText: 'Next', // Display text for next month link
- currentText: 'Today', // Display text for current month link
- monthNames: ['January','February','March','April','May','June',
- 'July','August','September','October','November','December'], // Names of months for drop-down and formatting
- monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting
- dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting
- dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting
- dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday
- weekHeader: 'Wk', // Column header for week of the year
- dateFormat: 'mm/dd/yy', // See format options on parseDate
- firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
- isRTL: false, // True if right-to-left language, false if left-to-right
- showMonthAfterYear: false, // True if the year select precedes month, false for month then year
- yearSuffix: '' // Additional text to append to the year in the month headers
- };
- this._defaults = { // Global defaults for all the date picker instances
- showOn: 'focus', // 'focus' for popup on focus,
- // 'button' for trigger button, or 'both' for either
- showAnim: 'fadeIn', // Name of jQuery animation for popup
- showOptions: {}, // Options for enhanced animations
- defaultDate: null, // Used when field is blank: actual date,
- // +/-number for offset from today, null for today
- appendText: '', // Display text following the input box, e.g. showing the format
- buttonText: '...', // Text for trigger button
- buttonImage: '', // URL for trigger button image
- buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
- hideIfNoPrevNext: false, // True to hide next/previous month links
- // if not applicable, false to just disable them
- navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
- gotoCurrent: false, // True if today link goes back to current selection instead
- changeMonth: false, // True if month can be selected directly, false if only prev/next
- changeYear: false, // True if year can be selected directly, false if only prev/next
- yearRange: 'c-10:c+10', // Range of years to display in drop-down,
- // either relative to today's year (-nn:+nn), relative to currently displayed year
- // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
- showOtherMonths: false, // True to show dates in other months, false to leave blank
- selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
- showWeek: false, // True to show week of the year, false to not show it
- calculateWeek: this.iso8601Week, // How to calculate the week of the year,
- // takes a Date and returns the number of the week for it
- shortYearCutoff: '+10', // Short year values < this are in the current century,
- // > this are in the previous century,
- // string value starting with '+' for current year + value
- minDate: null, // The earliest selectable date, or null for no limit
- maxDate: null, // The latest selectable date, or null for no limit
- duration: 'fast', // Duration of display/closure
- beforeShowDay: null, // Function that takes a date and returns an array with
- // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',
- // [2] = cell title (optional), e.g. $.datepicker.noWeekends
- beforeShow: null, // Function that takes an input field and
- // returns a set of custom settings for the date picker
- onSelect: null, // Define a callback function when a date is selected
- onChangeMonthYear: null, // Define a callback function when the month or year is changed
- onClose: null, // Define a callback function when the datepicker is closed
- numberOfMonths: 1, // Number of months to show at a time
- showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)
- stepMonths: 1, // Number of months to step back/forward
- stepBigMonths: 12, // Number of months to step back/forward for the big links
- altField: '', // Selector for an alternate field to store selected dates into
- altFormat: '', // The date format to use for the alternate field
- constrainInput: true, // The input is constrained by the current date format
- showButtonPanel: false, // True to show button panel, false to not show it
- autoSize: false, // True to size the input for the date format, false to leave as is
- disabled: false // The initial disabled state
- };
- $.extend(this._defaults, this.regional['']);
- this.dpDiv = bindHover($('<div id="' + this._mainDivId + '" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'));
-}
-
-$.extend(Datepicker.prototype, {
- /* Class name added to elements to indicate already configured with a date picker. */
- markerClassName: 'hasDatepicker',
-
- //Keep track of the maximum number of rows displayed (see #7043)
- maxRows: 4,
-
- /* Debug logging (if enabled). */
- log: function () {
- if (this.debug)
- console.log.apply('', arguments);
- },
-
- // TODO rename to "widget" when switching to widget factory
- _widgetDatepicker: function() {
- return this.dpDiv;
- },
-
- /* Override the default settings for all instances of the date picker.
- @param settings object - the new settings to use as defaults (anonymous object)
- @return the manager object */
- setDefaults: function(settings) {
- extendRemove(this._defaults, settings || {});
- return this;
- },
-
- /* Attach the date picker to a jQuery selection.
- @param target element - the target input field or division or span
- @param settings object - the new settings to use for this date picker instance (anonymous) */
- _attachDatepicker: function(target, settings) {
- // check for settings on the control itself - in namespace 'date:'
- var inlineSettings = null;
- for (var attrName in this._defaults) {
- var attrValue = target.getAttribute('date:' + attrName);
- if (attrValue) {
- inlineSettings = inlineSettings || {};
- try {
- inlineSettings[attrName] = eval(attrValue);
- } catch (err) {
- inlineSettings[attrName] = attrValue;
- }
- }
- }
- var nodeName = target.nodeName.toLowerCase();
- var inline = (nodeName == 'div' || nodeName == 'span');
- if (!target.id) {
- this.uuid += 1;
- target.id = 'dp' + this.uuid;
- }
- var inst = this._newInst($(target), inline);
- inst.settings = $.extend({}, settings || {}, inlineSettings || {});
- if (nodeName == 'input') {
- this._connectDatepicker(target, inst);
- } else if (inline) {
- this._inlineDatepicker(target, inst);
- }
- },
-
- /* Create a new instance object. */
- _newInst: function(target, inline) {
- var id = target[0].id.replace(/([^A-Za-z0-9_-])/g, '\\\\$1'); // escape jQuery meta chars
- return {id: id, input: target, // associated target
- selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
- drawMonth: 0, drawYear: 0, // month being drawn
- inline: inline, // is datepicker inline or not
- dpDiv: (!inline ? this.dpDiv : // presentation div
- bindHover($('<div class="' + this._inlineClass + ' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')))};
- },
-
- /* Attach the date picker to an input field. */
- _connectDatepicker: function(target, inst) {
- var input = $(target);
- inst.append = $([]);
- inst.trigger = $([]);
- if (input.hasClass(this.markerClassName))
- return;
- this._attachments(input, inst);
- input.addClass(this.markerClassName).keydown(this._doKeyDown).
- keypress(this._doKeyPress).keyup(this._doKeyUp).
- bind("setData.datepicker", function(event, key, value) {
- inst.settings[key] = value;
- }).bind("getData.datepicker", function(event, key) {
- return this._get(inst, key);
- });
- this._autoSize(inst);
- $.data(target, PROP_NAME, inst);
- //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665)
- if( inst.settings.disabled ) {
- this._disableDatepicker( target );
- }
- },
-
- /* Make attachments based on settings. */
- _attachments: function(input, inst) {
- var appendText = this._get(inst, 'appendText');
- var isRTL = this._get(inst, 'isRTL');
- if (inst.append)
- inst.append.remove();
- if (appendText) {
- inst.append = $('<span class="' + this._appendClass + '">' + appendText + '</span>');
- input[isRTL ? 'before' : 'after'](inst.append);
- }
- input.unbind('focus', this._showDatepicker);
- if (inst.trigger)
- inst.trigger.remove();
- var showOn = this._get(inst, 'showOn');
- if (showOn == 'focus' || showOn == 'both') // pop-up date picker when in the marked field
- input.focus(this._showDatepicker);
- if (showOn == 'button' || showOn == 'both') { // pop-up date picker when button clicked
- var buttonText = this._get(inst, 'buttonText');
- var buttonImage = this._get(inst, 'buttonImage');
- inst.trigger = $(this._get(inst, 'buttonImageOnly') ?
- $('<img/>').addClass(this._triggerClass).
- attr({ src: buttonImage, alt: buttonText, title: buttonText }) :
- $('<button type="button"></button>').addClass(this._triggerClass).
- html(buttonImage == '' ? buttonText : $('<img/>').attr(
- { src:buttonImage, alt:buttonText, title:buttonText })));
- input[isRTL ? 'before' : 'after'](inst.trigger);
- inst.trigger.click(function() {
- if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0])
- $.datepicker._hideDatepicker();
- else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) {
- $.datepicker._hideDatepicker();
- $.datepicker._showDatepicker(input[0]);
- } else
- $.datepicker._showDatepicker(input[0]);
- return false;
- });
- }
- },
-
- /* Apply the maximum length for the date format. */
- _autoSize: function(inst) {
- if (this._get(inst, 'autoSize') && !inst.inline) {
- var date = new Date(2009, 12 - 1, 20); // Ensure double digits
- var dateFormat = this._get(inst, 'dateFormat');
- if (dateFormat.match(/[DM]/)) {
- var findMax = function(names) {
- var max = 0;
- var maxI = 0;
- for (var i = 0; i < names.length; i++) {
- if (names[i].length > max) {
- max = names[i].length;
- maxI = i;
- }
- }
- return maxI;
- };
- date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ?
- 'monthNames' : 'monthNamesShort'))));
- date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
- 'dayNames' : 'dayNamesShort'))) + 20 - date.getDay());
- }
- inst.input.attr('size', this._formatDate(inst, date).length);
- }
- },
-
- /* Attach an inline date picker to a div. */
- _inlineDatepicker: function(target, inst) {
- var divSpan = $(target);
- if (divSpan.hasClass(this.markerClassName))
- return;
- divSpan.addClass(this.markerClassName).append(inst.dpDiv).
- bind("setData.datepicker", function(event, key, value){
- inst.settings[key] = value;
- }).bind("getData.datepicker", function(event, key){
- return this._get(inst, key);
- });
- $.data(target, PROP_NAME, inst);
- this._setDate(inst, this._getDefaultDate(inst), true);
- this._updateDatepicker(inst);
- this._updateAlternate(inst);
- //If disabled option is true, disable the datepicker before showing it (see ticket #5665)
- if( inst.settings.disabled ) {
- this._disableDatepicker( target );
- }
- // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements
- // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height
- inst.dpDiv.css( "display", "block" );
- },
-
- /* Pop-up the date picker in a "dialog" box.
- @param input element - ignored
- @param date string or Date - the initial date to display
- @param onSelect function - the function to call when a date is selected
- @param settings object - update the dialog date picker instance's settings (anonymous object)
- @param pos int[2] - coordinates for the dialog's position within the screen or
- event - with x/y coordinates or
- leave empty for default (screen centre)
- @return the manager object */
- _dialogDatepicker: function(input, date, onSelect, settings, pos) {
- var inst = this._dialogInst; // internal instance
- if (!inst) {
- this.uuid += 1;
- var id = 'dp' + this.uuid;
- this._dialogInput = $('<input type="text" id="' + id +
- '" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');
- this._dialogInput.keydown(this._doKeyDown);
- $('body').append(this._dialogInput);
- inst = this._dialogInst = this._newInst(this._dialogInput, false);
- inst.settings = {};
- $.data(this._dialogInput[0], PROP_NAME, inst);
- }
- extendRemove(inst.settings, settings || {});
- date = (date && date.constructor == Date ? this._formatDate(inst, date) : date);
- this._dialogInput.val(date);
-
- this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null);
- if (!this._pos) {
- var browserWidth = document.documentElement.clientWidth;
- var browserHeight = document.documentElement.clientHeight;
- var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
- var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
- this._pos = // should use actual width/height below
- [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY];
- }
-
- // move input on screen for focus, but hidden behind dialog
- this._dialogInput.css('left', (this._pos[0] + 20) + 'px').css('top', this._pos[1] + 'px');
- inst.settings.onSelect = onSelect;
- this._inDialog = true;
- this.dpDiv.addClass(this._dialogClass);
- this._showDatepicker(this._dialogInput[0]);
- if ($.blockUI)
- $.blockUI(this.dpDiv);
- $.data(this._dialogInput[0], PROP_NAME, inst);
- return this;
- },
-
- /* Detach a datepicker from its control.
- @param target element - the target input field or division or span */
- _destroyDatepicker: function(target) {
- var $target = $(target);
- var inst = $.data(target, PROP_NAME);
- if (!$target.hasClass(this.markerClassName)) {
- return;
- }
- var nodeName = target.nodeName.toLowerCase();
- $.removeData(target, PROP_NAME);
- if (nodeName == 'input') {
- inst.append.remove();
- inst.trigger.remove();
- $target.removeClass(this.markerClassName).
- unbind('focus', this._showDatepicker).
- unbind('keydown', this._doKeyDown).
- unbind('keypress', this._doKeyPress).
- unbind('keyup', this._doKeyUp);
- } else if (nodeName == 'div' || nodeName == 'span')
- $target.removeClass(this.markerClassName).empty();
- },
-
- /* Enable the date picker to a jQuery selection.
- @param target element - the target input field or division or span */
- _enableDatepicker: function(target) {
- var $target = $(target);
- var inst = $.data(target, PROP_NAME);
- if (!$target.hasClass(this.markerClassName)) {
- return;
- }
- var nodeName = target.nodeName.toLowerCase();
- if (nodeName == 'input') {
- target.disabled = false;
- inst.trigger.filter('button').
- each(function() { this.disabled = false; }).end().
- filter('img').css({opacity: '1.0', cursor: ''});
- }
- else if (nodeName == 'div' || nodeName == 'span') {
- var inline = $target.children('.' + this._inlineClass);
- inline.children().removeClass('ui-state-disabled');
- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
- removeAttr("disabled");
- }
- this._disabledInputs = $.map(this._disabledInputs,
- function(value) { return (value == target ? null : value); }); // delete entry
- },
-
- /* Disable the date picker to a jQuery selection.
- @param target element - the target input field or division or span */
- _disableDatepicker: function(target) {
- var $target = $(target);
- var inst = $.data(target, PROP_NAME);
- if (!$target.hasClass(this.markerClassName)) {
- return;
- }
- var nodeName = target.nodeName.toLowerCase();
- if (nodeName == 'input') {
- target.disabled = true;
- inst.trigger.filter('button').
- each(function() { this.disabled = true; }).end().
- filter('img').css({opacity: '0.5', cursor: 'default'});
- }
- else if (nodeName == 'div' || nodeName == 'span') {
- var inline = $target.children('.' + this._inlineClass);
- inline.children().addClass('ui-state-disabled');
- inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
- attr("disabled", "disabled");
- }
- this._disabledInputs = $.map(this._disabledInputs,
- function(value) { return (value == target ? null : value); }); // delete entry
- this._disabledInputs[this._disabledInputs.length] = target;
- },
-
- /* Is the first field in a jQuery collection disabled as a datepicker?
- @param target element - the target input field or division or span
- @return boolean - true if disabled, false if enabled */
- _isDisabledDatepicker: function(target) {
- if (!target) {
- return false;
- }
- for (var i = 0; i < this._disabledInputs.length; i++) {
- if (this._disabledInputs[i] == target)
- return true;
- }
- return false;
- },
-
- /* Retrieve the instance data for the target control.
- @param target element - the target input field or division or span
- @return object - the associated instance data
- @throws error if a jQuery problem getting data */
- _getInst: function(target) {
- try {
- return $.data(target, PROP_NAME);
- }
- catch (err) {
- throw 'Missing instance data for this datepicker';
- }
- },
-
- /* Update or retrieve the settings for a date picker attached to an input field or division.
- @param target element - the target input field or division or span
- @param name object - the new settings to update or
- string - the name of the setting to change or retrieve,
- when retrieving also 'all' for all instance settings or
- 'defaults' for all global defaults
- @param value any - the new value for the setting
- (omit if above is an object or to retrieve a value) */
- _optionDatepicker: function(target, name, value) {
- var inst = this._getInst(target);
- if (arguments.length == 2 && typeof name == 'string') {
- return (name == 'defaults' ? $.extend({}, $.datepicker._defaults) :
- (inst ? (name == 'all' ? $.extend({}, inst.settings) :
- this._get(inst, name)) : null));
- }
- var settings = name || {};
- if (typeof name == 'string') {
- settings = {};
- settings[name] = value;
- }
- if (inst) {
- if (this._curInst == inst) {
- this._hideDatepicker();
- }
- var date = this._getDateDatepicker(target, true);
- var minDate = this._getMinMaxDate(inst, 'min');
- var maxDate = this._getMinMaxDate(inst, 'max');
- extendRemove(inst.settings, settings);
- // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided
- if (minDate !== null && settings['dateFormat'] !== undefined && settings['minDate'] === undefined)
- inst.settings.minDate = this._formatDate(inst, minDate);
- if (maxDate !== null && settings['dateFormat'] !== undefined && settings['maxDate'] === undefined)
- inst.settings.maxDate = this._formatDate(inst, maxDate);
- this._attachments($(target), inst);
- this._autoSize(inst);
- this._setDate(inst, date);
- this._updateAlternate(inst);
- this._updateDatepicker(inst);
- }
- },
-
- // change method deprecated
- _changeDatepicker: function(target, name, value) {
- this._optionDatepicker(target, name, value);
- },
-
- /* Redraw the date picker attached to an input field or division.
- @param target element - the target input field or division or span */
- _refreshDatepicker: function(target) {
- var inst = this._getInst(target);
- if (inst) {
- this._updateDatepicker(inst);
- }
- },
-
- /* Set the dates for a jQuery selection.
- @param target element - the target input field or division or span
- @param date Date - the new date */
- _setDateDatepicker: function(target, date) {
- var inst = this._getInst(target);
- if (inst) {
- this._setDate(inst, date);
- this._updateDatepicker(inst);
- this._updateAlternate(inst);
- }
- },
-
- /* Get the date(s) for the first entry in a jQuery selection.
- @param target element - the target input field or division or span
- @param noDefault boolean - true if no default date is to be used
- @return Date - the current date */
- _getDateDatepicker: function(target, noDefault) {
- var inst = this._getInst(target);
- if (inst && !inst.inline)
- this._setDateFromField(inst, noDefault);
- return (inst ? this._getDate(inst) : null);
- },
-
- /* Handle keystrokes. */
- _doKeyDown: function(event) {
- var inst = $.datepicker._getInst(event.target);
- var handled = true;
- var isRTL = inst.dpDiv.is('.ui-datepicker-rtl');
- inst._keyEvent = true;
- if ($.datepicker._datepickerShowing)
- switch (event.keyCode) {
- case 9: $.datepicker._hideDatepicker();
- handled = false;
- break; // hide on tab out
- case 13: var sel = $('td.' + $.datepicker._dayOverClass + ':not(.' +
- $.datepicker._currentClass + ')', inst.dpDiv);
- if (sel[0])
- $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
- var onSelect = $.datepicker._get(inst, 'onSelect');
- if (onSelect) {
- var dateStr = $.datepicker._formatDate(inst);
-
- // trigger custom callback
- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
- }
- else
- $.datepicker._hideDatepicker();
- return false; // don't submit the form
- break; // select the value on enter
- case 27: $.datepicker._hideDatepicker();
- break; // hide on escape
- case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
- -$.datepicker._get(inst, 'stepBigMonths') :
- -$.datepicker._get(inst, 'stepMonths')), 'M');
- break; // previous month/year on page up/+ ctrl
- case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
- +$.datepicker._get(inst, 'stepBigMonths') :
- +$.datepicker._get(inst, 'stepMonths')), 'M');
- break; // next month/year on page down/+ ctrl
- case 35: if (event.ctrlKey || event.metaKey) $.datepicker._clearDate(event.target);
- handled = event.ctrlKey || event.metaKey;
- break; // clear on ctrl or command +end
- case 36: if (event.ctrlKey || event.metaKey) $.datepicker._gotoToday(event.target);
- handled = event.ctrlKey || event.metaKey;
- break; // current on ctrl or command +home
- case 37: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), 'D');
- handled = event.ctrlKey || event.metaKey;
- // -1 day on ctrl or command +left
- if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
- -$.datepicker._get(inst, 'stepBigMonths') :
- -$.datepicker._get(inst, 'stepMonths')), 'M');
- // next month/year on alt +left on Mac
- break;
- case 38: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, -7, 'D');
- handled = event.ctrlKey || event.metaKey;
- break; // -1 week on ctrl or command +up
- case 39: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), 'D');
- handled = event.ctrlKey || event.metaKey;
- // +1 day on ctrl or command +right
- if (event.originalEvent.altKey) $.datepicker._adjustDate(event.target, (event.ctrlKey ?
- +$.datepicker._get(inst, 'stepBigMonths') :
- +$.datepicker._get(inst, 'stepMonths')), 'M');
- // next month/year on alt +right
- break;
- case 40: if (event.ctrlKey || event.metaKey) $.datepicker._adjustDate(event.target, +7, 'D');
- handled = event.ctrlKey || event.metaKey;
- break; // +1 week on ctrl or command +down
- default: handled = false;
- }
- else if (event.keyCode == 36 && event.ctrlKey) // display the date picker on ctrl+home
- $.datepicker._showDatepicker(this);
- else {
- handled = false;
- }
- if (handled) {
- event.preventDefault();
- event.stopPropagation();
- }
- },
-
- /* Filter entered characters - based on date format. */
- _doKeyPress: function(event) {
- var inst = $.datepicker._getInst(event.target);
- if ($.datepicker._get(inst, 'constrainInput')) {
- var chars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat'));
- var chr = String.fromCharCode(event.charCode == undefined ? event.keyCode : event.charCode);
- return event.ctrlKey || event.metaKey || (chr < ' ' || !chars || chars.indexOf(chr) > -1);
- }
- },
-
- /* Synchronise manual entry and field/alternate field. */
- _doKeyUp: function(event) {
- var inst = $.datepicker._getInst(event.target);
- if (inst.input.val() != inst.lastVal) {
- try {
- var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
- (inst.input ? inst.input.val() : null),
- $.datepicker._getFormatConfig(inst));
- if (date) { // only if valid
- $.datepicker._setDateFromField(inst);
- $.datepicker._updateAlternate(inst);
- $.datepicker._updateDatepicker(inst);
- }
- }
- catch (event) {
- $.datepicker.log(event);
- }
- }
- return true;
- },
-
- /* Pop-up the date picker for a given input field.
- If false returned from beforeShow event handler do not show.
- @param input element - the input field attached to the date picker or
- event - if triggered by focus */
- _showDatepicker: function(input) {
- input = input.target || input;
- if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
- input = $('input', input.parentNode)[0];
- if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
- return;
- var inst = $.datepicker._getInst(input);
- if ($.datepicker._curInst && $.datepicker._curInst != inst) {
- $.datepicker._curInst.dpDiv.stop(true, true);
- if ( inst && $.datepicker._datepickerShowing ) {
- $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] );
- }
- }
- var beforeShow = $.datepicker._get(inst, 'beforeShow');
- var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
- if(beforeShowSettings === false){
- //false
- return;
- }
- extendRemove(inst.settings, beforeShowSettings);
- inst.lastVal = null;
- $.datepicker._lastInput = input;
- $.datepicker._setDateFromField(inst);
- if ($.datepicker._inDialog) // hide cursor
- input.value = '';
- if (!$.datepicker._pos) { // position below input
- $.datepicker._pos = $.datepicker._findPos(input);
- $.datepicker._pos[1] += input.offsetHeight; // add the height
- }
- var isFixed = false;
- $(input).parents().each(function() {
- isFixed |= $(this).css('position') == 'fixed';
- return !isFixed;
- });
- if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled
- $.datepicker._pos[0] -= document.documentElement.scrollLeft;
- $.datepicker._pos[1] -= document.documentElement.scrollTop;
- }
- var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]};
- $.datepicker._pos = null;
- //to avoid flashes on Firefox
- inst.dpDiv.empty();
- // determine sizing offscreen
- inst.dpDiv.css({position: 'absolute', display: 'block', top: '-1000px'});
- $.datepicker._updateDatepicker(inst);
- // fix width for dynamic number of date pickers
- // and adjust position before showing
- offset = $.datepicker._checkOffset(inst, offset, isFixed);
- inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ?
- 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
- left: offset.left + 'px', top: offset.top + 'px'});
- if (!inst.inline) {
- var showAnim = $.datepicker._get(inst, 'showAnim');
- var duration = $.datepicker._get(inst, 'duration');
- var postProcess = function() {
- var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
- if( !! cover.length ){
- var borders = $.datepicker._getBorders(inst.dpDiv);
- cover.css({left: -borders[0], top: -borders[1],
- width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()});
- }
- };
- inst.dpDiv.zIndex($(input).zIndex()+1);
- $.datepicker._datepickerShowing = true;
- if ($.effects && $.effects[showAnim])
- inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
- else
- inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess);
- if (!showAnim || !duration)
- postProcess();
- if (inst.input.is(':visible') && !inst.input.is(':disabled'))
- inst.input.focus();
- $.datepicker._curInst = inst;
- }
- },
-
- /* Generate the date picker content. */
- _updateDatepicker: function(inst) {
- var self = this;
- self.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
- var borders = $.datepicker._getBorders(inst.dpDiv);
- instActive = inst; // for delegate hover events
- inst.dpDiv.empty().append(this._generateHTML(inst));
- var cover = inst.dpDiv.find('iframe.ui-datepicker-cover'); // IE6- only
- if( !!cover.length ){ //avoid call to outerXXXX() when not in IE6
- cover.css({left: -borders[0], top: -borders[1], width: inst.dpDiv.outerWidth(), height: inst.dpDiv.outerHeight()})
- }
- inst.dpDiv.find('.' + this._dayOverClass + ' a').mouseover();
- var numMonths = this._getNumberOfMonths(inst);
- var cols = numMonths[1];
- var width = 17;
- inst.dpDiv.removeClass('ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4').width('');
- if (cols > 1)
- inst.dpDiv.addClass('ui-datepicker-multi-' + cols).css('width', (width * cols) + 'em');
- inst.dpDiv[(numMonths[0] != 1 || numMonths[1] != 1 ? 'add' : 'remove') +
- 'Class']('ui-datepicker-multi');
- inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
- 'Class']('ui-datepicker-rtl');
- if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
- // #6694 - don't focus the input if it's already focused
- // this breaks the change event in IE
- inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement)
- inst.input.focus();
- // deffered render of the years select (to avoid flashes on Firefox)
- if( inst.yearshtml ){
- var origyearshtml = inst.yearshtml;
- setTimeout(function(){
- //assure that inst.yearshtml didn't change.
- if( origyearshtml === inst.yearshtml && inst.yearshtml ){
- inst.dpDiv.find('select.ui-datepicker-year:first').replaceWith(inst.yearshtml);
- }
- origyearshtml = inst.yearshtml = null;
- }, 0);
- }
- },
-
- /* Retrieve the size of left and top borders for an element.
- @param elem (jQuery object) the element of interest
- @return (number[2]) the left and top borders */
- _getBorders: function(elem) {
- var convert = function(value) {
- return {thin: 1, medium: 2, thick: 3}[value] || value;
- };
- return [parseFloat(convert(elem.css('border-left-width'))),
- parseFloat(convert(elem.css('border-top-width')))];
- },
-
- /* Check positioning to remain on screen. */
- _checkOffset: function(inst, offset, isFixed) {
- var dpWidth = inst.dpDiv.outerWidth();
- var dpHeight = inst.dpDiv.outerHeight();
- var inputWidth = inst.input ? inst.input.outerWidth() : 0;
- var inputHeight = inst.input ? inst.input.outerHeight() : 0;
- var viewWidth = document.documentElement.clientWidth + $(document).scrollLeft();
- var viewHeight = document.documentElement.clientHeight + $(document).scrollTop();
-
- offset.left -= (this._get(inst, 'isRTL') ? (dpWidth - inputWidth) : 0);
- offset.left -= (isFixed && offset.left == inst.input.offset().left) ? $(document).scrollLeft() : 0;
- offset.top -= (isFixed && offset.top == (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0;
-
- // now check if datepicker is showing outside window viewport - move to a better place if so.
- offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ?
- Math.abs(offset.left + dpWidth - viewWidth) : 0);
- offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ?
- Math.abs(dpHeight + inputHeight) : 0);
-
- return offset;
- },
-
- /* Find an object's position on the screen. */
- _findPos: function(obj) {
- var inst = this._getInst(obj);
- var isRTL = this._get(inst, 'isRTL');
- while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) {
- obj = obj[isRTL ? 'previousSibling' : 'nextSibling'];
- }
- var position = $(obj).offset();
- return [position.left, position.top];
- },
-
- /* Hide the date picker from view.
- @param input element - the input field attached to the date picker */
- _hideDatepicker: function(input) {
- var inst = this._curInst;
- if (!inst || (input && inst != $.data(input, PROP_NAME)))
- return;
- if (this._datepickerShowing) {
- var showAnim = this._get(inst, 'showAnim');
- var duration = this._get(inst, 'duration');
- var self = this;
- var postProcess = function() {
- $.datepicker._tidyDialog(inst);
- self._curInst = null;
- };
- if ($.effects && $.effects[showAnim])
- inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess);
- else
- inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' :
- (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);
- if (!showAnim)
- postProcess();
- this._datepickerShowing = false;
- var onClose = this._get(inst, 'onClose');
- if (onClose)
- onClose.apply((inst.input ? inst.input[0] : null),
- [(inst.input ? inst.input.val() : ''), inst]);
- this._lastInput = null;
- if (this._inDialog) {
- this._dialogInput.css({ position: 'absolute', left: '0', top: '-100px' });
- if ($.blockUI) {
- $.unblockUI();
- $('body').append(this.dpDiv);
- }
- }
- this._inDialog = false;
- }
- },
-
- /* Tidy up after a dialog display. */
- _tidyDialog: function(inst) {
- inst.dpDiv.removeClass(this._dialogClass).unbind('.ui-datepicker-calendar');
- },
-
- /* Close date picker if clicked elsewhere. */
- _checkExternalClick: function(event) {
- if (!$.datepicker._curInst)
- return;
-
- var $target = $(event.target),
- inst = $.datepicker._getInst($target[0]);
-
- if ( ( ( $target[0].id != $.datepicker._mainDivId &&
- $target.parents('#' + $.datepicker._mainDivId).length == 0 &&
- !$target.hasClass($.datepicker.markerClassName) &&
- !$target.closest("." + $.datepicker._triggerClass).length &&
- $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) ||
- ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst != inst ) )
- $.datepicker._hideDatepicker();
- },
-
- /* Adjust one of the date sub-fields. */
- _adjustDate: function(id, offset, period) {
- var target = $(id);
- var inst = this._getInst(target[0]);
- if (this._isDisabledDatepicker(target[0])) {
- return;
- }
- this._adjustInstDate(inst, offset +
- (period == 'M' ? this._get(inst, 'showCurrentAtPos') : 0), // undo positioning
- period);
- this._updateDatepicker(inst);
- },
-
- /* Action for current link. */
- _gotoToday: function(id) {
- var target = $(id);
- var inst = this._getInst(target[0]);
- if (this._get(inst, 'gotoCurrent') && inst.currentDay) {
- inst.selectedDay = inst.currentDay;
- inst.drawMonth = inst.selectedMonth = inst.currentMonth;
- inst.drawYear = inst.selectedYear = inst.currentYear;
- }
- else {
- var date = new Date();
- inst.selectedDay = date.getDate();
- inst.drawMonth = inst.selectedMonth = date.getMonth();
- inst.drawYear = inst.selectedYear = date.getFullYear();
- }
- this._notifyChange(inst);
- this._adjustDate(target);
- },
-
- /* Action for selecting a new month/year. */
- _selectMonthYear: function(id, select, period) {
- var target = $(id);
- var inst = this._getInst(target[0]);
- inst['selected' + (period == 'M' ? 'Month' : 'Year')] =
- inst['draw' + (period == 'M' ? 'Month' : 'Year')] =
- parseInt(select.options[select.selectedIndex].value,10);
- this._notifyChange(inst);
- this._adjustDate(target);
- },
-
- /* Action for selecting a day. */
- _selectDay: function(id, month, year, td) {
- var target = $(id);
- if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
- return;
- }
- var inst = this._getInst(target[0]);
- inst.selectedDay = inst.currentDay = $('a', td).html();
- inst.selectedMonth = inst.currentMonth = month;
- inst.selectedYear = inst.currentYear = year;
- this._selectDate(id, this._formatDate(inst,
- inst.currentDay, inst.currentMonth, inst.currentYear));
- },
-
- /* Erase the input field and hide the date picker. */
- _clearDate: function(id) {
- var target = $(id);
- var inst = this._getInst(target[0]);
- this._selectDate(target, '');
- },
-
- /* Update the input field with the selected date. */
- _selectDate: function(id, dateStr) {
- var target = $(id);
- var inst = this._getInst(target[0]);
- dateStr = (dateStr != null ? dateStr : this._formatDate(inst));
- if (inst.input)
- inst.input.val(dateStr);
- this._updateAlternate(inst);
- var onSelect = this._get(inst, 'onSelect');
- if (onSelect)
- onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback
- else if (inst.input)
- inst.input.trigger('change'); // fire the change event
- if (inst.inline)
- this._updateDatepicker(inst);
- else {
- this._hideDatepicker();
- this._lastInput = inst.input[0];
- if (typeof(inst.input[0]) != 'object')
- inst.input.focus(); // restore focus
- this._lastInput = null;
- }
- },
-
- /* Update any alternate field to synchronise with the main field. */
- _updateAlternate: function(inst) {
- var altField = this._get(inst, 'altField');
- if (altField) { // update alternate field too
- var altFormat = this._get(inst, 'altFormat') || this._get(inst, 'dateFormat');
- var date = this._getDate(inst);
- var dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
- $(altField).each(function() { $(this).val(dateStr); });
- }
- },
-
- /* Set as beforeShowDay function to prevent selection of weekends.
- @param date Date - the date to customise
- @return [boolean, string] - is this date selectable?, what is its CSS class? */
- noWeekends: function(date) {
- var day = date.getDay();
- return [(day > 0 && day < 6), ''];
- },
-
- /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition.
- @param date Date - the date to get the week for
- @return number - the number of the week within the year that contains this date */
- iso8601Week: function(date) {
- var checkDate = new Date(date.getTime());
- // Find Thursday of this week starting on Monday
- checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
- var time = checkDate.getTime();
- checkDate.setMonth(0); // Compare with Jan 1
- checkDate.setDate(1);
- return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
- },
-
- /* Parse a string value into a date object.
- See formatDate below for the possible formats.
-
- @param format string - the expected format of the date
- @param value string - the date in the above format
- @param settings Object - attributes include:
- shortYearCutoff number - the cutoff year for determining the century (optional)
- dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
- dayNames string[7] - names of the days from Sunday (optional)
- monthNamesShort string[12] - abbreviated names of the months (optional)
- monthNames string[12] - names of the months (optional)
- @return Date - the extracted date value or null if value is blank */
- parseDate: function (format, value, settings) {
- if (format == null || value == null)
- throw 'Invalid arguments';
- value = (typeof value == 'object' ? value.toString() : value + '');
- if (value == '')
- return null;
- var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff;
- shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
- var year = -1;
- var month = -1;
- var day = -1;
- var doy = -1;
- var literal = false;
- // Check whether a format character is doubled
- var lookAhead = function(match) {
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
- if (matches)
- iFormat++;
- return matches;
- };
- // Extract a number from the string value
- var getNumber = function(match) {
- var isDoubled = lookAhead(match);
- var size = (match == '@' ? 14 : (match == '!' ? 20 :
- (match == 'y' && isDoubled ? 4 : (match == 'o' ? 3 : 2))));
- var digits = new RegExp('^\\d{1,' + size + '}');
- var num = value.substring(iValue).match(digits);
- if (!num)
- throw 'Missing number at position ' + iValue;
- iValue += num[0].length;
- return parseInt(num[0], 10);
- };
- // Extract a name from the string value and convert to an index
- var getName = function(match, shortNames, longNames) {
- var names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) {
- return [ [k, v] ];
- }).sort(function (a, b) {
- return -(a[1].length - b[1].length);
- });
- var index = -1;
- $.each(names, function (i, pair) {
- var name = pair[1];
- if (value.substr(iValue, name.length).toLowerCase() == name.toLowerCase()) {
- index = pair[0];
- iValue += name.length;
- return false;
- }
- });
- if (index != -1)
- return index + 1;
- else
- throw 'Unknown name at position ' + iValue;
- };
- // Confirm that a literal character matches the string value
- var checkLiteral = function() {
- if (value.charAt(iValue) != format.charAt(iFormat))
- throw 'Unexpected literal at position ' + iValue;
- iValue++;
- };
- var iValue = 0;
- for (var iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- checkLiteral();
- else
- switch (format.charAt(iFormat)) {
- case 'd':
- day = getNumber('d');
- break;
- case 'D':
- getName('D', dayNamesShort, dayNames);
- break;
- case 'o':
- doy = getNumber('o');
- break;
- case 'm':
- month = getNumber('m');
- break;
- case 'M':
- month = getName('M', monthNamesShort, monthNames);
- break;
- case 'y':
- year = getNumber('y');
- break;
- case '@':
- var date = new Date(getNumber('@'));
- year = date.getFullYear();
- month = date.getMonth() + 1;
- day = date.getDate();
- break;
- case '!':
- var date = new Date((getNumber('!') - this._ticksTo1970) / 10000);
- year = date.getFullYear();
- month = date.getMonth() + 1;
- day = date.getDate();
- break;
- case "'":
- if (lookAhead("'"))
- checkLiteral();
- else
- literal = true;
- break;
- default:
- checkLiteral();
- }
- }
- if (iValue < value.length){
- throw "Extra/unparsed characters found in date: " + value.substring(iValue);
- }
- if (year == -1)
- year = new Date().getFullYear();
- else if (year < 100)
- year += new Date().getFullYear() - new Date().getFullYear() % 100 +
- (year <= shortYearCutoff ? 0 : -100);
- if (doy > -1) {
- month = 1;
- day = doy;
- do {
- var dim = this._getDaysInMonth(year, month - 1);
- if (day <= dim)
- break;
- month++;
- day -= dim;
- } while (true);
- }
- var date = this._daylightSavingAdjust(new Date(year, month - 1, day));
- if (date.getFullYear() != year || date.getMonth() + 1 != month || date.getDate() != day)
- throw 'Invalid date'; // E.g. 31/02/00
- return date;
- },
-
- /* Standard date formats. */
- ATOM: 'yy-mm-dd', // RFC 3339 (ISO 8601)
- COOKIE: 'D, dd M yy',
- ISO_8601: 'yy-mm-dd',
- RFC_822: 'D, d M y',
- RFC_850: 'DD, dd-M-y',
- RFC_1036: 'D, d M y',
- RFC_1123: 'D, d M yy',
- RFC_2822: 'D, d M yy',
- RSS: 'D, d M y', // RFC 822
- TICKS: '!',
- TIMESTAMP: '@',
- W3C: 'yy-mm-dd', // ISO 8601
-
- _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) +
- Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000),
-
- /* Format a date object into a string value.
- The format can be combinations of the following:
- d - day of month (no leading zero)
- dd - day of month (two digit)
- o - day of year (no leading zeros)
- oo - day of year (three digit)
- D - day name short
- DD - day name long
- m - month of year (no leading zero)
- mm - month of year (two digit)
- M - month name short
- MM - month name long
- y - year (two digit)
- yy - year (four digit)
- @ - Unix timestamp (ms since 01/01/1970)
- ! - Windows ticks (100ns since 01/01/0001)
- '...' - literal text
- '' - single quote
-
- @param format string - the desired format of the date
- @param date Date - the date value to format
- @param settings Object - attributes include:
- dayNamesShort string[7] - abbreviated names of the days from Sunday (optional)
- dayNames string[7] - names of the days from Sunday (optional)
- monthNamesShort string[12] - abbreviated names of the months (optional)
- monthNames string[12] - names of the months (optional)
- @return string - the date in the above format */
- formatDate: function (format, date, settings) {
- if (!date)
- return '';
- var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort;
- var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames;
- var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort;
- var monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames;
- // Check whether a format character is doubled
- var lookAhead = function(match) {
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
- if (matches)
- iFormat++;
- return matches;
- };
- // Format a number, with leading zero if necessary
- var formatNumber = function(match, value, len) {
- var num = '' + value;
- if (lookAhead(match))
- while (num.length < len)
- num = '0' + num;
- return num;
- };
- // Format a name, short or long as requested
- var formatName = function(match, value, shortNames, longNames) {
- return (lookAhead(match) ? longNames[value] : shortNames[value]);
- };
- var output = '';
- var literal = false;
- if (date)
- for (var iFormat = 0; iFormat < format.length; iFormat++) {
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- output += format.charAt(iFormat);
- else
- switch (format.charAt(iFormat)) {
- case 'd':
- output += formatNumber('d', date.getDate(), 2);
- break;
- case 'D':
- output += formatName('D', date.getDay(), dayNamesShort, dayNames);
- break;
- case 'o':
- output += formatNumber('o',
- Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
- break;
- case 'm':
- output += formatNumber('m', date.getMonth() + 1, 2);
- break;
- case 'M':
- output += formatName('M', date.getMonth(), monthNamesShort, monthNames);
- break;
- case 'y':
- output += (lookAhead('y') ? date.getFullYear() :
- (date.getYear() % 100 < 10 ? '0' : '') + date.getYear() % 100);
- break;
- case '@':
- output += date.getTime();
- break;
- case '!':
- output += date.getTime() * 10000 + this._ticksTo1970;
- break;
- case "'":
- if (lookAhead("'"))
- output += "'";
- else
- literal = true;
- break;
- default:
- output += format.charAt(iFormat);
- }
- }
- return output;
- },
-
- /* Extract all possible characters from the date format. */
- _possibleChars: function (format) {
- var chars = '';
- var literal = false;
- // Check whether a format character is doubled
- var lookAhead = function(match) {
- var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
- if (matches)
- iFormat++;
- return matches;
- };
- for (var iFormat = 0; iFormat < format.length; iFormat++)
- if (literal)
- if (format.charAt(iFormat) == "'" && !lookAhead("'"))
- literal = false;
- else
- chars += format.charAt(iFormat);
- else
- switch (format.charAt(iFormat)) {
- case 'd': case 'm': case 'y': case '@':
- chars += '0123456789';
- break;
- case 'D': case 'M':
- return null; // Accept anything
- case "'":
- if (lookAhead("'"))
- chars += "'";
- else
- literal = true;
- break;
- default:
- chars += format.charAt(iFormat);
- }
- return chars;
- },
-
- /* Get a setting value, defaulting if necessary. */
- _get: function(inst, name) {
- return inst.settings[name] !== undefined ?
- inst.settings[name] : this._defaults[name];
- },
-
- /* Parse existing date and initialise date picker. */
- _setDateFromField: function(inst, noDefault) {
- if (inst.input.val() == inst.lastVal) {
- return;
- }
- var dateFormat = this._get(inst, 'dateFormat');
- var dates = inst.lastVal = inst.input ? inst.input.val() : null;
- var date, defaultDate;
- date = defaultDate = this._getDefaultDate(inst);
- var settings = this._getFormatConfig(inst);
- try {
- date = this.parseDate(dateFormat, dates, settings) || defaultDate;
- } catch (event) {
- this.log(event);
- dates = (noDefault ? '' : dates);
- }
- inst.selectedDay = date.getDate();
- inst.drawMonth = inst.selectedMonth = date.getMonth();
- inst.drawYear = inst.selectedYear = date.getFullYear();
- inst.currentDay = (dates ? date.getDate() : 0);
- inst.currentMonth = (dates ? date.getMonth() : 0);
- inst.currentYear = (dates ? date.getFullYear() : 0);
- this._adjustInstDate(inst);
- },
-
- /* Retrieve the default date shown on opening. */
- _getDefaultDate: function(inst) {
- return this._restrictMinMax(inst,
- this._determineDate(inst, this._get(inst, 'defaultDate'), new Date()));
- },
-
- /* A date may be specified as an exact value or a relative one. */
- _determineDate: function(inst, date, defaultDate) {
- var offsetNumeric = function(offset) {
- var date = new Date();
- date.setDate(date.getDate() + offset);
- return date;
- };
- var offsetString = function(offset) {
- try {
- return $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
- offset, $.datepicker._getFormatConfig(inst));
- }
- catch (e) {
- // Ignore
- }
- var date = (offset.toLowerCase().match(/^c/) ?
- $.datepicker._getDate(inst) : null) || new Date();
- var year = date.getFullYear();
- var month = date.getMonth();
- var day = date.getDate();
- var pattern = /([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;
- var matches = pattern.exec(offset);
- while (matches) {
- switch (matches[2] || 'd') {
- case 'd' : case 'D' :
- day += parseInt(matches[1],10); break;
- case 'w' : case 'W' :
- day += parseInt(matches[1],10) * 7; break;
- case 'm' : case 'M' :
- month += parseInt(matches[1],10);
- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
- break;
- case 'y': case 'Y' :
- year += parseInt(matches[1],10);
- day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
- break;
- }
- matches = pattern.exec(offset);
- }
- return new Date(year, month, day);
- };
- var newDate = (date == null || date === '' ? defaultDate : (typeof date == 'string' ? offsetString(date) :
- (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime()))));
- newDate = (newDate && newDate.toString() == 'Invalid Date' ? defaultDate : newDate);
- if (newDate) {
- newDate.setHours(0);
- newDate.setMinutes(0);
- newDate.setSeconds(0);
- newDate.setMilliseconds(0);
- }
- return this._daylightSavingAdjust(newDate);
- },
-
- /* Handle switch to/from daylight saving.
- Hours may be non-zero on daylight saving cut-over:
- > 12 when midnight changeover, but then cannot generate
- midnight datetime, so jump to 1AM, otherwise reset.
- @param date (Date) the date to check
- @return (Date) the corrected date */
- _daylightSavingAdjust: function(date) {
- if (!date) return null;
- date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
- return date;
- },
-
- /* Set the date(s) directly. */
- _setDate: function(inst, date, noChange) {
- var clear = !date;
- var origMonth = inst.selectedMonth;
- var origYear = inst.selectedYear;
- var newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date()));
- inst.selectedDay = inst.currentDay = newDate.getDate();
- inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
- inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
- if ((origMonth != inst.selectedMonth || origYear != inst.selectedYear) && !noChange)
- this._notifyChange(inst);
- this._adjustInstDate(inst);
- if (inst.input) {
- inst.input.val(clear ? '' : this._formatDate(inst));
- }
- },
-
- /* Retrieve the date(s) directly. */
- _getDate: function(inst) {
- var startDate = (!inst.currentYear || (inst.input && inst.input.val() == '') ? null :
- this._daylightSavingAdjust(new Date(
- inst.currentYear, inst.currentMonth, inst.currentDay)));
- return startDate;
- },
-
- /* Generate the HTML for the current state of the date picker. */
- _generateHTML: function(inst) {
- var today = new Date();
- today = this._daylightSavingAdjust(
- new Date(today.getFullYear(), today.getMonth(), today.getDate())); // clear time
- var isRTL = this._get(inst, 'isRTL');
- var showButtonPanel = this._get(inst, 'showButtonPanel');
- var hideIfNoPrevNext = this._get(inst, 'hideIfNoPrevNext');
- var navigationAsDateFormat = this._get(inst, 'navigationAsDateFormat');
- var numMonths = this._getNumberOfMonths(inst);
- var showCurrentAtPos = this._get(inst, 'showCurrentAtPos');
- var stepMonths = this._get(inst, 'stepMonths');
- var isMultiMonth = (numMonths[0] != 1 || numMonths[1] != 1);
- var currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) :
- new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
- var minDate = this._getMinMaxDate(inst, 'min');
- var maxDate = this._getMinMaxDate(inst, 'max');
- var drawMonth = inst.drawMonth - showCurrentAtPos;
- var drawYear = inst.drawYear;
- if (drawMonth < 0) {
- drawMonth += 12;
- drawYear--;
- }
- if (maxDate) {
- var maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(),
- maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate()));
- maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw);
- while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
- drawMonth--;
- if (drawMonth < 0) {
- drawMonth = 11;
- drawYear--;
- }
- }
- }
- inst.drawMonth = drawMonth;
- inst.drawYear = drawYear;
- var prevText = this._get(inst, 'prevText');
- prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText,
- this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)),
- this._getFormatConfig(inst)));
- var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
- '<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_' + dpuuid +
- '.datepicker._adjustDate(\'#' + inst.id + '\', -' + stepMonths + ', \'M\');"' +
- ' title="' + prevText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>' :
- (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+ prevText +'"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'e' : 'w') + '">' + prevText + '</span></a>'));
- var nextText = this._get(inst, 'nextText');
- nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText,
- this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)),
- this._getFormatConfig(inst)));
- var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
- '<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_' + dpuuid +
- '.datepicker._adjustDate(\'#' + inst.id + '\', +' + stepMonths + ', \'M\');"' +
- ' title="' + nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>' :
- (hideIfNoPrevNext ? '' : '<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+ nextText + '"><span class="ui-icon ui-icon-circle-triangle-' + ( isRTL ? 'w' : 'e') + '">' + nextText + '</span></a>'));
- var currentText = this._get(inst, 'currentText');
- var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today);
- currentText = (!navigationAsDateFormat ? currentText :
- this.formatDate(currentText, gotoDate, this._getFormatConfig(inst)));
- var controls = (!inst.inline ? '<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
- '.datepicker._hideDatepicker();">' + this._get(inst, 'closeText') + '</button>' : '');
- var buttonPanel = (showButtonPanel) ? '<div class="ui-datepicker-buttonpane ui-widget-content">' + (isRTL ? controls : '') +
- (this._isInRange(inst, gotoDate) ? '<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_' + dpuuid +
- '.datepicker._gotoToday(\'#' + inst.id + '\');"' +
- '>' + currentText + '</button>' : '') + (isRTL ? '' : controls) + '</div>' : '';
- var firstDay = parseInt(this._get(inst, 'firstDay'),10);
- firstDay = (isNaN(firstDay) ? 0 : firstDay);
- var showWeek = this._get(inst, 'showWeek');
- var dayNames = this._get(inst, 'dayNames');
- var dayNamesShort = this._get(inst, 'dayNamesShort');
- var dayNamesMin = this._get(inst, 'dayNamesMin');
- var monthNames = this._get(inst, 'monthNames');
- var monthNamesShort = this._get(inst, 'monthNamesShort');
- var beforeShowDay = this._get(inst, 'beforeShowDay');
- var showOtherMonths = this._get(inst, 'showOtherMonths');
- var selectOtherMonths = this._get(inst, 'selectOtherMonths');
- var calculateWeek = this._get(inst, 'calculateWeek') || this.iso8601Week;
- var defaultDate = this._getDefaultDate(inst);
- var html = '';
- for (var row = 0; row < numMonths[0]; row++) {
- var group = '';
- this.maxRows = 4;
- for (var col = 0; col < numMonths[1]; col++) {
- var selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
- var cornerClass = ' ui-corner-all';
- var calender = '';
- if (isMultiMonth) {
- calender += '<div class="ui-datepicker-group';
- if (numMonths[1] > 1)
- switch (col) {
- case 0: calender += ' ui-datepicker-group-first';
- cornerClass = ' ui-corner-' + (isRTL ? 'right' : 'left'); break;
- case numMonths[1]-1: calender += ' ui-datepicker-group-last';
- cornerClass = ' ui-corner-' + (isRTL ? 'left' : 'right'); break;
- default: calender += ' ui-datepicker-group-middle'; cornerClass = ''; break;
- }
- calender += '">';
- }
- calender += '<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix' + cornerClass + '">' +
- (/all|left/.test(cornerClass) && row == 0 ? (isRTL ? next : prev) : '') +
- (/all|right/.test(cornerClass) && row == 0 ? (isRTL ? prev : next) : '') +
- this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate,
- row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers
- '</div><table class="ui-datepicker-calendar"><thead>' +
- '<tr>';
- var thead = (showWeek ? '<th class="ui-datepicker-week-col">' + this._get(inst, 'weekHeader') + '</th>' : '');
- for (var dow = 0; dow < 7; dow++) { // days of the week
- var day = (dow + firstDay) % 7;
- thead += '<th' + ((dow + firstDay + 6) % 7 >= 5 ? ' class="ui-datepicker-week-end"' : '') + '>' +
- '<span title="' + dayNames[day] + '">' + dayNamesMin[day] + '</span></th>';
- }
- calender += thead + '</tr></thead><tbody>';
- var daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
- if (drawYear == inst.selectedYear && drawMonth == inst.selectedMonth)
- inst.selectedDay = Math.min(inst.selectedDay, daysInMonth);
- var leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
- var curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate
- var numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043)
- this.maxRows = numRows;
- var printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
- for (var dRow = 0; dRow < numRows; dRow++) { // create date picker rows
- calender += '<tr>';
- var tbody = (!showWeek ? '' : '<td class="ui-datepicker-week-col">' +
- this._get(inst, 'calculateWeek')(printDate) + '</td>');
- for (var dow = 0; dow < 7; dow++) { // create date picker days
- var daySettings = (beforeShowDay ?
- beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, '']);
- var otherMonth = (printDate.getMonth() != drawMonth);
- var unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] ||
- (minDate && printDate < minDate) || (maxDate && printDate > maxDate);
- tbody += '<td class="' +
- ((dow + firstDay + 6) % 7 >= 5 ? ' ui-datepicker-week-end' : '') + // highlight weekends
- (otherMonth ? ' ui-datepicker-other-month' : '') + // highlight days from other months
- ((printDate.getTime() == selectedDate.getTime() && drawMonth == inst.selectedMonth && inst._keyEvent) || // user pressed key
- (defaultDate.getTime() == printDate.getTime() && defaultDate.getTime() == selectedDate.getTime()) ?
- // or defaultDate is current printedDate and defaultDate is selectedDate
- ' ' + this._dayOverClass : '') + // highlight selected day
- (unselectable ? ' ' + this._unselectableClass + ' ui-state-disabled': '') + // highlight unselectable days
- (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates
- (printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day
- (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
- ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
- (unselectable ? '' : ' onclick="DP_jQuery_' + dpuuid + '.datepicker._selectDay(\'#' +
- inst.id + '\',' + printDate.getMonth() + ',' + printDate.getFullYear() + ', this);return false;"') + '>' + // actions
- (otherMonth && !showOtherMonths ? '&#xa0;' : // display for other months
- (unselectable ? '<span class="ui-state-default">' + printDate.getDate() + '</span>' : '<a class="ui-state-default' +
- (printDate.getTime() == today.getTime() ? ' ui-state-highlight' : '') +
- (printDate.getTime() == currentDate.getTime() ? ' ui-state-active' : '') + // highlight selected day
- (otherMonth ? ' ui-priority-secondary' : '') + // distinguish dates from other months
- '" href="#">' + printDate.getDate() + '</a>')) + '</td>'; // display selectable date
- printDate.setDate(printDate.getDate() + 1);
- printDate = this._daylightSavingAdjust(printDate);
- }
- calender += tbody + '</tr>';
- }
- drawMonth++;
- if (drawMonth > 11) {
- drawMonth = 0;
- drawYear++;
- }
- calender += '</tbody></table>' + (isMultiMonth ? '</div>' +
- ((numMonths[0] > 0 && col == numMonths[1]-1) ? '<div class="ui-datepicker-row-break"></div>' : '') : '');
- group += calender;
- }
- html += group;
- }
- html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ?
- '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : '');
- inst._keyEvent = false;
- return html;
- },
-
- /* Generate the month and year header. */
- _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
- secondary, monthNames, monthNamesShort) {
- var changeMonth = this._get(inst, 'changeMonth');
- var changeYear = this._get(inst, 'changeYear');
- var showMonthAfterYear = this._get(inst, 'showMonthAfterYear');
- var html = '<div class="ui-datepicker-title">';
- var monthHtml = '';
- // month selection
- if (secondary || !changeMonth)
- monthHtml += '<span class="ui-datepicker-month">' + monthNames[drawMonth] + '</span>';
- else {
- var inMinYear = (minDate && minDate.getFullYear() == drawYear);
- var inMaxYear = (maxDate && maxDate.getFullYear() == drawYear);
- monthHtml += '<select class="ui-datepicker-month" ' +
- 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'M\');" ' +
- '>';
- for (var month = 0; month < 12; month++) {
- if ((!inMinYear || month >= minDate.getMonth()) &&
- (!inMaxYear || month <= maxDate.getMonth()))
- monthHtml += '<option value="' + month + '"' +
- (month == drawMonth ? ' selected="selected"' : '') +
- '>' + monthNamesShort[month] + '</option>';
- }
- monthHtml += '</select>';
- }
- if (!showMonthAfterYear)
- html += monthHtml + (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '');
- // year selection
- if ( !inst.yearshtml ) {
- inst.yearshtml = '';
- if (secondary || !changeYear)
- html += '<span class="ui-datepicker-year">' + drawYear + '</span>';
- else {
- // determine range of years to display
- var years = this._get(inst, 'yearRange').split(':');
- var thisYear = new Date().getFullYear();
- var determineYear = function(value) {
- var year = (value.match(/c[+-].*/) ? drawYear + parseInt(value.substring(1), 10) :
- (value.match(/[+-].*/) ? thisYear + parseInt(value, 10) :
- parseInt(value, 10)));
- return (isNaN(year) ? thisYear : year);
- };
- var year = determineYear(years[0]);
- var endYear = Math.max(year, determineYear(years[1] || ''));
- year = (minDate ? Math.max(year, minDate.getFullYear()) : year);
- endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear);
- inst.yearshtml += '<select class="ui-datepicker-year" ' +
- 'onchange="DP_jQuery_' + dpuuid + '.datepicker._selectMonthYear(\'#' + inst.id + '\', this, \'Y\');" ' +
- '>';
- for (; year <= endYear; year++) {
- inst.yearshtml += '<option value="' + year + '"' +
- (year == drawYear ? ' selected="selected"' : '') +
- '>' + year + '</option>';
- }
- inst.yearshtml += '</select>';
-
- html += inst.yearshtml;
- inst.yearshtml = null;
- }
- }
- html += this._get(inst, 'yearSuffix');
- if (showMonthAfterYear)
- html += (secondary || !(changeMonth && changeYear) ? '&#xa0;' : '') + monthHtml;
- html += '</div>'; // Close datepicker_header
- return html;
- },
-
- /* Adjust one of the date sub-fields. */
- _adjustInstDate: function(inst, offset, period) {
- var year = inst.drawYear + (period == 'Y' ? offset : 0);
- var month = inst.drawMonth + (period == 'M' ? offset : 0);
- var day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) +
- (period == 'D' ? offset : 0);
- var date = this._restrictMinMax(inst,
- this._daylightSavingAdjust(new Date(year, month, day)));
- inst.selectedDay = date.getDate();
- inst.drawMonth = inst.selectedMonth = date.getMonth();
- inst.drawYear = inst.selectedYear = date.getFullYear();
- if (period == 'M' || period == 'Y')
- this._notifyChange(inst);
- },
-
- /* Ensure a date is within any min/max bounds. */
- _restrictMinMax: function(inst, date) {
- var minDate = this._getMinMaxDate(inst, 'min');
- var maxDate = this._getMinMaxDate(inst, 'max');
- var newDate = (minDate && date < minDate ? minDate : date);
- newDate = (maxDate && newDate > maxDate ? maxDate : newDate);
- return newDate;
- },
-
- /* Notify change of month/year. */
- _notifyChange: function(inst) {
- var onChange = this._get(inst, 'onChangeMonthYear');
- if (onChange)
- onChange.apply((inst.input ? inst.input[0] : null),
- [inst.selectedYear, inst.selectedMonth + 1, inst]);
- },
-
- /* Determine the number of months to show. */
- _getNumberOfMonths: function(inst) {
- var numMonths = this._get(inst, 'numberOfMonths');
- return (numMonths == null ? [1, 1] : (typeof numMonths == 'number' ? [1, numMonths] : numMonths));
- },
-
- /* Determine the current maximum date - ensure no time components are set. */
- _getMinMaxDate: function(inst, minMax) {
- return this._determineDate(inst, this._get(inst, minMax + 'Date'), null);
- },
-
- /* Find the number of days in a given month. */
- _getDaysInMonth: function(year, month) {
- return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate();
- },
-
- /* Find the day of the week of the first of a month. */
- _getFirstDayOfMonth: function(year, month) {
- return new Date(year, month, 1).getDay();
- },
-
- /* Determines if we should allow a "next/prev" month display change. */
- _canAdjustMonth: function(inst, offset, curYear, curMonth) {
- var numMonths = this._getNumberOfMonths(inst);
- var date = this._daylightSavingAdjust(new Date(curYear,
- curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
- if (offset < 0)
- date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()));
- return this._isInRange(inst, date);
- },
-
- /* Is the given date in the accepted range? */
- _isInRange: function(inst, date) {
- var minDate = this._getMinMaxDate(inst, 'min');
- var maxDate = this._getMinMaxDate(inst, 'max');
- return ((!minDate || date.getTime() >= minDate.getTime()) &&
- (!maxDate || date.getTime() <= maxDate.getTime()));
- },
-
- /* Provide the configuration settings for formatting/parsing. */
- _getFormatConfig: function(inst) {
- var shortYearCutoff = this._get(inst, 'shortYearCutoff');
- shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff :
- new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10));
- return {shortYearCutoff: shortYearCutoff,
- dayNamesShort: this._get(inst, 'dayNamesShort'), dayNames: this._get(inst, 'dayNames'),
- monthNamesShort: this._get(inst, 'monthNamesShort'), monthNames: this._get(inst, 'monthNames')};
- },
-
- /* Format the given date for display. */
- _formatDate: function(inst, day, month, year) {
- if (!day) {
- inst.currentDay = inst.selectedDay;
- inst.currentMonth = inst.selectedMonth;
- inst.currentYear = inst.selectedYear;
- }
- var date = (day ? (typeof day == 'object' ? day :
- this._daylightSavingAdjust(new Date(year, month, day))) :
- this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay)));
- return this.formatDate(this._get(inst, 'dateFormat'), date, this._getFormatConfig(inst));
- }
-});
-
-/*
- * Bind hover events for datepicker elements.
- * Done via delegate so the binding only occurs once in the lifetime of the parent div.
- * Global instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker.
- */
-function bindHover(dpDiv) {
- var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a';
- return dpDiv.bind('mouseout', function(event) {
- var elem = $( event.target ).closest( selector );
- if ( !elem.length ) {
- return;
- }
- elem.removeClass( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" );
- })
- .bind('mouseover', function(event) {
- var elem = $( event.target ).closest( selector );
- if ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) ||
- !elem.length ) {
- return;
- }
- elem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover');
- elem.addClass('ui-state-hover');
- if (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover');
- if (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover');
- });
-}
-
-/* jQuery extend now ignores nulls! */
-function extendRemove(target, props) {
- $.extend(target, props);
- for (var name in props)
- if (props[name] == null || props[name] == undefined)
- target[name] = props[name];
- return target;
-};
-
-/* Determine whether an object is an array. */
-function isArray(a) {
- return (a && (($.browser.safari && typeof a == 'object' && a.length) ||
- (a.constructor && a.constructor.toString().match(/\Array\(\)/))));
-};
-
-/* Invoke the datepicker functionality.
- @param options string - a command, optionally followed by additional parameters or
- Object - settings for attaching new datepicker functionality
- @return jQuery object */
-$.fn.datepicker = function(options){
-
- /* Verify an empty collection wasn't passed - Fixes #6976 */
- if ( !this.length ) {
- return this;
- }
-
- /* Initialise the date picker. */
- if (!$.datepicker.initialized) {
- $(document).mousedown($.datepicker._checkExternalClick).
- find('body').append($.datepicker.dpDiv);
- $.datepicker.initialized = true;
- }
-
- var otherArgs = Array.prototype.slice.call(arguments, 1);
- if (typeof options == 'string' && (options == 'isDisabled' || options == 'getDate' || options == 'widget'))
- return $.datepicker['_' + options + 'Datepicker'].
- apply($.datepicker, [this[0]].concat(otherArgs));
- if (options == 'option' && arguments.length == 2 && typeof arguments[1] == 'string')
- return $.datepicker['_' + options + 'Datepicker'].
- apply($.datepicker, [this[0]].concat(otherArgs));
- return this.each(function() {
- typeof options == 'string' ?
- $.datepicker['_' + options + 'Datepicker'].
- apply($.datepicker, [this].concat(otherArgs)) :
- $.datepicker._attachDatepicker(this, options);
- });
-};
-
-$.datepicker = new Datepicker(); // singleton instance
-$.datepicker.initialized = false;
-$.datepicker.uuid = new Date().getTime();
-$.datepicker.version = "1.8.18";
-
-// Workaround for #4055
-// Add another global to avoid noConflict issues with inline event handlers
-window['DP_jQuery_' + dpuuid] = $;
-
-})(jQuery);
-/*
- * jQuery UI Dialog 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Dialog
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- * jquery.ui.button.js
- * jquery.ui.draggable.js
- * jquery.ui.mouse.js
- * jquery.ui.position.js
- * jquery.ui.resizable.js
- */
-(function( $, undefined ) {
-
-var uiDialogClasses =
- 'ui-dialog ' +
- 'ui-widget ' +
- 'ui-widget-content ' +
- 'ui-corner-all ',
- sizeRelatedOptions = {
- buttons: true,
- height: true,
- maxHeight: true,
- maxWidth: true,
- minHeight: true,
- minWidth: true,
- width: true
- },
- resizableRelatedOptions = {
- maxHeight: true,
- maxWidth: true,
- minHeight: true,
- minWidth: true
- },
- // support for jQuery 1.3.2 - handle common attrFn methods for dialog
- attrFn = $.attrFn || {
- val: true,
- css: true,
- html: true,
- text: true,
- data: true,
- width: true,
- height: true,
- offset: true,
- click: true
- };
-
-$.widget("ui.dialog", {
- options: {
- autoOpen: true,
- buttons: {},
- closeOnEscape: true,
- closeText: 'close',
- dialogClass: '',
- draggable: true,
- hide: null,
- height: 'auto',
- maxHeight: false,
- maxWidth: false,
- minHeight: 150,
- minWidth: 150,
- modal: false,
- position: {
- my: 'center',
- at: 'center',
- collision: 'fit',
- // ensure that the titlebar is never outside the document
- using: function(pos) {
- var topOffset = $(this).css(pos).offset().top;
- if (topOffset < 0) {
- $(this).css('top', pos.top - topOffset);
- }
- }
- },
- resizable: true,
- show: null,
- stack: true,
- title: '',
- width: 300,
- zIndex: 1000
- },
-
- _create: function() {
- this.originalTitle = this.element.attr('title');
- // #5742 - .attr() might return a DOMElement
- if ( typeof this.originalTitle !== "string" ) {
- this.originalTitle = "";
- }
-
- this.options.title = this.options.title || this.originalTitle;
- var self = this,
- options = self.options,
-
- title = options.title || '&#160;',
- titleId = $.ui.dialog.getTitleId(self.element),
-
- uiDialog = (self.uiDialog = $('<div></div>'))
- .appendTo(document.body)
- .hide()
- .addClass(uiDialogClasses + options.dialogClass)
- .css({
- zIndex: options.zIndex
- })
- // setting tabIndex makes the div focusable
- // setting outline to 0 prevents a border on focus in Mozilla
- .attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
- if (options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
- event.keyCode === $.ui.keyCode.ESCAPE) {
-
- self.close(event);
- event.preventDefault();
- }
- })
- .attr({
- role: 'dialog',
- 'aria-labelledby': titleId
- })
- .mousedown(function(event) {
- self.moveToTop(false, event);
- }),
-
- uiDialogContent = self.element
- .show()
- .removeAttr('title')
- .addClass(
- 'ui-dialog-content ' +
- 'ui-widget-content')
- .appendTo(uiDialog),
-
- uiDialogTitlebar = (self.uiDialogTitlebar = $('<div></div>'))
- .addClass(
- 'ui-dialog-titlebar ' +
- 'ui-widget-header ' +
- 'ui-corner-all ' +
- 'ui-helper-clearfix'
- )
- .prependTo(uiDialog),
-
- uiDialogTitlebarClose = $('<a href="#"></a>')
- .addClass(
- 'ui-dialog-titlebar-close ' +
- 'ui-corner-all'
- )
- .attr('role', 'button')
- .hover(
- function() {
- uiDialogTitlebarClose.addClass('ui-state-hover');
- },
- function() {
- uiDialogTitlebarClose.removeClass('ui-state-hover');
- }
- )
- .focus(function() {
- uiDialogTitlebarClose.addClass('ui-state-focus');
- })
- .blur(function() {
- uiDialogTitlebarClose.removeClass('ui-state-focus');
- })
- .click(function(event) {
- self.close(event);
- return false;
- })
- .appendTo(uiDialogTitlebar),
-
- uiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('<span></span>'))
- .addClass(
- 'ui-icon ' +
- 'ui-icon-closethick'
- )
- .text(options.closeText)
- .appendTo(uiDialogTitlebarClose),
-
- uiDialogTitle = $('<span></span>')
- .addClass('ui-dialog-title')
- .attr('id', titleId)
- .html(title)
- .prependTo(uiDialogTitlebar);
-
- //handling of deprecated beforeclose (vs beforeClose) option
- //Ticket #4669 http://dev.jqueryui.com/ticket/4669
- //TODO: remove in 1.9pre
- if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) {
- options.beforeClose = options.beforeclose;
- }
-
- uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection();
-
- if (options.draggable && $.fn.draggable) {
- self._makeDraggable();
- }
- if (options.resizable && $.fn.resizable) {
- self._makeResizable();
- }
-
- self._createButtons(options.buttons);
- self._isOpen = false;
-
- if ($.fn.bgiframe) {
- uiDialog.bgiframe();
- }
- },
-
- _init: function() {
- if ( this.options.autoOpen ) {
- this.open();
- }
- },
-
- destroy: function() {
- var self = this;
-
- if (self.overlay) {
- self.overlay.destroy();
- }
- self.uiDialog.hide();
- self.element
- .unbind('.dialog')
- .removeData('dialog')
- .removeClass('ui-dialog-content ui-widget-content')
- .hide().appendTo('body');
- self.uiDialog.remove();
-
- if (self.originalTitle) {
- self.element.attr('title', self.originalTitle);
- }
-
- return self;
- },
-
- widget: function() {
- return this.uiDialog;
- },
-
- close: function(event) {
- var self = this,
- maxZ, thisZ;
-
- if (false === self._trigger('beforeClose', event)) {
- return;
- }
-
- if (self.overlay) {
- self.overlay.destroy();
- }
- self.uiDialog.unbind('keypress.ui-dialog');
-
- self._isOpen = false;
-
- if (self.options.hide) {
- self.uiDialog.hide(self.options.hide, function() {
- self._trigger('close', event);
- });
- } else {
- self.uiDialog.hide();
- self._trigger('close', event);
- }
-
- $.ui.dialog.overlay.resize();
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- if (self.options.modal) {
- maxZ = 0;
- $('.ui-dialog').each(function() {
- if (this !== self.uiDialog[0]) {
- thisZ = $(this).css('z-index');
- if(!isNaN(thisZ)) {
- maxZ = Math.max(maxZ, thisZ);
- }
- }
- });
- $.ui.dialog.maxZ = maxZ;
- }
-
- return self;
- },
-
- isOpen: function() {
- return this._isOpen;
- },
-
- // the force parameter allows us to move modal dialogs to their correct
- // position on open
- moveToTop: function(force, event) {
- var self = this,
- options = self.options,
- saveScroll;
-
- if ((options.modal && !force) ||
- (!options.stack && !options.modal)) {
- return self._trigger('focus', event);
- }
-
- if (options.zIndex > $.ui.dialog.maxZ) {
- $.ui.dialog.maxZ = options.zIndex;
- }
- if (self.overlay) {
- $.ui.dialog.maxZ += 1;
- self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ);
- }
-
- //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
- // http://ui.jquery.com/bugs/ticket/3193
- saveScroll = { scrollTop: self.element.scrollTop(), scrollLeft: self.element.scrollLeft() };
- $.ui.dialog.maxZ += 1;
- self.uiDialog.css('z-index', $.ui.dialog.maxZ);
- self.element.attr(saveScroll);
- self._trigger('focus', event);
-
- return self;
- },
-
- open: function() {
- if (this._isOpen) { return; }
-
- var self = this,
- options = self.options,
- uiDialog = self.uiDialog;
-
- self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null;
- self._size();
- self._position(options.position);
- uiDialog.show(options.show);
- self.moveToTop(true);
-
- // prevent tabbing out of modal dialogs
- if ( options.modal ) {
- uiDialog.bind( "keydown.ui-dialog", function( event ) {
- if ( event.keyCode !== $.ui.keyCode.TAB ) {
- return;
- }
-
- var tabbables = $(':tabbable', this),
- first = tabbables.filter(':first'),
- last = tabbables.filter(':last');
-
- if (event.target === last[0] && !event.shiftKey) {
- first.focus(1);
- return false;
- } else if (event.target === first[0] && event.shiftKey) {
- last.focus(1);
- return false;
- }
- });
- }
-
- // set focus to the first tabbable element in the content area or the first button
- // if there are no tabbable elements, set focus on the dialog itself
- $(self.element.find(':tabbable').get().concat(
- uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat(
- uiDialog.get()))).eq(0).focus();
-
- self._isOpen = true;
- self._trigger('open');
-
- return self;
- },
-
- _createButtons: function(buttons) {
- var self = this,
- hasButtons = false,
- uiDialogButtonPane = $('<div></div>')
- .addClass(
- 'ui-dialog-buttonpane ' +
- 'ui-widget-content ' +
- 'ui-helper-clearfix'
- ),
- uiButtonSet = $( "<div></div>" )
- .addClass( "ui-dialog-buttonset" )
- .appendTo( uiDialogButtonPane );
-
- // if we already have a button pane, remove it
- self.uiDialog.find('.ui-dialog-buttonpane').remove();
-
- if (typeof buttons === 'object' && buttons !== null) {
- $.each(buttons, function() {
- return !(hasButtons = true);
- });
- }
- if (hasButtons) {
- $.each(buttons, function(name, props) {
- props = $.isFunction( props ) ?
- { click: props, text: name } :
- props;
- var button = $('<button type="button"></button>')
- .click(function() {
- props.click.apply(self.element[0], arguments);
- })
- .appendTo(uiButtonSet);
- // can't use .attr( props, true ) with jQuery 1.3.2.
- $.each( props, function( key, value ) {
- if ( key === "click" ) {
- return;
- }
- if ( key in attrFn ) {
- button[ key ]( value );
- } else {
- button.attr( key, value );
- }
- });
- if ($.fn.button) {
- button.button();
- }
- });
- uiDialogButtonPane.appendTo(self.uiDialog);
- }
- },
-
- _makeDraggable: function() {
- var self = this,
- options = self.options,
- doc = $(document),
- heightBeforeDrag;
-
- function filteredUi(ui) {
- return {
- position: ui.position,
- offset: ui.offset
- };
- }
-
- self.uiDialog.draggable({
- cancel: '.ui-dialog-content, .ui-dialog-titlebar-close',
- handle: '.ui-dialog-titlebar',
- containment: 'document',
- start: function(event, ui) {
- heightBeforeDrag = options.height === "auto" ? "auto" : $(this).height();
- $(this).height($(this).height()).addClass("ui-dialog-dragging");
- self._trigger('dragStart', event, filteredUi(ui));
- },
- drag: function(event, ui) {
- self._trigger('drag', event, filteredUi(ui));
- },
- stop: function(event, ui) {
- options.position = [ui.position.left - doc.scrollLeft(),
- ui.position.top - doc.scrollTop()];
- $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag);
- self._trigger('dragStop', event, filteredUi(ui));
- $.ui.dialog.overlay.resize();
- }
- });
- },
-
- _makeResizable: function(handles) {
- handles = (handles === undefined ? this.options.resizable : handles);
- var self = this,
- options = self.options,
- // .ui-resizable has position: relative defined in the stylesheet
- // but dialogs have to use absolute or fixed positioning
- position = self.uiDialog.css('position'),
- resizeHandles = (typeof handles === 'string' ?
- handles :
- 'n,e,s,w,se,sw,ne,nw'
- );
-
- function filteredUi(ui) {
- return {
- originalPosition: ui.originalPosition,
- originalSize: ui.originalSize,
- position: ui.position,
- size: ui.size
- };
- }
-
- self.uiDialog.resizable({
- cancel: '.ui-dialog-content',
- containment: 'document',
- alsoResize: self.element,
- maxWidth: options.maxWidth,
- maxHeight: options.maxHeight,
- minWidth: options.minWidth,
- minHeight: self._minHeight(),
- handles: resizeHandles,
- start: function(event, ui) {
- $(this).addClass("ui-dialog-resizing");
- self._trigger('resizeStart', event, filteredUi(ui));
- },
- resize: function(event, ui) {
- self._trigger('resize', event, filteredUi(ui));
- },
- stop: function(event, ui) {
- $(this).removeClass("ui-dialog-resizing");
- options.height = $(this).height();
- options.width = $(this).width();
- self._trigger('resizeStop', event, filteredUi(ui));
- $.ui.dialog.overlay.resize();
- }
- })
- .css('position', position)
- .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se');
- },
-
- _minHeight: function() {
- var options = this.options;
-
- if (options.height === 'auto') {
- return options.minHeight;
- } else {
- return Math.min(options.minHeight, options.height);
- }
- },
-
- _position: function(position) {
- var myAt = [],
- offset = [0, 0],
- isVisible;
-
- if (position) {
- // deep extending converts arrays to objects in jQuery <= 1.3.2 :-(
- // if (typeof position == 'string' || $.isArray(position)) {
- // myAt = $.isArray(position) ? position : position.split(' ');
-
- if (typeof position === 'string' || (typeof position === 'object' && '0' in position)) {
- myAt = position.split ? position.split(' ') : [position[0], position[1]];
- if (myAt.length === 1) {
- myAt[1] = myAt[0];
- }
-
- $.each(['left', 'top'], function(i, offsetPosition) {
- if (+myAt[i] === myAt[i]) {
- offset[i] = myAt[i];
- myAt[i] = offsetPosition;
- }
- });
-
- position = {
- my: myAt.join(" "),
- at: myAt.join(" "),
- offset: offset.join(" ")
- };
- }
-
- position = $.extend({}, $.ui.dialog.prototype.options.position, position);
- } else {
- position = $.ui.dialog.prototype.options.position;
- }
-
- // need to show the dialog to get the actual offset in the position plugin
- isVisible = this.uiDialog.is(':visible');
- if (!isVisible) {
- this.uiDialog.show();
- }
- this.uiDialog
- // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781
- .css({ top: 0, left: 0 })
- .position($.extend({ of: window }, position));
- if (!isVisible) {
- this.uiDialog.hide();
- }
- },
-
- _setOptions: function( options ) {
- var self = this,
- resizableOptions = {},
- resize = false;
-
- $.each( options, function( key, value ) {
- self._setOption( key, value );
-
- if ( key in sizeRelatedOptions ) {
- resize = true;
- }
- if ( key in resizableRelatedOptions ) {
- resizableOptions[ key ] = value;
- }
- });
-
- if ( resize ) {
- this._size();
- }
- if ( this.uiDialog.is( ":data(resizable)" ) ) {
- this.uiDialog.resizable( "option", resizableOptions );
- }
- },
-
- _setOption: function(key, value){
- var self = this,
- uiDialog = self.uiDialog;
-
- switch (key) {
- //handling of deprecated beforeclose (vs beforeClose) option
- //Ticket #4669 http://dev.jqueryui.com/ticket/4669
- //TODO: remove in 1.9pre
- case "beforeclose":
- key = "beforeClose";
- break;
- case "buttons":
- self._createButtons(value);
- break;
- case "closeText":
- // ensure that we always pass a string
- self.uiDialogTitlebarCloseText.text("" + value);
- break;
- case "dialogClass":
- uiDialog
- .removeClass(self.options.dialogClass)
- .addClass(uiDialogClasses + value);
- break;
- case "disabled":
- if (value) {
- uiDialog.addClass('ui-dialog-disabled');
- } else {
- uiDialog.removeClass('ui-dialog-disabled');
- }
- break;
- case "draggable":
- var isDraggable = uiDialog.is( ":data(draggable)" );
- if ( isDraggable && !value ) {
- uiDialog.draggable( "destroy" );
- }
-
- if ( !isDraggable && value ) {
- self._makeDraggable();
- }
- break;
- case "position":
- self._position(value);
- break;
- case "resizable":
- // currently resizable, becoming non-resizable
- var isResizable = uiDialog.is( ":data(resizable)" );
- if (isResizable && !value) {
- uiDialog.resizable('destroy');
- }
-
- // currently resizable, changing handles
- if (isResizable && typeof value === 'string') {
- uiDialog.resizable('option', 'handles', value);
- }
-
- // currently non-resizable, becoming resizable
- if (!isResizable && value !== false) {
- self._makeResizable(value);
- }
- break;
- case "title":
- // convert whatever was passed in o a string, for html() to not throw up
- $(".ui-dialog-title", self.uiDialogTitlebar).html("" + (value || '&#160;'));
- break;
- }
-
- $.Widget.prototype._setOption.apply(self, arguments);
- },
-
- _size: function() {
- /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content
- * divs will both have width and height set, so we need to reset them
- */
- var options = this.options,
- nonContentHeight,
- minContentHeight,
- isVisible = this.uiDialog.is( ":visible" );
-
- // reset content sizing
- this.element.show().css({
- width: 'auto',
- minHeight: 0,
- height: 0
- });
-
- if (options.minWidth > options.width) {
- options.width = options.minWidth;
- }
-
- // reset wrapper sizing
- // determine the height of all the non-content elements
- nonContentHeight = this.uiDialog.css({
- height: 'auto',
- width: options.width
- })
- .height();
- minContentHeight = Math.max( 0, options.minHeight - nonContentHeight );
-
- if ( options.height === "auto" ) {
- // only needed for IE6 support
- if ( $.support.minHeight ) {
- this.element.css({
- minHeight: minContentHeight,
- height: "auto"
- });
- } else {
- this.uiDialog.show();
- var autoHeight = this.element.css( "height", "auto" ).height();
- if ( !isVisible ) {
- this.uiDialog.hide();
- }
- this.element.height( Math.max( autoHeight, minContentHeight ) );
- }
- } else {
- this.element.height( Math.max( options.height - nonContentHeight, 0 ) );
- }
-
- if (this.uiDialog.is(':data(resizable)')) {
- this.uiDialog.resizable('option', 'minHeight', this._minHeight());
- }
- }
-});
-
-$.extend($.ui.dialog, {
- version: "1.8.18",
-
- uuid: 0,
- maxZ: 0,
-
- getTitleId: function($el) {
- var id = $el.attr('id');
- if (!id) {
- this.uuid += 1;
- id = this.uuid;
- }
- return 'ui-dialog-title-' + id;
- },
-
- overlay: function(dialog) {
- this.$el = $.ui.dialog.overlay.create(dialog);
- }
-});
-
-$.extend($.ui.dialog.overlay, {
- instances: [],
- // reuse old instances due to IE memory leak with alpha transparency (see #5185)
- oldInstances: [],
- maxZ: 0,
- events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
- function(event) { return event + '.dialog-overlay'; }).join(' '),
- create: function(dialog) {
- if (this.instances.length === 0) {
- // prevent use of anchors and inputs
- // we use a setTimeout in case the overlay is created from an
- // event that we're going to be cancelling (see #2804)
- setTimeout(function() {
- // handle $(el).dialog().dialog('close') (see #4065)
- if ($.ui.dialog.overlay.instances.length) {
- $(document).bind($.ui.dialog.overlay.events, function(event) {
- // stop events if the z-index of the target is < the z-index of the overlay
- // we cannot return true when we don't want to cancel the event (#3523)
- if ($(event.target).zIndex() < $.ui.dialog.overlay.maxZ) {
- return false;
- }
- });
- }
- }, 1);
-
- // allow closing by pressing the escape key
- $(document).bind('keydown.dialog-overlay', function(event) {
- if (dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
- event.keyCode === $.ui.keyCode.ESCAPE) {
-
- dialog.close(event);
- event.preventDefault();
- }
- });
-
- // handle window resize
- $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize);
- }
-
- var $el = (this.oldInstances.pop() || $('<div></div>').addClass('ui-widget-overlay'))
- .appendTo(document.body)
- .css({
- width: this.width(),
- height: this.height()
- });
-
- if ($.fn.bgiframe) {
- $el.bgiframe();
- }
-
- this.instances.push($el);
- return $el;
- },
-
- destroy: function($el) {
- var indexOf = $.inArray($el, this.instances);
- if (indexOf != -1){
- this.oldInstances.push(this.instances.splice(indexOf, 1)[0]);
- }
-
- if (this.instances.length === 0) {
- $([document, window]).unbind('.dialog-overlay');
- }
-
- $el.remove();
-
- // adjust the maxZ to allow other modal dialogs to continue to work (see #4309)
- var maxZ = 0;
- $.each(this.instances, function() {
- maxZ = Math.max(maxZ, this.css('z-index'));
- });
- this.maxZ = maxZ;
- },
-
- height: function() {
- var scrollHeight,
- offsetHeight;
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
- scrollHeight = Math.max(
- document.documentElement.scrollHeight,
- document.body.scrollHeight
- );
- offsetHeight = Math.max(
- document.documentElement.offsetHeight,
- document.body.offsetHeight
- );
-
- if (scrollHeight < offsetHeight) {
- return $(window).height() + 'px';
- } else {
- return scrollHeight + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).height() + 'px';
- }
- },
-
- width: function() {
- var scrollWidth,
- offsetWidth;
- // handle IE
- if ( $.browser.msie ) {
- scrollWidth = Math.max(
- document.documentElement.scrollWidth,
- document.body.scrollWidth
- );
- offsetWidth = Math.max(
- document.documentElement.offsetWidth,
- document.body.offsetWidth
- );
-
- if (scrollWidth < offsetWidth) {
- return $(window).width() + 'px';
- } else {
- return scrollWidth + 'px';
- }
- // handle "good" browsers
- } else {
- return $(document).width() + 'px';
- }
- },
-
- resize: function() {
- /* If the dialog is draggable and the user drags it past the
- * right edge of the window, the document becomes wider so we
- * need to stretch the overlay. If the user then drags the
- * dialog back to the left, the document will become narrower,
- * so we need to shrink the overlay to the appropriate size.
- * This is handled by shrinking the overlay before setting it
- * to the full document size.
- */
- var $overlays = $([]);
- $.each($.ui.dialog.overlay.instances, function() {
- $overlays = $overlays.add(this);
- });
-
- $overlays.css({
- width: 0,
- height: 0
- }).css({
- width: $.ui.dialog.overlay.width(),
- height: $.ui.dialog.overlay.height()
- });
- }
-});
-
-$.extend($.ui.dialog.overlay.prototype, {
- destroy: function() {
- $.ui.dialog.overlay.destroy(this.$el);
- }
-});
-
-}(jQuery));
-/*
- * jQuery UI Position 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Position
- */
-(function( $, undefined ) {
-
-$.ui = $.ui || {};
-
-var horizontalPositions = /left|center|right/,
- verticalPositions = /top|center|bottom/,
- center = "center",
- support = {},
- _position = $.fn.position,
- _offset = $.fn.offset;
-
-$.fn.position = function( options ) {
- if ( !options || !options.of ) {
- return _position.apply( this, arguments );
- }
-
- // make a copy, we don't want to modify arguments
- options = $.extend( {}, options );
-
- var target = $( options.of ),
- targetElem = target[0],
- collision = ( options.collision || "flip" ).split( " " ),
- offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],
- targetWidth,
- targetHeight,
- basePosition;
-
- if ( targetElem.nodeType === 9 ) {
- targetWidth = target.width();
- targetHeight = target.height();
- basePosition = { top: 0, left: 0 };
- // TODO: use $.isWindow() in 1.9
- } else if ( targetElem.setTimeout ) {
- targetWidth = target.width();
- targetHeight = target.height();
- basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
- } else if ( targetElem.preventDefault ) {
- // force left top to allow flipping
- options.at = "left top";
- targetWidth = targetHeight = 0;
- basePosition = { top: options.of.pageY, left: options.of.pageX };
- } else {
- targetWidth = target.outerWidth();
- targetHeight = target.outerHeight();
- basePosition = target.offset();
- }
-
- // force my and at to have valid horizontal and veritcal positions
- // if a value is missing or invalid, it will be converted to center
- $.each( [ "my", "at" ], function() {
- var pos = ( options[this] || "" ).split( " " );
- if ( pos.length === 1) {
- pos = horizontalPositions.test( pos[0] ) ?
- pos.concat( [center] ) :
- verticalPositions.test( pos[0] ) ?
- [ center ].concat( pos ) :
- [ center, center ];
- }
- pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : center;
- pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : center;
- options[ this ] = pos;
- });
-
- // normalize collision option
- if ( collision.length === 1 ) {
- collision[ 1 ] = collision[ 0 ];
- }
-
- // normalize offset option
- offset[ 0 ] = parseInt( offset[0], 10 ) || 0;
- if ( offset.length === 1 ) {
- offset[ 1 ] = offset[ 0 ];
- }
- offset[ 1 ] = parseInt( offset[1], 10 ) || 0;
-
- if ( options.at[0] === "right" ) {
- basePosition.left += targetWidth;
- } else if ( options.at[0] === center ) {
- basePosition.left += targetWidth / 2;
- }
-
- if ( options.at[1] === "bottom" ) {
- basePosition.top += targetHeight;
- } else if ( options.at[1] === center ) {
- basePosition.top += targetHeight / 2;
- }
-
- basePosition.left += offset[ 0 ];
- basePosition.top += offset[ 1 ];
-
- return this.each(function() {
- var elem = $( this ),
- elemWidth = elem.outerWidth(),
- elemHeight = elem.outerHeight(),
- marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0,
- marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0,
- collisionWidth = elemWidth + marginLeft +
- ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ),
- collisionHeight = elemHeight + marginTop +
- ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ),
- position = $.extend( {}, basePosition ),
- collisionPosition;
-
- if ( options.my[0] === "right" ) {
- position.left -= elemWidth;
- } else if ( options.my[0] === center ) {
- position.left -= elemWidth / 2;
- }
-
- if ( options.my[1] === "bottom" ) {
- position.top -= elemHeight;
- } else if ( options.my[1] === center ) {
- position.top -= elemHeight / 2;
- }
-
- // prevent fractions if jQuery version doesn't support them (see #5280)
- if ( !support.fractions ) {
- position.left = Math.round( position.left );
- position.top = Math.round( position.top );
- }
-
- collisionPosition = {
- left: position.left - marginLeft,
- top: position.top - marginTop
- };
-
- $.each( [ "left", "top" ], function( i, dir ) {
- if ( $.ui.position[ collision[i] ] ) {
- $.ui.position[ collision[i] ][ dir ]( position, {
- targetWidth: targetWidth,
- targetHeight: targetHeight,
- elemWidth: elemWidth,
- elemHeight: elemHeight,
- collisionPosition: collisionPosition,
- collisionWidth: collisionWidth,
- collisionHeight: collisionHeight,
- offset: offset,
- my: options.my,
- at: options.at
- });
- }
- });
-
- if ( $.fn.bgiframe ) {
- elem.bgiframe();
- }
- elem.offset( $.extend( position, { using: options.using } ) );
- });
-};
-
-$.ui.position = {
- fit: {
- left: function( position, data ) {
- var win = $( window ),
- over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft();
- position.left = over > 0 ? position.left - over : Math.max( position.left - data.collisionPosition.left, position.left );
- },
- top: function( position, data ) {
- var win = $( window ),
- over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop();
- position.top = over > 0 ? position.top - over : Math.max( position.top - data.collisionPosition.top, position.top );
- }
- },
-
- flip: {
- left: function( position, data ) {
- if ( data.at[0] === center ) {
- return;
- }
- var win = $( window ),
- over = data.collisionPosition.left + data.collisionWidth - win.width() - win.scrollLeft(),
- myOffset = data.my[ 0 ] === "left" ?
- -data.elemWidth :
- data.my[ 0 ] === "right" ?
- data.elemWidth :
- 0,
- atOffset = data.at[ 0 ] === "left" ?
- data.targetWidth :
- -data.targetWidth,
- offset = -2 * data.offset[ 0 ];
- position.left += data.collisionPosition.left < 0 ?
- myOffset + atOffset + offset :
- over > 0 ?
- myOffset + atOffset + offset :
- 0;
- },
- top: function( position, data ) {
- if ( data.at[1] === center ) {
- return;
- }
- var win = $( window ),
- over = data.collisionPosition.top + data.collisionHeight - win.height() - win.scrollTop(),
- myOffset = data.my[ 1 ] === "top" ?
- -data.elemHeight :
- data.my[ 1 ] === "bottom" ?
- data.elemHeight :
- 0,
- atOffset = data.at[ 1 ] === "top" ?
- data.targetHeight :
- -data.targetHeight,
- offset = -2 * data.offset[ 1 ];
- position.top += data.collisionPosition.top < 0 ?
- myOffset + atOffset + offset :
- over > 0 ?
- myOffset + atOffset + offset :
- 0;
- }
- }
-};
-
-// offset setter from jQuery 1.4
-if ( !$.offset.setOffset ) {
- $.offset.setOffset = function( elem, options ) {
- // set position first, in-case top/left are set even on static elem
- if ( /static/.test( $.curCSS( elem, "position" ) ) ) {
- elem.style.position = "relative";
- }
- var curElem = $( elem ),
- curOffset = curElem.offset(),
- curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,
- curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,
- props = {
- top: (options.top - curOffset.top) + curTop,
- left: (options.left - curOffset.left) + curLeft
- };
-
- if ( 'using' in options ) {
- options.using.call( elem, props );
- } else {
- curElem.css( props );
- }
- };
-
- $.fn.offset = function( options ) {
- var elem = this[ 0 ];
- if ( !elem || !elem.ownerDocument ) { return null; }
- if ( options ) {
- return this.each(function() {
- $.offset.setOffset( this, options );
- });
- }
- return _offset.call( this );
- };
-}
-
-// fraction support test (older versions of jQuery don't support fractions)
-(function () {
- var body = document.getElementsByTagName( "body" )[ 0 ],
- div = document.createElement( "div" ),
- testElement, testElementParent, testElementStyle, offset, offsetTotal;
-
- //Create a "fake body" for testing based on method used in jQuery.support
- testElement = document.createElement( body ? "div" : "body" );
- testElementStyle = {
- visibility: "hidden",
- width: 0,
- height: 0,
- border: 0,
- margin: 0,
- background: "none"
- };
- if ( body ) {
- $.extend( testElementStyle, {
- position: "absolute",
- left: "-1000px",
- top: "-1000px"
- });
- }
- for ( var i in testElementStyle ) {
- testElement.style[ i ] = testElementStyle[ i ];
- }
- testElement.appendChild( div );
- testElementParent = body || document.documentElement;
- testElementParent.insertBefore( testElement, testElementParent.firstChild );
-
- div.style.cssText = "position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;";
-
- offset = $( div ).offset( function( _, offset ) {
- return offset;
- }).offset();
-
- testElement.innerHTML = "";
- testElementParent.removeChild( testElement );
-
- offsetTotal = offset.top + offset.left + ( body ? 2000 : 0 );
- support.fractions = offsetTotal > 21 && offsetTotal < 22;
-})();
-
-}( jQuery ));
-/*
- * jQuery UI Progressbar 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Progressbar
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-$.widget( "ui.progressbar", {
- options: {
- value: 0,
- max: 100
- },
-
- min: 0,
-
- _create: function() {
- this.element
- .addClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
- .attr({
- role: "progressbar",
- "aria-valuemin": this.min,
- "aria-valuemax": this.options.max,
- "aria-valuenow": this._value()
- });
-
- this.valueDiv = $( "<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>" )
- .appendTo( this.element );
-
- this.oldValue = this._value();
- this._refreshValue();
- },
-
- destroy: function() {
- this.element
- .removeClass( "ui-progressbar ui-widget ui-widget-content ui-corner-all" )
- .removeAttr( "role" )
- .removeAttr( "aria-valuemin" )
- .removeAttr( "aria-valuemax" )
- .removeAttr( "aria-valuenow" );
-
- this.valueDiv.remove();
-
- $.Widget.prototype.destroy.apply( this, arguments );
- },
-
- value: function( newValue ) {
- if ( newValue === undefined ) {
- return this._value();
- }
-
- this._setOption( "value", newValue );
- return this;
- },
-
- _setOption: function( key, value ) {
- if ( key === "value" ) {
- this.options.value = value;
- this._refreshValue();
- if ( this._value() === this.options.max ) {
- this._trigger( "complete" );
- }
- }
-
- $.Widget.prototype._setOption.apply( this, arguments );
- },
-
- _value: function() {
- var val = this.options.value;
- // normalize invalid value
- if ( typeof val !== "number" ) {
- val = 0;
- }
- return Math.min( this.options.max, Math.max( this.min, val ) );
- },
-
- _percentage: function() {
- return 100 * this._value() / this.options.max;
- },
-
- _refreshValue: function() {
- var value = this.value();
- var percentage = this._percentage();
-
- if ( this.oldValue !== value ) {
- this.oldValue = value;
- this._trigger( "change" );
- }
-
- this.valueDiv
- .toggle( value > this.min )
- .toggleClass( "ui-corner-right", value === this.options.max )
- .width( percentage.toFixed(0) + "%" );
- this.element.attr( "aria-valuenow", value );
- }
-});
-
-$.extend( $.ui.progressbar, {
- version: "1.8.18"
-});
-
-})( jQuery );
-/*
- * jQuery UI Slider 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Slider
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.mouse.js
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-// number of pages in a slider
-// (how many times can you page up/down to go through the whole range)
-var numPages = 5;
-
-$.widget( "ui.slider", $.ui.mouse, {
-
- widgetEventPrefix: "slide",
-
- options: {
- animate: false,
- distance: 0,
- max: 100,
- min: 0,
- orientation: "horizontal",
- range: false,
- step: 1,
- value: 0,
- values: null
- },
-
- _create: function() {
- var self = this,
- o = this.options,
- existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
- handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
- handleCount = ( o.values && o.values.length ) || 1,
- handles = [];
-
- this._keySliding = false;
- this._mouseSliding = false;
- this._animateOff = true;
- this._handleIndex = null;
- this._detectOrientation();
- this._mouseInit();
-
- this.element
- .addClass( "ui-slider" +
- " ui-slider-" + this.orientation +
- " ui-widget" +
- " ui-widget-content" +
- " ui-corner-all" +
- ( o.disabled ? " ui-slider-disabled ui-disabled" : "" ) );
-
- this.range = $([]);
-
- if ( o.range ) {
- if ( o.range === true ) {
- if ( !o.values ) {
- o.values = [ this._valueMin(), this._valueMin() ];
- }
- if ( o.values.length && o.values.length !== 2 ) {
- o.values = [ o.values[0], o.values[0] ];
- }
- }
-
- this.range = $( "<div></div>" )
- .appendTo( this.element )
- .addClass( "ui-slider-range" +
- // note: this isn't the most fittingly semantic framework class for this element,
- // but worked best visually with a variety of themes
- " ui-widget-header" +
- ( ( o.range === "min" || o.range === "max" ) ? " ui-slider-range-" + o.range : "" ) );
- }
-
- for ( var i = existingHandles.length; i < handleCount; i += 1 ) {
- handles.push( handle );
- }
-
- this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( self.element ) );
-
- this.handle = this.handles.eq( 0 );
-
- this.handles.add( this.range ).filter( "a" )
- .click(function( event ) {
- event.preventDefault();
- })
- .hover(function() {
- if ( !o.disabled ) {
- $( this ).addClass( "ui-state-hover" );
- }
- }, function() {
- $( this ).removeClass( "ui-state-hover" );
- })
- .focus(function() {
- if ( !o.disabled ) {
- $( ".ui-slider .ui-state-focus" ).removeClass( "ui-state-focus" );
- $( this ).addClass( "ui-state-focus" );
- } else {
- $( this ).blur();
- }
- })
- .blur(function() {
- $( this ).removeClass( "ui-state-focus" );
- });
-
- this.handles.each(function( i ) {
- $( this ).data( "index.ui-slider-handle", i );
- });
-
- this.handles
- .keydown(function( event ) {
- var index = $( this ).data( "index.ui-slider-handle" ),
- allowed,
- curVal,
- newVal,
- step;
-
- if ( self.options.disabled ) {
- return;
- }
-
- switch ( event.keyCode ) {
- case $.ui.keyCode.HOME:
- case $.ui.keyCode.END:
- case $.ui.keyCode.PAGE_UP:
- case $.ui.keyCode.PAGE_DOWN:
- case $.ui.keyCode.UP:
- case $.ui.keyCode.RIGHT:
- case $.ui.keyCode.DOWN:
- case $.ui.keyCode.LEFT:
- event.preventDefault();
- if ( !self._keySliding ) {
- self._keySliding = true;
- $( this ).addClass( "ui-state-active" );
- allowed = self._start( event, index );
- if ( allowed === false ) {
- return;
- }
- }
- break;
- }
-
- step = self.options.step;
- if ( self.options.values && self.options.values.length ) {
- curVal = newVal = self.values( index );
- } else {
- curVal = newVal = self.value();
- }
-
- switch ( event.keyCode ) {
- case $.ui.keyCode.HOME:
- newVal = self._valueMin();
- break;
- case $.ui.keyCode.END:
- newVal = self._valueMax();
- break;
- case $.ui.keyCode.PAGE_UP:
- newVal = self._trimAlignValue( curVal + ( (self._valueMax() - self._valueMin()) / numPages ) );
- break;
- case $.ui.keyCode.PAGE_DOWN:
- newVal = self._trimAlignValue( curVal - ( (self._valueMax() - self._valueMin()) / numPages ) );
- break;
- case $.ui.keyCode.UP:
- case $.ui.keyCode.RIGHT:
- if ( curVal === self._valueMax() ) {
- return;
- }
- newVal = self._trimAlignValue( curVal + step );
- break;
- case $.ui.keyCode.DOWN:
- case $.ui.keyCode.LEFT:
- if ( curVal === self._valueMin() ) {
- return;
- }
- newVal = self._trimAlignValue( curVal - step );
- break;
- }
-
- self._slide( event, index, newVal );
- })
- .keyup(function( event ) {
- var index = $( this ).data( "index.ui-slider-handle" );
-
- if ( self._keySliding ) {
- self._keySliding = false;
- self._stop( event, index );
- self._change( event, index );
- $( this ).removeClass( "ui-state-active" );
- }
-
- });
-
- this._refreshValue();
-
- this._animateOff = false;
- },
-
- destroy: function() {
- this.handles.remove();
- this.range.remove();
-
- this.element
- .removeClass( "ui-slider" +
- " ui-slider-horizontal" +
- " ui-slider-vertical" +
- " ui-slider-disabled" +
- " ui-widget" +
- " ui-widget-content" +
- " ui-corner-all" )
- .removeData( "slider" )
- .unbind( ".slider" );
-
- this._mouseDestroy();
-
- return this;
- },
-
- _mouseCapture: function( event ) {
- var o = this.options,
- position,
- normValue,
- distance,
- closestHandle,
- self,
- index,
- allowed,
- offset,
- mouseOverHandle;
-
- if ( o.disabled ) {
- return false;
- }
-
- this.elementSize = {
- width: this.element.outerWidth(),
- height: this.element.outerHeight()
- };
- this.elementOffset = this.element.offset();
-
- position = { x: event.pageX, y: event.pageY };
- normValue = this._normValueFromMouse( position );
- distance = this._valueMax() - this._valueMin() + 1;
- self = this;
- this.handles.each(function( i ) {
- var thisDistance = Math.abs( normValue - self.values(i) );
- if ( distance > thisDistance ) {
- distance = thisDistance;
- closestHandle = $( this );
- index = i;
- }
- });
-
- // workaround for bug #3736 (if both handles of a range are at 0,
- // the first is always used as the one with least distance,
- // and moving it is obviously prevented by preventing negative ranges)
- if( o.range === true && this.values(1) === o.min ) {
- index += 1;
- closestHandle = $( this.handles[index] );
- }
-
- allowed = this._start( event, index );
- if ( allowed === false ) {
- return false;
- }
- this._mouseSliding = true;
-
- self._handleIndex = index;
-
- closestHandle
- .addClass( "ui-state-active" )
- .focus();
-
- offset = closestHandle.offset();
- mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
- this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
- left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
- top: event.pageY - offset.top -
- ( closestHandle.height() / 2 ) -
- ( parseInt( closestHandle.css("borderTopWidth"), 10 ) || 0 ) -
- ( parseInt( closestHandle.css("borderBottomWidth"), 10 ) || 0) +
- ( parseInt( closestHandle.css("marginTop"), 10 ) || 0)
- };
-
- if ( !this.handles.hasClass( "ui-state-hover" ) ) {
- this._slide( event, index, normValue );
- }
- this._animateOff = true;
- return true;
- },
-
- _mouseStart: function( event ) {
- return true;
- },
-
- _mouseDrag: function( event ) {
- var position = { x: event.pageX, y: event.pageY },
- normValue = this._normValueFromMouse( position );
-
- this._slide( event, this._handleIndex, normValue );
-
- return false;
- },
-
- _mouseStop: function( event ) {
- this.handles.removeClass( "ui-state-active" );
- this._mouseSliding = false;
-
- this._stop( event, this._handleIndex );
- this._change( event, this._handleIndex );
-
- this._handleIndex = null;
- this._clickOffset = null;
- this._animateOff = false;
-
- return false;
- },
-
- _detectOrientation: function() {
- this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal";
- },
-
- _normValueFromMouse: function( position ) {
- var pixelTotal,
- pixelMouse,
- percentMouse,
- valueTotal,
- valueMouse;
-
- if ( this.orientation === "horizontal" ) {
- pixelTotal = this.elementSize.width;
- pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 );
- } else {
- pixelTotal = this.elementSize.height;
- pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 );
- }
-
- percentMouse = ( pixelMouse / pixelTotal );
- if ( percentMouse > 1 ) {
- percentMouse = 1;
- }
- if ( percentMouse < 0 ) {
- percentMouse = 0;
- }
- if ( this.orientation === "vertical" ) {
- percentMouse = 1 - percentMouse;
- }
-
- valueTotal = this._valueMax() - this._valueMin();
- valueMouse = this._valueMin() + percentMouse * valueTotal;
-
- return this._trimAlignValue( valueMouse );
- },
-
- _start: function( event, index ) {
- var uiHash = {
- handle: this.handles[ index ],
- value: this.value()
- };
- if ( this.options.values && this.options.values.length ) {
- uiHash.value = this.values( index );
- uiHash.values = this.values();
- }
- return this._trigger( "start", event, uiHash );
- },
-
- _slide: function( event, index, newVal ) {
- var otherVal,
- newValues,
- allowed;
-
- if ( this.options.values && this.options.values.length ) {
- otherVal = this.values( index ? 0 : 1 );
-
- if ( ( this.options.values.length === 2 && this.options.range === true ) &&
- ( ( index === 0 && newVal > otherVal) || ( index === 1 && newVal < otherVal ) )
- ) {
- newVal = otherVal;
- }
-
- if ( newVal !== this.values( index ) ) {
- newValues = this.values();
- newValues[ index ] = newVal;
- // A slide can be canceled by returning false from the slide callback
- allowed = this._trigger( "slide", event, {
- handle: this.handles[ index ],
- value: newVal,
- values: newValues
- } );
- otherVal = this.values( index ? 0 : 1 );
- if ( allowed !== false ) {
- this.values( index, newVal, true );
- }
- }
- } else {
- if ( newVal !== this.value() ) {
- // A slide can be canceled by returning false from the slide callback
- allowed = this._trigger( "slide", event, {
- handle: this.handles[ index ],
- value: newVal
- } );
- if ( allowed !== false ) {
- this.value( newVal );
- }
- }
- }
- },
-
- _stop: function( event, index ) {
- var uiHash = {
- handle: this.handles[ index ],
- value: this.value()
- };
- if ( this.options.values && this.options.values.length ) {
- uiHash.value = this.values( index );
- uiHash.values = this.values();
- }
-
- this._trigger( "stop", event, uiHash );
- },
-
- _change: function( event, index ) {
- if ( !this._keySliding && !this._mouseSliding ) {
- var uiHash = {
- handle: this.handles[ index ],
- value: this.value()
- };
- if ( this.options.values && this.options.values.length ) {
- uiHash.value = this.values( index );
- uiHash.values = this.values();
- }
-
- this._trigger( "change", event, uiHash );
- }
- },
-
- value: function( newValue ) {
- if ( arguments.length ) {
- this.options.value = this._trimAlignValue( newValue );
- this._refreshValue();
- this._change( null, 0 );
- return;
- }
-
- return this._value();
- },
-
- values: function( index, newValue ) {
- var vals,
- newValues,
- i;
-
- if ( arguments.length > 1 ) {
- this.options.values[ index ] = this._trimAlignValue( newValue );
- this._refreshValue();
- this._change( null, index );
- return;
- }
-
- if ( arguments.length ) {
- if ( $.isArray( arguments[ 0 ] ) ) {
- vals = this.options.values;
- newValues = arguments[ 0 ];
- for ( i = 0; i < vals.length; i += 1 ) {
- vals[ i ] = this._trimAlignValue( newValues[ i ] );
- this._change( null, i );
- }
- this._refreshValue();
- } else {
- if ( this.options.values && this.options.values.length ) {
- return this._values( index );
- } else {
- return this.value();
- }
- }
- } else {
- return this._values();
- }
- },
-
- _setOption: function( key, value ) {
- var i,
- valsLength = 0;
-
- if ( $.isArray( this.options.values ) ) {
- valsLength = this.options.values.length;
- }
-
- $.Widget.prototype._setOption.apply( this, arguments );
-
- switch ( key ) {
- case "disabled":
- if ( value ) {
- this.handles.filter( ".ui-state-focus" ).blur();
- this.handles.removeClass( "ui-state-hover" );
- this.handles.propAttr( "disabled", true );
- this.element.addClass( "ui-disabled" );
- } else {
- this.handles.propAttr( "disabled", false );
- this.element.removeClass( "ui-disabled" );
- }
- break;
- case "orientation":
- this._detectOrientation();
- this.element
- .removeClass( "ui-slider-horizontal ui-slider-vertical" )
- .addClass( "ui-slider-" + this.orientation );
- this._refreshValue();
- break;
- case "value":
- this._animateOff = true;
- this._refreshValue();
- this._change( null, 0 );
- this._animateOff = false;
- break;
- case "values":
- this._animateOff = true;
- this._refreshValue();
- for ( i = 0; i < valsLength; i += 1 ) {
- this._change( null, i );
- }
- this._animateOff = false;
- break;
- }
- },
-
- //internal value getter
- // _value() returns value trimmed by min and max, aligned by step
- _value: function() {
- var val = this.options.value;
- val = this._trimAlignValue( val );
-
- return val;
- },
-
- //internal values getter
- // _values() returns array of values trimmed by min and max, aligned by step
- // _values( index ) returns single value trimmed by min and max, aligned by step
- _values: function( index ) {
- var val,
- vals,
- i;
-
- if ( arguments.length ) {
- val = this.options.values[ index ];
- val = this._trimAlignValue( val );
-
- return val;
- } else {
- // .slice() creates a copy of the array
- // this copy gets trimmed by min and max and then returned
- vals = this.options.values.slice();
- for ( i = 0; i < vals.length; i+= 1) {
- vals[ i ] = this._trimAlignValue( vals[ i ] );
- }
-
- return vals;
- }
- },
-
- // returns the step-aligned value that val is closest to, between (inclusive) min and max
- _trimAlignValue: function( val ) {
- if ( val <= this._valueMin() ) {
- return this._valueMin();
- }
- if ( val >= this._valueMax() ) {
- return this._valueMax();
- }
- var step = ( this.options.step > 0 ) ? this.options.step : 1,
- valModStep = (val - this._valueMin()) % step,
- alignValue = val - valModStep;
-
- if ( Math.abs(valModStep) * 2 >= step ) {
- alignValue += ( valModStep > 0 ) ? step : ( -step );
- }
-
- // Since JavaScript has problems with large floats, round
- // the final value to 5 digits after the decimal point (see #4124)
- return parseFloat( alignValue.toFixed(5) );
- },
-
- _valueMin: function() {
- return this.options.min;
- },
-
- _valueMax: function() {
- return this.options.max;
- },
-
- _refreshValue: function() {
- var oRange = this.options.range,
- o = this.options,
- self = this,
- animate = ( !this._animateOff ) ? o.animate : false,
- valPercent,
- _set = {},
- lastValPercent,
- value,
- valueMin,
- valueMax;
-
- if ( this.options.values && this.options.values.length ) {
- this.handles.each(function( i, j ) {
- valPercent = ( self.values(i) - self._valueMin() ) / ( self._valueMax() - self._valueMin() ) * 100;
- _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
- $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
- if ( self.options.range === true ) {
- if ( self.orientation === "horizontal" ) {
- if ( i === 0 ) {
- self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
- }
- if ( i === 1 ) {
- self.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
- }
- } else {
- if ( i === 0 ) {
- self.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
- }
- if ( i === 1 ) {
- self.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } );
- }
- }
- }
- lastValPercent = valPercent;
- });
- } else {
- value = this.value();
- valueMin = this._valueMin();
- valueMax = this._valueMax();
- valPercent = ( valueMax !== valueMin ) ?
- ( value - valueMin ) / ( valueMax - valueMin ) * 100 :
- 0;
- _set[ self.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%";
- this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate );
-
- if ( oRange === "min" && this.orientation === "horizontal" ) {
- this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
- }
- if ( oRange === "max" && this.orientation === "horizontal" ) {
- this.range[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
- }
- if ( oRange === "min" && this.orientation === "vertical" ) {
- this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
- }
- if ( oRange === "max" && this.orientation === "vertical" ) {
- this.range[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, { queue: false, duration: o.animate } );
- }
- }
- }
-
-});
-
-$.extend( $.ui.slider, {
- version: "1.8.18"
-});
-
-}(jQuery));
-/*
- * jQuery UI Tabs 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Tabs
- *
- * Depends:
- * jquery.ui.core.js
- * jquery.ui.widget.js
- */
-(function( $, undefined ) {
-
-var tabId = 0,
- listId = 0;
-
-function getNextTabId() {
- return ++tabId;
-}
-
-function getNextListId() {
- return ++listId;
-}
-
-$.widget( "ui.tabs", {
- options: {
- add: null,
- ajaxOptions: null,
- cache: false,
- cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
- collapsible: false,
- disable: null,
- disabled: [],
- enable: null,
- event: "click",
- fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
- idPrefix: "ui-tabs-",
- load: null,
- panelTemplate: "<div></div>",
- remove: null,
- select: null,
- show: null,
- spinner: "<em>Loading&#8230;</em>",
- tabTemplate: "<li><a href='#{href}'><span>#{label}</span></a></li>"
- },
-
- _create: function() {
- this._tabify( true );
- },
-
- _setOption: function( key, value ) {
- if ( key == "selected" ) {
- if (this.options.collapsible && value == this.options.selected ) {
- return;
- }
- this.select( value );
- } else {
- this.options[ key ] = value;
- this._tabify();
- }
- },
-
- _tabId: function( a ) {
- return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) ||
- this.options.idPrefix + getNextTabId();
- },
-
- _sanitizeSelector: function( hash ) {
- // we need this because an id may contain a ":"
- return hash.replace( /:/g, "\\:" );
- },
-
- _cookie: function() {
- var cookie = this.cookie ||
- ( this.cookie = this.options.cookie.name || "ui-tabs-" + getNextListId() );
- return $.cookie.apply( null, [ cookie ].concat( $.makeArray( arguments ) ) );
- },
-
- _ui: function( tab, panel ) {
- return {
- tab: tab,
- panel: panel,
- index: this.anchors.index( tab )
- };
- },
-
- _cleanup: function() {
- // restore all former loading tabs labels
- this.lis.filter( ".ui-state-processing" )
- .removeClass( "ui-state-processing" )
- .find( "span:data(label.tabs)" )
- .each(function() {
- var el = $( this );
- el.html( el.data( "label.tabs" ) ).removeData( "label.tabs" );
- });
- },
-
- _tabify: function( init ) {
- var self = this,
- o = this.options,
- fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
-
- this.list = this.element.find( "ol,ul" ).eq( 0 );
- this.lis = $( " > li:has(a[href])", this.list );
- this.anchors = this.lis.map(function() {
- return $( "a", this )[ 0 ];
- });
- this.panels = $( [] );
-
- this.anchors.each(function( i, a ) {
- var href = $( a ).attr( "href" );
- // For dynamically created HTML that contains a hash as href IE < 8 expands
- // such href to the full page url with hash and then misinterprets tab as ajax.
- // Same consideration applies for an added tab with a fragment identifier
- // since a[href=#fragment-identifier] does unexpectedly not match.
- // Thus normalize href attribute...
- var hrefBase = href.split( "#" )[ 0 ],
- baseEl;
- if ( hrefBase && ( hrefBase === location.toString().split( "#" )[ 0 ] ||
- ( baseEl = $( "base" )[ 0 ]) && hrefBase === baseEl.href ) ) {
- href = a.hash;
- a.href = href;
- }
-
- // inline tab
- if ( fragmentId.test( href ) ) {
- self.panels = self.panels.add( self.element.find( self._sanitizeSelector( href ) ) );
- // remote tab
- // prevent loading the page itself if href is just "#"
- } else if ( href && href !== "#" ) {
- // required for restore on destroy
- $.data( a, "href.tabs", href );
-
- // TODO until #3808 is fixed strip fragment identifier from url
- // (IE fails to load from such url)
- $.data( a, "load.tabs", href.replace( /#.*$/, "" ) );
-
- var id = self._tabId( a );
- a.href = "#" + id;
- var $panel = self.element.find( "#" + id );
- if ( !$panel.length ) {
- $panel = $( o.panelTemplate )
- .attr( "id", id )
- .addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
- .insertAfter( self.panels[ i - 1 ] || self.list );
- $panel.data( "destroy.tabs", true );
- }
- self.panels = self.panels.add( $panel );
- // invalid tab href
- } else {
- o.disabled.push( i );
- }
- });
-
- // initialization from scratch
- if ( init ) {
- // attach necessary classes for styling
- this.element.addClass( "ui-tabs ui-widget ui-widget-content ui-corner-all" );
- this.list.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
- this.lis.addClass( "ui-state-default ui-corner-top" );
- this.panels.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" );
-
- // Selected tab
- // use "selected" option or try to retrieve:
- // 1. from fragment identifier in url
- // 2. from cookie
- // 3. from selected class attribute on <li>
- if ( o.selected === undefined ) {
- if ( location.hash ) {
- this.anchors.each(function( i, a ) {
- if ( a.hash == location.hash ) {
- o.selected = i;
- return false;
- }
- });
- }
- if ( typeof o.selected !== "number" && o.cookie ) {
- o.selected = parseInt( self._cookie(), 10 );
- }
- if ( typeof o.selected !== "number" && this.lis.filter( ".ui-tabs-selected" ).length ) {
- o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) );
- }
- o.selected = o.selected || ( this.lis.length ? 0 : -1 );
- } else if ( o.selected === null ) { // usage of null is deprecated, TODO remove in next release
- o.selected = -1;
- }
-
- // sanity check - default to first tab...
- o.selected = ( ( o.selected >= 0 && this.anchors[ o.selected ] ) || o.selected < 0 )
- ? o.selected
- : 0;
-
- // Take disabling tabs via class attribute from HTML
- // into account and update option properly.
- // A selected tab cannot become disabled.
- o.disabled = $.unique( o.disabled.concat(
- $.map( this.lis.filter( ".ui-state-disabled" ), function( n, i ) {
- return self.lis.index( n );
- })
- ) ).sort();
-
- if ( $.inArray( o.selected, o.disabled ) != -1 ) {
- o.disabled.splice( $.inArray( o.selected, o.disabled ), 1 );
- }
-
- // highlight selected tab
- this.panels.addClass( "ui-tabs-hide" );
- this.lis.removeClass( "ui-tabs-selected ui-state-active" );
- // check for length avoids error when initializing empty list
- if ( o.selected >= 0 && this.anchors.length ) {
- self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) ).removeClass( "ui-tabs-hide" );
- this.lis.eq( o.selected ).addClass( "ui-tabs-selected ui-state-active" );
-
- // seems to be expected behavior that the show callback is fired
- self.element.queue( "tabs", function() {
- self._trigger( "show", null,
- self._ui( self.anchors[ o.selected ], self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) )[ 0 ] ) );
- });
-
- this.load( o.selected );
- }
-
- // clean up to avoid memory leaks in certain versions of IE 6
- // TODO: namespace this event
- $( window ).bind( "unload", function() {
- self.lis.add( self.anchors ).unbind( ".tabs" );
- self.lis = self.anchors = self.panels = null;
- });
- // update selected after add/remove
- } else {
- o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) );
- }
-
- // update collapsible
- // TODO: use .toggleClass()
- this.element[ o.collapsible ? "addClass" : "removeClass" ]( "ui-tabs-collapsible" );
-
- // set or update cookie after init and add/remove respectively
- if ( o.cookie ) {
- this._cookie( o.selected, o.cookie );
- }
-
- // disable tabs
- for ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) {
- $( li )[ $.inArray( i, o.disabled ) != -1 &&
- // TODO: use .toggleClass()
- !$( li ).hasClass( "ui-tabs-selected" ) ? "addClass" : "removeClass" ]( "ui-state-disabled" );
- }
-
- // reset cache if switching from cached to not cached
- if ( o.cache === false ) {
- this.anchors.removeData( "cache.tabs" );
- }
-
- // remove all handlers before, tabify may run on existing tabs after add or option change
- this.lis.add( this.anchors ).unbind( ".tabs" );
-
- if ( o.event !== "mouseover" ) {
- var addState = function( state, el ) {
- if ( el.is( ":not(.ui-state-disabled)" ) ) {
- el.addClass( "ui-state-" + state );
- }
- };
- var removeState = function( state, el ) {
- el.removeClass( "ui-state-" + state );
- };
- this.lis.bind( "mouseover.tabs" , function() {
- addState( "hover", $( this ) );
- });
- this.lis.bind( "mouseout.tabs", function() {
- removeState( "hover", $( this ) );
- });
- this.anchors.bind( "focus.tabs", function() {
- addState( "focus", $( this ).closest( "li" ) );
- });
- this.anchors.bind( "blur.tabs", function() {
- removeState( "focus", $( this ).closest( "li" ) );
- });
- }
-
- // set up animations
- var hideFx, showFx;
- if ( o.fx ) {
- if ( $.isArray( o.fx ) ) {
- hideFx = o.fx[ 0 ];
- showFx = o.fx[ 1 ];
- } else {
- hideFx = showFx = o.fx;
- }
- }
-
- // Reset certain styles left over from animation
- // and prevent IE's ClearType bug...
- function resetStyle( $el, fx ) {
- $el.css( "display", "" );
- if ( !$.support.opacity && fx.opacity ) {
- $el[ 0 ].style.removeAttribute( "filter" );
- }
- }
-
- // Show a tab...
- var showTab = showFx
- ? function( clicked, $show ) {
- $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" );
- $show.hide().removeClass( "ui-tabs-hide" ) // avoid flicker that way
- .animate( showFx, showFx.duration || "normal", function() {
- resetStyle( $show, showFx );
- self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) );
- });
- }
- : function( clicked, $show ) {
- $( clicked ).closest( "li" ).addClass( "ui-tabs-selected ui-state-active" );
- $show.removeClass( "ui-tabs-hide" );
- self._trigger( "show", null, self._ui( clicked, $show[ 0 ] ) );
- };
-
- // Hide a tab, $show is optional...
- var hideTab = hideFx
- ? function( clicked, $hide ) {
- $hide.animate( hideFx, hideFx.duration || "normal", function() {
- self.lis.removeClass( "ui-tabs-selected ui-state-active" );
- $hide.addClass( "ui-tabs-hide" );
- resetStyle( $hide, hideFx );
- self.element.dequeue( "tabs" );
- });
- }
- : function( clicked, $hide, $show ) {
- self.lis.removeClass( "ui-tabs-selected ui-state-active" );
- $hide.addClass( "ui-tabs-hide" );
- self.element.dequeue( "tabs" );
- };
-
- // attach tab event handler, unbind to avoid duplicates from former tabifying...
- this.anchors.bind( o.event + ".tabs", function() {
- var el = this,
- $li = $(el).closest( "li" ),
- $hide = self.panels.filter( ":not(.ui-tabs-hide)" ),
- $show = self.element.find( self._sanitizeSelector( el.hash ) );
-
- // If tab is already selected and not collapsible or tab disabled or
- // or is already loading or click callback returns false stop here.
- // Check if click handler returns false last so that it is not executed
- // for a disabled or loading tab!
- if ( ( $li.hasClass( "ui-tabs-selected" ) && !o.collapsible) ||
- $li.hasClass( "ui-state-disabled" ) ||
- $li.hasClass( "ui-state-processing" ) ||
- self.panels.filter( ":animated" ).length ||
- self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) {
- this.blur();
- return false;
- }
-
- o.selected = self.anchors.index( this );
-
- self.abort();
-
- // if tab may be closed
- if ( o.collapsible ) {
- if ( $li.hasClass( "ui-tabs-selected" ) ) {
- o.selected = -1;
-
- if ( o.cookie ) {
- self._cookie( o.selected, o.cookie );
- }
-
- self.element.queue( "tabs", function() {
- hideTab( el, $hide );
- }).dequeue( "tabs" );
-
- this.blur();
- return false;
- } else if ( !$hide.length ) {
- if ( o.cookie ) {
- self._cookie( o.selected, o.cookie );
- }
-
- self.element.queue( "tabs", function() {
- showTab( el, $show );
- });
-
- // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
- self.load( self.anchors.index( this ) );
-
- this.blur();
- return false;
- }
- }
-
- if ( o.cookie ) {
- self._cookie( o.selected, o.cookie );
- }
-
- // show new tab
- if ( $show.length ) {
- if ( $hide.length ) {
- self.element.queue( "tabs", function() {
- hideTab( el, $hide );
- });
- }
- self.element.queue( "tabs", function() {
- showTab( el, $show );
- });
-
- self.load( self.anchors.index( this ) );
- } else {
- throw "jQuery UI Tabs: Mismatching fragment identifier.";
- }
-
- // Prevent IE from keeping other link focussed when using the back button
- // and remove dotted border from clicked link. This is controlled via CSS
- // in modern browsers; blur() removes focus from address bar in Firefox
- // which can become a usability and annoying problem with tabs('rotate').
- if ( $.browser.msie ) {
- this.blur();
- }
- });
-
- // disable click in any case
- this.anchors.bind( "click.tabs", function(){
- return false;
- });
- },
-
- _getIndex: function( index ) {
- // meta-function to give users option to provide a href string instead of a numerical index.
- // also sanitizes numerical indexes to valid values.
- if ( typeof index == "string" ) {
- index = this.anchors.index( this.anchors.filter( "[href$=" + index + "]" ) );
- }
-
- return index;
- },
-
- destroy: function() {
- var o = this.options;
-
- this.abort();
-
- this.element
- .unbind( ".tabs" )
- .removeClass( "ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible" )
- .removeData( "tabs" );
-
- this.list.removeClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" );
-
- this.anchors.each(function() {
- var href = $.data( this, "href.tabs" );
- if ( href ) {
- this.href = href;
- }
- var $this = $( this ).unbind( ".tabs" );
- $.each( [ "href", "load", "cache" ], function( i, prefix ) {
- $this.removeData( prefix + ".tabs" );
- });
- });
-
- this.lis.unbind( ".tabs" ).add( this.panels ).each(function() {
- if ( $.data( this, "destroy.tabs" ) ) {
- $( this ).remove();
- } else {
- $( this ).removeClass([
- "ui-state-default",
- "ui-corner-top",
- "ui-tabs-selected",
- "ui-state-active",
- "ui-state-hover",
- "ui-state-focus",
- "ui-state-disabled",
- "ui-tabs-panel",
- "ui-widget-content",
- "ui-corner-bottom",
- "ui-tabs-hide"
- ].join( " " ) );
- }
- });
-
- if ( o.cookie ) {
- this._cookie( null, o.cookie );
- }
-
- return this;
- },
-
- add: function( url, label, index ) {
- if ( index === undefined ) {
- index = this.anchors.length;
- }
-
- var self = this,
- o = this.options,
- $li = $( o.tabTemplate.replace( /#\{href\}/g, url ).replace( /#\{label\}/g, label ) ),
- id = !url.indexOf( "#" ) ? url.replace( "#", "" ) : this._tabId( $( "a", $li )[ 0 ] );
-
- $li.addClass( "ui-state-default ui-corner-top" ).data( "destroy.tabs", true );
-
- // try to find an existing element before creating a new one
- var $panel = self.element.find( "#" + id );
- if ( !$panel.length ) {
- $panel = $( o.panelTemplate )
- .attr( "id", id )
- .data( "destroy.tabs", true );
- }
- $panel.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide" );
-
- if ( index >= this.lis.length ) {
- $li.appendTo( this.list );
- $panel.appendTo( this.list[ 0 ].parentNode );
- } else {
- $li.insertBefore( this.lis[ index ] );
- $panel.insertBefore( this.panels[ index ] );
- }
-
- o.disabled = $.map( o.disabled, function( n, i ) {
- return n >= index ? ++n : n;
- });
-
- this._tabify();
-
- if ( this.anchors.length == 1 ) {
- o.selected = 0;
- $li.addClass( "ui-tabs-selected ui-state-active" );
- $panel.removeClass( "ui-tabs-hide" );
- this.element.queue( "tabs", function() {
- self._trigger( "show", null, self._ui( self.anchors[ 0 ], self.panels[ 0 ] ) );
- });
-
- this.load( 0 );
- }
-
- this._trigger( "add", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
- return this;
- },
-
- remove: function( index ) {
- index = this._getIndex( index );
- var o = this.options,
- $li = this.lis.eq( index ).remove(),
- $panel = this.panels.eq( index ).remove();
-
- // If selected tab was removed focus tab to the right or
- // in case the last tab was removed the tab to the left.
- if ( $li.hasClass( "ui-tabs-selected" ) && this.anchors.length > 1) {
- this.select( index + ( index + 1 < this.anchors.length ? 1 : -1 ) );
- }
-
- o.disabled = $.map(
- $.grep( o.disabled, function(n, i) {
- return n != index;
- }),
- function( n, i ) {
- return n >= index ? --n : n;
- });
-
- this._tabify();
-
- this._trigger( "remove", null, this._ui( $li.find( "a" )[ 0 ], $panel[ 0 ] ) );
- return this;
- },
-
- enable: function( index ) {
- index = this._getIndex( index );
- var o = this.options;
- if ( $.inArray( index, o.disabled ) == -1 ) {
- return;
- }
-
- this.lis.eq( index ).removeClass( "ui-state-disabled" );
- o.disabled = $.grep( o.disabled, function( n, i ) {
- return n != index;
- });
-
- this._trigger( "enable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
- return this;
- },
-
- disable: function( index ) {
- index = this._getIndex( index );
- var self = this, o = this.options;
- // cannot disable already selected tab
- if ( index != o.selected ) {
- this.lis.eq( index ).addClass( "ui-state-disabled" );
-
- o.disabled.push( index );
- o.disabled.sort();
-
- this._trigger( "disable", null, this._ui( this.anchors[ index ], this.panels[ index ] ) );
- }
-
- return this;
- },
-
- select: function( index ) {
- index = this._getIndex( index );
- if ( index == -1 ) {
- if ( this.options.collapsible && this.options.selected != -1 ) {
- index = this.options.selected;
- } else {
- return this;
- }
- }
- this.anchors.eq( index ).trigger( this.options.event + ".tabs" );
- return this;
- },
-
- load: function( index ) {
- index = this._getIndex( index );
- var self = this,
- o = this.options,
- a = this.anchors.eq( index )[ 0 ],
- url = $.data( a, "load.tabs" );
-
- this.abort();
-
- // not remote or from cache
- if ( !url || this.element.queue( "tabs" ).length !== 0 && $.data( a, "cache.tabs" ) ) {
- this.element.dequeue( "tabs" );
- return;
- }
-
- // load remote from here on
- this.lis.eq( index ).addClass( "ui-state-processing" );
-
- if ( o.spinner ) {
- var span = $( "span", a );
- span.data( "label.tabs", span.html() ).html( o.spinner );
- }
-
- this.xhr = $.ajax( $.extend( {}, o.ajaxOptions, {
- url: url,
- success: function( r, s ) {
- self.element.find( self._sanitizeSelector( a.hash ) ).html( r );
-
- // take care of tab labels
- self._cleanup();
-
- if ( o.cache ) {
- $.data( a, "cache.tabs", true );
- }
-
- self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );
- try {
- o.ajaxOptions.success( r, s );
- }
- catch ( e ) {}
- },
- error: function( xhr, s, e ) {
- // take care of tab labels
- self._cleanup();
-
- self._trigger( "load", null, self._ui( self.anchors[ index ], self.panels[ index ] ) );
- try {
- // Passing index avoid a race condition when this method is
- // called after the user has selected another tab.
- // Pass the anchor that initiated this request allows
- // loadError to manipulate the tab content panel via $(a.hash)
- o.ajaxOptions.error( xhr, s, index, a );
- }
- catch ( e ) {}
- }
- } ) );
-
- // last, so that load event is fired before show...
- self.element.dequeue( "tabs" );
-
- return this;
- },
-
- abort: function() {
- // stop possibly running animations
- this.element.queue( [] );
- this.panels.stop( false, true );
-
- // "tabs" queue must not contain more than two elements,
- // which are the callbacks for the latest clicked tab...
- this.element.queue( "tabs", this.element.queue( "tabs" ).splice( -2, 2 ) );
-
- // terminate pending requests from other tabs
- if ( this.xhr ) {
- this.xhr.abort();
- delete this.xhr;
- }
-
- // take care of tab labels
- this._cleanup();
- return this;
- },
-
- url: function( index, url ) {
- this.anchors.eq( index ).removeData( "cache.tabs" ).data( "load.tabs", url );
- return this;
- },
-
- length: function() {
- return this.anchors.length;
- }
-});
-
-$.extend( $.ui.tabs, {
- version: "1.8.18"
-});
-
-/*
- * Tabs Extensions
- */
-
-/*
- * Rotate
- */
-$.extend( $.ui.tabs.prototype, {
- rotation: null,
- rotate: function( ms, continuing ) {
- var self = this,
- o = this.options;
-
- var rotate = self._rotate || ( self._rotate = function( e ) {
- clearTimeout( self.rotation );
- self.rotation = setTimeout(function() {
- var t = o.selected;
- self.select( ++t < self.anchors.length ? t : 0 );
- }, ms );
-
- if ( e ) {
- e.stopPropagation();
- }
- });
-
- var stop = self._unrotate || ( self._unrotate = !continuing
- ? function(e) {
- if (e.clientX) { // in case of a true click
- self.rotate(null);
- }
- }
- : function( e ) {
- t = o.selected;
- rotate();
- });
-
- // start rotation
- if ( ms ) {
- this.element.bind( "tabsshow", rotate );
- this.anchors.bind( o.event + ".tabs", stop );
- rotate();
- // stop rotation
- } else {
- clearTimeout( self.rotation );
- this.element.unbind( "tabsshow", rotate );
- this.anchors.unbind( o.event + ".tabs", stop );
- delete this._rotate;
- delete this._unrotate;
- }
-
- return this;
- }
-});
-
-})( jQuery );
diff --git a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.flot-0.7.js b/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.flot-0.7.js
deleted file mode 100644
index aabc544e9a9..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.flot-0.7.js
+++ /dev/null
@@ -1,2599 +0,0 @@
-/*! Javascript plotting library for jQuery, v. 0.7.
- *
- * Released under the MIT license by IOLA, December 2007.
- *
- */
-
-// first an inline dependency, jquery.colorhelpers.js, we inline it here
-// for convenience
-
-/* Plugin for jQuery for working with colors.
- *
- * Version 1.1.
- *
- * Inspiration from jQuery color animation plugin by John Resig.
- *
- * Released under the MIT license by Ole Laursen, October 2009.
- *
- * Examples:
- *
- * $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString()
- * var c = $.color.extract($("#mydiv"), 'background-color');
- * console.log(c.r, c.g, c.b, c.a);
- * $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)"
- *
- * Note that .scale() and .add() return the same modified object
- * instead of making a new one.
- *
- * V. 1.1: Fix error handling so e.g. parsing an empty string does
- * produce a color rather than just crashing.
- */
-(function(B){B.color={};B.color.make=function(F,E,C,D){var G={};G.r=F||0;G.g=E||0;G.b=C||0;G.a=D!=null?D:1;G.add=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]+=I}return G.normalize()};G.scale=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]*=I}return G.normalize()};G.toString=function(){if(G.a>=1){return"rgb("+[G.r,G.g,G.b].join(",")+")"}else{return"rgba("+[G.r,G.g,G.b,G.a].join(",")+")"}};G.normalize=function(){function H(J,K,I){return K<J?J:(K>I?I:K)}G.r=H(0,parseInt(G.r),255);G.g=H(0,parseInt(G.g),255);G.b=H(0,parseInt(G.b),255);G.a=H(0,G.a,1);return G};G.clone=function(){return B.color.make(G.r,G.b,G.g,G.a)};return G.normalize()};B.color.extract=function(D,C){var E;do{E=D.css(C).toLowerCase();if(E!=""&&E!="transparent"){break}D=D.parent()}while(!B.nodeName(D.get(0),"body"));if(E=="rgba(0, 0, 0, 0)"){E="transparent"}return B.color.parse(E)};B.color.parse=function(F){var E,C=B.color.make;if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10))}if(E=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10),parseFloat(E[4]))}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55)}if(E=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55,parseFloat(E[4]))}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return C(parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16))}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return C(parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16))}var D=B.trim(F).toLowerCase();if(D=="transparent"){return C(255,255,255,0)}else{E=A[D]||[0,0,0];return C(E[0],E[1],E[2])}};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
-
-// the actual Flot code
-(function($) {
- function Plot(placeholder, data_, options_, plugins) {
- // data is on the form:
- // [ series1, series2 ... ]
- // where series is either just the data as [ [x1, y1], [x2, y2], ... ]
- // or { data: [ [x1, y1], [x2, y2], ... ], label: "some label", ... }
-
- var series = [],
- options = {
- // the color theme used for graphs
- colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"],
- legend: {
- show: true,
- noColumns: 1, // number of colums in legend table
- labelFormatter: null, // fn: string -> string
- labelBoxBorderColor: "#ccc", // border color for the little label boxes
- container: null, // container (as jQuery object) to put legend in, null means default on top of graph
- position: "ne", // position of default legend container within plot
- margin: 5, // distance from grid edge to default legend container within plot
- backgroundColor: null, // null means auto-detect
- backgroundOpacity: 0.85 // set to 0 to avoid background
- },
- xaxis: {
- show: null, // null = auto-detect, true = always, false = never
- position: "bottom", // or "top"
- mode: null, // null or "time"
- color: null, // base color, labels, ticks
- tickColor: null, // possibly different color of ticks, e.g. "rgba(0,0,0,0.15)"
- transform: null, // null or f: number -> number to transform axis
- inverseTransform: null, // if transform is set, this should be the inverse function
- min: null, // min. value to show, null means set automatically
- max: null, // max. value to show, null means set automatically
- autoscaleMargin: null, // margin in % to add if auto-setting min/max
- ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks
- tickFormatter: null, // fn: number -> string
- labelWidth: null, // size of tick labels in pixels
- labelHeight: null,
- reserveSpace: null, // whether to reserve space even if axis isn't shown
- tickLength: null, // size in pixels of ticks, or "full" for whole line
- alignTicksWithAxis: null, // axis number or null for no sync
-
- // mode specific options
- tickDecimals: null, // no. of decimals, null means auto
- tickSize: null, // number or [number, "unit"]
- minTickSize: null, // number or [number, "unit"]
- monthNames: null, // list of names of months
- timeformat: null, // format string to use
- twelveHourClock: false // 12 or 24 time in time mode
- },
- yaxis: {
- autoscaleMargin: 0.02,
- position: "left" // or "right"
- },
- xaxes: [],
- yaxes: [],
- series: {
- points: {
- show: false,
- radius: 3,
- lineWidth: 2, // in pixels
- fill: true,
- fillColor: "#ffffff",
- symbol: "circle" // or callback
- },
- lines: {
- // we don't put in show: false so we can see
- // whether lines were actively disabled
- lineWidth: 2, // in pixels
- fill: false,
- fillColor: null,
- steps: false
- },
- bars: {
- show: false,
- lineWidth: 2, // in pixels
- barWidth: 1, // in units of the x axis
- fill: true,
- fillColor: null,
- align: "left", // or "center"
- horizontal: false
- },
- shadowSize: 3
- },
- grid: {
- show: true,
- aboveData: false,
- color: "#545454", // primary color used for outline and labels
- backgroundColor: null, // null for transparent, else color
- borderColor: null, // set if different from the grid color
- tickColor: null, // color for the ticks, e.g. "rgba(0,0,0,0.15)"
- labelMargin: 5, // in pixels
- axisMargin: 8, // in pixels
- borderWidth: 2, // in pixels
- minBorderMargin: null, // in pixels, null means taken from points radius
- markings: null, // array of ranges or fn: axes -> array of ranges
- markingsColor: "#f4f4f4",
- markingsLineWidth: 2,
- // interactive stuff
- clickable: false,
- hoverable: false,
- autoHighlight: true, // highlight in case mouse is near
- mouseActiveRadius: 10 // how far the mouse can be away to activate an item
- },
- hooks: {}
- },
- canvas = null, // the canvas for the plot itself
- overlay = null, // canvas for interactive stuff on top of plot
- eventHolder = null, // jQuery object that events should be bound to
- ctx = null, octx = null,
- xaxes = [], yaxes = [],
- plotOffset = { left: 0, right: 0, top: 0, bottom: 0},
- canvasWidth = 0, canvasHeight = 0,
- plotWidth = 0, plotHeight = 0,
- hooks = {
- processOptions: [],
- processRawData: [],
- processDatapoints: [],
- drawSeries: [],
- draw: [],
- bindEvents: [],
- drawOverlay: [],
- shutdown: []
- },
- plot = this;
-
- // public functions
- plot.setData = setData;
- plot.setupGrid = setupGrid;
- plot.draw = draw;
- plot.getPlaceholder = function() { return placeholder; };
- plot.getCanvas = function() { return canvas; };
- plot.getPlotOffset = function() { return plotOffset; };
- plot.width = function () { return plotWidth; };
- plot.height = function () { return plotHeight; };
- plot.offset = function () {
- var o = eventHolder.offset();
- o.left += plotOffset.left;
- o.top += plotOffset.top;
- return o;
- };
- plot.getData = function () { return series; };
- plot.getAxes = function () {
- var res = {}, i;
- $.each(xaxes.concat(yaxes), function (_, axis) {
- if (axis)
- res[axis.direction + (axis.n != 1 ? axis.n : "") + "axis"] = axis;
- });
- return res;
- };
- plot.getXAxes = function () { return xaxes; };
- plot.getYAxes = function () { return yaxes; };
- plot.c2p = canvasToAxisCoords;
- plot.p2c = axisToCanvasCoords;
- plot.getOptions = function () { return options; };
- plot.highlight = highlight;
- plot.unhighlight = unhighlight;
- plot.triggerRedrawOverlay = triggerRedrawOverlay;
- plot.pointOffset = function(point) {
- return {
- left: parseInt(xaxes[axisNumber(point, "x") - 1].p2c(+point.x) + plotOffset.left),
- top: parseInt(yaxes[axisNumber(point, "y") - 1].p2c(+point.y) + plotOffset.top)
- };
- };
- plot.shutdown = shutdown;
- plot.resize = function () {
- getCanvasDimensions();
- resizeCanvas(canvas);
- resizeCanvas(overlay);
- };
-
- // public attributes
- plot.hooks = hooks;
-
- // initialize
- initPlugins(plot);
- parseOptions(options_);
- setupCanvases();
- setData(data_);
- setupGrid();
- draw();
- bindEvents();
-
-
- function executeHooks(hook, args) {
- args = [plot].concat(args);
- for (var i = 0; i < hook.length; ++i)
- hook[i].apply(this, args);
- }
-
- function initPlugins() {
- for (var i = 0; i < plugins.length; ++i) {
- var p = plugins[i];
- p.init(plot);
- if (p.options)
- $.extend(true, options, p.options);
- }
- }
-
- function parseOptions(opts) {
- var i;
-
- $.extend(true, options, opts);
-
- if (options.xaxis.color == null)
- options.xaxis.color = options.grid.color;
- if (options.yaxis.color == null)
- options.yaxis.color = options.grid.color;
-
- if (options.xaxis.tickColor == null) // backwards-compatibility
- options.xaxis.tickColor = options.grid.tickColor;
- if (options.yaxis.tickColor == null) // backwards-compatibility
- options.yaxis.tickColor = options.grid.tickColor;
-
- if (options.grid.borderColor == null)
- options.grid.borderColor = options.grid.color;
- if (options.grid.tickColor == null)
- options.grid.tickColor = $.color.parse(options.grid.color).scale('a', 0.22).toString();
-
- // fill in defaults in axes, copy at least always the
- // first as the rest of the code assumes it'll be there
- for (i = 0; i < Math.max(1, options.xaxes.length); ++i)
- options.xaxes[i] = $.extend(true, {}, options.xaxis, options.xaxes[i]);
- for (i = 0; i < Math.max(1, options.yaxes.length); ++i)
- options.yaxes[i] = $.extend(true, {}, options.yaxis, options.yaxes[i]);
-
- // backwards compatibility, to be removed in future
- if (options.xaxis.noTicks && options.xaxis.ticks == null)
- options.xaxis.ticks = options.xaxis.noTicks;
- if (options.yaxis.noTicks && options.yaxis.ticks == null)
- options.yaxis.ticks = options.yaxis.noTicks;
- if (options.x2axis) {
- options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis);
- options.xaxes[1].position = "top";
- }
- if (options.y2axis) {
- options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis);
- options.yaxes[1].position = "right";
- }
- if (options.grid.coloredAreas)
- options.grid.markings = options.grid.coloredAreas;
- if (options.grid.coloredAreasColor)
- options.grid.markingsColor = options.grid.coloredAreasColor;
- if (options.lines)
- $.extend(true, options.series.lines, options.lines);
- if (options.points)
- $.extend(true, options.series.points, options.points);
- if (options.bars)
- $.extend(true, options.series.bars, options.bars);
- if (options.shadowSize != null)
- options.series.shadowSize = options.shadowSize;
-
- // save options on axes for future reference
- for (i = 0; i < options.xaxes.length; ++i)
- getOrCreateAxis(xaxes, i + 1).options = options.xaxes[i];
- for (i = 0; i < options.yaxes.length; ++i)
- getOrCreateAxis(yaxes, i + 1).options = options.yaxes[i];
-
- // add hooks from options
- for (var n in hooks)
- if (options.hooks[n] && options.hooks[n].length)
- hooks[n] = hooks[n].concat(options.hooks[n]);
-
- executeHooks(hooks.processOptions, [options]);
- }
-
- function setData(d) {
- series = parseData(d);
- fillInSeriesOptions();
- processData();
- }
-
- function parseData(d) {
- var res = [];
- for (var i = 0; i < d.length; ++i) {
- var s = $.extend(true, {}, options.series);
-
- if (d[i].data != null) {
- s.data = d[i].data; // move the data instead of deep-copy
- delete d[i].data;
-
- $.extend(true, s, d[i]);
-
- d[i].data = s.data;
- }
- else
- s.data = d[i];
- res.push(s);
- }
-
- return res;
- }
-
- function axisNumber(obj, coord) {
- var a = obj[coord + "axis"];
- if (typeof a == "object") // if we got a real axis, extract number
- a = a.n;
- if (typeof a != "number")
- a = 1; // default to first axis
- return a;
- }
-
- function allAxes() {
- // return flat array without annoying null entries
- return $.grep(xaxes.concat(yaxes), function (a) { return a; });
- }
-
- function canvasToAxisCoords(pos) {
- // return an object with x/y corresponding to all used axes
- var res = {}, i, axis;
- for (i = 0; i < xaxes.length; ++i) {
- axis = xaxes[i];
- if (axis && axis.used)
- res["x" + axis.n] = axis.c2p(pos.left);
- }
-
- for (i = 0; i < yaxes.length; ++i) {
- axis = yaxes[i];
- if (axis && axis.used)
- res["y" + axis.n] = axis.c2p(pos.top);
- }
-
- if (res.x1 !== undefined)
- res.x = res.x1;
- if (res.y1 !== undefined)
- res.y = res.y1;
-
- return res;
- }
-
- function axisToCanvasCoords(pos) {
- // get canvas coords from the first pair of x/y found in pos
- var res = {}, i, axis, key;
-
- for (i = 0; i < xaxes.length; ++i) {
- axis = xaxes[i];
- if (axis && axis.used) {
- key = "x" + axis.n;
- if (pos[key] == null && axis.n == 1)
- key = "x";
-
- if (pos[key] != null) {
- res.left = axis.p2c(pos[key]);
- break;
- }
- }
- }
-
- for (i = 0; i < yaxes.length; ++i) {
- axis = yaxes[i];
- if (axis && axis.used) {
- key = "y" + axis.n;
- if (pos[key] == null && axis.n == 1)
- key = "y";
-
- if (pos[key] != null) {
- res.top = axis.p2c(pos[key]);
- break;
- }
- }
- }
-
- return res;
- }
-
- function getOrCreateAxis(axes, number) {
- if (!axes[number - 1])
- axes[number - 1] = {
- n: number, // save the number for future reference
- direction: axes == xaxes ? "x" : "y",
- options: $.extend(true, {}, axes == xaxes ? options.xaxis : options.yaxis)
- };
-
- return axes[number - 1];
- }
-
- function fillInSeriesOptions() {
- var i;
-
- // collect what we already got of colors
- var neededColors = series.length,
- usedColors = [],
- assignedColors = [];
- for (i = 0; i < series.length; ++i) {
- var sc = series[i].color;
- if (sc != null) {
- --neededColors;
- if (typeof sc == "number")
- assignedColors.push(sc);
- else
- usedColors.push($.color.parse(series[i].color));
- }
- }
-
- // we might need to generate more colors if higher indices
- // are assigned
- for (i = 0; i < assignedColors.length; ++i) {
- neededColors = Math.max(neededColors, assignedColors[i] + 1);
- }
-
- // produce colors as needed
- var colors = [], variation = 0;
- i = 0;
- while (colors.length < neededColors) {
- var c;
- if (options.colors.length == i) // check degenerate case
- c = $.color.make(100, 100, 100);
- else
- c = $.color.parse(options.colors[i]);
-
- // vary color if needed
- var sign = variation % 2 == 1 ? -1 : 1;
- c.scale('rgb', 1 + sign * Math.ceil(variation / 2) * 0.2)
-
- // FIXME: if we're getting to close to something else,
- // we should probably skip this one
- colors.push(c);
-
- ++i;
- if (i >= options.colors.length) {
- i = 0;
- ++variation;
- }
- }
-
- // fill in the options
- var colori = 0, s;
- for (i = 0; i < series.length; ++i) {
- s = series[i];
-
- // assign colors
- if (s.color == null) {
- s.color = colors[colori].toString();
- ++colori;
- }
- else if (typeof s.color == "number")
- s.color = colors[s.color].toString();
-
- // turn on lines automatically in case nothing is set
- if (s.lines.show == null) {
- var v, show = true;
- for (v in s)
- if (s[v] && s[v].show) {
- show = false;
- break;
- }
- if (show)
- s.lines.show = true;
- }
-
- // setup axes
- s.xaxis = getOrCreateAxis(xaxes, axisNumber(s, "x"));
- s.yaxis = getOrCreateAxis(yaxes, axisNumber(s, "y"));
- }
- }
-
- function processData() {
- var topSentry = Number.POSITIVE_INFINITY,
- bottomSentry = Number.NEGATIVE_INFINITY,
- fakeInfinity = Number.MAX_VALUE,
- i, j, k, m, length,
- s, points, ps, x, y, axis, val, f, p;
-
- function updateAxis(axis, min, max) {
- if (min < axis.datamin && min != -fakeInfinity)
- axis.datamin = min;
- if (max > axis.datamax && max != fakeInfinity)
- axis.datamax = max;
- }
-
- $.each(allAxes(), function (_, axis) {
- // init axis
- axis.datamin = topSentry;
- axis.datamax = bottomSentry;
- axis.used = false;
- });
-
- for (i = 0; i < series.length; ++i) {
- s = series[i];
- s.datapoints = { points: [] };
-
- executeHooks(hooks.processRawData, [ s, s.data, s.datapoints ]);
- }
-
- // first pass: clean and copy data
- for (i = 0; i < series.length; ++i) {
- s = series[i];
-
- var data = s.data, format = s.datapoints.format;
-
- if (!format) {
- format = [];
- // find out how to copy
- format.push({ x: true, number: true, required: true });
- format.push({ y: true, number: true, required: true });
-
- if (s.bars.show || (s.lines.show && s.lines.fill)) {
- format.push({ y: true, number: true, required: false, defaultValue: 0 });
- if (s.bars.horizontal) {
- delete format[format.length - 1].y;
- format[format.length - 1].x = true;
- }
- }
-
- s.datapoints.format = format;
- }
-
- if (s.datapoints.pointsize != null)
- continue; // already filled in
-
- s.datapoints.pointsize = format.length;
-
- ps = s.datapoints.pointsize;
- points = s.datapoints.points;
-
- insertSteps = s.lines.show && s.lines.steps;
- s.xaxis.used = s.yaxis.used = true;
-
- for (j = k = 0; j < data.length; ++j, k += ps) {
- p = data[j];
-
- var nullify = p == null;
- if (!nullify) {
- for (m = 0; m < ps; ++m) {
- val = p[m];
- f = format[m];
-
- if (f) {
- if (f.number && val != null) {
- val = +val; // convert to number
- if (isNaN(val))
- val = null;
- else if (val == Infinity)
- val = fakeInfinity;
- else if (val == -Infinity)
- val = -fakeInfinity;
- }
-
- if (val == null) {
- if (f.required)
- nullify = true;
-
- if (f.defaultValue != null)
- val = f.defaultValue;
- }
- }
-
- points[k + m] = val;
- }
- }
-
- if (nullify) {
- for (m = 0; m < ps; ++m) {
- val = points[k + m];
- if (val != null) {
- f = format[m];
- // extract min/max info
- if (f.x)
- updateAxis(s.xaxis, val, val);
- if (f.y)
- updateAxis(s.yaxis, val, val);
- }
- points[k + m] = null;
- }
- }
- else {
- // a little bit of line specific stuff that
- // perhaps shouldn't be here, but lacking
- // better means...
- if (insertSteps && k > 0
- && points[k - ps] != null
- && points[k - ps] != points[k]
- && points[k - ps + 1] != points[k + 1]) {
- // copy the point to make room for a middle point
- for (m = 0; m < ps; ++m)
- points[k + ps + m] = points[k + m];
-
- // middle point has same y
- points[k + 1] = points[k - ps + 1];
-
- // we've added a point, better reflect that
- k += ps;
- }
- }
- }
- }
-
- // give the hooks a chance to run
- for (i = 0; i < series.length; ++i) {
- s = series[i];
-
- executeHooks(hooks.processDatapoints, [ s, s.datapoints]);
- }
-
- // second pass: find datamax/datamin for auto-scaling
- for (i = 0; i < series.length; ++i) {
- s = series[i];
- points = s.datapoints.points,
- ps = s.datapoints.pointsize;
-
- var xmin = topSentry, ymin = topSentry,
- xmax = bottomSentry, ymax = bottomSentry;
-
- for (j = 0; j < points.length; j += ps) {
- if (points[j] == null)
- continue;
-
- for (m = 0; m < ps; ++m) {
- val = points[j + m];
- f = format[m];
- if (!f || val == fakeInfinity || val == -fakeInfinity)
- continue;
-
- if (f.x) {
- if (val < xmin)
- xmin = val;
- if (val > xmax)
- xmax = val;
- }
- if (f.y) {
- if (val < ymin)
- ymin = val;
- if (val > ymax)
- ymax = val;
- }
- }
- }
-
- if (s.bars.show) {
- // make sure we got room for the bar on the dancing floor
- var delta = s.bars.align == "left" ? 0 : -s.bars.barWidth/2;
- if (s.bars.horizontal) {
- ymin += delta;
- ymax += delta + s.bars.barWidth;
- }
- else {
- xmin += delta;
- xmax += delta + s.bars.barWidth;
- }
- }
-
- updateAxis(s.xaxis, xmin, xmax);
- updateAxis(s.yaxis, ymin, ymax);
- }
-
- $.each(allAxes(), function (_, axis) {
- if (axis.datamin == topSentry)
- axis.datamin = null;
- if (axis.datamax == bottomSentry)
- axis.datamax = null;
- });
- }
-
- function makeCanvas(skipPositioning, cls) {
- var c = document.createElement('canvas');
- c.className = cls;
- c.width = canvasWidth;
- c.height = canvasHeight;
-
- if (!skipPositioning)
- $(c).css({ position: 'absolute', left: 0, top: 0 });
-
- $(c).appendTo(placeholder);
-
- if (!c.getContext) // excanvas hack
- c = window.G_vmlCanvasManager.initElement(c);
-
- // used for resetting in case we get replotted
- c.getContext("2d").save();
-
- return c;
- }
-
- function getCanvasDimensions() {
- canvasWidth = placeholder.width();
- canvasHeight = placeholder.height();
-
- if (canvasWidth <= 0 || canvasHeight <= 0)
- throw "Invalid dimensions for plot, width = " + canvasWidth + ", height = " + canvasHeight;
- }
-
- function resizeCanvas(c) {
- // resizing should reset the state (excanvas seems to be
- // buggy though)
- if (c.width != canvasWidth)
- c.width = canvasWidth;
-
- if (c.height != canvasHeight)
- c.height = canvasHeight;
-
- // so try to get back to the initial state (even if it's
- // gone now, this should be safe according to the spec)
- var cctx = c.getContext("2d");
- cctx.restore();
-
- // and save again
- cctx.save();
- }
-
- function setupCanvases() {
- var reused,
- existingCanvas = placeholder.children("canvas.base"),
- existingOverlay = placeholder.children("canvas.overlay");
-
- if (existingCanvas.length == 0 || existingOverlay == 0) {
- // init everything
-
- placeholder.html(""); // make sure placeholder is clear
-
- placeholder.css({ padding: 0 }); // padding messes up the positioning
-
- if (placeholder.css("position") == 'static')
- placeholder.css("position", "relative"); // for positioning labels and overlay
-
- getCanvasDimensions();
-
- canvas = makeCanvas(true, "base");
- overlay = makeCanvas(false, "overlay"); // overlay canvas for interactive features
-
- reused = false;
- }
- else {
- // reuse existing elements
-
- canvas = existingCanvas.get(0);
- overlay = existingOverlay.get(0);
-
- reused = true;
- }
-
- ctx = canvas.getContext("2d");
- octx = overlay.getContext("2d");
-
- // we include the canvas in the event holder too, because IE 7
- // sometimes has trouble with the stacking order
- eventHolder = $([overlay, canvas]);
-
- if (reused) {
- // run shutdown in the old plot object
- placeholder.data("plot").shutdown();
-
- // reset reused canvases
- plot.resize();
-
- // make sure overlay pixels are cleared (canvas is cleared when we redraw)
- octx.clearRect(0, 0, canvasWidth, canvasHeight);
-
- // then whack any remaining obvious garbage left
- eventHolder.unbind();
- placeholder.children().not([canvas, overlay]).remove();
- }
-
- // save in case we get replotted
- placeholder.data("plot", plot);
- }
-
- function bindEvents() {
- // bind events
- if (options.grid.hoverable) {
- eventHolder.mousemove(onMouseMove);
- eventHolder.mouseleave(onMouseLeave);
- }
-
- if (options.grid.clickable)
- eventHolder.click(onClick);
-
- executeHooks(hooks.bindEvents, [eventHolder]);
- }
-
- function shutdown() {
- if (redrawTimeout)
- clearTimeout(redrawTimeout);
-
- eventHolder.unbind("mousemove", onMouseMove);
- eventHolder.unbind("mouseleave", onMouseLeave);
- eventHolder.unbind("click", onClick);
-
- executeHooks(hooks.shutdown, [eventHolder]);
- }
-
- function setTransformationHelpers(axis) {
- // set helper functions on the axis, assumes plot area
- // has been computed already
-
- function identity(x) { return x; }
-
- var s, m, t = axis.options.transform || identity,
- it = axis.options.inverseTransform;
-
- // precompute how much the axis is scaling a point
- // in canvas space
- if (axis.direction == "x") {
- s = axis.scale = plotWidth / Math.abs(t(axis.max) - t(axis.min));
- m = Math.min(t(axis.max), t(axis.min));
- }
- else {
- s = axis.scale = plotHeight / Math.abs(t(axis.max) - t(axis.min));
- s = -s;
- m = Math.max(t(axis.max), t(axis.min));
- }
-
- // data point to canvas coordinate
- if (t == identity) // slight optimization
- axis.p2c = function (p) { return (p - m) * s; };
- else
- axis.p2c = function (p) { return (t(p) - m) * s; };
- // canvas coordinate to data point
- if (!it)
- axis.c2p = function (c) { return m + c / s; };
- else
- axis.c2p = function (c) { return it(m + c / s); };
- }
-
- function measureTickLabels(axis) {
- var opts = axis.options, i, ticks = axis.ticks || [], labels = [],
- l, w = opts.labelWidth, h = opts.labelHeight, dummyDiv;
-
- function makeDummyDiv(labels, width) {
- return $('<div style="position:absolute;top:-10000px;' + width + 'font-size:smaller">' +
- '<div class="' + axis.direction + 'Axis ' + axis.direction + axis.n + 'Axis">'
- + labels.join("") + '</div></div>')
- .appendTo(placeholder);
- }
-
- if (axis.direction == "x") {
- // to avoid measuring the widths of the labels (it's slow), we
- // construct fixed-size boxes and put the labels inside
- // them, we don't need the exact figures and the
- // fixed-size box content is easy to center
- if (w == null)
- w = Math.floor(canvasWidth / (ticks.length > 0 ? ticks.length : 1));
-
- // measure x label heights
- if (h == null) {
- labels = [];
- for (i = 0; i < ticks.length; ++i) {
- l = ticks[i].label;
- if (l)
- labels.push('<div class="tickLabel" style="float:left;width:' + w + 'px">' + l + '</div>');
- }
-
- if (labels.length > 0) {
- // stick them all in the same div and measure
- // collective height
- labels.push('<div style="clear:left"></div>');
- dummyDiv = makeDummyDiv(labels, "width:10000px;");
- h = dummyDiv.height();
- dummyDiv.remove();
- }
- }
- }
- else if (w == null || h == null) {
- // calculate y label dimensions
- for (i = 0; i < ticks.length; ++i) {
- l = ticks[i].label;
- if (l)
- labels.push('<div class="tickLabel">' + l + '</div>');
- }
-
- if (labels.length > 0) {
- dummyDiv = makeDummyDiv(labels, "");
- if (w == null)
- w = dummyDiv.children().width();
- if (h == null)
- h = dummyDiv.find("div.tickLabel").height();
- dummyDiv.remove();
- }
- }
-
- if (w == null)
- w = 0;
- if (h == null)
- h = 0;
-
- axis.labelWidth = w;
- axis.labelHeight = h;
- }
-
- function allocateAxisBoxFirstPhase(axis) {
- // find the bounding box of the axis by looking at label
- // widths/heights and ticks, make room by diminishing the
- // plotOffset
-
- var lw = axis.labelWidth,
- lh = axis.labelHeight,
- pos = axis.options.position,
- tickLength = axis.options.tickLength,
- axismargin = options.grid.axisMargin,
- padding = options.grid.labelMargin,
- all = axis.direction == "x" ? xaxes : yaxes,
- index;
-
- // determine axis margin
- var samePosition = $.grep(all, function (a) {
- return a && a.options.position == pos && a.reserveSpace;
- });
- if ($.inArray(axis, samePosition) == samePosition.length - 1)
- axismargin = 0; // outermost
-
- // determine tick length - if we're innermost, we can use "full"
- if (tickLength == null)
- tickLength = "full";
-
- var sameDirection = $.grep(all, function (a) {
- return a && a.reserveSpace;
- });
-
- var innermost = $.inArray(axis, sameDirection) == 0;
- if (!innermost && tickLength == "full")
- tickLength = 5;
-
- if (!isNaN(+tickLength))
- padding += +tickLength;
-
- // compute box
- if (axis.direction == "x") {
- lh += padding;
-
- if (pos == "bottom") {
- plotOffset.bottom += lh + axismargin;
- axis.box = { top: canvasHeight - plotOffset.bottom, height: lh };
- }
- else {
- axis.box = { top: plotOffset.top + axismargin, height: lh };
- plotOffset.top += lh + axismargin;
- }
- }
- else {
- lw += padding;
-
- if (pos == "left") {
- axis.box = { left: plotOffset.left + axismargin, width: lw };
- plotOffset.left += lw + axismargin;
- }
- else {
- plotOffset.right += lw + axismargin;
- axis.box = { left: canvasWidth - plotOffset.right, width: lw };
- }
- }
-
- // save for future reference
- axis.position = pos;
- axis.tickLength = tickLength;
- axis.box.padding = padding;
- axis.innermost = innermost;
- }
-
- function allocateAxisBoxSecondPhase(axis) {
- // set remaining bounding box coordinates
- if (axis.direction == "x") {
- axis.box.left = plotOffset.left;
- axis.box.width = plotWidth;
- }
- else {
- axis.box.top = plotOffset.top;
- axis.box.height = plotHeight;
- }
- }
-
- function setupGrid() {
- var i, axes = allAxes();
-
- // first calculate the plot and axis box dimensions
-
- $.each(axes, function (_, axis) {
- axis.show = axis.options.show;
- if (axis.show == null)
- axis.show = axis.used; // by default an axis is visible if it's got data
-
- axis.reserveSpace = axis.show || axis.options.reserveSpace;
-
- setRange(axis);
- });
-
- allocatedAxes = $.grep(axes, function (axis) { return axis.reserveSpace; });
-
- plotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = 0;
- if (options.grid.show) {
- $.each(allocatedAxes, function (_, axis) {
- // make the ticks
- setupTickGeneration(axis);
- setTicks(axis);
- snapRangeToTicks(axis, axis.ticks);
-
- // find labelWidth/Height for axis
- measureTickLabels(axis);
- });
-
- // with all dimensions in house, we can compute the
- // axis boxes, start from the outside (reverse order)
- for (i = allocatedAxes.length - 1; i >= 0; --i)
- allocateAxisBoxFirstPhase(allocatedAxes[i]);
-
- // make sure we've got enough space for things that
- // might stick out
- var minMargin = options.grid.minBorderMargin;
- if (minMargin == null) {
- minMargin = 0;
- for (i = 0; i < series.length; ++i)
- minMargin = Math.max(minMargin, series[i].points.radius + series[i].points.lineWidth/2);
- }
-
- for (var a in plotOffset) {
- plotOffset[a] += options.grid.borderWidth;
- plotOffset[a] = Math.max(minMargin, plotOffset[a]);
- }
- }
-
- plotWidth = canvasWidth - plotOffset.left - plotOffset.right;
- plotHeight = canvasHeight - plotOffset.bottom - plotOffset.top;
-
- // now we got the proper plotWidth/Height, we can compute the scaling
- $.each(axes, function (_, axis) {
- setTransformationHelpers(axis);
- });
-
- if (options.grid.show) {
- $.each(allocatedAxes, function (_, axis) {
- allocateAxisBoxSecondPhase(axis);
- });
-
- insertAxisLabels();
- }
-
- insertLegend();
- }
-
- function setRange(axis) {
- var opts = axis.options,
- min = +(opts.min != null ? opts.min : axis.datamin),
- max = +(opts.max != null ? opts.max : axis.datamax),
- delta = max - min;
-
- if (delta == 0.0) {
- // degenerate case
- var widen = max == 0 ? 1 : 0.01;
-
- if (opts.min == null)
- min -= widen;
- // always widen max if we couldn't widen min to ensure we
- // don't fall into min == max which doesn't work
- if (opts.max == null || opts.min != null)
- max += widen;
- }
- else {
- // consider autoscaling
- var margin = opts.autoscaleMargin;
- if (margin != null) {
- if (opts.min == null) {
- min -= delta * margin;
- // make sure we don't go below zero if all values
- // are positive
- if (min < 0 && axis.datamin != null && axis.datamin >= 0)
- min = 0;
- }
- if (opts.max == null) {
- max += delta * margin;
- if (max > 0 && axis.datamax != null && axis.datamax <= 0)
- max = 0;
- }
- }
- }
- axis.min = min;
- axis.max = max;
- }
-
- function setupTickGeneration(axis) {
- var opts = axis.options;
-
- // estimate number of ticks
- var noTicks;
- if (typeof opts.ticks == "number" && opts.ticks > 0)
- noTicks = opts.ticks;
- else
- // heuristic based on the model a*sqrt(x) fitted to
- // some data points that seemed reasonable
- noTicks = 0.3 * Math.sqrt(axis.direction == "x" ? canvasWidth : canvasHeight);
-
- var delta = (axis.max - axis.min) / noTicks,
- size, generator, unit, formatter, i, magn, norm;
-
- if (opts.mode == "time") {
- // pretty handling of time
-
- // map of app. size of time units in milliseconds
- var timeUnitSize = {
- "second": 1000,
- "minute": 60 * 1000,
- "hour": 60 * 60 * 1000,
- "day": 24 * 60 * 60 * 1000,
- "month": 30 * 24 * 60 * 60 * 1000,
- "year": 365.2425 * 24 * 60 * 60 * 1000
- };
-
-
- // the allowed tick sizes, after 1 year we use
- // an integer algorithm
- var spec = [
- [1, "second"], [2, "second"], [5, "second"], [10, "second"],
- [30, "second"],
- [1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
- [30, "minute"],
- [1, "hour"], [2, "hour"], [4, "hour"],
- [8, "hour"], [12, "hour"],
- [1, "day"], [2, "day"], [3, "day"],
- [0.25, "month"], [0.5, "month"], [1, "month"],
- [2, "month"], [3, "month"], [6, "month"],
- [1, "year"]
- ];
-
- var minSize = 0;
- if (opts.minTickSize != null) {
- if (typeof opts.tickSize == "number")
- minSize = opts.tickSize;
- else
- minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];
- }
-
- for (var i = 0; i < spec.length - 1; ++i)
- if (delta < (spec[i][0] * timeUnitSize[spec[i][1]]
- + spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2
- && spec[i][0] * timeUnitSize[spec[i][1]] >= minSize)
- break;
- size = spec[i][0];
- unit = spec[i][1];
-
- // special-case the possibility of several years
- if (unit == "year") {
- magn = Math.pow(10, Math.floor(Math.log(delta / timeUnitSize.year) / Math.LN10));
- norm = (delta / timeUnitSize.year) / magn;
- if (norm < 1.5)
- size = 1;
- else if (norm < 3)
- size = 2;
- else if (norm < 7.5)
- size = 5;
- else
- size = 10;
-
- size *= magn;
- }
-
- axis.tickSize = opts.tickSize || [size, unit];
-
- generator = function(axis) {
- var ticks = [],
- tickSize = axis.tickSize[0], unit = axis.tickSize[1],
- d = new Date(axis.min);
-
- var step = tickSize * timeUnitSize[unit];
-
- if (unit == "second")
- d.setUTCSeconds(floorInBase(d.getUTCSeconds(), tickSize));
- if (unit == "minute")
- d.setUTCMinutes(floorInBase(d.getUTCMinutes(), tickSize));
- if (unit == "hour")
- d.setUTCHours(floorInBase(d.getUTCHours(), tickSize));
- if (unit == "month")
- d.setUTCMonth(floorInBase(d.getUTCMonth(), tickSize));
- if (unit == "year")
- d.setUTCFullYear(floorInBase(d.getUTCFullYear(), tickSize));
-
- // reset smaller components
- d.setUTCMilliseconds(0);
- if (step >= timeUnitSize.minute)
- d.setUTCSeconds(0);
- if (step >= timeUnitSize.hour)
- d.setUTCMinutes(0);
- if (step >= timeUnitSize.day)
- d.setUTCHours(0);
- if (step >= timeUnitSize.day * 4)
- d.setUTCDate(1);
- if (step >= timeUnitSize.year)
- d.setUTCMonth(0);
-
-
- var carry = 0, v = Number.NaN, prev;
- do {
- prev = v;
- v = d.getTime();
- ticks.push(v);
- if (unit == "month") {
- if (tickSize < 1) {
- // a bit complicated - we'll divide the month
- // up but we need to take care of fractions
- // so we don't end up in the middle of a day
- d.setUTCDate(1);
- var start = d.getTime();
- d.setUTCMonth(d.getUTCMonth() + 1);
- var end = d.getTime();
- d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);
- carry = d.getUTCHours();
- d.setUTCHours(0);
- }
- else
- d.setUTCMonth(d.getUTCMonth() + tickSize);
- }
- else if (unit == "year") {
- d.setUTCFullYear(d.getUTCFullYear() + tickSize);
- }
- else
- d.setTime(v + step);
- } while (v < axis.max && v != prev);
-
- return ticks;
- };
-
- formatter = function (v, axis) {
- var d = new Date(v);
-
- // first check global format
- if (opts.timeformat != null)
- return $.plot.formatDate(d, opts.timeformat, opts.monthNames);
-
- var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];
- var span = axis.max - axis.min;
- var suffix = (opts.twelveHourClock) ? " %p" : "";
-
- if (t < timeUnitSize.minute)
- fmt = "%h:%M:%S" + suffix;
- else if (t < timeUnitSize.day) {
- if (span < 2 * timeUnitSize.day)
- fmt = "%h:%M" + suffix;
- else
- fmt = "%b %d %h:%M" + suffix;
- }
- else if (t < timeUnitSize.month)
- fmt = "%b %d";
- else if (t < timeUnitSize.year) {
- if (span < timeUnitSize.year)
- fmt = "%b";
- else
- fmt = "%b %y";
- }
- else
- fmt = "%y";
-
- return $.plot.formatDate(d, fmt, opts.monthNames);
- };
- }
- else {
- // pretty rounding of base-10 numbers
- var maxDec = opts.tickDecimals;
- var dec = -Math.floor(Math.log(delta) / Math.LN10);
- if (maxDec != null && dec > maxDec)
- dec = maxDec;
-
- magn = Math.pow(10, -dec);
- norm = delta / magn; // norm is between 1.0 and 10.0
-
- if (norm < 1.5)
- size = 1;
- else if (norm < 3) {
- size = 2;
- // special case for 2.5, requires an extra decimal
- if (norm > 2.25 && (maxDec == null || dec + 1 <= maxDec)) {
- size = 2.5;
- ++dec;
- }
- }
- else if (norm < 7.5)
- size = 5;
- else
- size = 10;
-
- size *= magn;
-
- if (opts.minTickSize != null && size < opts.minTickSize)
- size = opts.minTickSize;
-
- axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec);
- axis.tickSize = opts.tickSize || size;
-
- generator = function (axis) {
- var ticks = [];
-
- // spew out all possible ticks
- var start = floorInBase(axis.min, axis.tickSize),
- i = 0, v = Number.NaN, prev;
- do {
- prev = v;
- v = start + i * axis.tickSize;
- ticks.push(v);
- ++i;
- } while (v < axis.max && v != prev);
- return ticks;
- };
-
- formatter = function (v, axis) {
- return v.toFixed(axis.tickDecimals);
- };
- }
-
- if (opts.alignTicksWithAxis != null) {
- var otherAxis = (axis.direction == "x" ? xaxes : yaxes)[opts.alignTicksWithAxis - 1];
- if (otherAxis && otherAxis.used && otherAxis != axis) {
- // consider snapping min/max to outermost nice ticks
- var niceTicks = generator(axis);
- if (niceTicks.length > 0) {
- if (opts.min == null)
- axis.min = Math.min(axis.min, niceTicks[0]);
- if (opts.max == null && niceTicks.length > 1)
- axis.max = Math.max(axis.max, niceTicks[niceTicks.length - 1]);
- }
-
- generator = function (axis) {
- // copy ticks, scaled to this axis
- var ticks = [], v, i;
- for (i = 0; i < otherAxis.ticks.length; ++i) {
- v = (otherAxis.ticks[i].v - otherAxis.min) / (otherAxis.max - otherAxis.min);
- v = axis.min + v * (axis.max - axis.min);
- ticks.push(v);
- }
- return ticks;
- };
-
- // we might need an extra decimal since forced
- // ticks don't necessarily fit naturally
- if (axis.mode != "time" && opts.tickDecimals == null) {
- var extraDec = Math.max(0, -Math.floor(Math.log(delta) / Math.LN10) + 1),
- ts = generator(axis);
-
- // only proceed if the tick interval rounded
- // with an extra decimal doesn't give us a
- // zero at end
- if (!(ts.length > 1 && /\..*0$/.test((ts[1] - ts[0]).toFixed(extraDec))))
- axis.tickDecimals = extraDec;
- }
- }
- }
-
- axis.tickGenerator = generator;
- if ($.isFunction(opts.tickFormatter))
- axis.tickFormatter = function (v, axis) { return "" + opts.tickFormatter(v, axis); };
- else
- axis.tickFormatter = formatter;
- }
-
- function setTicks(axis) {
- var oticks = axis.options.ticks, ticks = [];
- if (oticks == null || (typeof oticks == "number" && oticks > 0))
- ticks = axis.tickGenerator(axis);
- else if (oticks) {
- if ($.isFunction(oticks))
- // generate the ticks
- ticks = oticks({ min: axis.min, max: axis.max });
- else
- ticks = oticks;
- }
-
- // clean up/labelify the supplied ticks, copy them over
- var i, v;
- axis.ticks = [];
- for (i = 0; i < ticks.length; ++i) {
- var label = null;
- var t = ticks[i];
- if (typeof t == "object") {
- v = +t[0];
- if (t.length > 1)
- label = t[1];
- }
- else
- v = +t;
- if (label == null)
- label = axis.tickFormatter(v, axis);
- if (!isNaN(v))
- axis.ticks.push({ v: v, label: label });
- }
- }
-
- function snapRangeToTicks(axis, ticks) {
- if (axis.options.autoscaleMargin && ticks.length > 0) {
- // snap to ticks
- if (axis.options.min == null)
- axis.min = Math.min(axis.min, ticks[0].v);
- if (axis.options.max == null && ticks.length > 1)
- axis.max = Math.max(axis.max, ticks[ticks.length - 1].v);
- }
- }
-
- function draw() {
- ctx.clearRect(0, 0, canvasWidth, canvasHeight);
-
- var grid = options.grid;
-
- // draw background, if any
- if (grid.show && grid.backgroundColor)
- drawBackground();
-
- if (grid.show && !grid.aboveData)
- drawGrid();
-
- for (var i = 0; i < series.length; ++i) {
- executeHooks(hooks.drawSeries, [ctx, series[i]]);
- drawSeries(series[i]);
- }
-
- executeHooks(hooks.draw, [ctx]);
-
- if (grid.show && grid.aboveData)
- drawGrid();
- }
-
- function extractRange(ranges, coord) {
- var axis, from, to, key, axes = allAxes();
-
- for (i = 0; i < axes.length; ++i) {
- axis = axes[i];
- if (axis.direction == coord) {
- key = coord + axis.n + "axis";
- if (!ranges[key] && axis.n == 1)
- key = coord + "axis"; // support x1axis as xaxis
- if (ranges[key]) {
- from = ranges[key].from;
- to = ranges[key].to;
- break;
- }
- }
- }
-
- // backwards-compat stuff - to be removed in future
- if (!ranges[key]) {
- axis = coord == "x" ? xaxes[0] : yaxes[0];
- from = ranges[coord + "1"];
- to = ranges[coord + "2"];
- }
-
- // auto-reverse as an added bonus
- if (from != null && to != null && from > to) {
- var tmp = from;
- from = to;
- to = tmp;
- }
-
- return { from: from, to: to, axis: axis };
- }
-
- function drawBackground() {
- ctx.save();
- ctx.translate(plotOffset.left, plotOffset.top);
-
- ctx.fillStyle = getColorOrGradient(options.grid.backgroundColor, plotHeight, 0, "rgba(255, 255, 255, 0)");
- ctx.fillRect(0, 0, plotWidth, plotHeight);
- ctx.restore();
- }
-
- function drawGrid() {
- var i;
-
- ctx.save();
- ctx.translate(plotOffset.left, plotOffset.top);
-
- // draw markings
- var markings = options.grid.markings;
- if (markings) {
- if ($.isFunction(markings)) {
- var axes = plot.getAxes();
- // xmin etc. is backwards compatibility, to be
- // removed in the future
- axes.xmin = axes.xaxis.min;
- axes.xmax = axes.xaxis.max;
- axes.ymin = axes.yaxis.min;
- axes.ymax = axes.yaxis.max;
-
- markings = markings(axes);
- }
-
- for (i = 0; i < markings.length; ++i) {
- var m = markings[i],
- xrange = extractRange(m, "x"),
- yrange = extractRange(m, "y");
-
- // fill in missing
- if (xrange.from == null)
- xrange.from = xrange.axis.min;
- if (xrange.to == null)
- xrange.to = xrange.axis.max;
- if (yrange.from == null)
- yrange.from = yrange.axis.min;
- if (yrange.to == null)
- yrange.to = yrange.axis.max;
-
- // clip
- if (xrange.to < xrange.axis.min || xrange.from > xrange.axis.max ||
- yrange.to < yrange.axis.min || yrange.from > yrange.axis.max)
- continue;
-
- xrange.from = Math.max(xrange.from, xrange.axis.min);
- xrange.to = Math.min(xrange.to, xrange.axis.max);
- yrange.from = Math.max(yrange.from, yrange.axis.min);
- yrange.to = Math.min(yrange.to, yrange.axis.max);
-
- if (xrange.from == xrange.to && yrange.from == yrange.to)
- continue;
-
- // then draw
- xrange.from = xrange.axis.p2c(xrange.from);
- xrange.to = xrange.axis.p2c(xrange.to);
- yrange.from = yrange.axis.p2c(yrange.from);
- yrange.to = yrange.axis.p2c(yrange.to);
-
- if (xrange.from == xrange.to || yrange.from == yrange.to) {
- // draw line
- ctx.beginPath();
- ctx.strokeStyle = m.color || options.grid.markingsColor;
- ctx.lineWidth = m.lineWidth || options.grid.markingsLineWidth;
- ctx.moveTo(xrange.from, yrange.from);
- ctx.lineTo(xrange.to, yrange.to);
- ctx.stroke();
- }
- else {
- // fill area
- ctx.fillStyle = m.color || options.grid.markingsColor;
- ctx.fillRect(xrange.from, yrange.to,
- xrange.to - xrange.from,
- yrange.from - yrange.to);
- }
- }
- }
-
- // draw the ticks
- var axes = allAxes(), bw = options.grid.borderWidth;
-
- for (var j = 0; j < axes.length; ++j) {
- var axis = axes[j], box = axis.box,
- t = axis.tickLength, x, y, xoff, yoff;
- if (!axis.show || axis.ticks.length == 0)
- continue
-
- ctx.strokeStyle = axis.options.tickColor || $.color.parse(axis.options.color).scale('a', 0.22).toString();
- ctx.lineWidth = 1;
-
- // find the edges
- if (axis.direction == "x") {
- x = 0;
- if (t == "full")
- y = (axis.position == "top" ? 0 : plotHeight);
- else
- y = box.top - plotOffset.top + (axis.position == "top" ? box.height : 0);
- }
- else {
- y = 0;
- if (t == "full")
- x = (axis.position == "left" ? 0 : plotWidth);
- else
- x = box.left - plotOffset.left + (axis.position == "left" ? box.width : 0);
- }
-
- // draw tick bar
- if (!axis.innermost) {
- ctx.beginPath();
- xoff = yoff = 0;
- if (axis.direction == "x")
- xoff = plotWidth;
- else
- yoff = plotHeight;
-
- if (ctx.lineWidth == 1) {
- x = Math.floor(x) + 0.5;
- y = Math.floor(y) + 0.5;
- }
-
- ctx.moveTo(x, y);
- ctx.lineTo(x + xoff, y + yoff);
- ctx.stroke();
- }
-
- // draw ticks
- ctx.beginPath();
- for (i = 0; i < axis.ticks.length; ++i) {
- var v = axis.ticks[i].v;
-
- xoff = yoff = 0;
-
- if (v < axis.min || v > axis.max
- // skip those lying on the axes if we got a border
- || (t == "full" && bw > 0
- && (v == axis.min || v == axis.max)))
- continue;
-
- if (axis.direction == "x") {
- x = axis.p2c(v);
- yoff = t == "full" ? -plotHeight : t;
-
- if (axis.position == "top")
- yoff = -yoff;
- }
- else {
- y = axis.p2c(v);
- xoff = t == "full" ? -plotWidth : t;
-
- if (axis.position == "left")
- xoff = -xoff;
- }
-
- if (ctx.lineWidth == 1) {
- if (axis.direction == "x")
- x = Math.floor(x) + 0.5;
- else
- y = Math.floor(y) + 0.5;
- }
-
- ctx.moveTo(x, y);
- ctx.lineTo(x + xoff, y + yoff);
- }
-
- ctx.stroke();
- }
-
-
- // draw border
- if (bw) {
- ctx.lineWidth = bw;
- ctx.strokeStyle = options.grid.borderColor;
- ctx.strokeRect(-bw/2, -bw/2, plotWidth + bw, plotHeight + bw);
- }
-
- ctx.restore();
- }
-
- function insertAxisLabels() {
- placeholder.find(".tickLabels").remove();
-
- var html = ['<div class="tickLabels" style="font-size:smaller">'];
-
- var axes = allAxes();
- for (var j = 0; j < axes.length; ++j) {
- var axis = axes[j], box = axis.box;
- if (!axis.show)
- continue;
- //debug: html.push('<div style="position:absolute;opacity:0.10;background-color:red;left:' + box.left + 'px;top:' + box.top + 'px;width:' + box.width + 'px;height:' + box.height + 'px"></div>')
- html.push('<div class="' + axis.direction + 'Axis ' + axis.direction + axis.n + 'Axis" style="color:' + axis.options.color + '">');
- for (var i = 0; i < axis.ticks.length; ++i) {
- var tick = axis.ticks[i];
- if (!tick.label || tick.v < axis.min || tick.v > axis.max)
- continue;
-
- var pos = {}, align;
-
- if (axis.direction == "x") {
- align = "center";
- pos.left = Math.round(plotOffset.left + axis.p2c(tick.v) - axis.labelWidth/2);
- if (axis.position == "bottom")
- pos.top = box.top + box.padding;
- else
- pos.bottom = canvasHeight - (box.top + box.height - box.padding);
- }
- else {
- pos.top = Math.round(plotOffset.top + axis.p2c(tick.v) - axis.labelHeight/2);
- if (axis.position == "left") {
- pos.right = canvasWidth - (box.left + box.width - box.padding)
- align = "right";
- }
- else {
- pos.left = box.left + box.padding;
- align = "left";
- }
- }
-
- pos.width = axis.labelWidth;
-
- var style = ["position:absolute", "text-align:" + align ];
- for (var a in pos)
- style.push(a + ":" + pos[a] + "px")
-
- html.push('<div class="tickLabel" style="' + style.join(';') + '">' + tick.label + '</div>');
- }
- html.push('</div>');
- }
-
- html.push('</div>');
-
- placeholder.append(html.join(""));
- }
-
- function drawSeries(series) {
- if (series.lines.show)
- drawSeriesLines(series);
- if (series.bars.show)
- drawSeriesBars(series);
- if (series.points.show)
- drawSeriesPoints(series);
- }
-
- function drawSeriesLines(series) {
- function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
- var points = datapoints.points,
- ps = datapoints.pointsize,
- prevx = null, prevy = null;
-
- ctx.beginPath();
- for (var i = ps; i < points.length; i += ps) {
- var x1 = points[i - ps], y1 = points[i - ps + 1],
- x2 = points[i], y2 = points[i + 1];
-
- if (x1 == null || x2 == null)
- continue;
-
- // clip with ymin
- if (y1 <= y2 && y1 < axisy.min) {
- if (y2 < axisy.min)
- continue; // line segment is outside
- // compute new intersection point
- x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
- y1 = axisy.min;
- }
- else if (y2 <= y1 && y2 < axisy.min) {
- if (y1 < axisy.min)
- continue;
- x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
- y2 = axisy.min;
- }
-
- // clip with ymax
- if (y1 >= y2 && y1 > axisy.max) {
- if (y2 > axisy.max)
- continue;
- x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
- y1 = axisy.max;
- }
- else if (y2 >= y1 && y2 > axisy.max) {
- if (y1 > axisy.max)
- continue;
- x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
- y2 = axisy.max;
- }
-
- // clip with xmin
- if (x1 <= x2 && x1 < axisx.min) {
- if (x2 < axisx.min)
- continue;
- y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
- x1 = axisx.min;
- }
- else if (x2 <= x1 && x2 < axisx.min) {
- if (x1 < axisx.min)
- continue;
- y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
- x2 = axisx.min;
- }
-
- // clip with xmax
- if (x1 >= x2 && x1 > axisx.max) {
- if (x2 > axisx.max)
- continue;
- y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
- x1 = axisx.max;
- }
- else if (x2 >= x1 && x2 > axisx.max) {
- if (x1 > axisx.max)
- continue;
- y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
- x2 = axisx.max;
- }
-
- if (x1 != prevx || y1 != prevy)
- ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);
-
- prevx = x2;
- prevy = y2;
- ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset);
- }
- ctx.stroke();
- }
-
- function plotLineArea(datapoints, axisx, axisy) {
- var points = datapoints.points,
- ps = datapoints.pointsize,
- bottom = Math.min(Math.max(0, axisy.min), axisy.max),
- i = 0, top, areaOpen = false,
- ypos = 1, segmentStart = 0, segmentEnd = 0;
-
- // we process each segment in two turns, first forward
- // direction to sketch out top, then once we hit the
- // end we go backwards to sketch the bottom
- while (true) {
- if (ps > 0 && i > points.length + ps)
- break;
-
- i += ps; // ps is negative if going backwards
-
- var x1 = points[i - ps],
- y1 = points[i - ps + ypos],
- x2 = points[i], y2 = points[i + ypos];
-
- if (areaOpen) {
- if (ps > 0 && x1 != null && x2 == null) {
- // at turning point
- segmentEnd = i;
- ps = -ps;
- ypos = 2;
- continue;
- }
-
- if (ps < 0 && i == segmentStart + ps) {
- // done with the reverse sweep
- ctx.fill();
- areaOpen = false;
- ps = -ps;
- ypos = 1;
- i = segmentStart = segmentEnd + ps;
- continue;
- }
- }
-
- if (x1 == null || x2 == null)
- continue;
-
- // clip x values
-
- // clip with xmin
- if (x1 <= x2 && x1 < axisx.min) {
- if (x2 < axisx.min)
- continue;
- y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
- x1 = axisx.min;
- }
- else if (x2 <= x1 && x2 < axisx.min) {
- if (x1 < axisx.min)
- continue;
- y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
- x2 = axisx.min;
- }
-
- // clip with xmax
- if (x1 >= x2 && x1 > axisx.max) {
- if (x2 > axisx.max)
- continue;
- y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
- x1 = axisx.max;
- }
- else if (x2 >= x1 && x2 > axisx.max) {
- if (x1 > axisx.max)
- continue;
- y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
- x2 = axisx.max;
- }
-
- if (!areaOpen) {
- // open area
- ctx.beginPath();
- ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom));
- areaOpen = true;
- }
-
- // now first check the case where both is outside
- if (y1 >= axisy.max && y2 >= axisy.max) {
- ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max));
- ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max));
- continue;
- }
- else if (y1 <= axisy.min && y2 <= axisy.min) {
- ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min));
- ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min));
- continue;
- }
-
- // else it's a bit more complicated, there might
- // be a flat maxed out rectangle first, then a
- // triangular cutout or reverse; to find these
- // keep track of the current x values
- var x1old = x1, x2old = x2;
-
- // clip the y values, without shortcutting, we
- // go through all cases in turn
-
- // clip with ymin
- if (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) {
- x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
- y1 = axisy.min;
- }
- else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) {
- x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
- y2 = axisy.min;
- }
-
- // clip with ymax
- if (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) {
- x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
- y1 = axisy.max;
- }
- else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) {
- x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
- y2 = axisy.max;
- }
-
- // if the x value was changed we got a rectangle
- // to fill
- if (x1 != x1old) {
- ctx.lineTo(axisx.p2c(x1old), axisy.p2c(y1));
- // it goes to (x1, y1), but we fill that below
- }
-
- // fill triangular section, this sometimes result
- // in redundant points if (x1, y1) hasn't changed
- // from previous line to, but we just ignore that
- ctx.lineTo(axisx.p2c(x1), axisy.p2c(y1));
- ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));
-
- // fill the other rectangle if it's there
- if (x2 != x2old) {
- ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));
- ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2));
- }
- }
- }
-
- ctx.save();
- ctx.translate(plotOffset.left, plotOffset.top);
- ctx.lineJoin = "round";
-
- var lw = series.lines.lineWidth,
- sw = series.shadowSize;
- // FIXME: consider another form of shadow when filling is turned on
- if (lw > 0 && sw > 0) {
- // draw shadow as a thick and thin line with transparency
- ctx.lineWidth = sw;
- ctx.strokeStyle = "rgba(0,0,0,0.1)";
- // position shadow at angle from the mid of line
- var angle = Math.PI/18;
- plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis);
- ctx.lineWidth = sw/2;
- plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis);
- }
-
- ctx.lineWidth = lw;
- ctx.strokeStyle = series.color;
- var fillStyle = getFillStyle(series.lines, series.color, 0, plotHeight);
- if (fillStyle) {
- ctx.fillStyle = fillStyle;
- plotLineArea(series.datapoints, series.xaxis, series.yaxis);
- }
-
- if (lw > 0)
- plotLine(series.datapoints, 0, 0, series.xaxis, series.yaxis);
- ctx.restore();
- }
-
- function drawSeriesPoints(series) {
- function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {
- var points = datapoints.points, ps = datapoints.pointsize;
-
- for (var i = 0; i < points.length; i += ps) {
- var x = points[i], y = points[i + 1];
- if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)
- continue;
-
- ctx.beginPath();
- x = axisx.p2c(x);
- y = axisy.p2c(y) + offset;
- if (symbol == "circle")
- ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false);
- else
- symbol(ctx, x, y, radius, shadow);
- ctx.closePath();
-
- if (fillStyle) {
- ctx.fillStyle = fillStyle;
- ctx.fill();
- }
- ctx.stroke();
- }
- }
-
- ctx.save();
- ctx.translate(plotOffset.left, plotOffset.top);
-
- var lw = series.points.lineWidth,
- sw = series.shadowSize,
- radius = series.points.radius,
- symbol = series.points.symbol;
- if (lw > 0 && sw > 0) {
- // draw shadow in two steps
- var w = sw / 2;
- ctx.lineWidth = w;
- ctx.strokeStyle = "rgba(0,0,0,0.1)";
- plotPoints(series.datapoints, radius, null, w + w/2, true,
- series.xaxis, series.yaxis, symbol);
-
- ctx.strokeStyle = "rgba(0,0,0,0.2)";
- plotPoints(series.datapoints, radius, null, w/2, true,
- series.xaxis, series.yaxis, symbol);
- }
-
- ctx.lineWidth = lw;
- ctx.strokeStyle = series.color;
- plotPoints(series.datapoints, radius,
- getFillStyle(series.points, series.color), 0, false,
- series.xaxis, series.yaxis, symbol);
- ctx.restore();
- }
-
- function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
- var left, right, bottom, top,
- drawLeft, drawRight, drawTop, drawBottom,
- tmp;
-
- // in horizontal mode, we start the bar from the left
- // instead of from the bottom so it appears to be
- // horizontal rather than vertical
- if (horizontal) {
- drawBottom = drawRight = drawTop = true;
- drawLeft = false;
- left = b;
- right = x;
- top = y + barLeft;
- bottom = y + barRight;
-
- // account for negative bars
- if (right < left) {
- tmp = right;
- right = left;
- left = tmp;
- drawLeft = true;
- drawRight = false;
- }
- }
- else {
- drawLeft = drawRight = drawTop = true;
- drawBottom = false;
- left = x + barLeft;
- right = x + barRight;
- bottom = b;
- top = y;
-
- // account for negative bars
- if (top < bottom) {
- tmp = top;
- top = bottom;
- bottom = tmp;
- drawBottom = true;
- drawTop = false;
- }
- }
-
- // clip
- if (right < axisx.min || left > axisx.max ||
- top < axisy.min || bottom > axisy.max)
- return;
-
- if (left < axisx.min) {
- left = axisx.min;
- drawLeft = false;
- }
-
- if (right > axisx.max) {
- right = axisx.max;
- drawRight = false;
- }
-
- if (bottom < axisy.min) {
- bottom = axisy.min;
- drawBottom = false;
- }
-
- if (top > axisy.max) {
- top = axisy.max;
- drawTop = false;
- }
-
- left = axisx.p2c(left);
- bottom = axisy.p2c(bottom);
- right = axisx.p2c(right);
- top = axisy.p2c(top);
-
- // fill the bar
- if (fillStyleCallback) {
- c.beginPath();
- c.moveTo(left, bottom);
- c.lineTo(left, top);
- c.lineTo(right, top);
- c.lineTo(right, bottom);
- c.fillStyle = fillStyleCallback(bottom, top);
- c.fill();
- }
-
- // draw outline
- if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) {
- c.beginPath();
-
- // FIXME: inline moveTo is buggy with excanvas
- c.moveTo(left, bottom + offset);
- if (drawLeft)
- c.lineTo(left, top + offset);
- else
- c.moveTo(left, top + offset);
- if (drawTop)
- c.lineTo(right, top + offset);
- else
- c.moveTo(right, top + offset);
- if (drawRight)
- c.lineTo(right, bottom + offset);
- else
- c.moveTo(right, bottom + offset);
- if (drawBottom)
- c.lineTo(left, bottom + offset);
- else
- c.moveTo(left, bottom + offset);
- c.stroke();
- }
- }
-
- function drawSeriesBars(series) {
- function plotBars(datapoints, barLeft, barRight, offset, fillStyleCallback, axisx, axisy) {
- var points = datapoints.points, ps = datapoints.pointsize;
-
- for (var i = 0; i < points.length; i += ps) {
- if (points[i] == null)
- continue;
- drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, offset, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth);
- }
- }
-
- ctx.save();
- ctx.translate(plotOffset.left, plotOffset.top);
-
- // FIXME: figure out a way to add shadows (for instance along the right edge)
- ctx.lineWidth = series.bars.lineWidth;
- ctx.strokeStyle = series.color;
- var barLeft = series.bars.align == "left" ? 0 : -series.bars.barWidth/2;
- var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null;
- plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, 0, fillStyleCallback, series.xaxis, series.yaxis);
- ctx.restore();
- }
-
- function getFillStyle(filloptions, seriesColor, bottom, top) {
- var fill = filloptions.fill;
- if (!fill)
- return null;
-
- if (filloptions.fillColor)
- return getColorOrGradient(filloptions.fillColor, bottom, top, seriesColor);
-
- var c = $.color.parse(seriesColor);
- c.a = typeof fill == "number" ? fill : 0.4;
- c.normalize();
- return c.toString();
- }
-
- function insertLegend() {
- placeholder.find(".legend").remove();
-
- if (!options.legend.show)
- return;
-
- var fragments = [], rowStarted = false,
- lf = options.legend.labelFormatter, s, label;
- for (var i = 0; i < series.length; ++i) {
- s = series[i];
- label = s.label;
- if (!label)
- continue;
-
- if (i % options.legend.noColumns == 0) {
- if (rowStarted)
- fragments.push('</tr>');
- fragments.push('<tr>');
- rowStarted = true;
- }
-
- if (lf)
- label = lf(label, s);
-
- fragments.push(
- '<td class="legendColorBox"><div style="border:1px solid ' + options.legend.labelBoxBorderColor + ';padding:1px"><div style="width:4px;height:0;border:5px solid ' + s.color + ';overflow:hidden"></div></div></td>' +
- '<td class="legendLabel">' + label + '</td>');
- }
- if (rowStarted)
- fragments.push('</tr>');
-
- if (fragments.length == 0)
- return;
-
- var table = '<table style="font-size:smaller;color:' + options.grid.color + '">' + fragments.join("") + '</table>';
- if (options.legend.container != null)
- $(options.legend.container).html(table);
- else {
- var pos = "",
- p = options.legend.position,
- m = options.legend.margin;
- if (m[0] == null)
- m = [m, m];
- if (p.charAt(0) == "n")
- pos += 'top:' + (m[1] + plotOffset.top) + 'px;';
- else if (p.charAt(0) == "s")
- pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;';
- if (p.charAt(1) == "e")
- pos += 'right:' + (m[0] + plotOffset.right) + 'px;';
- else if (p.charAt(1) == "w")
- pos += 'left:' + (m[0] + plotOffset.left) + 'px;';
- var legend = $('<div class="legend">' + table.replace('style="', 'style="position:absolute;' + pos +';') + '</div>').appendTo(placeholder);
- if (options.legend.backgroundOpacity != 0.0) {
- // put in the transparent background
- // separately to avoid blended labels and
- // label boxes
- var c = options.legend.backgroundColor;
- if (c == null) {
- c = options.grid.backgroundColor;
- if (c && typeof c == "string")
- c = $.color.parse(c);
- else
- c = $.color.extract(legend, 'background-color');
- c.a = 1;
- c = c.toString();
- }
- var div = legend.children();
- $('<div style="position:absolute;width:' + div.width() + 'px;height:' + div.height() + 'px;' + pos +'background-color:' + c + ';"> </div>').prependTo(legend).css('opacity', options.legend.backgroundOpacity);
- }
- }
- }
-
-
- // interactive features
-
- var highlights = [],
- redrawTimeout = null;
-
- // returns the data item the mouse is over, or null if none is found
- function findNearbyItem(mouseX, mouseY, seriesFilter) {
- var maxDistance = options.grid.mouseActiveRadius,
- smallestDistance = maxDistance * maxDistance + 1,
- item = null, foundPoint = false, i, j;
-
- for (i = series.length - 1; i >= 0; --i) {
- if (!seriesFilter(series[i]))
- continue;
-
- var s = series[i],
- axisx = s.xaxis,
- axisy = s.yaxis,
- points = s.datapoints.points,
- ps = s.datapoints.pointsize,
- mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster
- my = axisy.c2p(mouseY),
- maxx = maxDistance / axisx.scale,
- maxy = maxDistance / axisy.scale;
-
- // with inverse transforms, we can't use the maxx/maxy
- // optimization, sadly
- if (axisx.options.inverseTransform)
- maxx = Number.MAX_VALUE;
- if (axisy.options.inverseTransform)
- maxy = Number.MAX_VALUE;
-
- if (s.lines.show || s.points.show) {
- for (j = 0; j < points.length; j += ps) {
- var x = points[j], y = points[j + 1];
- if (x == null)
- continue;
-
- // For points and lines, the cursor must be within a
- // certain distance to the data point
- if (x - mx > maxx || x - mx < -maxx ||
- y - my > maxy || y - my < -maxy)
- continue;
-
- // We have to calculate distances in pixels, not in
- // data units, because the scales of the axes may be different
- var dx = Math.abs(axisx.p2c(x) - mouseX),
- dy = Math.abs(axisy.p2c(y) - mouseY),
- dist = dx * dx + dy * dy; // we save the sqrt
-
- // use <= to ensure last point takes precedence
- // (last generally means on top of)
- if (dist < smallestDistance) {
- smallestDistance = dist;
- item = [i, j / ps];
- }
- }
- }
-
- if (s.bars.show && !item) { // no other point can be nearby
- var barLeft = s.bars.align == "left" ? 0 : -s.bars.barWidth/2,
- barRight = barLeft + s.bars.barWidth;
-
- for (j = 0; j < points.length; j += ps) {
- var x = points[j], y = points[j + 1], b = points[j + 2];
- if (x == null)
- continue;
-
- // for a bar graph, the cursor must be inside the bar
- if (series[i].bars.horizontal ?
- (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&
- my >= y + barLeft && my <= y + barRight) :
- (mx >= x + barLeft && mx <= x + barRight &&
- my >= Math.min(b, y) && my <= Math.max(b, y)))
- item = [i, j / ps];
- }
- }
- }
-
- if (item) {
- i = item[0];
- j = item[1];
- ps = series[i].datapoints.pointsize;
-
- return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),
- dataIndex: j,
- series: series[i],
- seriesIndex: i };
- }
-
- return null;
- }
-
- function onMouseMove(e) {
- if (options.grid.hoverable)
- triggerClickHoverEvent("plothover", e,
- function (s) { return s["hoverable"] != false; });
- }
-
- function onMouseLeave(e) {
- if (options.grid.hoverable)
- triggerClickHoverEvent("plothover", e,
- function (s) { return false; });
- }
-
- function onClick(e) {
- triggerClickHoverEvent("plotclick", e,
- function (s) { return s["clickable"] != false; });
- }
-
- // trigger click or hover event (they send the same parameters
- // so we share their code)
- function triggerClickHoverEvent(eventname, event, seriesFilter) {
- var offset = eventHolder.offset(),
- canvasX = event.pageX - offset.left - plotOffset.left,
- canvasY = event.pageY - offset.top - plotOffset.top,
- pos = canvasToAxisCoords({ left: canvasX, top: canvasY });
-
- pos.pageX = event.pageX;
- pos.pageY = event.pageY;
-
- var item = findNearbyItem(canvasX, canvasY, seriesFilter);
-
- if (item) {
- // fill in mouse pos for any listeners out there
- item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left + plotOffset.left);
- item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top + plotOffset.top);
- }
-
- if (options.grid.autoHighlight) {
- // clear auto-highlights
- for (var i = 0; i < highlights.length; ++i) {
- var h = highlights[i];
- if (h.auto == eventname &&
- !(item && h.series == item.series &&
- h.point[0] == item.datapoint[0] &&
- h.point[1] == item.datapoint[1]))
- unhighlight(h.series, h.point);
- }
-
- if (item)
- highlight(item.series, item.datapoint, eventname);
- }
-
- placeholder.trigger(eventname, [ pos, item ]);
- }
-
- function triggerRedrawOverlay() {
- if (!redrawTimeout)
- redrawTimeout = setTimeout(drawOverlay, 30);
- }
-
- function drawOverlay() {
- redrawTimeout = null;
-
- // draw highlights
- octx.save();
- octx.clearRect(0, 0, canvasWidth, canvasHeight);
- octx.translate(plotOffset.left, plotOffset.top);
-
- var i, hi;
- for (i = 0; i < highlights.length; ++i) {
- hi = highlights[i];
-
- if (hi.series.bars.show)
- drawBarHighlight(hi.series, hi.point);
- else
- drawPointHighlight(hi.series, hi.point);
- }
- octx.restore();
-
- executeHooks(hooks.drawOverlay, [octx]);
- }
-
- function highlight(s, point, auto) {
- if (typeof s == "number")
- s = series[s];
-
- if (typeof point == "number") {
- var ps = s.datapoints.pointsize;
- point = s.datapoints.points.slice(ps * point, ps * (point + 1));
- }
-
- var i = indexOfHighlight(s, point);
- if (i == -1) {
- highlights.push({ series: s, point: point, auto: auto });
-
- triggerRedrawOverlay();
- }
- else if (!auto)
- highlights[i].auto = false;
- }
-
- function unhighlight(s, point) {
- if (s == null && point == null) {
- highlights = [];
- triggerRedrawOverlay();
- }
-
- if (typeof s == "number")
- s = series[s];
-
- if (typeof point == "number")
- point = s.data[point];
-
- var i = indexOfHighlight(s, point);
- if (i != -1) {
- highlights.splice(i, 1);
-
- triggerRedrawOverlay();
- }
- }
-
- function indexOfHighlight(s, p) {
- for (var i = 0; i < highlights.length; ++i) {
- var h = highlights[i];
- if (h.series == s && h.point[0] == p[0]
- && h.point[1] == p[1])
- return i;
- }
- return -1;
- }
-
- function drawPointHighlight(series, point) {
- var x = point[0], y = point[1],
- axisx = series.xaxis, axisy = series.yaxis;
-
- if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)
- return;
-
- var pointRadius = series.points.radius + series.points.lineWidth / 2;
- octx.lineWidth = pointRadius;
- octx.strokeStyle = $.color.parse(series.color).scale('a', 0.5).toString();
- var radius = 1.5 * pointRadius,
- x = axisx.p2c(x),
- y = axisy.p2c(y);
-
- octx.beginPath();
- if (series.points.symbol == "circle")
- octx.arc(x, y, radius, 0, 2 * Math.PI, false);
- else
- series.points.symbol(octx, x, y, radius, false);
- octx.closePath();
- octx.stroke();
- }
-
- function drawBarHighlight(series, point) {
- octx.lineWidth = series.bars.lineWidth;
- octx.strokeStyle = $.color.parse(series.color).scale('a', 0.5).toString();
- var fillStyle = $.color.parse(series.color).scale('a', 0.5).toString();
- var barLeft = series.bars.align == "left" ? 0 : -series.bars.barWidth/2;
- drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth,
- 0, function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth);
- }
-
- function getColorOrGradient(spec, bottom, top, defaultColor) {
- if (typeof spec == "string")
- return spec;
- else {
- // assume this is a gradient spec; IE currently only
- // supports a simple vertical gradient properly, so that's
- // what we support too
- var gradient = ctx.createLinearGradient(0, top, 0, bottom);
-
- for (var i = 0, l = spec.colors.length; i < l; ++i) {
- var c = spec.colors[i];
- if (typeof c != "string") {
- var co = $.color.parse(defaultColor);
- if (c.brightness != null)
- co = co.scale('rgb', c.brightness)
- if (c.opacity != null)
- co.a *= c.opacity;
- c = co.toString();
- }
- gradient.addColorStop(i / (l - 1), c);
- }
-
- return gradient;
- }
- }
- }
-
- $.plot = function(placeholder, data, options) {
- //var t0 = new Date();
- var plot = new Plot($(placeholder), data, options, $.plot.plugins);
- //(window.console ? console.log : alert)("time used (msecs): " + ((new Date()).getTime() - t0.getTime()));
- return plot;
- };
-
- $.plot.version = "0.7";
-
- $.plot.plugins = [];
-
- // returns a string with the date d formatted according to fmt
- $.plot.formatDate = function(d, fmt, monthNames) {
- var leftPad = function(n) {
- n = "" + n;
- return n.length == 1 ? "0" + n : n;
- };
-
- var r = [];
- var escape = false, padNext = false;
- var hours = d.getUTCHours();
- var isAM = hours < 12;
- if (monthNames == null)
- monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
-
- if (fmt.search(/%p|%P/) != -1) {
- if (hours > 12) {
- hours = hours - 12;
- } else if (hours == 0) {
- hours = 12;
- }
- }
- for (var i = 0; i < fmt.length; ++i) {
- var c = fmt.charAt(i);
-
- if (escape) {
- switch (c) {
- case 'h': c = "" + hours; break;
- case 'H': c = leftPad(hours); break;
- case 'M': c = leftPad(d.getUTCMinutes()); break;
- case 'S': c = leftPad(d.getUTCSeconds()); break;
- case 'd': c = "" + d.getUTCDate(); break;
- case 'm': c = "" + (d.getUTCMonth() + 1); break;
- case 'y': c = "" + d.getUTCFullYear(); break;
- case 'b': c = "" + monthNames[d.getUTCMonth()]; break;
- case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break;
- case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break;
- case '0': c = ""; padNext = true; break;
- }
- if (c && padNext) {
- c = leftPad(c);
- padNext = false;
- }
- r.push(c);
- if (!padNext)
- escape = false;
- }
- else {
- if (c == "%")
- escape = true;
- else
- r.push(c);
- }
- }
- return r.join("");
- };
-
- // round to nearby lower multiple of base
- function floorInBase(n, base) {
- return base * Math.floor(n / base);
- }
-
-})(jQuery);
diff --git a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.js b/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.js
deleted file mode 100644
index 8c24ffc610d..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/jquery.js
+++ /dev/null
@@ -1,9472 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.8.3
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time)
- */
-(function( window, undefined ) {
-var
- // A central reference to the root jQuery(document)
- rootjQuery,
-
- // The deferred used on DOM ready
- readyList,
-
- // Use the correct document accordingly with window argument (sandbox)
- document = window.document,
- location = window.location,
- navigator = window.navigator,
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- // Save a reference to some core methods
- core_push = Array.prototype.push,
- core_slice = Array.prototype.slice,
- core_indexOf = Array.prototype.indexOf,
- core_toString = Object.prototype.toString,
- core_hasOwn = Object.prototype.hasOwnProperty,
- core_trim = String.prototype.trim,
-
- // Define a local copy of jQuery
- jQuery = function( selector, context ) {
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context, rootjQuery );
- },
-
- // Used for matching numbers
- core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
-
- // Used for detecting and trimming whitespace
- core_rnotwhite = /\S/,
- core_rspace = /\s+/,
-
- // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
- rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
- // A simple way to check for HTML strings
- // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
- rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
- // Match a standalone tag
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
-
- // JSON RegExp
- rvalidchars = /^[\],:{}\s]*$/,
- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
- rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
- rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/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();
- },
-
- // The ready event handler and self cleanup method
- DOMContentLoaded = function() {
- if ( document.addEventListener ) {
- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- jQuery.ready();
- } else if ( document.readyState === "complete" ) {
- // we're here because readyState === "complete" in oldIE
- // which is good enough for us to call the dom ready!
- document.detachEvent( "onreadystatechange", DOMContentLoaded );
- jQuery.ready();
- }
- },
-
- // [[Class]] -> type pairs
- class2type = {};
-
-jQuery.fn = jQuery.prototype = {
- constructor: jQuery,
- init: function( selector, context, rootjQuery ) {
- var match, elem, ret, doc;
-
- // Handle $(""), $(null), $(undefined), $(false)
- if ( !selector ) {
- return this;
- }
-
- // Handle $(DOMElement)
- if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
- }
-
- // 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;
- doc = ( context && context.nodeType ? context.ownerDocument || context : document );
-
- // scripts is true for back-compat
- selector = jQuery.parseHTML( match[1], doc, true );
- if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
- this.attr.call( selector, context, true );
- }
-
- return jQuery.merge( this, selector );
-
- // 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 || rootjQuery ).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return this.constructor( context ).find( selector );
- }
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return rootjQuery.ready( selector );
- }
-
- if ( selector.selector !== undefined ) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.makeArray( selector, this );
- },
-
- // Start with an empty selector
- selector: "",
-
- // The current version of jQuery being used
- jquery: "1.8.3",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
-
- toArray: function() {
- return core_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 a 'clean' array
- this.toArray() :
-
- // Return just the object
- ( num < 0 ? this[ this.length + num ] : this[ num ] );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
-
- // 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;
-
- if ( name === "find" ) {
- ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
- } else if ( name ) {
- ret.selector = this.selector + "." + name + "(" + selector + ")";
- }
-
- // Return the newly-formed element set
- return ret;
- },
-
- // Execute a callback for every element in the matched set.
- // (You can seed the arguments with an array of args, but this is
- // only used internally.)
- each: function( callback, args ) {
- return jQuery.each( this, callback, args );
- },
-
- ready: function( fn ) {
- // Add the callback
- jQuery.ready.promise().done( fn );
-
- return this;
- },
-
- eq: function( i ) {
- i = +i;
- return i === -1 ?
- this.slice( i ) :
- this.slice( i, i + 1 );
- },
-
- first: function() {
- return this.eq( 0 );
- },
-
- last: function() {
- return this.eq( -1 );
- },
-
- slice: function() {
- return this.pushStack( core_slice.apply( this, arguments ),
- "slice", core_slice.call(arguments).join(",") );
- },
-
- map: function( callback ) {
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- end: function() {
- return this.prevObject || this.constructor(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: core_push,
- sort: [].sort,
- splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- deep = target;
- target = arguments[1] || {};
- // skip the boolean and the target
- i = 2;
- }
-
- // 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 ( length === i ) {
- 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({
- noConflict: function( deep ) {
- if ( window.$ === jQuery ) {
- window.$ = _$;
- }
-
- if ( deep && window.jQuery === jQuery ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- },
-
- // 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;
- }
-
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready, 1 );
- }
-
- // 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.trigger ) {
- jQuery( document ).trigger("ready").off("ready");
- }
- },
-
- // 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 ) {
- return obj != null && obj == obj.window;
- },
-
- isNumeric: function( obj ) {
- return !isNaN( parseFloat(obj) ) && isFinite( obj );
- },
-
- type: function( obj ) {
- return obj == null ?
- String( obj ) :
- class2type[ core_toString.call(obj) ] || "object";
- },
-
- isPlainObject: function( obj ) {
- // 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 &&
- !core_hasOwn.call(obj, "constructor") &&
- !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
- return false;
- }
- } catch ( e ) {
- // IE8,9 Will throw exceptions on certain host objects #9897
- return false;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
-
- var key;
- for ( key in obj ) {}
-
- return key === undefined || core_hasOwn.call( obj, key );
- },
-
- isEmptyObject: function( obj ) {
- var name;
- for ( name in obj ) {
- return false;
- }
- return true;
- },
-
- error: function( msg ) {
- throw new Error( msg );
- },
-
- // data: string of html
- // context (optional): If specified, the fragment will be created in this context, defaults to document
- // scripts (optional): If true, will include scripts passed in the html string
- parseHTML: function( data, context, scripts ) {
- var parsed;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
- if ( typeof context === "boolean" ) {
- scripts = context;
- context = 0;
- }
- context = context || document;
-
- // Single tag
- if ( (parsed = rsingleTag.exec( data )) ) {
- return [ context.createElement( parsed[1] ) ];
- }
-
- parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] );
- return jQuery.merge( [],
- (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );
- },
-
- parseJSON: function( data ) {
- if ( !data || typeof data !== "string") {
- return null;
- }
-
- // Make sure leading/trailing whitespace is removed (IE can't handle it)
- data = jQuery.trim( data );
-
- // Attempt to parse using the native JSON parser first
- if ( window.JSON && window.JSON.parse ) {
- return window.JSON.parse( data );
- }
-
- // Make sure the incoming data is actual JSON
- // Logic borrowed from http://json.org/json2.js
- if ( rvalidchars.test( data.replace( rvalidescape, "@" )
- .replace( rvalidtokens, "]" )
- .replace( rvalidbraces, "")) ) {
-
- return ( new Function( "return " + data ) )();
-
- }
- jQuery.error( "Invalid JSON: " + data );
- },
-
- // Cross-browser xml parsing
- parseXML: function( data ) {
- var xml, tmp;
- if ( !data || typeof data !== "string" ) {
- return null;
- }
- try {
- if ( window.DOMParser ) { // Standard
- tmp = new DOMParser();
- xml = tmp.parseFromString( data , "text/xml" );
- } else { // IE
- xml = new ActiveXObject( "Microsoft.XMLDOM" );
- xml.async = "false";
- xml.loadXML( data );
- }
- } catch( e ) {
- xml = undefined;
- }
- if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
- jQuery.error( "Invalid XML: " + data );
- }
- return xml;
- },
-
- noop: function() {},
-
- // Evaluates a script in a global context
- // 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 && core_rnotwhite.test( 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 );
- } )( 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();
- },
-
- // args is for internal usage only
- each: function( obj, callback, args ) {
- var name,
- i = 0,
- length = obj.length,
- isObj = length === undefined || jQuery.isFunction( obj );
-
- if ( args ) {
- if ( isObj ) {
- for ( name in obj ) {
- if ( callback.apply( obj[ name ], args ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.apply( obj[ i++ ], args ) === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isObj ) {
- for ( name in obj ) {
- if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
- break;
- }
- }
- }
- }
-
- return obj;
- },
-
- // Use native String.trim function wherever possible
- trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
- function( text ) {
- return text == null ?
- "" :
- core_trim.call( text );
- } :
-
- // Otherwise use our own trimming functionality
- function( text ) {
- return text == null ?
- "" :
- ( text + "" ).replace( rtrim, "" );
- },
-
- // results is for internal usage only
- makeArray: function( arr, results ) {
- var type,
- ret = results || [];
-
- if ( arr != null ) {
- // The window, strings (and functions) also have 'length'
- // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
- type = jQuery.type( arr );
-
- if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
- core_push.call( ret, arr );
- } else {
- jQuery.merge( ret, arr );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, arr, i ) {
- var len;
-
- if ( arr ) {
- if ( core_indexOf ) {
- return core_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 l = second.length,
- i = first.length,
- j = 0;
-
- if ( typeof l === "number" ) {
- for ( ; j < l; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- } else {
- while ( second[j] !== undefined ) {
- first[ i++ ] = second[ j++ ];
- }
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, inv ) {
- var retVal,
- ret = [],
- i = 0,
- length = elems.length;
- inv = !!inv;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( ; i < length; i++ ) {
- retVal = !!callback( elems[ i ], i );
- if ( inv !== retVal ) {
- ret.push( elems[ i ] );
- }
- }
-
- return ret;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- var value, key,
- ret = [],
- i = 0,
- length = elems.length,
- // jquery objects are treated as arrays
- isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
- // Go through the array, translating each of the items to their
- if ( isArray ) {
- for ( ; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
-
- // Go through every key on the object,
- } else {
- for ( key in elems ) {
- value = callback( elems[ key ], key, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
- }
-
- // Flatten any nested arrays
- return ret.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 tmp, args, proxy;
-
- 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 = core_slice.call( arguments, 2 );
- proxy = function() {
- return fn.apply( context, args.concat( core_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;
- },
-
- // Multifunctional method to get and set values of a collection
- // The value/s can optionally be executed if it's a function
- access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
- var exec,
- bulk = key == null,
- i = 0,
- length = elems.length;
-
- // Sets many values
- if ( key && typeof key === "object" ) {
- for ( i in key ) {
- jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
- }
- chainable = 1;
-
- // Sets one value
- } else if ( value !== undefined ) {
- // Optionally, function values get executed if exec is true
- exec = pass === undefined && jQuery.isFunction( value );
-
- if ( bulk ) {
- // Bulk operations only iterate when executing function values
- if ( exec ) {
- exec = fn;
- fn = function( elem, key, value ) {
- return exec.call( jQuery( elem ), value );
- };
-
- // Otherwise they run against the entire set
- } else {
- fn.call( elems, value );
- fn = null;
- }
- }
-
- if ( fn ) {
- for (; i < length; i++ ) {
- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
- }
- }
-
- chainable = 1;
- }
-
- return chainable ?
- elems :
-
- // Gets
- bulk ?
- fn.call( elems ) :
- length ? fn( elems[0], key ) : emptyGet;
- },
-
- now: function() {
- return ( new Date() ).getTime();
- }
-});
-
-jQuery.ready.promise = function( obj ) {
- if ( !readyList ) {
-
- readyList = jQuery.Deferred();
-
- // Catch cases where $(document).ready() is called after the browser event has already occurred.
- // we once tried to use readyState "interactive" here, but it caused issues like the one
- // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
- if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- setTimeout( jQuery.ready, 1 );
-
- // Standards-based browsers support DOMContentLoaded
- } else if ( document.addEventListener ) {
- // Use the handy event callback
- document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
- // A fallback to window.onload, that will always work
- window.addEventListener( "load", jQuery.ready, false );
-
- // If IE event model is used
- } else {
- // Ensure firing before onload, maybe late but safe also for iframes
- document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", jQuery.ready );
-
- // 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 setTimeout( doScrollCheck, 50 );
- }
-
- // and execute any waiting functions
- jQuery.ready();
- }
- })();
- }
- }
- }
- return readyList.promise( obj );
-};
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
- var object = optionsCache[ options ] = {};
- jQuery.each( options.split( core_rspace ), 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" ?
- ( optionsCache[ options ] || createOptions( options ) ) :
- jQuery.extend( {}, options );
-
- var // Last fire value (for non-forgettable lists)
- memory,
- // Flag to know if list was already fired
- fired,
- // Flag to know if list is currently firing
- firing,
- // First callback to fire (used internally by add and fireWith)
- firingStart,
- // End of the loop when firing
- firingLength,
- // Index of currently firing callback (modified by remove if needed)
- firingIndex,
- // Actual callback list
- list = [],
- // Stack of fire calls for repeatable lists
- stack = !options.once && [],
- // Fire callbacks
- fire = function( data ) {
- memory = options.memory && data;
- fired = true;
- firingIndex = firingStart || 0;
- firingStart = 0;
- firingLength = list.length;
- firing = true;
- for ( ; list && firingIndex < firingLength; firingIndex++ ) {
- if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
- memory = false; // To prevent further calls using add
- break;
- }
- }
- firing = false;
- if ( list ) {
- if ( stack ) {
- if ( stack.length ) {
- fire( stack.shift() );
- }
- } else if ( memory ) {
- list = [];
- } else {
- self.disable();
- }
- }
- },
- // Actual Callbacks object
- self = {
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if ( list ) {
- // First, we save the current length
- var start = list.length;
- (function add( args ) {
- jQuery.each( args, function( _, arg ) {
- var type = jQuery.type( arg );
- if ( type === "function" ) {
- if ( !options.unique || !self.has( arg ) ) {
- list.push( arg );
- }
- } else if ( arg && arg.length && type !== "string" ) {
- // Inspect recursively
- add( arg );
- }
- });
- })( arguments );
- // Do we need to add the callbacks to the
- // current firing batch?
- if ( firing ) {
- firingLength = list.length;
- // With memory, if we're not firing then
- // we should call right away
- } else if ( memory ) {
- firingStart = start;
- fire( memory );
- }
- }
- return this;
- },
- // Remove a callback from the list
- remove: function() {
- if ( list ) {
- jQuery.each( arguments, function( _, arg ) {
- var index;
- while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
- list.splice( index, 1 );
- // Handle firing indexes
- if ( firing ) {
- if ( index <= firingLength ) {
- firingLength--;
- }
- if ( index <= firingIndex ) {
- firingIndex--;
- }
- }
- }
- });
- }
- return this;
- },
- // Control if a given callback is in the list
- has: function( fn ) {
- return jQuery.inArray( fn, list ) > -1;
- },
- // Remove all callbacks from the list
- empty: function() {
- list = [];
- return this;
- },
- // Have the list do nothing anymore
- disable: function() {
- list = stack = memory = undefined;
- return this;
- },
- // Is it disabled?
- disabled: function() {
- return !list;
- },
- // Lock the list in its current state
- lock: function() {
- stack = undefined;
- if ( !memory ) {
- self.disable();
- }
- return this;
- },
- // Is it locked?
- locked: function() {
- return !stack;
- },
- // Call all callbacks with the given context and arguments
- fireWith: function( context, args ) {
- args = args || [];
- args = [ context, args.slice ? args.slice() : args ];
- if ( list && ( !fired || stack ) ) {
- if ( firing ) {
- stack.push( args );
- } else {
- fire( args );
- }
- }
- 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 action = tuple[ 0 ],
- fn = fns[ i ];
- // deferred[ done | fail | progress ] for forwarding actions to newDefer
- deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?
- function() {
- var returned = fn.apply( this, arguments );
- if ( returned && jQuery.isFunction( returned.promise ) ) {
- returned.promise()
- .done( newDefer.resolve )
- .fail( newDefer.reject )
- .progress( newDefer.notify );
- } else {
- newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
- }
- } :
- newDefer[ action ]
- );
- });
- 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 ] = list.fire
- deferred[ tuple[0] ] = list.fire;
- 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 = core_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 ? core_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()
- .done( updateFunc( i, resolveContexts, resolveValues ) )
- .fail( deferred.reject )
- .progress( updateFunc( i, progressContexts, progressValues ) );
- } else {
- --remaining;
- }
- }
- }
-
- // if we're not waiting on anything, resolve the master
- if ( !remaining ) {
- deferred.resolveWith( resolveContexts, resolveValues );
- }
-
- return deferred.promise();
- }
-});
-jQuery.support = (function() {
-
- var support,
- all,
- a,
- select,
- opt,
- input,
- fragment,
- eventName,
- i,
- isSupported,
- clickFn,
- div = document.createElement("div");
-
- // Setup
- div.setAttribute( "className", "t" );
- div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
-
- // Support tests won't run in some limited or non-browser environments
- all = div.getElementsByTagName("*");
- a = div.getElementsByTagName("a")[ 0 ];
- if ( !all || !a || !all.length ) {
- return {};
- }
-
- // First batch of tests
- select = document.createElement("select");
- opt = select.appendChild( document.createElement("option") );
- input = div.getElementsByTagName("input")[ 0 ];
-
- a.style.cssText = "top:1px;float:left;opacity:.5";
- support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: !div.getElementsByTagName("tbody").length,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: !!div.getElementsByTagName("link").length,
-
- // Get the style information from getAttribute
- // (IE uses .cssText instead)
- style: /top/.test( a.getAttribute("style") ),
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: ( a.getAttribute("href") === "/a" ),
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- // Use a regex to work around a WebKit issue. See #5145
- opacity: /^0.5/.test( a.style.opacity ),
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: !!a.style.cssFloat,
-
- // Make sure that if no value is specified for a checkbox
- // that it defaults to "on".
- // (WebKit defaults to "" instead)
- checkOn: ( input.value === "on" ),
-
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- optSelected: opt.selected,
-
- // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
- getSetAttribute: div.className !== "t",
-
- // Tests for enctype support on a form (#6743)
- enctype: !!document.createElement("form").enctype,
-
- // Makes sure cloning an html5 element does not cause problems
- // Where outerHTML is undefined, this still works
- html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
-
- // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
- boxModel: ( document.compatMode === "CSS1Compat" ),
-
- // Will be defined later
- submitBubbles: true,
- changeBubbles: true,
- focusinBubbles: false,
- deleteExpando: true,
- noCloneEvent: true,
- inlineBlockNeedsLayout: false,
- shrinkWrapBlocks: false,
- reliableMarginRight: true,
- boxSizingReliable: true,
- pixelPosition: false
- };
-
- // Make sure checked status is properly cloned
- input.checked = true;
- support.noCloneChecked = input.cloneNode( true ).checked;
-
- // Make sure that the options inside disabled selects aren't marked as disabled
- // (WebKit marks them as disabled)
- select.disabled = true;
- support.optDisabled = !opt.disabled;
-
- // Test to see if it's possible to delete an expando from an element
- // Fails in Internet Explorer
- try {
- delete div.test;
- } catch( e ) {
- support.deleteExpando = false;
- }
-
- if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
- div.attachEvent( "onclick", clickFn = function() {
- // Cloning a node shouldn't copy over any
- // bound event handlers (IE does this)
- support.noCloneEvent = false;
- });
- div.cloneNode( true ).fireEvent("onclick");
- div.detachEvent( "onclick", clickFn );
- }
-
- // Check if a radio maintains its value
- // after being appended to the DOM
- input = document.createElement("input");
- input.value = "t";
- input.setAttribute( "type", "radio" );
- support.radioValue = input.value === "t";
-
- input.setAttribute( "checked", "checked" );
-
- // #11217 - WebKit loses check when the name is after the checked attribute
- input.setAttribute( "name", "t" );
-
- div.appendChild( input );
- fragment = document.createDocumentFragment();
- fragment.appendChild( div.lastChild );
-
- // WebKit doesn't clone checked state correctly in fragments
- support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
- // Check if a disconnected checkbox will retain its checked
- // value of true after appended to the DOM (IE6/7)
- support.appendChecked = input.checked;
-
- fragment.removeChild( input );
- fragment.appendChild( div );
-
- // Technique from Juriy Zaytsev
- // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
- // We only care about the case where non-standard event systems
- // are used, namely in IE. Short-circuiting here helps us to
- // avoid an eval call (in setAttribute) which can cause CSP
- // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
- if ( div.attachEvent ) {
- for ( i in {
- submit: true,
- change: true,
- focusin: true
- }) {
- eventName = "on" + i;
- isSupported = ( eventName in div );
- if ( !isSupported ) {
- div.setAttribute( eventName, "return;" );
- isSupported = ( typeof div[ eventName ] === "function" );
- }
- support[ i + "Bubbles" ] = isSupported;
- }
- }
-
- // Run tests that need a body at doc ready
- jQuery(function() {
- var container, div, tds, marginDiv,
- divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
- body = document.getElementsByTagName("body")[0];
-
- if ( !body ) {
- // Return for frameset docs that don't have a body
- return;
- }
-
- container = document.createElement("div");
- container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";
- body.insertBefore( container, body.firstChild );
-
- // Construct the test element
- div = document.createElement("div");
- container.appendChild( div );
-
- // Check if table cells still have offsetWidth/Height when they are set
- // to display:none and there are still other visible table cells in a
- // table row; if so, offsetWidth/Height are not reliable for use when
- // determining if an element has been hidden directly using
- // display:none (it is still safe to use offsets if a parent element is
- // hidden; don safety goggles and see bug #4512 for more information).
- // (only IE 8 fails this test)
- div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
- tds = div.getElementsByTagName("td");
- tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
- isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
- tds[ 0 ].style.display = "";
- tds[ 1 ].style.display = "none";
-
- // Check if empty table cells still have offsetWidth/Height
- // (IE <= 8 fail this test)
- support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
- // Check box-sizing and margin behavior
- div.innerHTML = "";
- div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
- support.boxSizing = ( div.offsetWidth === 4 );
- support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
-
- // NOTE: To any future maintainer, we've window.getComputedStyle
- // because jsdom on node.js will break without it.
- if ( window.getComputedStyle ) {
- support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
- support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
-
- // Check if div with explicit width and no margin-right incorrectly
- // gets computed margin-right based on width of container. For more
- // info see bug #3333
- // Fails in WebKit before Feb 2011 nightlies
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- marginDiv = document.createElement("div");
- marginDiv.style.cssText = div.style.cssText = divReset;
- marginDiv.style.marginRight = marginDiv.style.width = "0";
- div.style.width = "1px";
- div.appendChild( marginDiv );
- support.reliableMarginRight =
- !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
- }
-
- if ( typeof div.style.zoom !== "undefined" ) {
- // Check if natively block-level elements act like inline-block
- // elements when setting their display to 'inline' and giving
- // them layout
- // (IE < 8 does this)
- div.innerHTML = "";
- div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
- support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
- // Check if elements with layout shrink-wrap their children
- // (IE 6 does this)
- div.style.display = "block";
- div.style.overflow = "visible";
- div.innerHTML = "<div></div>";
- div.firstChild.style.width = "5px";
- support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-
- container.style.zoom = 1;
- }
-
- // Null elements to avoid leaks in IE
- body.removeChild( container );
- container = div = tds = marginDiv = null;
- });
-
- // Null elements to avoid leaks in IE
- fragment.removeChild( div );
- all = a = select = opt = input = fragment = div = null;
-
- return support;
-})();
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
- rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
- cache: {},
-
- deletedIds: [],
-
- // Remove at next major release (1.9/2.0)
- uuid: 0,
-
- // Unique for each copy of jQuery on the page
- // Non-digits removed to match rinlinejQuery
- expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
- // The following elements throw uncatchable exceptions if you
- // attempt to add expando properties to them.
- noData: {
- "embed": true,
- // Ban all objects except for Flash (which handle expandos)
- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- "applet": true
- },
-
- hasData: function( elem ) {
- elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
- return !!elem && !isEmptyDataObject( elem );
- },
-
- data: function( elem, name, data, pvt /* Internal Use Only */ ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var thisCache, ret,
- internalKey = jQuery.expando,
- getByName = typeof name === "string",
-
- // 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)) && getByName && data === undefined ) {
- 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 ) {
- elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
- } else {
- id = internalKey;
- }
- }
-
- if ( !cache[ id ] ) {
- cache[ id ] = {};
-
- // Avoids exposing jQuery metadata on plain JS objects when the object
- // is serialized using JSON.stringify
- if ( !isNode ) {
- cache[ id ].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 ( getByName ) {
-
- // 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;
- },
-
- removeData: function( elem, name, pvt /* Internal Use Only */ ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- var thisCache, i, l,
-
- 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(" ");
- }
- }
- }
-
- for ( i = 0, l = name.length; i < l; 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 : 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)
- } else if ( jQuery.support.deleteExpando || cache != cache.window ) {
- delete cache[ id ];
-
- // When all else fails, null
- } else {
- cache[ id ] = null;
- }
- },
-
- // For internal use only.
- _data: function( elem, name, data ) {
- return jQuery.data( elem, name, data, true );
- },
-
- // A method for determining if a DOM node can handle the data expando
- acceptData: function( elem ) {
- var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
-
- // nodes accept data unless otherwise specified; rejection can be conditional
- return !noData || noData !== true && elem.getAttribute("classid") === noData;
- }
-});
-
-jQuery.fn.extend({
- data: function( key, value ) {
- var parts, part, attr, name, l,
- elem = this[0],
- i = 0,
- data = null;
-
- // Gets all values
- if ( key === undefined ) {
- if ( this.length ) {
- data = jQuery.data( elem );
-
- if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
- attr = elem.attributes;
- for ( l = attr.length; i < l; i++ ) {
- name = attr[i].name;
-
- if ( !name.indexOf( "data-" ) ) {
- name = jQuery.camelCase( name.substring(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 );
- });
- }
-
- parts = key.split( ".", 2 );
- parts[1] = parts[1] ? "." + parts[1] : "";
- part = parts[1] + "!";
-
- return jQuery.access( this, function( value ) {
-
- if ( value === undefined ) {
- data = this.triggerHandler( "getData" + part, [ parts[0] ] );
-
- // Try to fetch any internally stored data first
- if ( data === undefined && elem ) {
- data = jQuery.data( elem, key );
- data = dataAttr( elem, key, data );
- }
-
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
- }
-
- parts[1] = value;
- this.each(function() {
- var self = jQuery( this );
-
- self.triggerHandler( "setData" + part, parts );
- jQuery.data( this, key, value );
- self.triggerHandler( "changeData" + part, parts );
- });
- }, null, value, arguments.length > 1, null, false );
- },
-
- removeData: function( key ) {
- return this.each(function() {
- jQuery.removeData( this, key );
- });
- }
-});
-
-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;
-}
-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", true );
- jQuery.removeData( elem, key, true );
- })
- });
- }
-});
-
-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 );
- });
- },
- // Based off of the plugin by Clint Helfers, with permission.
- // http://blindsignals.com/index.php/2009/07/jquery-delay/
- delay: function( time, type ) {
- time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
- type = type || "fx";
-
- return this.queue( type, function( next, hooks ) {
- var timeout = setTimeout( next, time );
- hooks.stop = function() {
- clearTimeout( timeout );
- };
- });
- },
- 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 );
- }
-});
-var nodeHook, boolHook, fixSpecified,
- rclass = /[\t\r\n]/g,
- rreturn = /\r/g,
- rtype = /^(?:button|input)$/i,
- rfocusable = /^(?:button|input|object|select|textarea)$/i,
- rclickable = /^a(?:rea|)$/i,
- rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
- getSetAttribute = jQuery.support.getSetAttribute;
-
-jQuery.fn.extend({
- attr: function( name, value ) {
- return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
- },
-
- removeAttr: function( name ) {
- return this.each(function() {
- jQuery.removeAttr( this, name );
- });
- },
-
- prop: function( name, value ) {
- return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
- },
-
- removeProp: function( name ) {
- name = jQuery.propFix[ name ] || name;
- return this.each(function() {
- // try/catch handles cases where IE balks (such as removing a property on window)
- try {
- this[ name ] = undefined;
- delete this[ name ];
- } catch( e ) {}
- });
- },
-
- addClass: function( value ) {
- var classNames, i, l, elem,
- setClass, c, cl;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).addClass( value.call(this, j, this.className) );
- });
- }
-
- if ( value && typeof value === "string" ) {
- classNames = value.split( core_rspace );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- elem = this[ i ];
-
- if ( elem.nodeType === 1 ) {
- if ( !elem.className && classNames.length === 1 ) {
- elem.className = value;
-
- } else {
- setClass = " " + elem.className + " ";
-
- for ( c = 0, cl = classNames.length; c < cl; c++ ) {
- if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {
- setClass += classNames[ c ] + " ";
- }
- }
- elem.className = jQuery.trim( setClass );
- }
- }
- }
- }
-
- return this;
- },
-
- removeClass: function( value ) {
- var removes, className, elem, c, cl, i, l;
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( j ) {
- jQuery( this ).removeClass( value.call(this, j, this.className) );
- });
- }
- if ( (value && typeof value === "string") || value === undefined ) {
- removes = ( value || "" ).split( core_rspace );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- elem = this[ i ];
- if ( elem.nodeType === 1 && elem.className ) {
-
- className = (" " + elem.className + " ").replace( rclass, " " );
-
- // loop over each item in the removal list
- for ( c = 0, cl = removes.length; c < cl; c++ ) {
- // Remove until there is nothing to remove,
- while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
- className = className.replace( " " + removes[ c ] + " " , " " );
- }
- }
- elem.className = value ? jQuery.trim( className ) : "";
- }
- }
- }
-
- return this;
- },
-
- toggleClass: function( value, stateVal ) {
- var type = typeof value,
- isBool = typeof stateVal === "boolean";
-
- if ( jQuery.isFunction( value ) ) {
- return this.each(function( i ) {
- jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
- });
- }
-
- return this.each(function() {
- if ( type === "string" ) {
- // toggle individual class names
- var className,
- i = 0,
- self = jQuery( this ),
- state = stateVal,
- classNames = value.split( core_rspace );
-
- while ( (className = classNames[ i++ ]) ) {
- // check each className given, space separated list
- state = isBool ? state : !self.hasClass( className );
- self[ state ? "addClass" : "removeClass" ]( className );
- }
-
- } else if ( type === "undefined" || type === "boolean" ) {
- if ( this.className ) {
- // store className if set
- jQuery._data( this, "__className__", this.className );
- }
-
- // toggle whole className
- this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
- }
- });
- },
-
- hasClass: function( selector ) {
- var className = " " + selector + " ",
- i = 0,
- l = this.length;
- for ( ; i < l; i++ ) {
- if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
- return true;
- }
- }
-
- return false;
- },
-
- val: function( value ) {
- var hooks, ret, isFunction,
- elem = this[0];
-
- if ( !arguments.length ) {
- if ( elem ) {
- hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
- return ret;
- }
-
- ret = elem.value;
-
- return typeof ret === "string" ?
- // handle most common string cases
- ret.replace(rreturn, "") :
- // handle cases where value is null/undef or number
- ret == null ? "" : ret;
- }
-
- return;
- }
-
- isFunction = jQuery.isFunction( value );
-
- return this.each(function( i ) {
- var val,
- self = jQuery(this);
-
- if ( this.nodeType !== 1 ) {
- return;
- }
-
- if ( isFunction ) {
- val = value.call( this, i, self.val() );
- } else {
- val = value;
- }
-
- // Treat null/undefined as ""; convert numbers to string
- if ( val == null ) {
- val = "";
- } else if ( typeof val === "number" ) {
- val += "";
- } else if ( jQuery.isArray( val ) ) {
- val = jQuery.map(val, function ( value ) {
- return value == null ? "" : value + "";
- });
- }
-
- hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
- // If set returns undefined, fall back to normal setting
- if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
- this.value = val;
- }
- });
- }
-});
-
-jQuery.extend({
- valHooks: {
- option: {
- get: function( elem ) {
- // attributes.value is undefined in Blackberry 4.7 but
- // uses .value. See #6932
- var val = elem.attributes.value;
- return !val || val.specified ? elem.value : elem.text;
- }
- },
- select: {
- get: function( elem ) {
- var value, option,
- options = elem.options,
- index = elem.selectedIndex,
- one = elem.type === "select-one" || index < 0,
- values = one ? null : [],
- max = one ? index + 1 : options.length,
- i = index < 0 ?
- max :
- one ? index : 0;
-
- // Loop through all the selected options
- for ( ; i < max; i++ ) {
- option = options[ i ];
-
- // oldIE doesn't update selected after form reset (#2551)
- if ( ( option.selected || i === index ) &&
- // Don't return options that are disabled or in a disabled optgroup
- ( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
- ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
- // Get the specific value for the option
- value = jQuery( option ).val();
-
- // We don't need an array for one selects
- if ( one ) {
- return value;
- }
-
- // Multi-Selects return an array
- values.push( value );
- }
- }
-
- return values;
- },
-
- set: function( elem, value ) {
- var values = jQuery.makeArray( value );
-
- jQuery(elem).find("option").each(function() {
- this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
- });
-
- if ( !values.length ) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- },
-
- // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9
- attrFn: {},
-
- attr: function( elem, name, value, pass ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set attributes on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) {
- return jQuery( elem )[ name ]( value );
- }
-
- // Fallback to prop when attributes are not supported
- if ( typeof elem.getAttribute === "undefined" ) {
- return jQuery.prop( elem, name, value );
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- // All attributes are lowercase
- // Grab necessary hook if one is defined
- if ( notxml ) {
- name = name.toLowerCase();
- hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
- }
-
- if ( value !== undefined ) {
-
- if ( value === null ) {
- jQuery.removeAttr( elem, name );
- return;
-
- } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- elem.setAttribute( name, value + "" );
- return value;
- }
-
- } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
-
- ret = elem.getAttribute( name );
-
- // Non-existent attributes return null, we normalize to undefined
- return ret === null ?
- undefined :
- ret;
- }
- },
-
- removeAttr: function( elem, value ) {
- var propName, attrNames, name, isBool,
- i = 0;
-
- if ( value && elem.nodeType === 1 ) {
-
- attrNames = value.split( core_rspace );
-
- for ( ; i < attrNames.length; i++ ) {
- name = attrNames[ i ];
-
- if ( name ) {
- propName = jQuery.propFix[ name ] || name;
- isBool = rboolean.test( name );
-
- // See #9699 for explanation of this approach (setting first, then removal)
- // Do not do this for boolean attributes (see #10870)
- if ( !isBool ) {
- jQuery.attr( elem, name, "" );
- }
- elem.removeAttribute( getSetAttribute ? name : propName );
-
- // Set corresponding property to false for boolean attributes
- if ( isBool && propName in elem ) {
- elem[ propName ] = false;
- }
- }
- }
- }
- },
-
- attrHooks: {
- type: {
- set: function( elem, value ) {
- // We can't allow the type property to be changed (since it causes problems in IE)
- if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
- jQuery.error( "type property can't be changed" );
- } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
- // Setting the type on a radio button after the value resets the value in IE6-9
- // Reset value to it's default in case type is set after value
- // This is for element creation
- var val = elem.value;
- elem.setAttribute( "type", value );
- if ( val ) {
- elem.value = val;
- }
- return value;
- }
- }
- },
- // Use the value property for back compat
- // Use the nodeHook for button elements in IE6/7 (#1954)
- value: {
- get: function( elem, name ) {
- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
- return nodeHook.get( elem, name );
- }
- return name in elem ?
- elem.value :
- null;
- },
- set: function( elem, value, name ) {
- if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
- return nodeHook.set( elem, value, name );
- }
- // Does not return so that setAttribute is also used
- elem.value = value;
- }
- }
- },
-
- propFix: {
- tabindex: "tabIndex",
- readonly: "readOnly",
- "for": "htmlFor",
- "class": "className",
- maxlength: "maxLength",
- cellspacing: "cellSpacing",
- cellpadding: "cellPadding",
- rowspan: "rowSpan",
- colspan: "colSpan",
- usemap: "useMap",
- frameborder: "frameBorder",
- contenteditable: "contentEditable"
- },
-
- prop: function( elem, name, value ) {
- var ret, hooks, notxml,
- nType = elem.nodeType;
-
- // don't get/set properties on text, comment and attribute nodes
- if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
- return;
- }
-
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
- if ( notxml ) {
- // Fix name and attach hooks
- name = jQuery.propFix[ name ] || name;
- hooks = jQuery.propHooks[ name ];
- }
-
- if ( value !== undefined ) {
- if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
- return ret;
-
- } else {
- return ( elem[ name ] = value );
- }
-
- } else {
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
- return ret;
-
- } else {
- return elem[ name ];
- }
- }
- },
-
- propHooks: {
- tabIndex: {
- get: function( elem ) {
- // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
- // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
- var attributeNode = elem.getAttributeNode("tabindex");
-
- return attributeNode && attributeNode.specified ?
- parseInt( attributeNode.value, 10 ) :
- rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
- 0 :
- undefined;
- }
- }
- }
-});
-
-// Hook for boolean attributes
-boolHook = {
- get: function( elem, name ) {
- // Align boolean attributes with corresponding properties
- // Fall back to attribute presence where some booleans are not supported
- var attrNode,
- property = jQuery.prop( elem, name );
- return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
- name.toLowerCase() :
- undefined;
- },
- set: function( elem, value, name ) {
- var propName;
- if ( value === false ) {
- // Remove boolean attributes when set to false
- jQuery.removeAttr( elem, name );
- } else {
- // value is true since we know at this point it's type boolean and not false
- // Set boolean attributes to the same name and set the DOM property
- propName = jQuery.propFix[ name ] || name;
- if ( propName in elem ) {
- // Only set the IDL specifically if it already exists on the element
- elem[ propName ] = true;
- }
-
- elem.setAttribute( name, name.toLowerCase() );
- }
- return name;
- }
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
- fixSpecified = {
- name: true,
- id: true,
- coords: true
- };
-
- // Use this for any attribute in IE6/7
- // This fixes almost every IE6/7 issue
- nodeHook = jQuery.valHooks.button = {
- get: function( elem, name ) {
- var ret;
- ret = elem.getAttributeNode( name );
- return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?
- ret.value :
- undefined;
- },
- set: function( elem, value, name ) {
- // Set the existing or create a new attribute node
- var ret = elem.getAttributeNode( name );
- if ( !ret ) {
- ret = document.createAttribute( name );
- elem.setAttributeNode( ret );
- }
- return ( ret.value = value + "" );
- }
- };
-
- // Set width and height to auto instead of 0 on empty string( Bug #8150 )
- // This is for removals
- jQuery.each([ "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- set: function( elem, value ) {
- if ( value === "" ) {
- elem.setAttribute( name, "auto" );
- return value;
- }
- }
- });
- });
-
- // Set contenteditable to false on removals(#10429)
- // Setting to empty string throws an error as an invalid value
- jQuery.attrHooks.contenteditable = {
- get: nodeHook.get,
- set: function( elem, value, name ) {
- if ( value === "" ) {
- value = "false";
- }
- nodeHook.set( elem, value, name );
- }
- };
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
- jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
- jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
- get: function( elem ) {
- var ret = elem.getAttribute( name, 2 );
- return ret === null ? undefined : ret;
- }
- });
- });
-}
-
-if ( !jQuery.support.style ) {
- jQuery.attrHooks.style = {
- get: function( elem ) {
- // Return undefined in the case of empty string
- // Normalize to lowercase since IE uppercases css property names
- return elem.style.cssText.toLowerCase() || undefined;
- },
- set: function( elem, value ) {
- return ( elem.style.cssText = value + "" );
- }
- };
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
- jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
- get: function( elem ) {
- var parent = elem.parentNode;
-
- if ( parent ) {
- parent.selectedIndex;
-
- // Make sure that it also works with optgroups, see #5701
- if ( parent.parentNode ) {
- parent.parentNode.selectedIndex;
- }
- }
- return null;
- }
- });
-}
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
- jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
- jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = {
- get: function( elem ) {
- // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
- return elem.getAttribute("value") === null ? "on" : elem.value;
- }
- };
- });
-}
-jQuery.each([ "radio", "checkbox" ], function() {
- jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
- set: function( elem, value ) {
- if ( jQuery.isArray( value ) ) {
- return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
- }
- }
- });
-});
-var rformElems = /^(?:textarea|input|select)$/i,
- rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
- rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
- rkeyEvent = /^key/,
- rmouseEvent = /^(?:mouse|contextmenu)|click/,
- rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
- hoverHack = function( events ) {
- return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
- };
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
- add: function( elem, types, handler, data, selector ) {
-
- var elemData, eventHandle, events,
- t, tns, type, namespaces, handleObj,
- handleObjIn, handlers, special;
-
- // Don't attach events to noData or text/comment nodes (allow plain objects tho)
- if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
- 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
- events = elemData.events;
- if ( !events ) {
- elemData.events = events = {};
- }
- eventHandle = elemData.handle;
- if ( !eventHandle ) {
- elemData.handle = eventHandle = 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
- // jQuery(...).bind("mouseover mouseout", fn);
- types = jQuery.trim( hoverHack(types) ).split( " " );
- for ( t = 0; t < types.length; t++ ) {
-
- tns = rtypenamespace.exec( types[t] ) || [];
- type = tns[1];
- namespaces = ( tns[2] || "" ).split( "." ).sort();
-
- // 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: tns[1],
- 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
- handlers = events[ type ];
- if ( !handlers ) {
- 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;
- },
-
- global: {},
-
- // Detach an event or set of events from an element
- remove: function( elem, types, handler, selector, mappedTypes ) {
-
- var t, tns, type, origType, namespaces, origCount,
- j, events, special, eventType, handleObj,
- 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 = jQuery.trim( hoverHack( types || "" ) ).split(" ");
- for ( t = 0; t < types.length; t++ ) {
- tns = rtypenamespace.exec( types[t] ) || [];
- type = origType = tns[1];
- namespaces = tns[2];
-
- // 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;
- eventType = events[ type ] || [];
- origCount = eventType.length;
- namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
-
- // Remove matching events
- for ( j = 0; j < eventType.length; j++ ) {
- handleObj = eventType[ j ];
-
- if ( ( mappedTypes || origType === handleObj.origType ) &&
- ( !handler || handler.guid === handleObj.guid ) &&
- ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
- ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
- eventType.splice( j--, 1 );
-
- if ( handleObj.selector ) {
- eventType.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 ( eventType.length === 0 && origCount !== eventType.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", true );
- }
- },
-
- // Events that are safe to short-circuit if no handlers are attached.
- // Native DOM events should not be added, they may have inline handlers.
- customEvent: {
- "getData": true,
- "setData": true,
- "changeData": true
- },
-
- trigger: function( event, data, elem, onlyHandlers ) {
- // Don't do events on text and comment nodes
- if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
- return;
- }
-
- // Event object or event type
- var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,
- type = event.type || event,
- namespaces = [];
-
- // 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( "!" ) >= 0 ) {
- // Exclusive events trigger only for the exact event (no namespaces)
- type = type.slice(0, -1);
- exclusive = true;
- }
-
- if ( type.indexOf( "." ) >= 0 ) {
- // Namespaced trigger; create a regexp to match event type in handle()
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
-
- if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
- // No jQuery handlers for this event type, and it can't have inline handlers
- return;
- }
-
- // Caller can pass in an Event, Object, or just an event type string
- event = typeof event === "object" ?
- // jQuery.Event object
- event[ jQuery.expando ] ? event :
- // Object literal
- new jQuery.Event( type, event ) :
- // Just the event type (string)
- new jQuery.Event( type );
-
- event.type = type;
- event.isTrigger = true;
- event.exclusive = exclusive;
- event.namespace = namespaces.join( "." );
- event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
- ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
-
- // Handle a global trigger
- if ( !elem ) {
-
- // TODO: Stop taunting the data cache; remove global events and always attach to document
- cache = jQuery.cache;
- for ( i in cache ) {
- if ( cache[ i ].events && cache[ i ].events[ type ] ) {
- jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
- }
- }
- return;
- }
-
- // 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 ? jQuery.makeArray( data ) : [];
- data.unshift( event );
-
- // Allow special events to draw outside the lines
- special = jQuery.event.special[ type ] || {};
- if ( 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)
- eventPath = [[ elem, special.bindType || type ]];
- if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
- bubbleType = special.delegateType || type;
- cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
- for ( old = elem; cur; cur = cur.parentNode ) {
- eventPath.push([ cur, bubbleType ]);
- old = cur;
- }
-
- // Only add window if we got to document (e.g., not plain obj or detached DOM)
- if ( old === (elem.ownerDocument || document) ) {
- eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
- }
- }
-
- // Fire handlers on the event path
- for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
-
- cur = eventPath[i][0];
- event.type = eventPath[i][1];
-
- handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
- if ( handle ) {
- handle.apply( cur, data );
- }
- // Note that this is a bare JS function and not a jQuery handler
- handle = ontype && cur[ ontype ];
- if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === 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( elem.ownerDocument, data ) === false) &&
- !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.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)
- // IE<9 dies on focus/blur to hidden element (#1486)
- if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
-
- // Don't re-trigger an onFOO event when we call its FOO() method
- old = elem[ ontype ];
-
- if ( old ) {
- elem[ ontype ] = null;
- }
-
- // Prevent re-triggering of the same event, since we already bubbled it above
- jQuery.event.triggered = type;
- elem[ type ]();
- jQuery.event.triggered = undefined;
-
- if ( old ) {
- elem[ ontype ] = old;
- }
- }
- }
- }
-
- return event.result;
- },
-
- dispatch: function( event ) {
-
- // Make a writable jQuery.Event from the native event object
- event = jQuery.event.fix( event || window.event );
-
- var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
- handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
- delegateCount = handlers.delegateCount,
- args = core_slice.call( arguments ),
- run_all = !event.exclusive && !event.namespace,
- special = jQuery.event.special[ event.type ] || {},
- handlerQueue = [];
-
- // 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 that should run if there are delegated events
- // Avoid non-left-click bubbling in Firefox (#3861)
- if ( delegateCount && !(event.button && event.type === "click") ) {
-
- for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
-
- // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)
- if ( cur.disabled !== true || event.type !== "click" ) {
- selMatch = {};
- matches = [];
- for ( i = 0; i < delegateCount; i++ ) {
- handleObj = handlers[ i ];
- sel = handleObj.selector;
-
- if ( selMatch[ sel ] === undefined ) {
- selMatch[ sel ] = handleObj.needsContext ?
- jQuery( sel, this ).index( cur ) >= 0 :
- jQuery.find( sel, this, null, [ cur ] ).length;
- }
- if ( selMatch[ sel ] ) {
- matches.push( handleObj );
- }
- }
- if ( matches.length ) {
- handlerQueue.push({ elem: cur, matches: matches });
- }
- }
- }
- }
-
- // Add the remaining (directly-bound) handlers
- if ( handlers.length > delegateCount ) {
- handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
- }
-
- // Run delegates first; they may want to stop propagation beneath us
- for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
- matched = handlerQueue[ i ];
- event.currentTarget = matched.elem;
-
- for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
- handleObj = matched.matches[ j ];
-
- // Triggered event must either 1) be non-exclusive and have no namespace, or
- // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
- if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
-
- event.data = handleObj.data;
- event.handleObj = handleObj;
-
- ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
- .apply( matched.elem, args );
-
- if ( ret !== undefined ) {
- event.result = ret;
- if ( 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;
- },
-
- // Includes some event props shared by KeyEvent and MouseEvent
- // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
- props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget 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 eventDoc, doc, body,
- 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;
- }
- },
-
- fix: function( event ) {
- if ( event[ jQuery.expando ] ) {
- return event;
- }
-
- // Create a writable copy of the event object and normalize some properties
- var i, prop,
- originalEvent = event,
- fixHook = jQuery.event.fixHooks[ event.type ] || {},
- copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
- event = jQuery.Event( originalEvent );
-
- for ( i = copy.length; i; ) {
- prop = copy[ --i ];
- event[ prop ] = originalEvent[ prop ];
- }
-
- // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
- if ( !event.target ) {
- event.target = originalEvent.srcElement || document;
- }
-
- // Target should not be a text node (#504, Safari)
- if ( event.target.nodeType === 3 ) {
- event.target = event.target.parentNode;
- }
-
- // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)
- event.metaKey = !!event.metaKey;
-
- return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
- },
-
- special: {
- load: {
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
-
- focus: {
- delegateType: "focusin"
- },
- blur: {
- delegateType: "focusout"
- },
-
- beforeunload: {
- setup: function( data, namespaces, eventHandle ) {
- // We only want to do this special case on windows
- if ( jQuery.isWindow( this ) ) {
- this.onbeforeunload = eventHandle;
- }
- },
-
- teardown: function( namespaces, eventHandle ) {
- if ( this.onbeforeunload === eventHandle ) {
- this.onbeforeunload = null;
- }
- }
- }
- },
-
- simulate: function( type, elem, event, bubble ) {
- // Piggyback on a donor event to simulate a different one.
- // Fake originalEvent to avoid donor's stopPropagation, but if the
- // simulated event prevents default then we do the same on the donor.
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- { type: type,
- isSimulated: true,
- originalEvent: {}
- }
- );
- if ( bubble ) {
- jQuery.event.trigger( e, null, elem );
- } else {
- jQuery.event.dispatch.call( elem, e );
- }
- if ( e.isDefaultPrevented() ) {
- event.preventDefault();
- }
- }
-};
-
-// Some plugins are using, but it's undocumented/deprecated and will be removed.
-// The 1.7 special event interface should provide all the hooks needed now.
-jQuery.event.handle = jQuery.event.dispatch;
-
-jQuery.removeEvent = document.removeEventListener ?
- function( elem, type, handle ) {
- if ( elem.removeEventListener ) {
- elem.removeEventListener( type, handle, false );
- }
- } :
- 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.returnValue === false ||
- src.getPreventDefault && src.getPreventDefault() ) ? 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;
-};
-
-function returnFalse() {
- return false;
-}
-function returnTrue() {
- return 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 = {
- preventDefault: function() {
- this.isDefaultPrevented = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
-
- // if preventDefault exists run it on the original event
- if ( e.preventDefault ) {
- e.preventDefault();
-
- // otherwise set the returnValue property of the original event to false (IE)
- } else {
- e.returnValue = false;
- }
- },
- stopPropagation: function() {
- this.isPropagationStopped = returnTrue;
-
- var e = this.originalEvent;
- if ( !e ) {
- return;
- }
- // if stopPropagation exists run it on the original event
- if ( e.stopPropagation ) {
- e.stopPropagation();
- }
- // otherwise set the cancelBubble property of the original event to true (IE)
- e.cancelBubble = true;
- },
- stopImmediatePropagation: function() {
- this.isImmediatePropagationStopped = returnTrue;
- this.stopPropagation();
- },
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
-}, function( orig, fix ) {
- jQuery.event.special[ orig ] = {
- delegateType: fix,
- bindType: fix,
-
- handle: function( event ) {
- var ret,
- target = this,
- related = event.relatedTarget,
- handleObj = event.handleObj,
- selector = handleObj.selector;
-
- // For mousenter/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 ( !jQuery.support.submitBubbles ) {
-
- 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" ) ? elem.form : undefined;
- if ( form && !jQuery._data( form, "_submit_attached" ) ) {
- jQuery.event.add( form, "submit._submit", function( event ) {
- event._submit_bubble = true;
- });
- jQuery._data( form, "_submit_attached", 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._submit_bubble ) {
- delete event._submit_bubble;
- if ( this.parentNode && !event.isTrigger ) {
- jQuery.event.simulate( "submit", this.parentNode, event, true );
- }
- }
- },
-
- 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 ( !jQuery.support.changeBubbles ) {
-
- 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._just_changed = true;
- }
- });
- jQuery.event.add( this, "click._change", function( event ) {
- if ( this._just_changed && !event.isTrigger ) {
- this._just_changed = false;
- }
- // Allow triggered, simulated change events (#11500)
- jQuery.event.simulate( "change", this, event, true );
- });
- }
- 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_attached" ) ) {
- jQuery.event.add( elem, "change._change", function( event ) {
- if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
- jQuery.event.simulate( "change", this.parentNode, event, true );
- }
- });
- jQuery._data( elem, "_change_attached", 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 );
- }
- };
-}
-
-// Create "bubbling" focus and blur events
-if ( !jQuery.support.focusinBubbles ) {
- jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
- // Attach a single capturing handler while someone wants focusin/focusout
- var attaches = 0,
- handler = function( event ) {
- jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
- };
-
- jQuery.event.special[ fix ] = {
- setup: function() {
- if ( attaches++ === 0 ) {
- document.addEventListener( orig, handler, true );
- }
- },
- teardown: function() {
- if ( --attaches === 0 ) {
- document.removeEventListener( orig, handler, true );
- }
- }
- };
- });
-}
-
-jQuery.fn.extend({
-
- on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
- var origFn, type;
-
- // Types can be a map of types/handlers
- if ( typeof types === "object" ) {
- // ( types-Object, selector, data )
- if ( typeof selector !== "string" ) { // && selector != null
- // ( types-Object, data )
- data = data || selector;
- selector = undefined;
- }
- for ( type in types ) {
- this.on( type, selector, data, types[ type ], one );
- }
- return this;
- }
-
- 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 this;
- }
-
- 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 this.each( function() {
- jQuery.event.add( this, types, fn, data, selector );
- });
- },
- one: function( types, selector, data, fn ) {
- return this.on( 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 );
- });
- },
-
- bind: function( types, data, fn ) {
- return this.on( types, null, data, fn );
- },
- unbind: function( types, fn ) {
- return this.off( types, null, fn );
- },
-
- live: function( types, data, fn ) {
- jQuery( this.context ).on( types, this.selector, data, fn );
- return this;
- },
- die: function( types, fn ) {
- jQuery( this.context ).off( types, this.selector || "**", fn );
- return this;
- },
-
- delegate: function( selector, types, data, fn ) {
- return this.on( types, selector, data, fn );
- },
- undelegate: function( selector, types, fn ) {
- // ( namespace ) or ( selector, types [, fn] )
- return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
- },
-
- trigger: function( type, data ) {
- return this.each(function() {
- jQuery.event.trigger( type, data, this );
- });
- },
- triggerHandler: function( type, data ) {
- if ( this[0] ) {
- return jQuery.event.trigger( type, data, this[0], true );
- }
- },
-
- toggle: function( fn ) {
- // Save reference to arguments for access in closure
- var args = arguments,
- guid = fn.guid || jQuery.guid++,
- i = 0,
- toggler = function( event ) {
- // Figure out which function to execute
- var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
- jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
- // Make sure that clicks stop
- event.preventDefault();
-
- // and execute the function
- return args[ lastToggle ].apply( this, arguments ) || false;
- };
-
- // link all the functions, so any of them can unbind this click handler
- toggler.guid = guid;
- while ( i < args.length ) {
- args[ i++ ].guid = guid;
- }
-
- return this.click( toggler );
- },
-
- hover: function( fnOver, fnOut ) {
- return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
- }
-});
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
- "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
- "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
- // Handle event binding
- jQuery.fn[ name ] = function( data, fn ) {
- if ( fn == null ) {
- fn = data;
- data = null;
- }
-
- return arguments.length > 0 ?
- this.on( name, null, data, fn ) :
- this.trigger( name );
- };
-
- if ( rkeyEvent.test( name ) ) {
- jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
- }
-
- if ( rmouseEvent.test( name ) ) {
- jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
- }
-});
-/*!
- * Sizzle CSS Selector Engine
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://sizzlejs.com/
- */
-(function( window, undefined ) {
-
-var cachedruns,
- assertGetIdNotName,
- Expr,
- getText,
- isXML,
- contains,
- compile,
- sortOrder,
- hasDuplicate,
- outermostContext,
-
- baseHasDuplicate = true,
- strundefined = "undefined",
-
- expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
-
- Token = String,
- document = window.document,
- docElem = document.documentElement,
- dirruns = 0,
- done = 0,
- pop = [].pop,
- push = [].push,
- slice = [].slice,
- // Use a stripped-down indexOf if a native one is unavailable
- indexOf = [].indexOf || function( elem ) {
- var i = 0,
- len = this.length;
- for ( ; i < len; i++ ) {
- if ( this[i] === elem ) {
- return i;
- }
- }
- return -1;
- },
-
- // Augment a function for special use by Sizzle
- markFunction = function( fn, value ) {
- fn[ expando ] = value == null || value;
- return fn;
- },
-
- createCache = function() {
- var cache = {},
- keys = [];
-
- return markFunction(function( key, value ) {
- // Only keep the most recent entries
- if ( keys.push( key ) > Expr.cacheLength ) {
- delete cache[ keys.shift() ];
- }
-
- // Retrieve with (key + " ") to avoid collision with native Object.prototype properties (see Issue #157)
- return (cache[ key + " " ] = value);
- }, cache );
- },
-
- classCache = createCache(),
- tokenCache = createCache(),
- compilerCache = createCache(),
-
- // Regex
-
- // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
- whitespace = "[\\x20\\t\\r\\n\\f]",
- // http://www.w3.org/TR/css3-syntax/#characters
- characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
-
- // Loosely modeled on CSS identifier characters
- // An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
- // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
- identifier = characterEncoding.replace( "w", "w#" ),
-
- // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
- operators = "([*^$|!~]?=)",
- attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
- "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
-
- // Prefer arguments not in parens/brackets,
- // then attribute selectors and non-pseudos (denoted by :),
- // then anything else
- // These preferences are here to reduce the number of selectors
- // needing tokenize in the PSEUDO preFilter
- pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
-
- // For matchExpr.POS and matchExpr.needsContext
- pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
- "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
-
- // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
- rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
- rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
- rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
- rpseudo = new RegExp( pseudos ),
-
- // Easily-parseable/retrievable ID or TAG or CLASS selectors
- rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
-
- rnot = /^:not/,
- rsibling = /[\x20\t\r\n\f]*[+~]/,
- rendsWithNot = /:not\($/,
-
- rheader = /h\d/i,
- rinputs = /input|select|textarea|button/i,
-
- rbackslash = /\\(?!\\)/g,
-
- matchExpr = {
- "ID": new RegExp( "^#(" + characterEncoding + ")" ),
- "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
- "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
- "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
- "ATTR": new RegExp( "^" + attributes ),
- "PSEUDO": new RegExp( "^" + pseudos ),
- "POS": new RegExp( pos, "i" ),
- "CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
- "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
- "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
- // For use in libraries implementing .is()
- "needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )
- },
-
- // Support
-
- // Used for testing something on an element
- assert = function( fn ) {
- var div = document.createElement("div");
-
- try {
- return fn( div );
- } catch (e) {
- return false;
- } finally {
- // release memory in IE
- div = null;
- }
- },
-
- // Check if getElementsByTagName("*") returns only elements
- assertTagNameNoComments = assert(function( div ) {
- div.appendChild( document.createComment("") );
- return !div.getElementsByTagName("*").length;
- }),
-
- // Check if getAttribute returns normalized href attributes
- assertHrefNotNormalized = assert(function( div ) {
- div.innerHTML = "<a href='#'></a>";
- return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
- div.firstChild.getAttribute("href") === "#";
- }),
-
- // Check if attributes should be retrieved by attribute nodes
- assertAttributes = assert(function( div ) {
- div.innerHTML = "<select></select>";
- var type = typeof div.lastChild.getAttribute("multiple");
- // IE8 returns a string for some attributes even when not present
- return type !== "boolean" && type !== "string";
- }),
-
- // Check if getElementsByClassName can be trusted
- assertUsableClassName = assert(function( div ) {
- // Opera can't find a second classname (in 9.6)
- div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
- if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
- return false;
- }
-
- // Safari 3.2 caches class attributes and doesn't catch changes
- div.lastChild.className = "e";
- return div.getElementsByClassName("e").length === 2;
- }),
-
- // Check if getElementById returns elements by name
- // Check if getElementsByName privileges form controls or returns elements by ID
- assertUsableName = assert(function( div ) {
- // Inject content
- div.id = expando + 0;
- div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
- docElem.insertBefore( div, docElem.firstChild );
-
- // Test
- var pass = document.getElementsByName &&
- // buggy browsers will return fewer than the correct 2
- document.getElementsByName( expando ).length === 2 +
- // buggy browsers will return more than the correct 0
- document.getElementsByName( expando + 0 ).length;
- assertGetIdNotName = !document.getElementById( expando );
-
- // Cleanup
- docElem.removeChild( div );
-
- return pass;
- });
-
-// If slice is not available, provide a backup
-try {
- slice.call( docElem.childNodes, 0 )[0].nodeType;
-} catch ( e ) {
- slice = function( i ) {
- var elem,
- results = [];
- for ( ; (elem = this[i]); i++ ) {
- results.push( elem );
- }
- return results;
- };
-}
-
-function Sizzle( selector, context, results, seed ) {
- results = results || [];
- context = context || document;
- var match, elem, xml, m,
- nodeType = context.nodeType;
-
- if ( !selector || typeof selector !== "string" ) {
- return results;
- }
-
- if ( nodeType !== 1 && nodeType !== 9 ) {
- return [];
- }
-
- xml = isXML( context );
-
- if ( !xml && !seed ) {
- if ( (match = rquickExpr.exec( selector )) ) {
- // Speed-up: Sizzle("#ID")
- if ( (m = match[1]) ) {
- if ( nodeType === 9 ) {
- elem = context.getElementById( m );
- // 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, Opera, and Webkit return items
- // by name instead of ID
- if ( elem.id === m ) {
- results.push( elem );
- return results;
- }
- } else {
- return results;
- }
- } else {
- // Context is not a document
- if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
- contains( context, elem ) && elem.id === m ) {
- results.push( elem );
- return results;
- }
- }
-
- // Speed-up: Sizzle("TAG")
- } else if ( match[2] ) {
- push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
- return results;
-
- // Speed-up: Sizzle(".CLASS")
- } else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {
- push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
- return results;
- }
- }
- }
-
- // All others
- return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );
-}
-
-Sizzle.matches = function( expr, elements ) {
- return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
- return Sizzle( expr, null, null, [ elem ] ).length > 0;
-};
-
-// Returns a function to use in pseudos for input types
-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
-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
-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]);
- }
- }
- });
- });
-}
-
-/**
- * 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 ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
- // Use textContent for elements
- // innerText usage removed for consistency of new lines (see #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
- } else {
-
- // If no nodeType, this is expected to be an array
- for ( ; (node = elem[i]); i++ ) {
- // Do not traverse comment nodes
- ret += getText( node );
- }
- }
- return ret;
-};
-
-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;
-};
-
-// Element contains another
-contains = Sizzle.contains = 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) );
- } :
- docElem.compareDocumentPosition ?
- function( a, b ) {
- return b && !!( a.compareDocumentPosition( b ) & 16 );
- } :
- function( a, b ) {
- while ( (b = b.parentNode) ) {
- if ( b === a ) {
- return true;
- }
- }
- return false;
- };
-
-Sizzle.attr = function( elem, name ) {
- var val,
- xml = isXML( elem );
-
- if ( !xml ) {
- name = name.toLowerCase();
- }
- if ( (val = Expr.attrHandle[ name ]) ) {
- return val( elem );
- }
- if ( xml || assertAttributes ) {
- return elem.getAttribute( name );
- }
- val = elem.getAttributeNode( name );
- return val ?
- typeof elem[ name ] === "boolean" ?
- elem[ name ] ? name : null :
- val.specified ? val.value : null :
- null;
-};
-
-Expr = Sizzle.selectors = {
-
- // Can be adjusted by the user
- cacheLength: 50,
-
- createPseudo: markFunction,
-
- match: matchExpr,
-
- // IE6/7 return a modified href
- attrHandle: assertHrefNotNormalized ?
- {} :
- {
- "href": function( elem ) {
- return elem.getAttribute( "href", 2 );
- },
- "type": function( elem ) {
- return elem.getAttribute("type");
- }
- },
-
- find: {
- "ID": assertGetIdNotName ?
- function( id, context, xml ) {
- if ( typeof context.getElementById !== strundefined && !xml ) {
- var m = context.getElementById( id );
- // Check parentNode to catch when Blackberry 4.6 returns
- // nodes that are no longer in the document #6963
- return m && m.parentNode ? [m] : [];
- }
- } :
- function( id, context, xml ) {
- if ( typeof context.getElementById !== strundefined && !xml ) {
- var m = context.getElementById( id );
-
- return m ?
- m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
- [m] :
- undefined :
- [];
- }
- },
-
- "TAG": assertTagNameNoComments ?
- function( tag, context ) {
- if ( typeof context.getElementsByTagName !== strundefined ) {
- return context.getElementsByTagName( tag );
- }
- } :
- function( tag, context ) {
- var results = context.getElementsByTagName( tag );
-
- // Filter out possible comments
- if ( tag === "*" ) {
- var elem,
- tmp = [],
- i = 0;
-
- for ( ; (elem = results[i]); i++ ) {
- if ( elem.nodeType === 1 ) {
- tmp.push( elem );
- }
- }
-
- return tmp;
- }
- return results;
- },
-
- "NAME": assertUsableName && function( tag, context ) {
- if ( typeof context.getElementsByName !== strundefined ) {
- return context.getElementsByName( name );
- }
- },
-
- "CLASS": assertUsableClassName && function( className, context, xml ) {
- if ( typeof context.getElementsByClassName !== strundefined && !xml ) {
- return context.getElementsByClassName( className );
- }
- }
- },
-
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
-
- preFilter: {
- "ATTR": function( match ) {
- match[1] = match[1].replace( rbackslash, "" );
-
- // Move the given value to match[3] whether quoted or unquoted
- match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
-
- if ( match[2] === "~=" ) {
- match[3] = " " + match[3] + " ";
- }
-
- return match.slice( 0, 4 );
- },
-
- "CHILD": function( match ) {
- /* matches from matchExpr["CHILD"]
- 1 type (only|nth|...)
- 2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
- 3 xn-component of xn+y argument ([+-]?\d*n|)
- 4 sign of xn-component
- 5 x of xn-component
- 6 sign of y-component
- 7 y of y-component
- */
- match[1] = match[1].toLowerCase();
-
- if ( match[1] === "nth" ) {
- // nth-child requires argument
- if ( !match[2] ) {
- Sizzle.error( match[0] );
- }
-
- // numeric x and y parameters for Expr.filter.CHILD
- // remember that false/true cast respectively to 0/1
- match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );
- match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );
-
- // other types prohibit arguments
- } else if ( match[2] ) {
- Sizzle.error( match[0] );
- }
-
- return match;
- },
-
- "PSEUDO": function( match ) {
- var unquoted, excess;
- if ( matchExpr["CHILD"].test( match[0] ) ) {
- return null;
- }
-
- if ( match[3] ) {
- match[2] = match[3];
- } else if ( (unquoted = match[4]) ) {
- // Only check arguments that contain a pseudo
- if ( 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
- unquoted = unquoted.slice( 0, excess );
- match[0] = match[0].slice( 0, excess );
- }
- match[2] = unquoted;
- }
-
- // Return only captures needed by the pseudo filter method (type and argument)
- return match.slice( 0, 3 );
- }
- },
-
- filter: {
- "ID": assertGetIdNotName ?
- function( id ) {
- id = id.replace( rbackslash, "" );
- return function( elem ) {
- return elem.getAttribute("id") === id;
- };
- } :
- function( id ) {
- id = id.replace( rbackslash, "" );
- return function( elem ) {
- var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
- return node && node.value === id;
- };
- },
-
- "TAG": function( nodeName ) {
- if ( nodeName === "*" ) {
- return function() { return true; };
- }
- nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
-
- return function( elem ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
-
- "CLASS": function( className ) {
- var pattern = classCache[ expando ][ className + " " ];
-
- return pattern ||
- (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
- classCache( className, function( elem ) {
- return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
- });
- },
-
- "ATTR": function( name, operator, check ) {
- return function( elem, context ) {
- 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.substr( result.length - check.length ) === check :
- operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
- operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
- false;
- };
- },
-
- "CHILD": function( type, argument, first, last ) {
-
- if ( type === "nth" ) {
- return function( elem ) {
- var node, diff,
- parent = elem.parentNode;
-
- if ( first === 1 && last === 0 ) {
- return true;
- }
-
- if ( parent ) {
- diff = 0;
- for ( node = parent.firstChild; node; node = node.nextSibling ) {
- if ( node.nodeType === 1 ) {
- diff++;
- if ( elem === node ) {
- break;
- }
- }
- }
- }
-
- // Incorporate the offset (or cast to NaN), then check against cycle size
- diff -= last;
- return diff === first || ( diff % first === 0 && diff / first >= 0 );
- };
- }
-
- return function( elem ) {
- var node = elem;
-
- switch ( type ) {
- case "only":
- case "first":
- while ( (node = node.previousSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- if ( type === "first" ) {
- return true;
- }
-
- node = elem;
-
- /* falls through */
- case "last":
- while ( (node = node.nextSibling) ) {
- if ( node.nodeType === 1 ) {
- return false;
- }
- }
-
- return true;
- }
- };
- },
-
- "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.call( seed, matched[i] );
- seed[ idx ] = !( matches[ idx ] = matched[i] );
- }
- }) :
- function( elem ) {
- return fn( elem, 0, args );
- };
- }
-
- return fn;
- }
- },
-
- 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 );
- return !results.pop();
- };
- }),
-
- "has": markFunction(function( selector ) {
- return function( elem ) {
- return Sizzle( selector, elem ).length > 0;
- };
- }),
-
- "contains": markFunction(function( text ) {
- return function( elem ) {
- return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
- };
- }),
-
- "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;
- },
-
- "parent": function( elem ) {
- return !Expr.pseudos["empty"]( elem );
- },
-
- "empty": function( elem ) {
- // http://www.w3.org/TR/selectors/#empty-pseudo
- // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
- // not comment, processing instructions, or others
- // Thanks to Diego Perini for the nodeName shortcut
- // Greater than "@" means alpha characters (specifically not starting with "#" or "?")
- var nodeType;
- elem = elem.firstChild;
- while ( elem ) {
- if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {
- return false;
- }
- elem = elem.nextSibling;
- }
- return true;
- },
-
- "header": function( elem ) {
- return rheader.test( elem.nodeName );
- },
-
- "text": function( elem ) {
- var type, attr;
- // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
- // use getAttribute instead to test this case
- return elem.nodeName.toLowerCase() === "input" &&
- (type = elem.type) === "text" &&
- ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );
- },
-
- // Input types
- "radio": createInputPseudo("radio"),
- "checkbox": createInputPseudo("checkbox"),
- "file": createInputPseudo("file"),
- "password": createInputPseudo("password"),
- "image": createInputPseudo("image"),
-
- "submit": createButtonPseudo("submit"),
- "reset": createButtonPseudo("reset"),
-
- "button": function( elem ) {
- var name = elem.nodeName.toLowerCase();
- return name === "input" && elem.type === "button" || name === "button";
- },
-
- "input": function( elem ) {
- return rinputs.test( elem.nodeName );
- },
-
- "focus": function( elem ) {
- var doc = elem.ownerDocument;
- return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
- },
-
- "active": function( elem ) {
- return elem === elem.ownerDocument.activeElement;
- },
-
- // Positional types
- "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 ) {
- for ( var i = 0; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "odd": createPositionalPseudo(function( matchIndexes, length ) {
- for ( var i = 1; i < length; i += 2 ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- }),
-
- "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
- for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {
- matchIndexes.push( i );
- }
- return matchIndexes;
- })
- }
-};
-
-function siblingCheck( a, b, ret ) {
- if ( a === b ) {
- return ret;
- }
-
- var cur = a.nextSibling;
-
- while ( cur ) {
- if ( cur === b ) {
- return -1;
- }
-
- cur = cur.nextSibling;
- }
-
- return 1;
-}
-
-sortOrder = docElem.compareDocumentPosition ?
- function( a, b ) {
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
- }
-
- return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?
- a.compareDocumentPosition :
- a.compareDocumentPosition(b) & 4
- ) ? -1 : 1;
- } :
- function( a, b ) {
- // The nodes are identical, we can exit early
- if ( a === b ) {
- hasDuplicate = true;
- return 0;
-
- // Fallback to using sourceIndex (in IE) if it's available on both nodes
- } else if ( a.sourceIndex && b.sourceIndex ) {
- return a.sourceIndex - b.sourceIndex;
- }
-
- var al, bl,
- ap = [],
- bp = [],
- aup = a.parentNode,
- bup = b.parentNode,
- cur = aup;
-
- // If the nodes are siblings (or identical) we can do a quick check
- if ( aup === bup ) {
- return siblingCheck( a, b );
-
- // If no parents were found then the nodes are disconnected
- } else if ( !aup ) {
- return -1;
-
- } else if ( !bup ) {
- return 1;
- }
-
- // Otherwise they're somewhere else in the tree so we need
- // to build up a full list of the parentNodes for comparison
- while ( cur ) {
- ap.unshift( cur );
- cur = cur.parentNode;
- }
-
- cur = bup;
-
- while ( cur ) {
- bp.unshift( cur );
- cur = cur.parentNode;
- }
-
- al = ap.length;
- bl = bp.length;
-
- // Start walking down the tree looking for a discrepancy
- for ( var i = 0; i < al && i < bl; i++ ) {
- if ( ap[i] !== bp[i] ) {
- return siblingCheck( ap[i], bp[i] );
- }
- }
-
- // We ended someplace up the tree so do a sibling check
- return i === al ?
- siblingCheck( a, bp[i], -1 ) :
- siblingCheck( ap[i], b, 1 );
- };
-
-// Always assume the presence of duplicates if sort doesn't
-// pass them to our comparison function (as in Google Chrome).
-[0, 0].sort( sortOrder );
-baseHasDuplicate = !hasDuplicate;
-
-// Document sorting and removing duplicates
-Sizzle.uniqueSort = function( results ) {
- var elem,
- duplicates = [],
- i = 1,
- j = 0;
-
- hasDuplicate = baseHasDuplicate;
- results.sort( sortOrder );
-
- if ( hasDuplicate ) {
- for ( ; (elem = results[i]); i++ ) {
- if ( elem === results[ i - 1 ] ) {
- j = duplicates.push( i );
- }
- }
- while ( j-- ) {
- results.splice( duplicates[ j ], 1 );
- }
- }
-
- return results;
-};
-
-Sizzle.error = function( msg ) {
- throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-function tokenize( selector, parseOnly ) {
- var matched, match, tokens, type,
- soFar, groups, preFilters,
- cached = tokenCache[ expando ][ 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 )) ) {
- tokens.push( matched = new Token( match.shift() ) );
- soFar = soFar.slice( matched.length );
-
- // Cast descendant combinators to space
- matched.type = match[0].replace( rtrim, " " );
- }
-
- // Filters
- for ( type in Expr.filter ) {
- if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
- (match = preFilters[ type ]( match ))) ) {
-
- tokens.push( matched = new Token( match.shift() ) );
- soFar = soFar.slice( matched.length );
- matched.type = type;
- matched.matches = match;
- }
- }
-
- 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 addCombinator( matcher, combinator, base ) {
- var dir = combinator.dir,
- checkNonElements = base && combinator.dir === "parentNode",
- doneName = done++;
-
- return combinator.first ?
- // Check against closest ancestor/preceding element
- function( elem, context, xml ) {
- while ( (elem = elem[ dir ]) ) {
- if ( checkNonElements || elem.nodeType === 1 ) {
- return matcher( elem, context, xml );
- }
- }
- } :
-
- // Check against all ancestor/preceding elements
- function( elem, context, xml ) {
- // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
- if ( !xml ) {
- var cache,
- dirkey = dirruns + " " + doneName + " ",
- cachedkey = dirkey + cachedruns;
- while ( (elem = elem[ dir ]) ) {
- if ( checkNonElements || elem.nodeType === 1 ) {
- if ( (cache = elem[ expando ]) === cachedkey ) {
- return elem.sizset;
- } else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {
- if ( elem.sizset ) {
- return elem;
- }
- } else {
- elem[ expando ] = cachedkey;
- if ( matcher( elem, context, xml ) ) {
- elem.sizset = true;
- return elem;
- }
- elem.sizset = false;
- }
- }
- }
- } else {
- while ( (elem = elem[ dir ]) ) {
- if ( checkNonElements || elem.nodeType === 1 ) {
- if ( matcher( elem, context, xml ) ) {
- return elem;
- }
- }
- }
- }
- };
-}
-
-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 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.call( 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.call( checkContext, elem ) > -1;
- }, implicitRelative, true ),
- matchers = [ function( elem, context, xml ) {
- return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
- (checkContext = context).nodeType ?
- matchContext( elem, context, xml ) :
- matchAnyContext( elem, context, xml ) );
- } ];
-
- 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 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),
- matcher,
- i < j && matcherFromTokens( tokens.slice( i, j ) ),
- j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
- j < len && tokens.join("")
- );
- }
- 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, expandContext ) {
- var elem, j, matcher,
- setMatched = [],
- matchedCount = 0,
- i = "0",
- unmatched = seed && [],
- outermost = expandContext != null,
- contextBackup = outermostContext,
- // We must always have either seed elements or context
- elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
- // Nested matchers should use non-integer dirruns
- dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
-
- if ( outermost ) {
- outermostContext = context !== document && context;
- cachedruns = superMatcher.el;
- }
-
- // Add elements passing elementMatchers directly to results
- for ( ; (elem = elems[i]) != null; i++ ) {
- if ( byElement && elem ) {
- for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
- if ( matcher( elem, context, xml ) ) {
- results.push( elem );
- break;
- }
- }
- if ( outermost ) {
- dirruns = dirrunsUnique;
- cachedruns = ++superMatcher.el;
- }
- }
-
- // 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 );
- }
- }
- }
-
- // Apply set filters to unmatched elements
- matchedCount += i;
- if ( bySet && i !== matchedCount ) {
- for ( j = 0; (matcher = setMatchers[j]); 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;
- };
-
- superMatcher.el = 0;
- return bySet ?
- markFunction( superMatcher ) :
- superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
- var i,
- setMatchers = [],
- elementMatchers = [],
- cached = compilerCache[ expando ][ selector + " " ];
-
- if ( !cached ) {
- // Generate a function of recursive functions that can be used to check each element
- if ( !group ) {
- group = tokenize( selector );
- }
- i = group.length;
- while ( i-- ) {
- cached = matcherFromTokens( group[i] );
- if ( cached[ expando ] ) {
- setMatchers.push( cached );
- } else {
- elementMatchers.push( cached );
- }
- }
-
- // Cache the compiled function
- cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
- }
- return cached;
-};
-
-function multipleContexts( selector, contexts, results ) {
- var i = 0,
- len = contexts.length;
- for ( ; i < len; i++ ) {
- Sizzle( selector, contexts[i], results );
- }
- return results;
-}
-
-function select( selector, context, results, seed, xml ) {
- var i, tokens, token, type, find,
- match = tokenize( selector ),
- j = match.length;
-
- if ( !seed ) {
- // Try to minimize operations if there is only one group
- if ( match.length === 1 ) {
-
- // Take a shortcut and set the context if the root selector is an ID
- tokens = match[0] = match[0].slice( 0 );
- if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
- context.nodeType === 9 && !xml &&
- Expr.relative[ tokens[1].type ] ) {
-
- context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];
- if ( !context ) {
- return results;
- }
-
- selector = selector.slice( tokens.shift().length );
- }
-
- // Fetch a seed set for right-to-left matching
- for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; 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( rbackslash, "" ),
- rsibling.test( tokens[0].type ) && context.parentNode || context,
- xml
- )) ) {
-
- // If seed is empty or no tokens remain, we can return early
- tokens.splice( i, 1 );
- selector = seed.length && tokens.join("");
- if ( !selector ) {
- push.apply( results, slice.call( seed, 0 ) );
- return results;
- }
-
- break;
- }
- }
- }
- }
- }
-
- // Compile and execute a filtering function
- // Provide `match` to avoid retokenization if we modified the selector above
- compile( selector, match )(
- seed,
- context,
- xml,
- results,
- rsibling.test( selector )
- );
- return results;
-}
-
-if ( document.querySelectorAll ) {
- (function() {
- var disconnectedMatch,
- oldSelect = select,
- rescape = /'|\\/g,
- rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
-
- // qSa(:focus) reports false when true (Chrome 21), no need to also add to buggyMatches since matches checks buggyQSA
- // A support test would require too much code (would include document ready)
- rbuggyQSA = [ ":focus" ],
-
- // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
- // A support test would require too much code (would include document ready)
- // just skip matchesSelector for :active
- rbuggyMatches = [ ":active" ],
- matches = docElem.matchesSelector ||
- docElem.mozMatchesSelector ||
- docElem.webkitMatchesSelector ||
- docElem.oMatchesSelector ||
- docElem.msMatchesSelector;
-
- // 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 explictly
- // setting a boolean content attribute,
- // since its presence should be enough
- // http://bugs.jquery.com/ticket/12359
- div.innerHTML = "<select><option selected=''></option></select>";
-
- // IE8 - Some boolean attributes are not treated correctly
- if ( !div.querySelectorAll("[selected]").length ) {
- rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
- }
-
- // Webkit/Opera - :checked should return selected option elements
- // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
- // IE8 throws error here (do not put tests after this one)
- if ( !div.querySelectorAll(":checked").length ) {
- rbuggyQSA.push(":checked");
- }
- });
-
- assert(function( div ) {
-
- // Opera 10-12/IE9 - ^= $= *= and empty values
- // Should not select anything
- div.innerHTML = "<p test=''></p>";
- if ( div.querySelectorAll("[test^='']").length ) {
- rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
- }
-
- // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
- // IE8 throws error here (do not put tests after this one)
- div.innerHTML = "<input type='hidden'/>";
- if ( !div.querySelectorAll(":enabled").length ) {
- rbuggyQSA.push(":enabled", ":disabled");
- }
- });
-
- // rbuggyQSA always contains :focus, so no need for a length check
- rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );
-
- select = function( selector, context, results, seed, xml ) {
- // Only use querySelectorAll when not filtering,
- // when this is not xml,
- // and when no QSA bugs apply
- if ( !seed && !xml && !rbuggyQSA.test( selector ) ) {
- var groups, i,
- old = true,
- nid = expando,
- newContext = context,
- newSelector = context.nodeType === 9 && selector;
-
- // qSA works strangely on Element-rooted queries
- // We can work around this by specifying an extra ID on the root
- // and working up from there (Thanks to Andrew Dupont for the technique)
- // IE 8 doesn't work on object elements
- if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
- groups = tokenize( selector );
-
- if ( (old = context.getAttribute("id")) ) {
- nid = old.replace( rescape, "\\$&" );
- } else {
- context.setAttribute( "id", nid );
- }
- nid = "[id='" + nid + "'] ";
-
- i = groups.length;
- while ( i-- ) {
- groups[i] = nid + groups[i].join("");
- }
- newContext = rsibling.test( selector ) && context.parentNode || context;
- newSelector = groups.join(",");
- }
-
- if ( newSelector ) {
- try {
- push.apply( results, slice.call( newContext.querySelectorAll(
- newSelector
- ), 0 ) );
- return results;
- } catch(qsaError) {
- } finally {
- if ( !old ) {
- context.removeAttribute("id");
- }
- }
- }
- }
-
- return oldSelect( selector, context, results, seed, xml );
- };
-
- if ( matches ) {
- assert(function( div ) {
- // Check to see if it's possible to do matchesSelector
- // on a disconnected node (IE 9)
- disconnectedMatch = matches.call( div, "div" );
-
- // This should fail with an exception
- // Gecko does not error, returns false instead
- try {
- matches.call( div, "[test!='']:sizzle" );
- rbuggyMatches.push( "!=", pseudos );
- } catch ( e ) {}
- });
-
- // rbuggyMatches always contains :active and :focus, so no need for a length check
- rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );
-
- Sizzle.matchesSelector = function( elem, expr ) {
- // Make sure that attribute selectors are quoted
- expr = expr.replace( rattributeQuotes, "='$1']" );
-
- // rbuggyMatches always contains :active, so no need for an existence check
- if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && !rbuggyQSA.test( expr ) ) {
- try {
- var ret = matches.call( elem, expr );
-
- // IE 9's matchesSelector returns false on disconnected nodes
- if ( ret || 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, null, null, [ elem ] ).length > 0;
- };
- }
- })();
-}
-
-// Deprecated
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Back-compat
-function setFilters() {}
-Expr.filters = setFilters.prototype = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
-// Override sizzle attribute retrieval
-Sizzle.attr = jQuery.attr;
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.pseudos;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-})( window );
-var runtil = /Until$/,
- rparentsprev = /^(?:parents|prev(?:Until|All))/,
- isSimple = /^.[^:#\[\.,]*$/,
- rneedsContext = jQuery.expr.match.needsContext,
- // 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({
- find: function( selector ) {
- var i, l, length, n, r, ret,
- self = this;
-
- if ( typeof selector !== "string" ) {
- return jQuery( selector ).filter(function() {
- for ( i = 0, l = self.length; i < l; i++ ) {
- if ( jQuery.contains( self[ i ], this ) ) {
- return true;
- }
- }
- });
- }
-
- ret = this.pushStack( "", "find", selector );
-
- for ( i = 0, l = this.length; i < l; i++ ) {
- length = ret.length;
- jQuery.find( selector, this[i], ret );
-
- if ( i > 0 ) {
- // Make sure that the results are unique
- for ( n = length; n < ret.length; n++ ) {
- for ( r = 0; r < length; r++ ) {
- if ( ret[r] === ret[n] ) {
- ret.splice(n--, 1);
- break;
- }
- }
- }
- }
- }
-
- return ret;
- },
-
- 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;
- }
- }
- });
- },
-
- not: function( selector ) {
- return this.pushStack( winnow(this, selector, false), "not", selector);
- },
-
- filter: function( selector ) {
- return this.pushStack( winnow(this, selector, true), "filter", selector );
- },
-
- is: function( selector ) {
- return !!selector && (
- typeof selector === "string" ?
- // 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".
- rneedsContext.test( selector ) ?
- jQuery( selector, this.context ).index( this[0] ) >= 0 :
- jQuery.filter( selector, this ).length > 0 :
- this.filter( selector ).length > 0 );
- },
-
- closest: function( selectors, context ) {
- var cur,
- i = 0,
- l = this.length,
- ret = [],
- pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
- jQuery( selectors, context || this.context ) :
- 0;
-
- for ( ; i < l; i++ ) {
- cur = this[i];
-
- while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
- if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
- ret.push( cur );
- break;
- }
- cur = cur.parentNode;
- }
- }
-
- ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
-
- return this.pushStack( ret, "closest", selectors );
- },
-
- // 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.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 ) {
- var set = typeof selector === "string" ?
- jQuery( selector, context ) :
- jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
- all = jQuery.merge( this.get(), set );
-
- return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
- all :
- jQuery.unique( all ) );
- },
-
- addBack: function( selector ) {
- return this.add( selector == null ?
- this.prevObject : this.prevObject.filter(selector)
- );
- }
-});
-
-jQuery.fn.andSelf = jQuery.fn.addBack;
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
-function isDisconnected( node ) {
- return !node || !node.parentNode || node.parentNode.nodeType === 11;
-}
-
-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 jQuery.dir( elem, "parentNode" );
- },
- parentsUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "parentNode", until );
- },
- next: function( elem ) {
- return sibling( elem, "nextSibling" );
- },
- prev: function( elem ) {
- return sibling( elem, "previousSibling" );
- },
- nextAll: function( elem ) {
- return jQuery.dir( elem, "nextSibling" );
- },
- prevAll: function( elem ) {
- return jQuery.dir( elem, "previousSibling" );
- },
- nextUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "nextSibling", until );
- },
- prevUntil: function( elem, i, until ) {
- return jQuery.dir( elem, "previousSibling", until );
- },
- siblings: function( elem ) {
- return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
- },
- children: function( elem ) {
- return jQuery.sibling( 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 ( !runtil.test( name ) ) {
- selector = until;
- }
-
- if ( selector && typeof selector === "string" ) {
- ret = jQuery.filter( selector, ret );
- }
-
- ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
-
- if ( this.length > 1 && rparentsprev.test( name ) ) {
- ret = ret.reverse();
- }
-
- return this.pushStack( ret, name, core_slice.call( arguments ).join(",") );
- };
-});
-
-jQuery.extend({
- filter: function( expr, elems, not ) {
- if ( not ) {
- expr = ":not(" + expr + ")";
- }
-
- return elems.length === 1 ?
- jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
- jQuery.find.matches(expr, elems);
- },
-
- dir: function( elem, dir, until ) {
- var matched = [],
- cur = elem[ dir ];
-
- while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
- if ( cur.nodeType === 1 ) {
- matched.push( cur );
- }
- cur = cur[dir];
- }
- return matched;
- },
-
- sibling: function( n, elem ) {
- var r = [];
-
- for ( ; n; n = n.nextSibling ) {
- if ( n.nodeType === 1 && n !== elem ) {
- r.push( n );
- }
- }
-
- return r;
- }
-});
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, keep ) {
-
- // Can't pass null or undefined to indexOf in Firefox 4
- // Set to 0 to skip string check
- qualifier = qualifier || 0;
-
- if ( jQuery.isFunction( qualifier ) ) {
- return jQuery.grep(elements, function( elem, i ) {
- var retVal = !!qualifier.call( elem, i, elem );
- return retVal === keep;
- });
-
- } else if ( qualifier.nodeType ) {
- return jQuery.grep(elements, function( elem, i ) {
- return ( elem === qualifier ) === keep;
- });
-
- } else if ( typeof qualifier === "string" ) {
- var filtered = jQuery.grep(elements, function( elem ) {
- return elem.nodeType === 1;
- });
-
- if ( isSimple.test( qualifier ) ) {
- return jQuery.filter(qualifier, filtered, !keep);
- } else {
- qualifier = jQuery.filter( qualifier, filtered );
- }
- }
-
- return jQuery.grep(elements, function( elem, i ) {
- return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
- });
-}
-function createSafeFragment( document ) {
- var list = nodeNames.split( "|" ),
- safeFrag = document.createDocumentFragment();
-
- if ( safeFrag.createElement ) {
- while ( list.length ) {
- safeFrag.createElement(
- list.pop()
- );
- }
- }
- return safeFrag;
-}
-
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
- "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
- rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
- rleadingWhitespace = /^\s+/,
- rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
- rtagName = /<([\w:]+)/,
- rtbody = /<tbody/i,
- rhtml = /<|&#?\w+;/,
- rnoInnerhtml = /<(?:script|style|link)/i,
- rnocache = /<(?:script|object|embed|option|style)/i,
- rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
- rcheckableType = /^(?:checkbox|radio)$/,
- // checked="checked" or checked
- rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
- rscriptType = /\/(java|ecma)script/i,
- rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
- wrapMap = {
- option: [ 1, "<select multiple='multiple'>", "</select>" ],
- legend: [ 1, "<fieldset>", "</fieldset>" ],
- thead: [ 1, "<table>", "</table>" ],
- tr: [ 2, "<table><tbody>", "</tbody></table>" ],
- td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
- col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
- area: [ 1, "<map>", "</map>" ],
- _default: [ 0, "", "" ]
- },
- safeFragment = createSafeFragment( document ),
- fragmentDiv = safeFragment.appendChild( document.createElement("div") );
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// 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.
-if ( !jQuery.support.htmlSerialize ) {
- wrapMap._default = [ 1, "X<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
- text: function( value ) {
- return jQuery.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 );
- },
-
- wrapAll: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapAll( html.call(this, i) );
- });
- }
-
- if ( this[0] ) {
- // The elements to wrap the target around
- var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
- if ( this[0].parentNode ) {
- wrap.insertBefore( this[0] );
- }
-
- wrap.map(function() {
- var elem = this;
-
- while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
- elem = elem.firstChild;
- }
-
- return elem;
- }).append( this );
- }
-
- return this;
- },
-
- wrapInner: function( html ) {
- if ( jQuery.isFunction( html ) ) {
- return this.each(function(i) {
- jQuery(this).wrapInner( html.call(this, i) );
- });
- }
-
- return this.each(function() {
- var self = jQuery( this ),
- contents = self.contents();
-
- if ( contents.length ) {
- contents.wrapAll( html );
-
- } else {
- self.append( html );
- }
- });
- },
-
- wrap: function( html ) {
- var isFunction = jQuery.isFunction( html );
-
- return this.each(function(i) {
- jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
- });
- },
-
- unwrap: function() {
- return this.parent().each(function() {
- if ( !jQuery.nodeName( this, "body" ) ) {
- jQuery( this ).replaceWith( this.childNodes );
- }
- }).end();
- },
-
- append: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 ) {
- this.appendChild( elem );
- }
- });
- },
-
- prepend: function() {
- return this.domManip(arguments, true, function( elem ) {
- if ( this.nodeType === 1 || this.nodeType === 11 ) {
- this.insertBefore( elem, this.firstChild );
- }
- });
- },
-
- before: function() {
- if ( !isDisconnected( this[0] ) ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this );
- });
- }
-
- if ( arguments.length ) {
- var set = jQuery.clean( arguments );
- return this.pushStack( jQuery.merge( set, this ), "before", this.selector );
- }
- },
-
- after: function() {
- if ( !isDisconnected( this[0] ) ) {
- return this.domManip(arguments, false, function( elem ) {
- this.parentNode.insertBefore( elem, this.nextSibling );
- });
- }
-
- if ( arguments.length ) {
- var set = jQuery.clean( arguments );
- return this.pushStack( jQuery.merge( this, set ), "after", this.selector );
- }
- },
-
- // keepData is for internal use only--do not document
- remove: function( selector, keepData ) {
- var elem,
- i = 0;
-
- for ( ; (elem = this[i]) != null; i++ ) {
- if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
- if ( !keepData && elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName("*") );
- jQuery.cleanData( [ elem ] );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
- }
- }
-
- return this;
- },
-
- 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( elem.getElementsByTagName("*") );
- }
-
- // Remove any remaining nodes
- while ( elem.firstChild ) {
- elem.removeChild( elem.firstChild );
- }
- }
-
- 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 jQuery.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 ) &&
- ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
- ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
- !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
-
- value = value.replace( rxhtmlTag, "<$1></$2>" );
-
- try {
- for (; i < l; i++ ) {
- // Remove element nodes and prevent memory leaks
- elem = this[i] || {};
- if ( elem.nodeType === 1 ) {
- jQuery.cleanData( elem.getElementsByTagName( "*" ) );
- 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( value ) {
- if ( !isDisconnected( this[0] ) ) {
- // Make sure that the elements are removed from the DOM before they are inserted
- // this can help fix replacing a parent with child elements
- if ( jQuery.isFunction( value ) ) {
- return this.each(function(i) {
- var self = jQuery(this), old = self.html();
- self.replaceWith( value.call( this, i, old ) );
- });
- }
-
- if ( typeof value !== "string" ) {
- value = jQuery( value ).detach();
- }
-
- return this.each(function() {
- var next = this.nextSibling,
- parent = this.parentNode;
-
- jQuery( this ).remove();
-
- if ( next ) {
- jQuery(next).before( value );
- } else {
- jQuery(parent).append( value );
- }
- });
- }
-
- return this.length ?
- this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
- this;
- },
-
- detach: function( selector ) {
- return this.remove( selector, true );
- },
-
- domManip: function( args, table, callback ) {
-
- // Flatten any nested arrays
- args = [].concat.apply( [], args );
-
- var results, first, fragment, iNoClone,
- i = 0,
- value = args[0],
- scripts = [],
- l = this.length;
-
- // We can't cloneNode fragments that contain checked, in WebKit
- if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) {
- return this.each(function() {
- jQuery(this).domManip( args, table, callback );
- });
- }
-
- if ( jQuery.isFunction(value) ) {
- return this.each(function(i) {
- var self = jQuery(this);
- args[0] = value.call( this, i, table ? self.html() : undefined );
- self.domManip( args, table, callback );
- });
- }
-
- if ( this[0] ) {
- results = jQuery.buildFragment( args, this, scripts );
- fragment = results.fragment;
- first = fragment.firstChild;
-
- if ( fragment.childNodes.length === 1 ) {
- fragment = first;
- }
-
- if ( first ) {
- table = table && jQuery.nodeName( first, "tr" );
-
- // Use the original fragment for the last item instead of the first because it can end up
- // being emptied incorrectly in certain situations (#8070).
- // Fragments from the fragment cache must always be cloned and never used in place.
- for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) {
- callback.call(
- table && jQuery.nodeName( this[i], "table" ) ?
- findOrAppend( this[i], "tbody" ) :
- this[i],
- i === iNoClone ?
- fragment :
- jQuery.clone( fragment, true, true )
- );
- }
- }
-
- // Fix #11809: Avoid leaking memory
- fragment = first = null;
-
- if ( scripts.length ) {
- jQuery.each( scripts, function( i, elem ) {
- if ( elem.src ) {
- if ( jQuery.ajax ) {
- jQuery.ajax({
- url: elem.src,
- type: "GET",
- dataType: "script",
- async: false,
- global: false,
- "throws": true
- });
- } else {
- jQuery.error("no ajax");
- }
- } else {
- jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) );
- }
-
- if ( elem.parentNode ) {
- elem.parentNode.removeChild( elem );
- }
- });
- }
- }
-
- return this;
- }
-});
-
-function findOrAppend( elem, tag ) {
- return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
-}
-
-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 cloneFixAttributes( src, dest ) {
- var nodeName;
-
- // We do not need to do anything for non-Elements
- if ( dest.nodeType !== 1 ) {
- return;
- }
-
- // clearAttributes removes the attributes, which we don't want,
- // but also removes the attachEvent events, which we *do* want
- if ( dest.clearAttributes ) {
- dest.clearAttributes();
- }
-
- // mergeAttributes, in contrast, only merges back on the
- // original attributes, not the events
- if ( dest.mergeAttributes ) {
- dest.mergeAttributes( src );
- }
-
- nodeName = dest.nodeName.toLowerCase();
-
- if ( nodeName === "object" ) {
- // IE6-10 improperly clones children of object elements using classid.
- // IE10 throws NoModificationAllowedError if parent is null, #12132.
- 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 ( jQuery.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.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;
-
- // IE blanks contents when cloning scripts
- } else if ( nodeName === "script" && dest.text !== src.text ) {
- dest.text = src.text;
- }
-
- // Event data gets referenced instead of copied if the expando
- // gets copied too
- dest.removeAttribute( jQuery.expando );
-}
-
-jQuery.buildFragment = function( args, context, scripts ) {
- var fragment, cacheable, cachehit,
- first = args[ 0 ];
-
- // Set context from what may come in as undefined or a jQuery collection or a node
- // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
- // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
- context = context || document;
- context = !context.nodeType && context[0] || context;
- context = context.ownerDocument || context;
-
- // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
- // Cloning options loses the selected state, so don't cache them
- // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
- // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
- // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
- if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document &&
- first.charAt(0) === "<" && !rnocache.test( first ) &&
- (jQuery.support.checkClone || !rchecked.test( first )) &&
- (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
-
- // Mark cacheable and look for a hit
- cacheable = true;
- fragment = jQuery.fragments[ first ];
- cachehit = fragment !== undefined;
- }
-
- if ( !fragment ) {
- fragment = context.createDocumentFragment();
- jQuery.clean( args, context, fragment, scripts );
-
- // Update the cache, but only store false
- // unless this is a second parsing of the same content
- if ( cacheable ) {
- jQuery.fragments[ first ] = cachehit && fragment;
- }
- }
-
- return { fragment: fragment, cacheable: cacheable };
-};
-
-jQuery.fragments = {};
-
-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 ),
- l = insert.length,
- parent = this.length === 1 && this[0].parentNode;
-
- if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) {
- insert[ original ]( this[0] );
- return this;
- } else {
- for ( ; i < l; i++ ) {
- elems = ( i > 0 ? this.clone(true) : this ).get();
- jQuery( insert[i] )[ original ]( elems );
- ret = ret.concat( elems );
- }
-
- return this.pushStack( ret, name, insert.selector );
- }
- };
-});
-
-function getAll( elem ) {
- if ( typeof elem.getElementsByTagName !== "undefined" ) {
- return elem.getElementsByTagName( "*" );
-
- } else if ( typeof elem.querySelectorAll !== "undefined" ) {
- return elem.querySelectorAll( "*" );
-
- } else {
- return [];
- }
-}
-
-// Used in clean, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
- if ( rcheckableType.test( elem.type ) ) {
- elem.defaultChecked = elem.checked;
- }
-}
-
-jQuery.extend({
- clone: function( elem, dataAndEvents, deepDataAndEvents ) {
- var srcElements,
- destElements,
- i,
- clone;
-
- if ( jQuery.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 ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
- (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
- // IE copies events bound via attachEvent when using cloneNode.
- // Calling detachEvent on the clone will also remove the events
- // from the original. In order to get around this, we use some
- // proprietary methods to clear the events. Thanks to MooTools
- // guys for this hotness.
-
- cloneFixAttributes( elem, clone );
-
- // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
- srcElements = getAll( elem );
- destElements = getAll( clone );
-
- // Weird iteration because IE will replace the length property
- // with an element if you are cloning the body and one of the
- // elements on the page has a name or id of "length"
- for ( i = 0; srcElements[i]; ++i ) {
- // Ensure that the destination node is not null; Fixes #9587
- if ( destElements[i] ) {
- cloneFixAttributes( srcElements[i], destElements[i] );
- }
- }
- }
-
- // Copy the events from the original to the clone
- if ( dataAndEvents ) {
- cloneCopyEvent( elem, clone );
-
- if ( deepDataAndEvents ) {
- srcElements = getAll( elem );
- destElements = getAll( clone );
-
- for ( i = 0; srcElements[i]; ++i ) {
- cloneCopyEvent( srcElements[i], destElements[i] );
- }
- }
- }
-
- srcElements = destElements = null;
-
- // Return the cloned set
- return clone;
- },
-
- clean: function( elems, context, fragment, scripts ) {
- var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags,
- safe = context === document && safeFragment,
- ret = [];
-
- // Ensure that context is a document
- if ( !context || typeof context.createDocumentFragment === "undefined" ) {
- context = document;
- }
-
- // Use the already-created safe fragment if context permits
- for ( i = 0; (elem = elems[i]) != null; i++ ) {
- if ( typeof elem === "number" ) {
- elem += "";
- }
-
- if ( !elem ) {
- continue;
- }
-
- // Convert html string into DOM nodes
- if ( typeof elem === "string" ) {
- if ( !rhtml.test( elem ) ) {
- elem = context.createTextNode( elem );
- } else {
- // Ensure a safe container in which to render the html
- safe = safe || createSafeFragment( context );
- div = context.createElement("div");
- safe.appendChild( div );
-
- // Fix "XHTML"-style tags in all browsers
- elem = elem.replace(rxhtmlTag, "<$1></$2>");
-
- // Go to html and back, then peel off extra wrappers
- tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
- wrap = wrapMap[ tag ] || wrapMap._default;
- depth = wrap[0];
- div.innerHTML = wrap[1] + elem + wrap[2];
-
- // Move to the right depth
- while ( depth-- ) {
- div = div.lastChild;
- }
-
- // Remove IE's autoinserted <tbody> from table fragments
- if ( !jQuery.support.tbody ) {
-
- // String was a <table>, *may* have spurious <tbody>
- hasBody = rtbody.test(elem);
- tbody = tag === "table" && !hasBody ?
- div.firstChild && div.firstChild.childNodes :
-
- // String was a bare <thead> or <tfoot>
- wrap[1] === "<table>" && !hasBody ?
- div.childNodes :
- [];
-
- for ( j = tbody.length - 1; j >= 0 ; --j ) {
- if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
- tbody[ j ].parentNode.removeChild( tbody[ j ] );
- }
- }
- }
-
- // IE completely kills leading whitespace when innerHTML is used
- if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
- div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
- }
-
- elem = div.childNodes;
-
- // Take out of fragment container (we need a fresh div each time)
- div.parentNode.removeChild( div );
- }
- }
-
- if ( elem.nodeType ) {
- ret.push( elem );
- } else {
- jQuery.merge( ret, elem );
- }
- }
-
- // Fix #11356: Clear elements from safeFragment
- if ( div ) {
- elem = div = safe = null;
- }
-
- // Reset defaultChecked for any radios and checkboxes
- // about to be appended to the DOM in IE 6/7 (#8060)
- if ( !jQuery.support.appendChecked ) {
- for ( i = 0; (elem = ret[i]) != null; i++ ) {
- if ( jQuery.nodeName( elem, "input" ) ) {
- fixDefaultChecked( elem );
- } else if ( typeof elem.getElementsByTagName !== "undefined" ) {
- jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
- }
- }
- }
-
- // Append elements to a provided document fragment
- if ( fragment ) {
- // Special handling of each script element
- handleScript = function( elem ) {
- // Check if we consider it executable
- if ( !elem.type || rscriptType.test( elem.type ) ) {
- // Detach the script and store it in the scripts array (if provided) or the fragment
- // Return truthy to indicate that it has been handled
- return scripts ?
- scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
- fragment.appendChild( elem );
- }
- };
-
- for ( i = 0; (elem = ret[i]) != null; i++ ) {
- // Check if we're done after handling an executable script
- if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
- // Append to fragment and handle embedded scripts
- fragment.appendChild( elem );
- if ( typeof elem.getElementsByTagName !== "undefined" ) {
- // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
- jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
-
- // Splice the scripts into ret after their former ancestor and advance our index beyond them
- ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
- i += jsTags.length;
- }
- }
- }
- }
-
- return ret;
- },
-
- cleanData: function( elems, /* internal */ acceptData ) {
- var data, id, elem, type,
- i = 0,
- internalKey = jQuery.expando,
- cache = jQuery.cache,
- deleteExpando = jQuery.support.deleteExpando,
- special = jQuery.event.special;
-
- for ( ; (elem = elems[i]) != null; i++ ) {
-
- if ( acceptData || jQuery.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 ];
-
- // IE does not allow us to delete expando properties from nodes,
- // nor does it have a removeAttribute function on Document nodes;
- // we must handle all of these cases
- if ( deleteExpando ) {
- delete elem[ internalKey ];
-
- } else if ( elem.removeAttribute ) {
- elem.removeAttribute( internalKey );
-
- } else {
- elem[ internalKey ] = null;
- }
-
- jQuery.deletedIds.push( id );
- }
- }
- }
- }
- }
-});
-// Limit scope pollution from any deprecated API
-(function() {
-
-var matched, browser;
-
-// Use of jQuery.browser is frowned upon.
-// More details: http://api.jquery.com/jQuery.browser
-// jQuery.uaMatch maintained for back-compat
-jQuery.uaMatch = function( ua ) {
- ua = ua.toLowerCase();
-
- var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
- /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
- /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
- /(msie) ([\w.]+)/.exec( ua ) ||
- ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
- [];
-
- return {
- browser: match[ 1 ] || "",
- version: match[ 2 ] || "0"
- };
-};
-
-matched = jQuery.uaMatch( navigator.userAgent );
-browser = {};
-
-if ( matched.browser ) {
- browser[ matched.browser ] = true;
- browser.version = matched.version;
-}
-
-// Chrome is Webkit, but Webkit is also Safari.
-if ( browser.chrome ) {
- browser.webkit = true;
-} else if ( browser.webkit ) {
- browser.safari = true;
-}
-
-jQuery.browser = browser;
-
-jQuery.sub = function() {
- function jQuerySub( selector, context ) {
- return new jQuerySub.fn.init( selector, context );
- }
- jQuery.extend( true, jQuerySub, this );
- jQuerySub.superclass = this;
- jQuerySub.fn = jQuerySub.prototype = this();
- jQuerySub.fn.constructor = jQuerySub;
- jQuerySub.sub = this.sub;
- jQuerySub.fn.init = function init( selector, context ) {
- if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
- context = jQuerySub( context );
- }
-
- return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
- };
- jQuerySub.fn.init.prototype = jQuerySub.fn;
- var rootjQuerySub = jQuerySub(document);
- return jQuerySub;
-};
-
-})();
-var curCSS, iframe, iframeDoc,
- ralpha = /alpha\([^)]*\)/i,
- ropacity = /opacity=([^)]*)/,
- rposition = /^(top|right|bottom|left)$/,
- // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
- // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
- rdisplayswap = /^(none|table(?!-c[ea]).+)/,
- rmargin = /^margin/,
- rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
- rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
- rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),
- elemdisplay = { BODY: "block" },
-
- cssShow = { position: "absolute", visibility: "hidden", display: "block" },
- cssNormalTransform = {
- letterSpacing: 0,
- fontWeight: 400
- },
-
- cssExpand = [ "Top", "Right", "Bottom", "Left" ],
- cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
-
- eventsToggle = jQuery.fn.toggle;
-
-// return a css property mapped to a potentially vendor prefixed property
-function vendorPropName( style, name ) {
-
- // shortcut for names that are not vendor prefixed
- if ( name in style ) {
- return name;
- }
-
- // check for vendor prefixed names
- var capName = name.charAt(0).toUpperCase() + name.slice(1),
- origName = name,
- i = cssPrefixes.length;
-
- while ( i-- ) {
- name = cssPrefixes[ i ] + capName;
- if ( name in style ) {
- return name;
- }
- }
-
- return origName;
-}
-
-function isHidden( elem, el ) {
- elem = el || elem;
- return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
-}
-
-function showHide( elements, show ) {
- var elem, display,
- values = [],
- index = 0,
- length = elements.length;
-
- for ( ; index < length; index++ ) {
- elem = elements[ index ];
- if ( !elem.style ) {
- continue;
- }
- values[ index ] = jQuery._data( elem, "olddisplay" );
- if ( show ) {
- // Reset the inline display of this element to learn if it is
- // being hidden by cascaded rules or not
- if ( !values[ index ] && elem.style.display === "none" ) {
- elem.style.display = "";
- }
-
- // Set elements which have been overridden with display: none
- // in a stylesheet to whatever the default browser style is
- // for such an element
- if ( elem.style.display === "" && isHidden( elem ) ) {
- values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
- }
- } else {
- display = curCSS( elem, "display" );
-
- if ( !values[ index ] && display !== "none" ) {
- jQuery._data( elem, "olddisplay", display );
- }
- }
- }
-
- // Set the display of most of the elements in a second loop
- // to avoid the constant reflow
- for ( index = 0; index < length; index++ ) {
- elem = elements[ index ];
- if ( !elem.style ) {
- continue;
- }
- if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
- elem.style.display = show ? values[ index ] || "" : "none";
- }
- }
-
- return elements;
-}
-
-jQuery.fn.extend({
- css: function( name, value ) {
- return jQuery.access( this, function( elem, name, value ) {
- return value !== undefined ?
- jQuery.style( elem, name, value ) :
- jQuery.css( elem, name );
- }, name, value, arguments.length > 1 );
- },
- show: function() {
- return showHide( this, true );
- },
- hide: function() {
- return showHide( this );
- },
- toggle: function( state, fn2 ) {
- var bool = typeof state === "boolean";
-
- if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) {
- return eventsToggle.apply( this, arguments );
- }
-
- return this.each(function() {
- if ( bool ? state : isHidden( this ) ) {
- jQuery( this ).show();
- } else {
- jQuery( this ).hide();
- }
- });
- }
-});
-
-jQuery.extend({
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function( elem, computed ) {
- if ( computed ) {
- // We should always get a number back from opacity
- var ret = curCSS( elem, "opacity" );
- return ret === "" ? "1" : ret;
-
- }
- }
- }
- },
-
- // Exclude the following css properties to add px
- cssNumber: {
- "fillOpacity": true,
- "fontWeight": true,
- "lineHeight": true,
- "opacity": true,
- "orphans": true,
- "widows": true,
- "zIndex": true,
- "zoom": true
- },
-
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {
- // normalize float css property
- "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
- },
-
- // Get and set the style property on a DOM Node
- style: function( elem, name, value, extra ) {
- // Don't set styles on text and comment nodes
- if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
- return;
- }
-
- // Make sure that we're working with the right name
- var ret, type, hooks,
- origName = jQuery.camelCase( name ),
- style = elem.style;
-
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
-
- // gets hook for the prefixed version
- // followed by the unprefixed version
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // Check if we're setting a value
- if ( value !== undefined ) {
- type = typeof value;
-
- // convert relative number strings (+= or -=) to relative numbers. #7345
- if ( type === "string" && (ret = rrelNum.exec( value )) ) {
- value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
- // Fixes bug #9237
- type = "number";
- }
-
- // Make sure that NaN and null values aren't set. See: #7116
- if ( value == null || type === "number" && isNaN( value ) ) {
- return;
- }
-
- // If a number was passed in, add 'px' to the (except for certain CSS properties)
- if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
- value += "px";
- }
-
- // If a hook was provided, use that value, otherwise just set the specified value
- if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
- // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
- // Fixes bug #5509
- try {
- style[ name ] = value;
- } catch(e) {}
- }
-
- } else {
- // If a hook was provided get the non-computed value from there
- if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
- return ret;
- }
-
- // Otherwise just get the value from the style object
- return style[ name ];
- }
- },
-
- css: function( elem, name, numeric, extra ) {
- var val, num, hooks,
- origName = jQuery.camelCase( name );
-
- // Make sure that we're working with the right name
- name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
-
- // gets hook for the prefixed version
- // followed by the unprefixed version
- hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
- // If a hook was provided get the computed value from there
- if ( hooks && "get" in hooks ) {
- val = hooks.get( elem, true, extra );
- }
-
- // Otherwise, if a way to get the computed value exists, use that
- if ( val === undefined ) {
- val = curCSS( elem, name );
- }
-
- //convert "normal" to computed value
- if ( val === "normal" && name in cssNormalTransform ) {
- val = cssNormalTransform[ name ];
- }
-
- // Return, converting to number if forced or a qualifier was provided and val looks numeric
- if ( numeric || extra !== undefined ) {
- num = parseFloat( val );
- return numeric || jQuery.isNumeric( num ) ? num || 0 : val;
- }
- return val;
- },
-
- // A method for quickly swapping in/out CSS properties to get correct calculations
- swap: function( elem, options, callback ) {
- var ret, name,
- old = {};
-
- // Remember the old values, and insert the new ones
- for ( name in options ) {
- old[ name ] = elem.style[ name ];
- elem.style[ name ] = options[ name ];
- }
-
- ret = callback.call( elem );
-
- // Revert the old values
- for ( name in options ) {
- elem.style[ name ] = old[ name ];
- }
-
- return ret;
- }
-});
-
-// NOTE: To any future maintainer, we've window.getComputedStyle
-// because jsdom on node.js will break without it.
-if ( window.getComputedStyle ) {
- curCSS = function( elem, name ) {
- var ret, width, minWidth, maxWidth,
- computed = window.getComputedStyle( elem, null ),
- style = elem.style;
-
- if ( computed ) {
-
- // getPropertyValue is only needed for .css('filter') in IE9, see #12537
- ret = computed.getPropertyValue( name ) || computed[ name ];
-
- if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
- ret = jQuery.style( elem, name );
- }
-
- // A tribute to the "awesome hack by Dean Edwards"
- // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
- // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
- // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
- if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
- width = style.width;
- minWidth = style.minWidth;
- maxWidth = style.maxWidth;
-
- style.minWidth = style.maxWidth = style.width = ret;
- ret = computed.width;
-
- style.width = width;
- style.minWidth = minWidth;
- style.maxWidth = maxWidth;
- }
- }
-
- return ret;
- };
-} else if ( document.documentElement.currentStyle ) {
- curCSS = function( elem, name ) {
- var left, rsLeft,
- ret = elem.currentStyle && elem.currentStyle[ name ],
- style = elem.style;
-
- // Avoid setting ret to empty string here
- // so we don't default to auto
- if ( ret == null && style && style[ name ] ) {
- ret = style[ name ];
- }
-
- // From the awesome hack by Dean Edwards
- // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
- // If we're not dealing with a regular pixel number
- // but a number that has a weird ending, we need to convert it to pixels
- // but not position css attributes, as those are proportional to the parent element instead
- // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
- if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
-
- // Remember the original values
- left = style.left;
- rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
-
- // Put in the new values to get a computed value out
- if ( rsLeft ) {
- elem.runtimeStyle.left = elem.currentStyle.left;
- }
- style.left = name === "fontSize" ? "1em" : ret;
- ret = style.pixelLeft + "px";
-
- // Revert the changed values
- style.left = left;
- if ( rsLeft ) {
- elem.runtimeStyle.left = rsLeft;
- }
- }
-
- return ret === "" ? "auto" : ret;
- };
-}
-
-function setPositiveNumber( elem, value, subtract ) {
- var matches = rnumsplit.exec( value );
- return matches ?
- Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
- value;
-}
-
-function augmentWidthOrHeight( elem, name, extra, isBorderBox ) {
- var i = extra === ( isBorderBox ? "border" : "content" ) ?
- // If we already have the right measurement, avoid augmentation
- 4 :
- // Otherwise initialize for horizontal or vertical properties
- name === "width" ? 1 : 0,
-
- val = 0;
-
- for ( ; i < 4; i += 2 ) {
- // both box models exclude margin, so add it if we want it
- if ( extra === "margin" ) {
- // we use jQuery.css instead of curCSS here
- // because of the reliableMarginRight CSS hook!
- val += jQuery.css( elem, extra + cssExpand[ i ], true );
- }
-
- // From this point on we use curCSS for maximum performance (relevant in animations)
- if ( isBorderBox ) {
- // border-box includes padding, so remove it if we want content
- if ( extra === "content" ) {
- val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;
- }
-
- // at this point, extra isn't border nor margin, so remove border
- if ( extra !== "margin" ) {
- val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
- }
- } else {
- // at this point, extra isn't content, so add padding
- val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;
-
- // at this point, extra isn't content nor padding, so add border
- if ( extra !== "padding" ) {
- val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
- }
- }
- }
-
- return val;
-}
-
-function getWidthOrHeight( elem, name, extra ) {
-
- // Start with offset property, which is equivalent to the border-box value
- var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
- valueIsBorderBox = true,
- isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box";
-
- // some non-html elements return undefined for offsetWidth, so check for null/undefined
- // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
- // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
- if ( val <= 0 || val == null ) {
- // Fall back to computed then uncomputed css if necessary
- val = curCSS( elem, name );
- if ( val < 0 || val == null ) {
- val = elem.style[ name ];
- }
-
- // Computed unit is not pixels. Stop here and return.
- if ( rnumnonpx.test(val) ) {
- return val;
- }
-
- // we need the check for style in case a browser which returns unreliable values
- // for getComputedStyle silently falls back to the reliable elem.style
- valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
-
- // Normalize "", auto, and prepare for extra
- val = parseFloat( val ) || 0;
- }
-
- // use the active box-sizing model to add/subtract irrelevant styles
- return ( val +
- augmentWidthOrHeight(
- elem,
- name,
- extra || ( isBorderBox ? "border" : "content" ),
- valueIsBorderBox
- )
- ) + "px";
-}
-
-
-// Try to determine the default display value of an element
-function css_defaultDisplay( nodeName ) {
- if ( elemdisplay[ nodeName ] ) {
- return elemdisplay[ nodeName ];
- }
-
- var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ),
- display = elem.css("display");
- elem.remove();
-
- // If the simple way fails,
- // get element's real default display by attaching it to a temp iframe
- if ( display === "none" || display === "" ) {
- // Use the already-created iframe if possible
- iframe = document.body.appendChild(
- iframe || jQuery.extend( document.createElement("iframe"), {
- frameBorder: 0,
- width: 0,
- height: 0
- })
- );
-
- // Create a cacheable copy of the iframe document on first call.
- // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
- // document to it; WebKit & Firefox won't allow reusing the iframe document.
- if ( !iframeDoc || !iframe.createElement ) {
- iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
- iframeDoc.write("<!doctype html><html><body>");
- iframeDoc.close();
- }
-
- elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );
-
- display = curCSS( elem, "display" );
- document.body.removeChild( iframe );
- }
-
- // Store the correct default display
- elemdisplay[ nodeName ] = display;
-
- return display;
-}
-
-jQuery.each([ "height", "width" ], function( i, name ) {
- jQuery.cssHooks[ name ] = {
- get: function( elem, computed, extra ) {
- if ( computed ) {
- // certain elements can have dimension info if we invisibly show them
- // however, it must have a current display style that would benefit from this
- if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) {
- return jQuery.swap( elem, cssShow, function() {
- return getWidthOrHeight( elem, name, extra );
- });
- } else {
- return getWidthOrHeight( elem, name, extra );
- }
- }
- },
-
- set: function( elem, value, extra ) {
- return setPositiveNumber( elem, value, extra ?
- augmentWidthOrHeight(
- elem,
- name,
- extra,
- jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"
- ) : 0
- );
- }
- };
-});
-
-if ( !jQuery.support.opacity ) {
- jQuery.cssHooks.opacity = {
- get: function( elem, computed ) {
- // IE uses filters for opacity
- return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
- ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
- computed ? "1" : "";
- },
-
- set: function( elem, value ) {
- var style = elem.style,
- currentStyle = elem.currentStyle,
- opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
- filter = currentStyle && currentStyle.filter || style.filter || "";
-
- // IE has trouble with opacity if it does not have layout
- // Force it by setting the zoom level
- style.zoom = 1;
-
- // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
- if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
- style.removeAttribute ) {
-
- // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
- // if "filter:" is present at all, clearType is disabled, we want to avoid this
- // style.removeAttribute is IE Only, but so apparently is this code path...
- style.removeAttribute( "filter" );
-
- // if there there is no filter style applied in a css rule, we are done
- if ( currentStyle && !currentStyle.filter ) {
- return;
- }
- }
-
- // otherwise, set new filter values
- style.filter = ralpha.test( filter ) ?
- filter.replace( ralpha, opacity ) :
- filter + " " + opacity;
- }
- };
-}
-
-// These hooks cannot be added until DOM ready because the support test
-// for it is not run until after DOM ready
-jQuery(function() {
- if ( !jQuery.support.reliableMarginRight ) {
- jQuery.cssHooks.marginRight = {
- get: function( elem, computed ) {
- // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
- // Work around by temporarily setting element display to inline-block
- return jQuery.swap( elem, { "display": "inline-block" }, function() {
- if ( computed ) {
- return curCSS( elem, "marginRight" );
- }
- });
- }
- };
- }
-
- // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
- // getComputedStyle returns percent when specified for top/left/bottom/right
- // rather than make the css module depend on the offset module, we just check for it here
- if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
- jQuery.each( [ "top", "left" ], function( i, prop ) {
- jQuery.cssHooks[ prop ] = {
- get: function( elem, computed ) {
- if ( computed ) {
- var ret = curCSS( elem, prop );
- // if curCSS returns percentage, fallback to offset
- return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret;
- }
- }
- };
- });
- }
-
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.hidden = function( elem ) {
- return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none");
- };
-
- jQuery.expr.filters.visible = function( elem ) {
- return !jQuery.expr.filters.hidden( elem );
- };
-}
-
-// These hooks are used by animate to expand properties
-jQuery.each({
- margin: "",
- padding: "",
- border: "Width"
-}, function( prefix, suffix ) {
- jQuery.cssHooks[ prefix + suffix ] = {
- expand: function( value ) {
- var i,
-
- // assumes a single number if not a string
- parts = typeof value === "string" ? value.split(" ") : [ value ],
- expanded = {};
-
- for ( i = 0; i < 4; i++ ) {
- expanded[ prefix + cssExpand[ i ] + suffix ] =
- parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
- }
-
- return expanded;
- }
- };
-
- if ( !rmargin.test( prefix ) ) {
- jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
- }
-});
-var r20 = /%20/g,
- rbracket = /\[\]$/,
- rCRLF = /\r?\n/g,
- rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
- rselectTextarea = /^(?:select|textarea)/i;
-
-jQuery.fn.extend({
- serialize: function() {
- return jQuery.param( this.serializeArray() );
- },
- serializeArray: function() {
- return this.map(function(){
- return this.elements ? jQuery.makeArray( this.elements ) : this;
- })
- .filter(function(){
- return this.name && !this.disabled &&
- ( this.checked || rselectTextarea.test( this.nodeName ) ||
- rinput.test( this.type ) );
- })
- .map(function( i, elem ){
- var val = jQuery( this ).val();
-
- return val == null ?
- null :
- jQuery.isArray( val ) ?
- jQuery.map( val, function( val, i ){
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }) :
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
- }).get();
- }
-});
-
-//Serialize an array of form elements or a set of
-//key/values into a query string
-jQuery.param = function( a, traditional ) {
- var prefix,
- s = [],
- add = function( key, value ) {
- // If value is a function, invoke it and return its value
- value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
- s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
- };
-
- // Set traditional to true for jQuery <= 1.3.2 behavior.
- if ( traditional === undefined ) {
- traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
- }
-
- // If an array was passed in, assume that it is an array of form elements.
- if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
- // Serialize the form elements
- jQuery.each( a, function() {
- add( this.name, this.value );
- });
-
- } else {
- // If traditional, encode the "old" way (the way 1.3.2 or older
- // did it), otherwise encode params recursively.
- for ( prefix in a ) {
- buildParams( prefix, a[ prefix ], traditional, add );
- }
- }
-
- // Return the resulting serialization
- return s.join( "&" ).replace( r20, "+" );
-};
-
-function buildParams( prefix, obj, traditional, add ) {
- var name;
-
- if ( jQuery.isArray( obj ) ) {
- // Serialize array item.
- jQuery.each( obj, function( i, v ) {
- if ( traditional || rbracket.test( prefix ) ) {
- // Treat each array item as a scalar.
- add( prefix, v );
-
- } else {
- // If array item is non-scalar (array or object), encode its
- // numeric index to resolve deserialization ambiguity issues.
- // Note that rack (as of 1.0.0) can't currently deserialize
- // nested arrays properly, and attempting to do so may cause
- // a server error. Possible fixes are to modify rack's
- // deserialization algorithm or to provide an option or flag
- // to force array serialization to be shallow.
- buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
- }
- });
-
- } else if ( !traditional && jQuery.type( obj ) === "object" ) {
- // Serialize object item.
- for ( name in obj ) {
- buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
- }
-
- } else {
- // Serialize scalar item.
- add( prefix, obj );
- }
-}
-var
- // Document location
- ajaxLocParts,
- ajaxLocation,
-
- rhash = /#.*$/,
- rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
- // #7653, #8125, #8152: local protocol detection
- rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
- rnoContent = /^(?:GET|HEAD)$/,
- rprotocol = /^\/\//,
- rquery = /\?/,
- rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
- rts = /([?&])_=[^&]*/,
- rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
-
- // Keep a copy of the old load method
- _load = jQuery.fn.load,
-
- /* Prefilters
- * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
- * 2) These are called:
- * - BEFORE asking for a transport
- * - AFTER param serialization (s.data is a string if s.processData is true)
- * 3) key is the dataType
- * 4) the catchall symbol "*" can be used
- * 5) execution will start with transport dataType and THEN continue down to "*" if needed
- */
- prefilters = {},
-
- /* Transports bindings
- * 1) key is the dataType
- * 2) the catchall symbol "*" can be used
- * 3) selection will start with transport dataType and THEN go to "*" if needed
- */
- transports = {},
-
- // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
- allTypes = ["*/"] + ["*"];
-
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
- ajaxLocation = location.href;
-} catch( e ) {
- // Use the href attribute of an A element
- // since IE will modify it given document.location
- ajaxLocation = document.createElement( "a" );
- ajaxLocation.href = "";
- ajaxLocation = ajaxLocation.href;
-}
-
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
- // dataTypeExpression is optional and defaults to "*"
- return function( dataTypeExpression, func ) {
-
- if ( typeof dataTypeExpression !== "string" ) {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
-
- var dataType, list, placeBefore,
- dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ),
- i = 0,
- length = dataTypes.length;
-
- if ( jQuery.isFunction( func ) ) {
- // For each dataType in the dataTypeExpression
- for ( ; i < length; i++ ) {
- dataType = dataTypes[ i ];
- // We control if we're asked to add before
- // any existing element
- placeBefore = /^\+/.test( dataType );
- if ( placeBefore ) {
- dataType = dataType.substr( 1 ) || "*";
- }
- list = structure[ dataType ] = structure[ dataType ] || [];
- // then we add to the structure accordingly
- list[ placeBefore ? "unshift" : "push" ]( func );
- }
- }
- };
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
- dataType /* internal */, inspected /* internal */ ) {
-
- dataType = dataType || options.dataTypes[ 0 ];
- inspected = inspected || {};
-
- inspected[ dataType ] = true;
-
- var selection,
- list = structure[ dataType ],
- i = 0,
- length = list ? list.length : 0,
- executeOnly = ( structure === prefilters );
-
- for ( ; i < length && ( executeOnly || !selection ); i++ ) {
- selection = list[ i ]( options, originalOptions, jqXHR );
- // If we got redirected to another dataType
- // we try there if executing only and not done already
- if ( typeof selection === "string" ) {
- if ( !executeOnly || inspected[ selection ] ) {
- selection = undefined;
- } else {
- options.dataTypes.unshift( selection );
- selection = inspectPrefiltersOrTransports(
- structure, options, originalOptions, jqXHR, selection, inspected );
- }
- }
- }
- // If we're only executing or nothing was selected
- // we try the catchall dataType if not done already
- if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
- selection = inspectPrefiltersOrTransports(
- structure, options, originalOptions, jqXHR, "*", inspected );
- }
- // unnecessary when only executing (prefilters)
- // but it'll be ignored by the caller in that case
- return selection;
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
- var key, deep,
- flatOptions = jQuery.ajaxSettings.flatOptions || {};
- for ( key in src ) {
- if ( src[ key ] !== undefined ) {
- ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
- }
- }
- if ( deep ) {
- jQuery.extend( true, target, deep );
- }
-}
-
-jQuery.fn.load = function( url, params, callback ) {
- if ( typeof url !== "string" && _load ) {
- return _load.apply( this, arguments );
- }
-
- // Don't do a request if no elements are being requested
- if ( !this.length ) {
- return this;
- }
-
- var selector, type, response,
- self = this,
- off = url.indexOf(" ");
-
- if ( off >= 0 ) {
- selector = url.slice( off, url.length );
- url = url.slice( 0, off );
- }
-
- // If it's a function
- if ( jQuery.isFunction( params ) ) {
-
- // We assume that it's the callback
- callback = params;
- params = undefined;
-
- // Otherwise, build a param string
- } else if ( params && typeof params === "object" ) {
- type = "POST";
- }
-
- // Request the remote document
- jQuery.ajax({
- url: url,
-
- // if "type" variable is undefined, then "GET" method will be used
- type: type,
- dataType: "html",
- data: params,
- complete: function( jqXHR, status ) {
- if ( callback ) {
- self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
- }
- }
- }).done(function( responseText ) {
-
- // Save response for use in complete callback
- response = arguments;
-
- // See if a selector was specified
- self.html( selector ?
-
- // Create a dummy div to hold the results
- jQuery("<div>")
-
- // inject the contents of the document in, removing the scripts
- // to avoid any 'Permission Denied' errors in IE
- .append( responseText.replace( rscript, "" ) )
-
- // Locate the specified elements
- .find( selector ) :
-
- // If not, just inject the full result
- responseText );
-
- });
-
- return this;
-};
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
- jQuery.fn[ o ] = function( f ){
- return this.on( o, f );
- };
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
- jQuery[ method ] = function( url, data, callback, type ) {
- // shift arguments if data argument was omitted
- if ( jQuery.isFunction( data ) ) {
- type = type || callback;
- callback = data;
- data = undefined;
- }
-
- return jQuery.ajax({
- type: method,
- url: url,
- data: data,
- success: callback,
- dataType: type
- });
- };
-});
-
-jQuery.extend({
-
- getScript: function( url, callback ) {
- return jQuery.get( url, undefined, callback, "script" );
- },
-
- getJSON: function( url, data, callback ) {
- return jQuery.get( url, data, callback, "json" );
- },
-
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function( target, settings ) {
- if ( settings ) {
- // Building a settings object
- ajaxExtend( target, jQuery.ajaxSettings );
- } else {
- // Extending ajaxSettings
- settings = target;
- target = jQuery.ajaxSettings;
- }
- ajaxExtend( target, settings );
- return target;
- },
-
- ajaxSettings: {
- url: ajaxLocation,
- isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
- global: true,
- type: "GET",
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- processData: true,
- async: true,
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- throws: false,
- traditional: false,
- headers: {},
- */
-
- accepts: {
- xml: "application/xml, text/xml",
- html: "text/html",
- text: "text/plain",
- json: "application/json, text/javascript",
- "*": allTypes
- },
-
- contents: {
- xml: /xml/,
- html: /html/,
- json: /json/
- },
-
- responseFields: {
- xml: "responseXML",
- text: "responseText"
- },
-
- // List of data converters
- // 1) key format is "source_type destination_type" (a single space in-between)
- // 2) the catchall symbol "*" can be used for source_type
- converters: {
-
- // Convert anything to text
- "* text": window.String,
-
- // Text to html (true = no transformation)
- "text html": true,
-
- // Evaluate text as a json expression
- "text json": jQuery.parseJSON,
-
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
-
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- context: true,
- url: true
- }
- },
-
- ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
- ajaxTransport: addToPrefiltersOrTransports( transports ),
-
- // Main method
- ajax: function( url, options ) {
-
- // If url is an object, simulate pre-1.5 signature
- if ( typeof url === "object" ) {
- options = url;
- url = undefined;
- }
-
- // Force options to be an object
- options = options || {};
-
- var // ifModified key
- ifModifiedKey,
- // Response headers
- responseHeadersString,
- responseHeaders,
- // transport
- transport,
- // timeout handle
- timeoutTimer,
- // Cross-domain detection vars
- parts,
- // To know if global events are to be dispatched
- fireGlobals,
- // Loop variable
- i,
- // Create the final options object
- s = jQuery.ajaxSetup( {}, options ),
- // Callbacks context
- callbackContext = s.context || s,
- // Context for global events
- // It's the callbackContext if one was provided in the options
- // and if it's a DOM node or a jQuery collection
- globalEventContext = callbackContext !== s &&
- ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
- jQuery( callbackContext ) : jQuery.event,
- // Deferreds
- deferred = jQuery.Deferred(),
- completeDeferred = jQuery.Callbacks( "once memory" ),
- // Status-dependent callbacks
- statusCode = s.statusCode || {},
- // Headers (they are sent all at once)
- requestHeaders = {},
- requestHeadersNames = {},
- // The jqXHR state
- state = 0,
- // Default abort message
- strAbort = "canceled",
- // Fake xhr
- jqXHR = {
-
- readyState: 0,
-
- // Caches the header
- setRequestHeader: function( name, value ) {
- if ( !state ) {
- var lname = name.toLowerCase();
- name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
- requestHeaders[ name ] = value;
- }
- return this;
- },
-
- // Raw string
- getAllResponseHeaders: function() {
- return state === 2 ? responseHeadersString : null;
- },
-
- // Builds headers hashtable if needed
- getResponseHeader: function( key ) {
- var match;
- if ( state === 2 ) {
- if ( !responseHeaders ) {
- responseHeaders = {};
- while( ( match = rheaders.exec( responseHeadersString ) ) ) {
- responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
- }
- }
- match = responseHeaders[ key.toLowerCase() ];
- }
- return match === undefined ? null : match;
- },
-
- // Overrides response content-type header
- overrideMimeType: function( type ) {
- if ( !state ) {
- s.mimeType = type;
- }
- return this;
- },
-
- // Cancel the request
- abort: function( statusText ) {
- statusText = statusText || strAbort;
- if ( transport ) {
- transport.abort( statusText );
- }
- done( 0, statusText );
- return this;
- }
- };
-
- // Callback for when everything is done
- // It is defined here because jslint complains if it is declared
- // at the end of the function (which would be more logical and readable)
- function done( status, nativeStatusText, responses, headers ) {
- var isSuccess, success, error, response, modified,
- statusText = nativeStatusText;
-
- // Called once
- if ( state === 2 ) {
- return;
- }
-
- // State is "done" now
- state = 2;
-
- // Clear timeout if it exists
- if ( timeoutTimer ) {
- clearTimeout( timeoutTimer );
- }
-
- // Dereference transport for early garbage collection
- // (no matter how long the jqXHR object will be used)
- transport = undefined;
-
- // Cache response headers
- responseHeadersString = headers || "";
-
- // Set readyState
- jqXHR.readyState = status > 0 ? 4 : 0;
-
- // Get response data
- if ( responses ) {
- response = ajaxHandleResponses( s, jqXHR, responses );
- }
-
- // If successful, handle type chaining
- if ( status >= 200 && status < 300 || status === 304 ) {
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
-
- modified = jqXHR.getResponseHeader("Last-Modified");
- if ( modified ) {
- jQuery.lastModified[ ifModifiedKey ] = modified;
- }
- modified = jqXHR.getResponseHeader("Etag");
- if ( modified ) {
- jQuery.etag[ ifModifiedKey ] = modified;
- }
- }
-
- // If not modified
- if ( status === 304 ) {
-
- statusText = "notmodified";
- isSuccess = true;
-
- // If we have data
- } else {
-
- isSuccess = ajaxConvert( s, response );
- statusText = isSuccess.state;
- success = isSuccess.data;
- error = isSuccess.error;
- isSuccess = !error;
- }
- } else {
- // We extract error from statusText
- // then normalize statusText and status for non-aborts
- error = statusText;
- if ( !statusText || status ) {
- statusText = "error";
- if ( status < 0 ) {
- status = 0;
- }
- }
- }
-
- // Set data for the fake xhr object
- jqXHR.status = status;
- jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
- // Success/Error
- if ( isSuccess ) {
- deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
- } else {
- deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
- }
-
- // Status-dependent callbacks
- jqXHR.statusCode( statusCode );
- statusCode = undefined;
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
- [ jqXHR, s, isSuccess ? success : error ] );
- }
-
- // Complete
- completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
- // Handle the global AJAX counter
- if ( !( --jQuery.active ) ) {
- jQuery.event.trigger( "ajaxStop" );
- }
- }
- }
-
- // Attach deferreds
- deferred.promise( jqXHR );
- jqXHR.success = jqXHR.done;
- jqXHR.error = jqXHR.fail;
- jqXHR.complete = completeDeferred.add;
-
- // Status-dependent callbacks
- jqXHR.statusCode = function( map ) {
- if ( map ) {
- var tmp;
- if ( state < 2 ) {
- for ( tmp in map ) {
- statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
- }
- } else {
- tmp = map[ jqXHR.status ];
- jqXHR.always( tmp );
- }
- }
- return this;
- };
-
- // Remove hash character (#7531: and string promotion)
- // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
- // We also use the url parameter if available
- s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
- // Extract dataTypes list
- s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace );
-
- // A cross-domain request is in order when we have a protocol:host:port mismatch
- if ( s.crossDomain == null ) {
- parts = rurl.exec( s.url.toLowerCase() );
- s.crossDomain = !!( parts &&
- ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
- ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
- ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
- );
- }
-
- // Convert data if not already a string
- if ( s.data && s.processData && typeof s.data !== "string" ) {
- s.data = jQuery.param( s.data, s.traditional );
- }
-
- // Apply prefilters
- inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
- // If request was aborted inside a prefilter, stop there
- if ( state === 2 ) {
- return jqXHR;
- }
-
- // We can fire global events as of now if asked to
- fireGlobals = s.global;
-
- // Uppercase the type
- s.type = s.type.toUpperCase();
-
- // Determine if request has content
- s.hasContent = !rnoContent.test( s.type );
-
- // Watch for a new set of requests
- if ( fireGlobals && jQuery.active++ === 0 ) {
- jQuery.event.trigger( "ajaxStart" );
- }
-
- // More options handling for requests with no content
- if ( !s.hasContent ) {
-
- // If data is available, append data to url
- if ( s.data ) {
- s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
- // #9682: remove data so that it's not used in an eventual retry
- delete s.data;
- }
-
- // Get ifModifiedKey before adding the anti-cache parameter
- ifModifiedKey = s.url;
-
- // Add anti-cache in url if needed
- if ( s.cache === false ) {
-
- var ts = jQuery.now(),
- // try replacing _= if it is there
- ret = s.url.replace( rts, "$1_=" + ts );
-
- // if nothing was replaced, add timestamp to the end
- s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
- }
- }
-
- // Set the correct header, if data is being sent
- if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
- jqXHR.setRequestHeader( "Content-Type", s.contentType );
- }
-
- // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
- if ( s.ifModified ) {
- ifModifiedKey = ifModifiedKey || s.url;
- if ( jQuery.lastModified[ ifModifiedKey ] ) {
- jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
- }
- if ( jQuery.etag[ ifModifiedKey ] ) {
- jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
- }
- }
-
- // Set the Accepts header for the server, depending on the dataType
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
- s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
- s.accepts[ "*" ]
- );
-
- // Check for headers option
- for ( i in s.headers ) {
- jqXHR.setRequestHeader( i, s.headers[ i ] );
- }
-
- // Allow custom headers/mimetypes and early abort
- if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
- // Abort if not done already and return
- return jqXHR.abort();
-
- }
-
- // aborting is no longer a cancellation
- strAbort = "abort";
-
- // Install callbacks on deferreds
- for ( i in { success: 1, error: 1, complete: 1 } ) {
- jqXHR[ i ]( s[ i ] );
- }
-
- // Get transport
- transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
- // If no transport, we auto-abort
- if ( !transport ) {
- done( -1, "No Transport" );
- } else {
- jqXHR.readyState = 1;
- // Send global event
- if ( fireGlobals ) {
- globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
- }
- // Timeout
- if ( s.async && s.timeout > 0 ) {
- timeoutTimer = setTimeout( function(){
- jqXHR.abort( "timeout" );
- }, s.timeout );
- }
-
- try {
- state = 1;
- transport.send( requestHeaders, done );
- } catch (e) {
- // Propagate exception as error if not done
- if ( state < 2 ) {
- done( -1, e );
- // Simply rethrow otherwise
- } else {
- throw e;
- }
- }
- }
-
- return jqXHR;
- },
-
- // Counter for holding the number of active queries
- active: 0,
-
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {}
-
-});
-
-/* Handles responses to an ajax request:
- * - sets all responseXXX fields accordingly
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-
- var ct, type, finalDataType, firstDataType,
- contents = s.contents,
- dataTypes = s.dataTypes,
- responseFields = s.responseFields;
-
- // Fill responseXXX fields
- for ( type in responseFields ) {
- if ( type in responses ) {
- jqXHR[ responseFields[type] ] = responses[ type ];
- }
- }
-
- // Remove auto dataType and get content-type in the process
- while( dataTypes[ 0 ] === "*" ) {
- dataTypes.shift();
- if ( ct === undefined ) {
- ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
- }
- }
-
- // Check if we're dealing with a known content-type
- if ( ct ) {
- for ( type in contents ) {
- if ( contents[ type ] && contents[ type ].test( ct ) ) {
- dataTypes.unshift( type );
- break;
- }
- }
- }
-
- // Check to see if we have a response for the expected dataType
- if ( dataTypes[ 0 ] in responses ) {
- finalDataType = dataTypes[ 0 ];
- } else {
- // Try convertible dataTypes
- for ( type in responses ) {
- if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
- finalDataType = type;
- break;
- }
- if ( !firstDataType ) {
- firstDataType = type;
- }
- }
- // Or just use first one
- finalDataType = finalDataType || firstDataType;
- }
-
- // If we found a dataType
- // We add the dataType to the list if needed
- // and return the corresponding response
- if ( finalDataType ) {
- if ( finalDataType !== dataTypes[ 0 ] ) {
- dataTypes.unshift( finalDataType );
- }
- return responses[ finalDataType ];
- }
-}
-
-// Chain conversions given the request and the original response
-function ajaxConvert( s, response ) {
-
- var conv, conv2, current, tmp,
- // Work with a copy of dataTypes in case we need to modify it for conversion
- dataTypes = s.dataTypes.slice(),
- prev = dataTypes[ 0 ],
- converters = {},
- i = 0;
-
- // Apply the dataFilter if provided
- if ( s.dataFilter ) {
- response = s.dataFilter( response, s.dataType );
- }
-
- // Create converters map with lowercased keys
- if ( dataTypes[ 1 ] ) {
- for ( conv in s.converters ) {
- converters[ conv.toLowerCase() ] = s.converters[ conv ];
- }
- }
-
- // Convert to each sequential dataType, tolerating list modification
- for ( ; (current = dataTypes[++i]); ) {
-
- // There's only work to do if current dataType is non-auto
- if ( current !== "*" ) {
-
- // Convert response if prev dataType is non-auto and differs from current
- if ( prev !== "*" && prev !== current ) {
-
- // Seek a direct converter
- conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
- // If none found, seek a pair
- if ( !conv ) {
- for ( conv2 in converters ) {
-
- // If conv2 outputs current
- tmp = conv2.split(" ");
- if ( tmp[ 1 ] === current ) {
-
- // If prev can be converted to accepted input
- conv = converters[ prev + " " + tmp[ 0 ] ] ||
- converters[ "* " + tmp[ 0 ] ];
- if ( conv ) {
- // Condense equivalence converters
- if ( conv === true ) {
- conv = converters[ conv2 ];
-
- // Otherwise, insert the intermediate dataType
- } else if ( converters[ conv2 ] !== true ) {
- current = tmp[ 0 ];
- dataTypes.splice( i--, 0, current );
- }
-
- break;
- }
- }
- }
- }
-
- // Apply converter (if not an equivalence)
- if ( conv !== true ) {
-
- // Unless errors are allowed to bubble, catch and return them
- if ( conv && s["throws"] ) {
- response = conv( response );
- } else {
- try {
- response = conv( response );
- } catch ( e ) {
- return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
- }
- }
- }
- }
-
- // Update prev for next iteration
- prev = current;
- }
- }
-
- return { state: "success", data: response };
-}
-var oldCallbacks = [],
- rquestion = /\?/,
- rjsonp = /(=)\?(?=&|$)|\?\?/,
- nonce = jQuery.now();
-
-// Default jsonp settings
-jQuery.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
- this[ callback ] = true;
- return callback;
- }
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
- var callbackName, overwritten, responseContainer,
- data = s.data,
- url = s.url,
- hasCallback = s.jsonp !== false,
- replaceInUrl = hasCallback && rjsonp.test( url ),
- replaceInData = hasCallback && !replaceInUrl && typeof data === "string" &&
- !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") &&
- rjsonp.test( data );
-
- // Handle iff the expected data type is "jsonp" or we have a parameter to set
- if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) {
-
- // Get callback name, remembering preexisting value associated with it
- callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
- s.jsonpCallback() :
- s.jsonpCallback;
- overwritten = window[ callbackName ];
-
- // Insert callback into url or form data
- if ( replaceInUrl ) {
- s.url = url.replace( rjsonp, "$1" + callbackName );
- } else if ( replaceInData ) {
- s.data = data.replace( rjsonp, "$1" + callbackName );
- } else if ( hasCallback ) {
- s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
- }
-
- // Use data converter to retrieve json after script execution
- s.converters["script json"] = function() {
- if ( !responseContainer ) {
- jQuery.error( callbackName + " was not called" );
- }
- return responseContainer[ 0 ];
- };
-
- // force json dataType
- s.dataTypes[ 0 ] = "json";
-
- // Install callback
- window[ callbackName ] = function() {
- responseContainer = arguments;
- };
-
- // Clean-up function (fires after converters)
- jqXHR.always(function() {
- // Restore preexisting value
- window[ callbackName ] = overwritten;
-
- // Save back as free
- if ( s[ callbackName ] ) {
- // make sure that re-using the options doesn't screw things around
- s.jsonpCallback = originalSettings.jsonpCallback;
-
- // save the callback name for future use
- oldCallbacks.push( callbackName );
- }
-
- // Call if it was a function and we have a response
- if ( responseContainer && jQuery.isFunction( overwritten ) ) {
- overwritten( responseContainer[ 0 ] );
- }
-
- responseContainer = overwritten = undefined;
- });
-
- // Delegate to script
- return "script";
- }
-});
-// Install script dataType
-jQuery.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /javascript|ecmascript/
- },
- converters: {
- "text script": function( text ) {
- jQuery.globalEval( text );
- return text;
- }
- }
-});
-
-// Handle cache's special case and global
-jQuery.ajaxPrefilter( "script", function( s ) {
- if ( s.cache === undefined ) {
- s.cache = false;
- }
- if ( s.crossDomain ) {
- s.type = "GET";
- s.global = false;
- }
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
-
- // This transport only deals with cross domain requests
- if ( s.crossDomain ) {
-
- var script,
- head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
-
- return {
-
- send: function( _, callback ) {
-
- script = document.createElement( "script" );
-
- script.async = "async";
-
- if ( s.scriptCharset ) {
- script.charset = s.scriptCharset;
- }
-
- script.src = s.url;
-
- // Attach handlers for all browsers
- script.onload = script.onreadystatechange = function( _, isAbort ) {
-
- if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
- // Handle memory leak in IE
- script.onload = script.onreadystatechange = null;
-
- // Remove the script
- if ( head && script.parentNode ) {
- head.removeChild( script );
- }
-
- // Dereference the script
- script = undefined;
-
- // Callback if not abort
- if ( !isAbort ) {
- callback( 200, "success" );
- }
- }
- };
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709 and #4378).
- head.insertBefore( script, head.firstChild );
- },
-
- abort: function() {
- if ( script ) {
- script.onload( 0, 1 );
- }
- }
- };
- }
-});
-var xhrCallbacks,
- // #5280: Internet Explorer will keep connections alive if we don't abort on unload
- xhrOnUnloadAbort = window.ActiveXObject ? function() {
- // Abort all pending requests
- for ( var key in xhrCallbacks ) {
- xhrCallbacks[ key ]( 0, 1 );
- }
- } : false,
- xhrId = 0;
-
-// Functions to create xhrs
-function createStandardXHR() {
- try {
- return new window.XMLHttpRequest();
- } catch( e ) {}
-}
-
-function createActiveXHR() {
- try {
- return new window.ActiveXObject( "Microsoft.XMLHTTP" );
- } catch( e ) {}
-}
-
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject ?
- /* Microsoft failed to properly
- * implement the XMLHttpRequest in IE7 (can't request local files),
- * so we use the ActiveXObject when it is available
- * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
- * we need a fallback.
- */
- function() {
- return !this.isLocal && createStandardXHR() || createActiveXHR();
- } :
- // For all other browsers, use the standard XMLHttpRequest object
- createStandardXHR;
-
-// Determine support properties
-(function( xhr ) {
- jQuery.extend( jQuery.support, {
- ajax: !!xhr,
- cors: !!xhr && ( "withCredentials" in xhr )
- });
-})( jQuery.ajaxSettings.xhr() );
-
-// Create transport if the browser can provide an xhr
-if ( jQuery.support.ajax ) {
-
- jQuery.ajaxTransport(function( s ) {
- // Cross domain only allowed if supported through XMLHttpRequest
- if ( !s.crossDomain || jQuery.support.cors ) {
-
- var callback;
-
- return {
- send: function( headers, complete ) {
-
- // Get a new xhr
- var handle, i,
- xhr = s.xhr();
-
- // Open the socket
- // Passing null username, generates a login popup on Opera (#2865)
- if ( s.username ) {
- xhr.open( s.type, s.url, s.async, s.username, s.password );
- } else {
- xhr.open( s.type, s.url, s.async );
- }
-
- // Apply custom fields if provided
- if ( s.xhrFields ) {
- for ( i in s.xhrFields ) {
- xhr[ i ] = s.xhrFields[ i ];
- }
- }
-
- // Override mime type if needed
- if ( s.mimeType && xhr.overrideMimeType ) {
- xhr.overrideMimeType( s.mimeType );
- }
-
- // X-Requested-With header
- // For cross-domain requests, seeing as conditions for a preflight are
- // akin to a jigsaw puzzle, we simply never set it to be sure.
- // (it can always be set on a per-request basis or even using ajaxSetup)
- // For same-domain requests, won't change header if already provided.
- if ( !s.crossDomain && !headers["X-Requested-With"] ) {
- headers[ "X-Requested-With" ] = "XMLHttpRequest";
- }
-
- // Need an extra try/catch for cross domain requests in Firefox 3
- try {
- for ( i in headers ) {
- xhr.setRequestHeader( i, headers[ i ] );
- }
- } catch( _ ) {}
-
- // Do send the request
- // This may raise an exception which is actually
- // handled in jQuery.ajax (so no try/catch here)
- xhr.send( ( s.hasContent && s.data ) || null );
-
- // Listener
- callback = function( _, isAbort ) {
-
- var status,
- statusText,
- responseHeaders,
- responses,
- xml;
-
- // Firefox throws exceptions when accessing properties
- // of an xhr when a network error occurred
- // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
- try {
-
- // Was never called and is aborted or complete
- if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
-
- // Only called once
- callback = undefined;
-
- // Do not keep as active anymore
- if ( handle ) {
- xhr.onreadystatechange = jQuery.noop;
- if ( xhrOnUnloadAbort ) {
- delete xhrCallbacks[ handle ];
- }
- }
-
- // If it's an abort
- if ( isAbort ) {
- // Abort it manually if needed
- if ( xhr.readyState !== 4 ) {
- xhr.abort();
- }
- } else {
- status = xhr.status;
- responseHeaders = xhr.getAllResponseHeaders();
- responses = {};
- xml = xhr.responseXML;
-
- // Construct response list
- if ( xml && xml.documentElement /* #4958 */ ) {
- responses.xml = xml;
- }
-
- // When requesting binary data, IE6-9 will throw an exception
- // on any attempt to access responseText (#11426)
- try {
- responses.text = xhr.responseText;
- } catch( e ) {
- }
-
- // Firefox throws an exception when accessing
- // statusText for faulty cross-domain requests
- try {
- statusText = xhr.statusText;
- } catch( e ) {
- // We normalize with Webkit giving an empty statusText
- statusText = "";
- }
-
- // Filter status for non standard behaviors
-
- // If the request is local and we have data: assume a success
- // (success with no data won't get notified, that's the best we
- // can do given current implementations)
- if ( !status && s.isLocal && !s.crossDomain ) {
- status = responses.text ? 200 : 404;
- // IE - #1450: sometimes returns 1223 when it should be 204
- } else if ( status === 1223 ) {
- status = 204;
- }
- }
- }
- } catch( firefoxAccessException ) {
- if ( !isAbort ) {
- complete( -1, firefoxAccessException );
- }
- }
-
- // Call complete if needed
- if ( responses ) {
- complete( status, statusText, responses, responseHeaders );
- }
- };
-
- if ( !s.async ) {
- // if we're in sync mode we fire the callback
- callback();
- } else if ( xhr.readyState === 4 ) {
- // (IE6 & IE7) if it's in cache and has been
- // retrieved directly we need to fire the callback
- setTimeout( callback, 0 );
- } else {
- handle = ++xhrId;
- if ( xhrOnUnloadAbort ) {
- // Create the active xhrs callbacks list if needed
- // and attach the unload handler
- if ( !xhrCallbacks ) {
- xhrCallbacks = {};
- jQuery( window ).unload( xhrOnUnloadAbort );
- }
- // Add to list of active xhrs callbacks
- xhrCallbacks[ handle ] = callback;
- }
- xhr.onreadystatechange = callback;
- }
- },
-
- abort: function() {
- if ( callback ) {
- callback(0,1);
- }
- }
- };
- }
- });
-}
-var fxNow, timerId,
- rfxtypes = /^(?:toggle|show|hide)$/,
- rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
- rrun = /queueHooks$/,
- animationPrefilters = [ defaultPrefilter ],
- tweeners = {
- "*": [function( prop, value ) {
- var end, unit,
- tween = this.createTween( prop, value ),
- parts = rfxnum.exec( value ),
- target = tween.cur(),
- start = +target || 0,
- scale = 1,
- maxIterations = 20;
-
- if ( parts ) {
- end = +parts[2];
- unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
-
- // We need to compute starting value
- if ( unit !== "px" && start ) {
- // Iteratively approximate from a nonzero starting point
- // Prefer the current property, because this process will be trivial if it uses the same units
- // Fallback to end or a simple constant
- start = jQuery.css( tween.elem, prop, true ) || end || 1;
-
- do {
- // If previous iteration zeroed out, double until we get *something*
- // Use a string for doubling factor so we don't accidentally see scale as unchanged below
- scale = scale || ".5";
-
- // Adjust and apply
- start = start / scale;
- jQuery.style( tween.elem, prop, start + unit );
-
- // Update scale, tolerating zero or NaN from tween.cur()
- // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
- } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
- }
-
- tween.unit = unit;
- tween.start = start;
- // If a +=/-= token was provided, we're doing a relative animation
- tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
- }
- return tween;
- }]
- };
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
- setTimeout(function() {
- fxNow = undefined;
- }, 0 );
- return ( fxNow = jQuery.now() );
-}
-
-function createTweens( animation, props ) {
- jQuery.each( props, function( prop, value ) {
- var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
- index = 0,
- length = collection.length;
- for ( ; index < length; index++ ) {
- if ( collection[ index ].call( animation, prop, value ) ) {
-
- // we're done with this property
- return;
- }
- }
- });
-}
-
-function Animation( elem, properties, options ) {
- var result,
- index = 0,
- tweenerIndex = 0,
- length = animationPrefilters.length,
- deferred = jQuery.Deferred().always( function() {
- // don't match elem in the :animated selector
- delete tick.elem;
- }),
- tick = function() {
- var currentTime = fxNow || createFxNow(),
- remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
- // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
- temp = remaining / animation.duration || 0,
- percent = 1 - temp,
- index = 0,
- length = animation.tweens.length;
-
- for ( ; index < length ; index++ ) {
- animation.tweens[ index ].run( percent );
- }
-
- deferred.notifyWith( elem, [ animation, percent, remaining ]);
-
- if ( percent < 1 && length ) {
- return remaining;
- } else {
- deferred.resolveWith( elem, [ animation ] );
- return false;
- }
- },
- animation = deferred.promise({
- elem: elem,
- props: jQuery.extend( {}, properties ),
- opts: jQuery.extend( true, { specialEasing: {} }, options ),
- originalProperties: properties,
- originalOptions: options,
- startTime: fxNow || createFxNow(),
- duration: options.duration,
- tweens: [],
- createTween: function( prop, end, easing ) {
- var tween = jQuery.Tween( elem, animation.opts, prop, end,
- animation.opts.specialEasing[ prop ] || animation.opts.easing );
- animation.tweens.push( tween );
- return tween;
- },
- stop: function( gotoEnd ) {
- var index = 0,
- // if we are going to the end, we want to run all the tweens
- // otherwise we skip this part
- length = gotoEnd ? animation.tweens.length : 0;
-
- for ( ; index < length ; index++ ) {
- animation.tweens[ index ].run( 1 );
- }
-
- // resolve when we played the last frame
- // otherwise, reject
- if ( gotoEnd ) {
- deferred.resolveWith( elem, [ animation, gotoEnd ] );
- } else {
- deferred.rejectWith( elem, [ animation, gotoEnd ] );
- }
- return this;
- }
- }),
- props = animation.props;
-
- propFilter( props, animation.opts.specialEasing );
-
- for ( ; index < length ; index++ ) {
- result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
- if ( result ) {
- return result;
- }
- }
-
- createTweens( animation, props );
-
- if ( jQuery.isFunction( animation.opts.start ) ) {
- animation.opts.start.call( elem, animation );
- }
-
- jQuery.fx.timer(
- jQuery.extend( tick, {
- anim: animation,
- queue: animation.opts.queue,
- elem: elem
- })
- );
-
- // attach callbacks from options
- return animation.progress( animation.opts.progress )
- .done( animation.opts.done, animation.opts.complete )
- .fail( animation.opts.fail )
- .always( animation.opts.always );
-}
-
-function propFilter( props, specialEasing ) {
- var index, name, easing, value, hooks;
-
- // camelCase, specialEasing and expand cssHook pass
- for ( index in props ) {
- name = jQuery.camelCase( index );
- easing = specialEasing[ name ];
- value = props[ index ];
- if ( jQuery.isArray( value ) ) {
- easing = value[ 1 ];
- value = props[ index ] = value[ 0 ];
- }
-
- if ( index !== name ) {
- props[ name ] = value;
- delete props[ index ];
- }
-
- hooks = jQuery.cssHooks[ name ];
- if ( hooks && "expand" in hooks ) {
- value = hooks.expand( value );
- delete props[ name ];
-
- // not quite $.extend, this wont overwrite keys already present.
- // also - reusing 'index' from above because we have the correct "name"
- for ( index in value ) {
- if ( !( index in props ) ) {
- props[ index ] = value[ index ];
- specialEasing[ index ] = easing;
- }
- }
- } else {
- specialEasing[ name ] = easing;
- }
- }
-}
-
-jQuery.Animation = jQuery.extend( Animation, {
-
- tweener: function( props, callback ) {
- if ( jQuery.isFunction( props ) ) {
- callback = props;
- props = [ "*" ];
- } else {
- props = props.split(" ");
- }
-
- var prop,
- index = 0,
- length = props.length;
-
- for ( ; index < length ; index++ ) {
- prop = props[ index ];
- tweeners[ prop ] = tweeners[ prop ] || [];
- tweeners[ prop ].unshift( callback );
- }
- },
-
- prefilter: function( callback, prepend ) {
- if ( prepend ) {
- animationPrefilters.unshift( callback );
- } else {
- animationPrefilters.push( callback );
- }
- }
-});
-
-function defaultPrefilter( elem, props, opts ) {
- var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
- anim = this,
- style = elem.style,
- orig = {},
- handled = [],
- hidden = elem.nodeType && isHidden( elem );
-
- // handle queue: false promises
- if ( !opts.queue ) {
- hooks = jQuery._queueHooks( elem, "fx" );
- if ( hooks.unqueued == null ) {
- hooks.unqueued = 0;
- oldfire = hooks.empty.fire;
- hooks.empty.fire = function() {
- if ( !hooks.unqueued ) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
-
- anim.always(function() {
- // doing this makes sure that the complete handler will be called
- // before this completes
- anim.always(function() {
- hooks.unqueued--;
- if ( !jQuery.queue( elem, "fx" ).length ) {
- hooks.empty.fire();
- }
- });
- });
- }
-
- // height/width overflow pass
- if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
- // Make sure that nothing sneaks out
- // Record all 3 overflow attributes because IE does not
- // change the overflow attribute when overflowX and
- // overflowY are set to the same value
- opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
- // Set display property to inline-block for height/width
- // animations on inline elements that are having width/height animated
- if ( jQuery.css( elem, "display" ) === "inline" &&
- jQuery.css( elem, "float" ) === "none" ) {
-
- // inline-level elements accept inline-block;
- // block-level elements need to be inline with layout
- if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
- style.display = "inline-block";
-
- } else {
- style.zoom = 1;
- }
- }
- }
-
- if ( opts.overflow ) {
- style.overflow = "hidden";
- if ( !jQuery.support.shrinkWrapBlocks ) {
- anim.done(function() {
- style.overflow = opts.overflow[ 0 ];
- style.overflowX = opts.overflow[ 1 ];
- style.overflowY = opts.overflow[ 2 ];
- });
- }
- }
-
-
- // show/hide pass
- for ( index in props ) {
- value = props[ index ];
- if ( rfxtypes.exec( value ) ) {
- delete props[ index ];
- toggle = toggle || value === "toggle";
- if ( value === ( hidden ? "hide" : "show" ) ) {
- continue;
- }
- handled.push( index );
- }
- }
-
- length = handled.length;
- if ( length ) {
- dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
- if ( "hidden" in dataShow ) {
- hidden = dataShow.hidden;
- }
-
- // store state if its toggle - enables .stop().toggle() to "reverse"
- if ( toggle ) {
- dataShow.hidden = !hidden;
- }
- if ( hidden ) {
- jQuery( elem ).show();
- } else {
- anim.done(function() {
- jQuery( elem ).hide();
- });
- }
- anim.done(function() {
- var prop;
- jQuery.removeData( elem, "fxshow", true );
- for ( prop in orig ) {
- jQuery.style( elem, prop, orig[ prop ] );
- }
- });
- for ( index = 0 ; index < length ; index++ ) {
- prop = handled[ index ];
- tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
- orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
-
- if ( !( prop in dataShow ) ) {
- dataShow[ prop ] = tween.start;
- if ( hidden ) {
- tween.end = tween.start;
- tween.start = prop === "width" || prop === "height" ? 1 : 0;
- }
- }
- }
- }
-}
-
-function Tween( elem, options, prop, end, easing ) {
- return new Tween.prototype.init( elem, options, prop, end, easing );
-}
-jQuery.Tween = Tween;
-
-Tween.prototype = {
- constructor: Tween,
- init: function( elem, options, prop, end, easing, unit ) {
- this.elem = elem;
- this.prop = prop;
- this.easing = easing || "swing";
- this.options = options;
- this.start = this.now = this.cur();
- this.end = end;
- this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
- },
- cur: function() {
- var hooks = Tween.propHooks[ this.prop ];
-
- return hooks && hooks.get ?
- hooks.get( this ) :
- Tween.propHooks._default.get( this );
- },
- run: function( percent ) {
- var eased,
- hooks = Tween.propHooks[ this.prop ];
-
- if ( this.options.duration ) {
- this.pos = eased = jQuery.easing[ this.easing ](
- percent, this.options.duration * percent, 0, 1, this.options.duration
- );
- } else {
- this.pos = eased = percent;
- }
- this.now = ( this.end - this.start ) * eased + this.start;
-
- if ( this.options.step ) {
- this.options.step.call( this.elem, this.now, this );
- }
-
- if ( hooks && hooks.set ) {
- hooks.set( this );
- } else {
- Tween.propHooks._default.set( this );
- }
- return this;
- }
-};
-
-Tween.prototype.init.prototype = Tween.prototype;
-
-Tween.propHooks = {
- _default: {
- get: function( tween ) {
- var result;
-
- if ( tween.elem[ tween.prop ] != null &&
- (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
- return tween.elem[ tween.prop ];
- }
-
- // passing any value as a 4th parameter to .css will automatically
- // attempt a parseFloat and fallback to a string if the parse fails
- // so, simple values such as "10px" are parsed to Float.
- // complex values such as "rotate(1rad)" are returned as is.
- result = jQuery.css( tween.elem, tween.prop, false, "" );
- // Empty strings, null, undefined and "auto" are converted to 0.
- return !result || result === "auto" ? 0 : result;
- },
- set: function( tween ) {
- // use step hook for back compat - use cssHook if its there - use .style if its
- // available and use plain properties where available
- if ( jQuery.fx.step[ tween.prop ] ) {
- jQuery.fx.step[ tween.prop ]( tween );
- } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
- jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
- } else {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
- }
-};
-
-// Remove in 2.0 - this supports IE8's panic based approach
-// to setting things on disconnected nodes
-
-Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- set: function( tween ) {
- if ( tween.elem.nodeType && tween.elem.parentNode ) {
- tween.elem[ tween.prop ] = tween.now;
- }
- }
-};
-
-jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
- var cssFn = jQuery.fn[ name ];
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return speed == null || typeof speed === "boolean" ||
- // special check for .toggle( handler, handler, ... )
- ( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ?
- cssFn.apply( this, arguments ) :
- this.animate( genFx( name, true ), speed, easing, callback );
- };
-});
-
-jQuery.fn.extend({
- fadeTo: function( speed, to, easing, callback ) {
-
- // show any hidden elements after setting opacity to 0
- return this.filter( isHidden ).css( "opacity", 0 ).show()
-
- // animate to the value specified
- .end().animate({ opacity: to }, speed, easing, callback );
- },
- animate: function( prop, speed, easing, callback ) {
- var empty = jQuery.isEmptyObject( prop ),
- optall = jQuery.speed( speed, easing, callback ),
- doAnimation = function() {
- // Operate on a copy of prop so per-property easing won't be lost
- var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
- // Empty animations resolve immediately
- if ( empty ) {
- anim.stop( true );
- }
- };
-
- return empty || optall.queue === false ?
- this.each( doAnimation ) :
- this.queue( optall.queue, doAnimation );
- },
- stop: function( type, clearQueue, gotoEnd ) {
- var stopQueue = function( hooks ) {
- var stop = hooks.stop;
- delete hooks.stop;
- stop( gotoEnd );
- };
-
- if ( typeof type !== "string" ) {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = undefined;
- }
- if ( clearQueue && type !== false ) {
- this.queue( type || "fx", [] );
- }
-
- return this.each(function() {
- var dequeue = true,
- index = type != null && type + "queueHooks",
- timers = jQuery.timers,
- data = jQuery._data( this );
-
- if ( index ) {
- if ( data[ index ] && data[ index ].stop ) {
- stopQueue( data[ index ] );
- }
- } else {
- for ( index in data ) {
- if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
- stopQueue( data[ index ] );
- }
- }
- }
-
- for ( index = timers.length; index--; ) {
- if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
- timers[ index ].anim.stop( gotoEnd );
- dequeue = false;
- timers.splice( index, 1 );
- }
- }
-
- // start the next in the queue if the last step wasn't forced
- // timers currently will call their complete callbacks, which will dequeue
- // but only if they were gotoEnd
- if ( dequeue || !gotoEnd ) {
- jQuery.dequeue( this, type );
- }
- });
- }
-});
-
-// Generate parameters to create a standard animation
-function genFx( type, includeWidth ) {
- var which,
- attrs = { height: type },
- i = 0;
-
- // if we include width, step value is 1 to do all cssExpand values,
- // if we don't include width, step value is 2 to skip over Left and Right
- includeWidth = includeWidth? 1 : 0;
- for( ; i < 4 ; i += 2 - includeWidth ) {
- which = cssExpand[ i ];
- attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
- }
-
- if ( includeWidth ) {
- attrs.opacity = attrs.width = type;
- }
-
- return attrs;
-}
-
-// Generate shortcuts for custom animations
-jQuery.each({
- slideDown: genFx("show"),
- slideUp: genFx("hide"),
- slideToggle: genFx("toggle"),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
- jQuery.fn[ name ] = function( speed, easing, callback ) {
- return this.animate( props, speed, easing, callback );
- };
-});
-
-jQuery.speed = function( speed, easing, fn ) {
- var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
- complete: fn || !fn && easing ||
- jQuery.isFunction( speed ) && speed,
- duration: speed,
- easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
- };
-
- opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
- opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
- // normalize opt.queue - true/undefined/null -> "fx"
- if ( opt.queue == null || opt.queue === true ) {
- opt.queue = "fx";
- }
-
- // Queueing
- opt.old = opt.complete;
-
- opt.complete = function() {
- if ( jQuery.isFunction( opt.old ) ) {
- opt.old.call( this );
- }
-
- if ( opt.queue ) {
- jQuery.dequeue( this, opt.queue );
- }
- };
-
- return opt;
-};
-
-jQuery.easing = {
- linear: function( p ) {
- return p;
- },
- swing: function( p ) {
- return 0.5 - Math.cos( p*Math.PI ) / 2;
- }
-};
-
-jQuery.timers = [];
-jQuery.fx = Tween.prototype.init;
-jQuery.fx.tick = function() {
- var timer,
- timers = jQuery.timers,
- i = 0;
-
- fxNow = jQuery.now();
-
- for ( ; i < timers.length; i++ ) {
- timer = timers[ i ];
- // Checks the timer has not already been removed
- if ( !timer() && timers[ i ] === timer ) {
- timers.splice( i--, 1 );
- }
- }
-
- if ( !timers.length ) {
- jQuery.fx.stop();
- }
- fxNow = undefined;
-};
-
-jQuery.fx.timer = function( timer ) {
- if ( timer() && jQuery.timers.push( timer ) && !timerId ) {
- timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
- }
-};
-
-jQuery.fx.interval = 13;
-
-jQuery.fx.stop = function() {
- clearInterval( timerId );
- timerId = null;
-};
-
-jQuery.fx.speeds = {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
-};
-
-// Back Compat <1.8 extension point
-jQuery.fx.step = {};
-
-if ( jQuery.expr && jQuery.expr.filters ) {
- jQuery.expr.filters.animated = function( elem ) {
- return jQuery.grep(jQuery.timers, function( fn ) {
- return elem === fn.elem;
- }).length;
- };
-}
-var rroot = /^(?:body|html)$/i;
-
-jQuery.fn.offset = function( options ) {
- if ( arguments.length ) {
- return options === undefined ?
- this :
- this.each(function( i ) {
- jQuery.offset.setOffset( this, options, i );
- });
- }
-
- var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft,
- box = { top: 0, left: 0 },
- elem = this[ 0 ],
- doc = elem && elem.ownerDocument;
-
- if ( !doc ) {
- return;
- }
-
- if ( (body = doc.body) === elem ) {
- return jQuery.offset.bodyOffset( elem );
- }
-
- docElem = doc.documentElement;
-
- // Make sure it's not a disconnected DOM node
- if ( !jQuery.contains( docElem, elem ) ) {
- return box;
- }
-
- // If we don't have gBCR, just use 0,0 rather than error
- // BlackBerry 5, iOS 3 (original iPhone)
- if ( typeof elem.getBoundingClientRect !== "undefined" ) {
- box = elem.getBoundingClientRect();
- }
- win = getWindow( doc );
- clientTop = docElem.clientTop || body.clientTop || 0;
- clientLeft = docElem.clientLeft || body.clientLeft || 0;
- scrollTop = win.pageYOffset || docElem.scrollTop;
- scrollLeft = win.pageXOffset || docElem.scrollLeft;
- return {
- top: box.top + scrollTop - clientTop,
- left: box.left + scrollLeft - clientLeft
- };
-};
-
-jQuery.offset = {
-
- bodyOffset: function( body ) {
- var top = body.offsetTop,
- left = body.offsetLeft;
-
- if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
- top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
- left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
- }
-
- return { top: top, left: left };
- },
-
- setOffset: function( elem, options, i ) {
- var position = jQuery.css( elem, "position" );
-
- // set position first, in-case top/left are set even on static elem
- if ( position === "static" ) {
- elem.style.position = "relative";
- }
-
- var curElem = jQuery( elem ),
- curOffset = curElem.offset(),
- curCSSTop = jQuery.css( elem, "top" ),
- curCSSLeft = jQuery.css( elem, "left" ),
- calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
- props = {}, curPosition = {}, curTop, curLeft;
-
- // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
- if ( calculatePosition ) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
- } else {
- curTop = parseFloat( curCSSTop ) || 0;
- curLeft = parseFloat( curCSSLeft ) || 0;
- }
-
- if ( jQuery.isFunction( options ) ) {
- options = options.call( elem, i, curOffset );
- }
-
- if ( options.top != null ) {
- props.top = ( options.top - curOffset.top ) + curTop;
- }
- if ( options.left != null ) {
- props.left = ( options.left - curOffset.left ) + curLeft;
- }
-
- if ( "using" in options ) {
- options.using.call( elem, props );
- } else {
- curElem.css( props );
- }
- }
-};
-
-
-jQuery.fn.extend({
-
- position: function() {
- if ( !this[0] ) {
- return;
- }
-
- var elem = this[0],
-
- // Get *real* offsetParent
- offsetParent = this.offsetParent(),
-
- // Get correct offsets
- offset = this.offset(),
- parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
-
- // Subtract element margins
- // note: when an element has margin: auto the offsetLeft and marginLeft
- // are the same in Safari causing offset.left to incorrectly be 0
- offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
- offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
-
- // Add offsetParent borders
- parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
- parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
-
- // Subtract the two offsets
- return {
- top: offset.top - parentOffset.top,
- left: offset.left - parentOffset.left
- };
- },
-
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || document.body;
- while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent || document.body;
- });
- }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
- var top = /Y/.test( prop );
-
- jQuery.fn[ method ] = function( val ) {
- return jQuery.access( this, function( elem, method, val ) {
- var win = getWindow( elem );
-
- if ( val === undefined ) {
- return win ? (prop in win) ? win[ prop ] :
- win.document.documentElement[ method ] :
- elem[ method ];
- }
-
- if ( win ) {
- win.scrollTo(
- !top ? val : jQuery( win ).scrollLeft(),
- top ? val : jQuery( win ).scrollTop()
- );
-
- } else {
- elem[ method ] = val;
- }
- }, method, val, arguments.length, null );
- };
-});
-
-function getWindow( elem ) {
- return jQuery.isWindow( elem ) ?
- elem :
- elem.nodeType === 9 ?
- elem.defaultView || elem.parentWindow :
- false;
-}
-// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
- jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
- // margin is only for outerHeight, outerWidth
- jQuery.fn[ funcName ] = function( margin, value ) {
- var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
- extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
- return jQuery.access( this, function( elem, type, value ) {
- var doc;
-
- if ( jQuery.isWindow( elem ) ) {
- // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
- // isn't a whole lot we can do. See pull request at this URL for discussion:
- // https://github.com/jquery/jquery/pull/764
- return elem.document.documentElement[ "client" + name ];
- }
-
- // Get document width or height
- if ( elem.nodeType === 9 ) {
- doc = elem.documentElement;
-
- // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
- // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
- return Math.max(
- elem.body[ "scroll" + name ], doc[ "scroll" + name ],
- elem.body[ "offset" + name ], doc[ "offset" + name ],
- doc[ "client" + name ]
- );
- }
-
- return value === undefined ?
- // Get width or height on the element, requesting but not forcing parseFloat
- jQuery.css( elem, type, value, extra ) :
-
- // Set width or height on the element
- jQuery.style( elem, type, value, extra );
- }, type, chainable ? margin : undefined, chainable, null );
- };
- });
-});
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
-// Expose jQuery as an AMD module, but only for AMD loaders that
-// understand the issues with loading multiple versions of jQuery
-// in a page that all might call define(). The loader will indicate
-// they have special allowances for multiple jQuery versions by
-// specifying define.amd.jQuery = true. Register as a named module,
-// since jQuery can be concatenated with other files that may use define,
-// but not use a proper concatenation script that understands anonymous
-// AMD modules. A named AMD is safest and most robust way to register.
-// Lowercase jquery is used because AMD module names are derived from
-// file names, and jQuery is normally delivered in a lowercase file name.
-// Do this after creating the global so that if an AMD module wants to call
-// noConflict to hide this version of jQuery, it will work.
-if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
- define( "jquery", [], function () { return jQuery; } );
-}
-
-})( window );
diff --git a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/underscore.js b/storage/mroonga/vendor/groonga/packages/debian/missing-sources/underscore.js
deleted file mode 100644
index 208d4cd890c..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/missing-sources/underscore.js
+++ /dev/null
@@ -1,999 +0,0 @@
-// Underscore.js 1.3.1
-// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
-// Underscore is freely distributable under the MIT license.
-// Portions of Underscore are inspired or borrowed from Prototype,
-// Oliver Steele's Functional, and John Resig's Micro-Templating.
-// For all details and documentation:
-// http://documentcloud.github.com/underscore
-
-(function() {
-
- // Baseline setup
- // --------------
-
- // Establish the root object, `window` in the browser, or `global` on the server.
- var root = this;
-
- // Save the previous value of the `_` variable.
- var previousUnderscore = root._;
-
- // Establish the object that gets returned to break out of a loop iteration.
- var breaker = {};
-
- // Save bytes in the minified (but not gzipped) version:
- var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
-
- // Create quick reference variables for speed access to core prototypes.
- var slice = ArrayProto.slice,
- unshift = ArrayProto.unshift,
- toString = ObjProto.toString,
- hasOwnProperty = ObjProto.hasOwnProperty;
-
- // All **ECMAScript 5** native function implementations that we hope to use
- // are declared here.
- var
- nativeForEach = ArrayProto.forEach,
- nativeMap = ArrayProto.map,
- nativeReduce = ArrayProto.reduce,
- nativeReduceRight = ArrayProto.reduceRight,
- nativeFilter = ArrayProto.filter,
- nativeEvery = ArrayProto.every,
- nativeSome = ArrayProto.some,
- nativeIndexOf = ArrayProto.indexOf,
- nativeLastIndexOf = ArrayProto.lastIndexOf,
- nativeIsArray = Array.isArray,
- nativeKeys = Object.keys,
- nativeBind = FuncProto.bind;
-
- // Create a safe reference to the Underscore object for use below.
- var _ = function(obj) { return new wrapper(obj); };
-
- // Export the Underscore object for **Node.js**, with
- // backwards-compatibility for the old `require()` API. If we're in
- // the browser, add `_` as a global object via a string identifier,
- // for Closure Compiler "advanced" mode.
- if (typeof exports !== 'undefined') {
- if (typeof module !== 'undefined' && module.exports) {
- exports = module.exports = _;
- }
- exports._ = _;
- } else {
- root['_'] = _;
- }
-
- // Current version.
- _.VERSION = '1.3.1';
-
- // Collection Functions
- // --------------------
-
- // The cornerstone, an `each` implementation, aka `forEach`.
- // Handles objects with the built-in `forEach`, arrays, and raw objects.
- // Delegates to **ECMAScript 5**'s native `forEach` if available.
- var each = _.each = _.forEach = function(obj, iterator, context) {
- if (obj == null) return;
- if (nativeForEach && obj.forEach === nativeForEach) {
- obj.forEach(iterator, context);
- } else if (obj.length === +obj.length) {
- for (var i = 0, l = obj.length; i < l; i++) {
- if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
- }
- } else {
- for (var key in obj) {
- if (_.has(obj, key)) {
- if (iterator.call(context, obj[key], key, obj) === breaker) return;
- }
- }
- }
- };
-
- // Return the results of applying the iterator to each element.
- // Delegates to **ECMAScript 5**'s native `map` if available.
- _.map = _.collect = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
- each(obj, function(value, index, list) {
- results[results.length] = iterator.call(context, value, index, list);
- });
- if (obj.length === +obj.length) results.length = obj.length;
- return results;
- };
-
- // **Reduce** builds up a single result from a list of values, aka `inject`,
- // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
- _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
- var initial = arguments.length > 2;
- if (obj == null) obj = [];
- if (nativeReduce && obj.reduce === nativeReduce) {
- if (context) iterator = _.bind(iterator, context);
- return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
- }
- each(obj, function(value, index, list) {
- if (!initial) {
- memo = value;
- initial = true;
- } else {
- memo = iterator.call(context, memo, value, index, list);
- }
- });
- if (!initial) throw new TypeError('Reduce of empty array with no initial value');
- return memo;
- };
-
- // The right-associative version of reduce, also known as `foldr`.
- // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
- _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
- var initial = arguments.length > 2;
- if (obj == null) obj = [];
- if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
- if (context) iterator = _.bind(iterator, context);
- return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
- }
- var reversed = _.toArray(obj).reverse();
- if (context && !initial) iterator = _.bind(iterator, context);
- return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator);
- };
-
- // Return the first value which passes a truth test. Aliased as `detect`.
- _.find = _.detect = function(obj, iterator, context) {
- var result;
- any(obj, function(value, index, list) {
- if (iterator.call(context, value, index, list)) {
- result = value;
- return true;
- }
- });
- return result;
- };
-
- // Return all the elements that pass a truth test.
- // Delegates to **ECMAScript 5**'s native `filter` if available.
- // Aliased as `select`.
- _.filter = _.select = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
- each(obj, function(value, index, list) {
- if (iterator.call(context, value, index, list)) results[results.length] = value;
- });
- return results;
- };
-
- // Return all the elements for which a truth test fails.
- _.reject = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- each(obj, function(value, index, list) {
- if (!iterator.call(context, value, index, list)) results[results.length] = value;
- });
- return results;
- };
-
- // Determine whether all of the elements match a truth test.
- // Delegates to **ECMAScript 5**'s native `every` if available.
- // Aliased as `all`.
- _.every = _.all = function(obj, iterator, context) {
- var result = true;
- if (obj == null) return result;
- if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
- each(obj, function(value, index, list) {
- if (!(result = result && iterator.call(context, value, index, list))) return breaker;
- });
- return result;
- };
-
- // Determine if at least one element in the object matches a truth test.
- // Delegates to **ECMAScript 5**'s native `some` if available.
- // Aliased as `any`.
- var any = _.some = _.any = function(obj, iterator, context) {
- iterator || (iterator = _.identity);
- var result = false;
- if (obj == null) return result;
- if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
- each(obj, function(value, index, list) {
- if (result || (result = iterator.call(context, value, index, list))) return breaker;
- });
- return !!result;
- };
-
- // Determine if a given value is included in the array or object using `===`.
- // Aliased as `contains`.
- _.include = _.contains = function(obj, target) {
- var found = false;
- if (obj == null) return found;
- if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
- found = any(obj, function(value) {
- return value === target;
- });
- return found;
- };
-
- // Invoke a method (with arguments) on every item in a collection.
- _.invoke = function(obj, method) {
- var args = slice.call(arguments, 2);
- return _.map(obj, function(value) {
- return (_.isFunction(method) ? method || value : value[method]).apply(value, args);
- });
- };
-
- // Convenience version of a common use case of `map`: fetching a property.
- _.pluck = function(obj, key) {
- return _.map(obj, function(value){ return value[key]; });
- };
-
- // Return the maximum element or (element-based computation).
- _.max = function(obj, iterator, context) {
- if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
- if (!iterator && _.isEmpty(obj)) return -Infinity;
- var result = {computed : -Infinity};
- each(obj, function(value, index, list) {
- var computed = iterator ? iterator.call(context, value, index, list) : value;
- computed >= result.computed && (result = {value : value, computed : computed});
- });
- return result.value;
- };
-
- // Return the minimum element (or element-based computation).
- _.min = function(obj, iterator, context) {
- if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
- if (!iterator && _.isEmpty(obj)) return Infinity;
- var result = {computed : Infinity};
- each(obj, function(value, index, list) {
- var computed = iterator ? iterator.call(context, value, index, list) : value;
- computed < result.computed && (result = {value : value, computed : computed});
- });
- return result.value;
- };
-
- // Shuffle an array.
- _.shuffle = function(obj) {
- var shuffled = [], rand;
- each(obj, function(value, index, list) {
- if (index == 0) {
- shuffled[0] = value;
- } else {
- rand = Math.floor(Math.random() * (index + 1));
- shuffled[index] = shuffled[rand];
- shuffled[rand] = value;
- }
- });
- return shuffled;
- };
-
- // Sort the object's values by a criterion produced by an iterator.
- _.sortBy = function(obj, iterator, context) {
- return _.pluck(_.map(obj, function(value, index, list) {
- return {
- value : value,
- criteria : iterator.call(context, value, index, list)
- };
- }).sort(function(left, right) {
- var a = left.criteria, b = right.criteria;
- return a < b ? -1 : a > b ? 1 : 0;
- }), 'value');
- };
-
- // Groups the object's values by a criterion. Pass either a string attribute
- // to group by, or a function that returns the criterion.
- _.groupBy = function(obj, val) {
- var result = {};
- var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };
- each(obj, function(value, index) {
- var key = iterator(value, index);
- (result[key] || (result[key] = [])).push(value);
- });
- return result;
- };
-
- // Use a comparator function to figure out at what index an object should
- // be inserted so as to maintain order. Uses binary search.
- _.sortedIndex = function(array, obj, iterator) {
- iterator || (iterator = _.identity);
- var low = 0, high = array.length;
- while (low < high) {
- var mid = (low + high) >> 1;
- iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
- }
- return low;
- };
-
- // Safely convert anything iterable into a real, live array.
- _.toArray = function(iterable) {
- if (!iterable) return [];
- if (iterable.toArray) return iterable.toArray();
- if (_.isArray(iterable)) return slice.call(iterable);
- if (_.isArguments(iterable)) return slice.call(iterable);
- return _.values(iterable);
- };
-
- // Return the number of elements in an object.
- _.size = function(obj) {
- return _.toArray(obj).length;
- };
-
- // Array Functions
- // ---------------
-
- // Get the first element of an array. Passing **n** will return the first N
- // values in the array. Aliased as `head`. The **guard** check allows it to work
- // with `_.map`.
- _.first = _.head = function(array, n, guard) {
- return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
- };
-
- // Returns everything but the last entry of the array. Especcialy useful on
- // the arguments object. Passing **n** will return all the values in
- // the array, excluding the last N. The **guard** check allows it to work with
- // `_.map`.
- _.initial = function(array, n, guard) {
- return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
- };
-
- // Get the last element of an array. Passing **n** will return the last N
- // values in the array. The **guard** check allows it to work with `_.map`.
- _.last = function(array, n, guard) {
- if ((n != null) && !guard) {
- return slice.call(array, Math.max(array.length - n, 0));
- } else {
- return array[array.length - 1];
- }
- };
-
- // Returns everything but the first entry of the array. Aliased as `tail`.
- // Especially useful on the arguments object. Passing an **index** will return
- // the rest of the values in the array from that index onward. The **guard**
- // check allows it to work with `_.map`.
- _.rest = _.tail = function(array, index, guard) {
- return slice.call(array, (index == null) || guard ? 1 : index);
- };
-
- // Trim out all falsy values from an array.
- _.compact = function(array) {
- return _.filter(array, function(value){ return !!value; });
- };
-
- // Return a completely flattened version of an array.
- _.flatten = function(array, shallow) {
- return _.reduce(array, function(memo, value) {
- if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value));
- memo[memo.length] = value;
- return memo;
- }, []);
- };
-
- // Return a version of the array that does not contain the specified value(s).
- _.without = function(array) {
- return _.difference(array, slice.call(arguments, 1));
- };
-
- // Produce a duplicate-free version of the array. If the array has already
- // been sorted, you have the option of using a faster algorithm.
- // Aliased as `unique`.
- _.uniq = _.unique = function(array, isSorted, iterator) {
- var initial = iterator ? _.map(array, iterator) : array;
- var result = [];
- _.reduce(initial, function(memo, el, i) {
- if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) {
- memo[memo.length] = el;
- result[result.length] = array[i];
- }
- return memo;
- }, []);
- return result;
- };
-
- // Produce an array that contains the union: each distinct element from all of
- // the passed-in arrays.
- _.union = function() {
- return _.uniq(_.flatten(arguments, true));
- };
-
- // Produce an array that contains every item shared between all the
- // passed-in arrays. (Aliased as "intersect" for back-compat.)
- _.intersection = _.intersect = function(array) {
- var rest = slice.call(arguments, 1);
- return _.filter(_.uniq(array), function(item) {
- return _.every(rest, function(other) {
- return _.indexOf(other, item) >= 0;
- });
- });
- };
-
- // Take the difference between one array and a number of other arrays.
- // Only the elements present in just the first array will remain.
- _.difference = function(array) {
- var rest = _.flatten(slice.call(arguments, 1));
- return _.filter(array, function(value){ return !_.include(rest, value); });
- };
-
- // Zip together multiple lists into a single array -- elements that share
- // an index go together.
- _.zip = function() {
- var args = slice.call(arguments);
- var length = _.max(_.pluck(args, 'length'));
- var results = new Array(length);
- for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
- return results;
- };
-
- // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
- // we need this function. Return the position of the first occurrence of an
- // item in an array, or -1 if the item is not included in the array.
- // Delegates to **ECMAScript 5**'s native `indexOf` if available.
- // If the array is large and already in sort order, pass `true`
- // for **isSorted** to use binary search.
- _.indexOf = function(array, item, isSorted) {
- if (array == null) return -1;
- var i, l;
- if (isSorted) {
- i = _.sortedIndex(array, item);
- return array[i] === item ? i : -1;
- }
- if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
- for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i;
- return -1;
- };
-
- // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
- _.lastIndexOf = function(array, item) {
- if (array == null) return -1;
- if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
- var i = array.length;
- while (i--) if (i in array && array[i] === item) return i;
- return -1;
- };
-
- // Generate an integer Array containing an arithmetic progression. A port of
- // the native Python `range()` function. See
- // [the Python documentation](http://docs.python.org/library/functions.html#range).
- _.range = function(start, stop, step) {
- if (arguments.length <= 1) {
- stop = start || 0;
- start = 0;
- }
- step = arguments[2] || 1;
-
- var len = Math.max(Math.ceil((stop - start) / step), 0);
- var idx = 0;
- var range = new Array(len);
-
- while(idx < len) {
- range[idx++] = start;
- start += step;
- }
-
- return range;
- };
-
- // Function (ahem) Functions
- // ------------------
-
- // Reusable constructor function for prototype setting.
- var ctor = function(){};
-
- // Create a function bound to a given object (assigning `this`, and arguments,
- // optionally). Binding with arguments is also known as `curry`.
- // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
- // We check for `func.bind` first, to fail fast when `func` is undefined.
- _.bind = function bind(func, context) {
- var bound, args;
- if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
- if (!_.isFunction(func)) throw new TypeError;
- args = slice.call(arguments, 2);
- return bound = function() {
- if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
- ctor.prototype = func.prototype;
- var self = new ctor;
- var result = func.apply(self, args.concat(slice.call(arguments)));
- if (Object(result) === result) return result;
- return self;
- };
- };
-
- // Bind all of an object's methods to that object. Useful for ensuring that
- // all callbacks defined on an object belong to it.
- _.bindAll = function(obj) {
- var funcs = slice.call(arguments, 1);
- if (funcs.length == 0) funcs = _.functions(obj);
- each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
- return obj;
- };
-
- // Memoize an expensive function by storing its results.
- _.memoize = function(func, hasher) {
- var memo = {};
- hasher || (hasher = _.identity);
- return function() {
- var key = hasher.apply(this, arguments);
- return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
- };
- };
-
- // Delays a function for the given number of milliseconds, and then calls
- // it with the arguments supplied.
- _.delay = function(func, wait) {
- var args = slice.call(arguments, 2);
- return setTimeout(function(){ return func.apply(func, args); }, wait);
- };
-
- // Defers a function, scheduling it to run after the current call stack has
- // cleared.
- _.defer = function(func) {
- return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
- };
-
- // Returns a function, that, when invoked, will only be triggered at most once
- // during a given window of time.
- _.throttle = function(func, wait) {
- var context, args, timeout, throttling, more;
- var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
- return function() {
- context = this; args = arguments;
- var later = function() {
- timeout = null;
- if (more) func.apply(context, args);
- whenDone();
- };
- if (!timeout) timeout = setTimeout(later, wait);
- if (throttling) {
- more = true;
- } else {
- func.apply(context, args);
- }
- whenDone();
- throttling = true;
- };
- };
-
- // Returns a function, that, as long as it continues to be invoked, will not
- // be triggered. The function will be called after it stops being called for
- // N milliseconds.
- _.debounce = function(func, wait) {
- var timeout;
- return function() {
- var context = this, args = arguments;
- var later = function() {
- timeout = null;
- func.apply(context, args);
- };
- clearTimeout(timeout);
- timeout = setTimeout(later, wait);
- };
- };
-
- // Returns a function that will be executed at most one time, no matter how
- // often you call it. Useful for lazy initialization.
- _.once = function(func) {
- var ran = false, memo;
- return function() {
- if (ran) return memo;
- ran = true;
- return memo = func.apply(this, arguments);
- };
- };
-
- // Returns the first function passed as an argument to the second,
- // allowing you to adjust arguments, run code before and after, and
- // conditionally execute the original function.
- _.wrap = function(func, wrapper) {
- return function() {
- var args = [func].concat(slice.call(arguments, 0));
- return wrapper.apply(this, args);
- };
- };
-
- // Returns a function that is the composition of a list of functions, each
- // consuming the return value of the function that follows.
- _.compose = function() {
- var funcs = arguments;
- return function() {
- var args = arguments;
- for (var i = funcs.length - 1; i >= 0; i--) {
- args = [funcs[i].apply(this, args)];
- }
- return args[0];
- };
- };
-
- // Returns a function that will only be executed after being called N times.
- _.after = function(times, func) {
- if (times <= 0) return func();
- return function() {
- if (--times < 1) { return func.apply(this, arguments); }
- };
- };
-
- // Object Functions
- // ----------------
-
- // Retrieve the names of an object's properties.
- // Delegates to **ECMAScript 5**'s native `Object.keys`
- _.keys = nativeKeys || function(obj) {
- if (obj !== Object(obj)) throw new TypeError('Invalid object');
- var keys = [];
- for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
- return keys;
- };
-
- // Retrieve the values of an object's properties.
- _.values = function(obj) {
- return _.map(obj, _.identity);
- };
-
- // Return a sorted list of the function names available on the object.
- // Aliased as `methods`
- _.functions = _.methods = function(obj) {
- var names = [];
- for (var key in obj) {
- if (_.isFunction(obj[key])) names.push(key);
- }
- return names.sort();
- };
-
- // Extend a given object with all the properties in passed-in object(s).
- _.extend = function(obj) {
- each(slice.call(arguments, 1), function(source) {
- for (var prop in source) {
- obj[prop] = source[prop];
- }
- });
- return obj;
- };
-
- // Fill in a given object with default properties.
- _.defaults = function(obj) {
- each(slice.call(arguments, 1), function(source) {
- for (var prop in source) {
- if (obj[prop] == null) obj[prop] = source[prop];
- }
- });
- return obj;
- };
-
- // Create a (shallow-cloned) duplicate of an object.
- _.clone = function(obj) {
- if (!_.isObject(obj)) return obj;
- return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
- };
-
- // Invokes interceptor with the obj, and then returns obj.
- // The primary purpose of this method is to "tap into" a method chain, in
- // order to perform operations on intermediate results within the chain.
- _.tap = function(obj, interceptor) {
- interceptor(obj);
- return obj;
- };
-
- // Internal recursive comparison function.
- function eq(a, b, stack) {
- // Identical objects are equal. `0 === -0`, but they aren't identical.
- // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
- if (a === b) return a !== 0 || 1 / a == 1 / b;
- // A strict comparison is necessary because `null == undefined`.
- if (a == null || b == null) return a === b;
- // Unwrap any wrapped objects.
- if (a._chain) a = a._wrapped;
- if (b._chain) b = b._wrapped;
- // Invoke a custom `isEqual` method if one is provided.
- if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b);
- if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a);
- // Compare `[[Class]]` names.
- var className = toString.call(a);
- if (className != toString.call(b)) return false;
- switch (className) {
- // Strings, numbers, dates, and booleans are compared by value.
- case '[object String]':
- // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
- // equivalent to `new String("5")`.
- return a == String(b);
- case '[object Number]':
- // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
- // other numeric values.
- return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
- case '[object Date]':
- case '[object Boolean]':
- // Coerce dates and booleans to numeric primitive values. Dates are compared by their
- // millisecond representations. Note that invalid dates with millisecond representations
- // of `NaN` are not equivalent.
- return +a == +b;
- // RegExps are compared by their source patterns and flags.
- case '[object RegExp]':
- return a.source == b.source &&
- a.global == b.global &&
- a.multiline == b.multiline &&
- a.ignoreCase == b.ignoreCase;
- }
- if (typeof a != 'object' || typeof b != 'object') return false;
- // Assume equality for cyclic structures. The algorithm for detecting cyclic
- // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
- var length = stack.length;
- while (length--) {
- // Linear search. Performance is inversely proportional to the number of
- // unique nested structures.
- if (stack[length] == a) return true;
- }
- // Add the first object to the stack of traversed objects.
- stack.push(a);
- var size = 0, result = true;
- // Recursively compare objects and arrays.
- if (className == '[object Array]') {
- // Compare array lengths to determine if a deep comparison is necessary.
- size = a.length;
- result = size == b.length;
- if (result) {
- // Deep compare the contents, ignoring non-numeric properties.
- while (size--) {
- // Ensure commutative equality for sparse arrays.
- if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break;
- }
- }
- } else {
- // Objects with different constructors are not equivalent.
- if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;
- // Deep compare objects.
- for (var key in a) {
- if (_.has(a, key)) {
- // Count the expected number of properties.
- size++;
- // Deep compare each member.
- if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break;
- }
- }
- // Ensure that both objects contain the same number of properties.
- if (result) {
- for (key in b) {
- if (_.has(b, key) && !(size--)) break;
- }
- result = !size;
- }
- }
- // Remove the first object from the stack of traversed objects.
- stack.pop();
- return result;
- }
-
- // Perform a deep comparison to check if two objects are equal.
- _.isEqual = function(a, b) {
- return eq(a, b, []);
- };
-
- // Is a given array, string, or object empty?
- // An "empty" object has no enumerable own-properties.
- _.isEmpty = function(obj) {
- if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
- for (var key in obj) if (_.has(obj, key)) return false;
- return true;
- };
-
- // Is a given value a DOM element?
- _.isElement = function(obj) {
- return !!(obj && obj.nodeType == 1);
- };
-
- // Is a given value an array?
- // Delegates to ECMA5's native Array.isArray
- _.isArray = nativeIsArray || function(obj) {
- return toString.call(obj) == '[object Array]';
- };
-
- // Is a given variable an object?
- _.isObject = function(obj) {
- return obj === Object(obj);
- };
-
- // Is a given variable an arguments object?
- _.isArguments = function(obj) {
- return toString.call(obj) == '[object Arguments]';
- };
- if (!_.isArguments(arguments)) {
- _.isArguments = function(obj) {
- return !!(obj && _.has(obj, 'callee'));
- };
- }
-
- // Is a given value a function?
- _.isFunction = function(obj) {
- return toString.call(obj) == '[object Function]';
- };
-
- // Is a given value a string?
- _.isString = function(obj) {
- return toString.call(obj) == '[object String]';
- };
-
- // Is a given value a number?
- _.isNumber = function(obj) {
- return toString.call(obj) == '[object Number]';
- };
-
- // Is the given value `NaN`?
- _.isNaN = function(obj) {
- // `NaN` is the only value for which `===` is not reflexive.
- return obj !== obj;
- };
-
- // Is a given value a boolean?
- _.isBoolean = function(obj) {
- return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
- };
-
- // Is a given value a date?
- _.isDate = function(obj) {
- return toString.call(obj) == '[object Date]';
- };
-
- // Is the given value a regular expression?
- _.isRegExp = function(obj) {
- return toString.call(obj) == '[object RegExp]';
- };
-
- // Is a given value equal to null?
- _.isNull = function(obj) {
- return obj === null;
- };
-
- // Is a given variable undefined?
- _.isUndefined = function(obj) {
- return obj === void 0;
- };
-
- // Has own property?
- _.has = function(obj, key) {
- return hasOwnProperty.call(obj, key);
- };
-
- // Utility Functions
- // -----------------
-
- // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
- // previous owner. Returns a reference to the Underscore object.
- _.noConflict = function() {
- root._ = previousUnderscore;
- return this;
- };
-
- // Keep the identity function around for default iterators.
- _.identity = function(value) {
- return value;
- };
-
- // Run a function **n** times.
- _.times = function (n, iterator, context) {
- for (var i = 0; i < n; i++) iterator.call(context, i);
- };
-
- // Escape a string for HTML interpolation.
- _.escape = function(string) {
- return (''+string).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g,'&#x2F;');
- };
-
- // Add your own custom functions to the Underscore object, ensuring that
- // they're correctly added to the OOP wrapper as well.
- _.mixin = function(obj) {
- each(_.functions(obj), function(name){
- addToWrapper(name, _[name] = obj[name]);
- });
- };
-
- // Generate a unique integer id (unique within the entire client session).
- // Useful for temporary DOM ids.
- var idCounter = 0;
- _.uniqueId = function(prefix) {
- var id = idCounter++;
- return prefix ? prefix + id : id;
- };
-
- // By default, Underscore uses ERB-style template delimiters, change the
- // following template settings to use alternative delimiters.
- _.templateSettings = {
- evaluate : /<%([\s\S]+?)%>/g,
- interpolate : /<%=([\s\S]+?)%>/g,
- escape : /<%-([\s\S]+?)%>/g
- };
-
- // When customizing `templateSettings`, if you don't want to define an
- // interpolation, evaluation or escaping regex, we need one that is
- // guaranteed not to match.
- var noMatch = /.^/;
-
- // Within an interpolation, evaluation, or escaping, remove HTML escaping
- // that had been previously added.
- var unescape = function(code) {
- return code.replace(/\\\\/g, '\\').replace(/\\'/g, "'");
- };
-
- // JavaScript micro-templating, similar to John Resig's implementation.
- // Underscore templating handles arbitrary delimiters, preserves whitespace,
- // and correctly escapes quotes within interpolated code.
- _.template = function(str, data) {
- var c = _.templateSettings;
- var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
- 'with(obj||{}){__p.push(\'' +
- str.replace(/\\/g, '\\\\')
- .replace(/'/g, "\\'")
- .replace(c.escape || noMatch, function(match, code) {
- return "',_.escape(" + unescape(code) + "),'";
- })
- .replace(c.interpolate || noMatch, function(match, code) {
- return "'," + unescape(code) + ",'";
- })
- .replace(c.evaluate || noMatch, function(match, code) {
- return "');" + unescape(code).replace(/[\r\n\t]/g, ' ') + ";__p.push('";
- })
- .replace(/\r/g, '\\r')
- .replace(/\n/g, '\\n')
- .replace(/\t/g, '\\t')
- + "');}return __p.join('');";
- var func = new Function('obj', '_', tmpl);
- if (data) return func(data, _);
- return function(data) {
- return func.call(this, data, _);
- };
- };
-
- // Add a "chain" function, which will delegate to the wrapper.
- _.chain = function(obj) {
- return _(obj).chain();
- };
-
- // The OOP Wrapper
- // ---------------
-
- // If Underscore is called as a function, it returns a wrapped object that
- // can be used OO-style. This wrapper holds altered versions of all the
- // underscore functions. Wrapped objects may be chained.
- var wrapper = function(obj) { this._wrapped = obj; };
-
- // Expose `wrapper.prototype` as `_.prototype`
- _.prototype = wrapper.prototype;
-
- // Helper function to continue chaining intermediate results.
- var result = function(obj, chain) {
- return chain ? _(obj).chain() : obj;
- };
-
- // A method to easily add functions to the OOP wrapper.
- var addToWrapper = function(name, func) {
- wrapper.prototype[name] = function() {
- var args = slice.call(arguments);
- unshift.call(args, this._wrapped);
- return result(func.apply(_, args), this._chain);
- };
- };
-
- // Add all of the Underscore functions to the wrapper object.
- _.mixin(_);
-
- // Add all mutator Array functions to the wrapper.
- each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
- var method = ArrayProto[name];
- wrapper.prototype[name] = function() {
- var wrapped = this._wrapped;
- method.apply(wrapped, arguments);
- var length = wrapped.length;
- if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];
- return result(wrapped, this._chain);
- };
- });
-
- // Add all accessor Array functions to the wrapper.
- each(['concat', 'join', 'slice'], function(name) {
- var method = ArrayProto[name];
- wrapper.prototype[name] = function() {
- return result(method.apply(this._wrapped, arguments), this._chain);
- };
- });
-
- // Start chaining a wrapped Underscore object.
- wrapper.prototype.chain = function() {
- this._chain = true;
- return this;
- };
-
- // Extracts the result from a wrapped and chained object.
- wrapper.prototype.value = function() {
- return this._wrapped;
- };
-
-}).call(this);
diff --git a/storage/mroonga/vendor/groonga/packages/debian/patches/series b/storage/mroonga/vendor/groonga/packages/debian/patches/series
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/patches/series
+++ /dev/null
diff --git a/storage/mroonga/vendor/groonga/packages/debian/rules b/storage/mroonga/vendor/groonga/packages/debian/rules
deleted file mode 100755
index d1be8f8fceb..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/rules
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile-gmake -*-
-#
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-# This has to be exported to make some magic below work.
-export DH_OPTIONS
-export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-export DEB_BUILD_HARDENING = 1
-DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk
-DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-
-%:
- dh $@
-
-override_dh_auto_configure:
- dh_auto_configure -- --with-munin-plugins
-
-# disable 'make check'.
-override_dh_auto_test:
-
-override_dh_install:
- find $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ -name *.la -delete
- find $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ -name underscore.js -delete
- install -d debian/tmp/etc/munin/plugin-conf.d/
- install -m 0644 debian/groonga-munin-plugins.conf \
- debian/tmp/etc/munin/plugin-conf.d/groonga
- mv debian/tmp/usr/share/doc/groonga/ \
- debian/tmp/usr/share/doc/groonga-doc/
- dh_install
diff --git a/storage/mroonga/vendor/groonga/packages/debian/source/format b/storage/mroonga/vendor/groonga/packages/debian/source/format
deleted file mode 100644
index 163aaf8d82b..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/storage/mroonga/vendor/groonga/packages/debian/watch b/storage/mroonga/vendor/groonga/packages/debian/watch
deleted file mode 100644
index 1ef60d391a4..00000000000
--- a/storage/mroonga/vendor/groonga/packages/debian/watch
+++ /dev/null
@@ -1,3 +0,0 @@
-version=3
-
-http://packages.groonga.org/source/groonga/groonga-(.*).tar.gz debian uupdate
diff --git a/storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.hayashi b/storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.hayashi
deleted file mode 100644
index 8fe39a41949..00000000000
--- a/storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.hayashi
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.kou b/storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.kou
deleted file mode 100644
index 3d2e6421530..00000000000
--- a/storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.kou
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.yoshihara b/storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.yoshihara
deleted file mode 100644
index c99adecea09..00000000000
--- a/storage/mroonga/vendor/groonga/packages/release-key-secret.asc.gpg.yoshihara
+++ /dev/null
Binary files differ
diff --git a/storage/mroonga/vendor/groonga/packages/rpm/Makefile.am b/storage/mroonga/vendor/groonga/packages/rpm/Makefile.am
deleted file mode 100644
index 06031c93f6f..00000000000
--- a/storage/mroonga/vendor/groonga/packages/rpm/Makefile.am
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = centos fedora
diff --git a/storage/mroonga/vendor/groonga/packages/rpm/centos/Makefile.am b/storage/mroonga/vendor/groonga/packages/rpm/centos/Makefile.am
deleted file mode 100644
index 321bd0c379d..00000000000
--- a/storage/mroonga/vendor/groonga/packages/rpm/centos/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-EXTRA_DIST = groonga.spec.in
-noinst_DATA = groonga.spec
diff --git a/storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in b/storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in
deleted file mode 100644
index de24a37fb60..00000000000
--- a/storage/mroonga/vendor/groonga/packages/rpm/centos/groonga.spec.in
+++ /dev/null
@@ -1,578 +0,0 @@
-%{!?use_lzo:%define use_lzo 0}
-%{!?use_mecab:%define use_mecab 1}
-%{?additional_configure_options:%define use_additional_configure_options 1}
-%{!?additional_configure_options:%define use_additional_configure_options 0}
-
-%global _initddir %{_sysconfdir}/init.d/
-
-Name: groonga
-Version: @VERSION@
-Release: 1%{?dist}
-Summary: An Embeddable Fulltext Search Engine
-
-Group: Applications/Text
-License: LGPLv2
-URL: http://groonga.org/
-Source0: http://packages.groonga.org/source/groonga/groonga-%{version}.tar.gz
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-%(%{__id_u} -n)
-%if %{use_mecab}
-BuildRequires: mecab-devel
-%endif
-BuildRequires: zlib-devel
-%if %{use_lzo}
-BuildRequires: lzo-devel
-%endif
-BuildRequires: pcre-devel
-Requires: %{name}-libs = %{version}-%{release}
-Requires: %{name}-plugin-suggest = %{version}-%{release}
-#BuildRequires: messagepack-devel
-#BuildRequires: zeromq-devel
-#BuildRequires: libevent-devel
-Obsoletes: %{name} < 1.2.2-0
-
-%description
-Groonga is an embeddable full-text search engine library. It can
-integrate with DBMS and scripting languages to enhance their search
-functionality. It also provides a standalone data store server based
-on relational data model.
-
-%package libs
-Summary: Runtime libraries for Groonga
-Group: System Environment/Libraries
-License: LGPLv2 and (MIT or GPLv2)
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
-
-%description libs
-This package contains the libraries for Groonga
-
-%package server-common
-Summary: Common packages for the Groonga server and the Groonga HTTP server
-Group: Applications/Text
-License: LGPLv2
-Requires: %{name} = %{version}-%{release}
-Requires(pre): shadow-utils
-
-%description server-common
-This package provides common settings for server use
-
-%package server-gqtp
-Summary: Groonga GQTP server
-Group: Applications/Text
-License: LGPLv2
-Requires: %{name}-server-common = %{version}-%{release}
-Requires(pre): shadow-utils
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
-Requires(postun): /sbin/service
-Obsoletes: %{name} < 1.2.2-0
-Obsoletes: %{name}-server < 2.0.7-0
-
-%description server-gqtp
-This package contains the Groonga GQTP server
-
-%package server-http
-Summary: Groonga HTTP server (stable)
-Group: Applications/Text
-License: LGPLv2
-Requires: %{name}-server-common = %{version}-%{release}
-Requires: curl
-Requires(pre): shadow-utils
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
-Requires(postun): /sbin/service
-Obsoletes: %{name} < 1.2.2-0
-Obsoletes: %{name}-server < 2.0.7-0
-Conflicts: %{name}-httpd
-
-%description server-http
-This package contains the Groonga HTTP server. It is stable but
-has only requisite minimum features.
-
-%package httpd
-Summary: Groonga HTTP server (experimental)
-Group: Applications/Text
-License: LGPLv2 and BSD
-Requires: %{name}-server-common = %{version}-%{release}
-Conflicts: %{name}-server-http
-
-%description httpd
-This package contains the Groonga HTTP server. It is experimental
-but has many features. Because it is based on nginx HTTP server.
-It will obsolete groonga-server-http when it is stable.
-
-%package doc
-Summary: Documentation for Groonga
-Group: Documentation
-License: LGPLv2 and BSD
-
-%description doc
-Documentation for Groonga
-
-%package devel
-Summary: Libraries and header files for Groonga
-Group: Development/Libraries
-Requires: %{name}-libs = %{version}-%{release}
-
-%description devel
-Libraries and header files for Groonga
-
-%if %{use_mecab}
-%package tokenizer-mecab
-Summary: MeCab tokenizer for Groonga
-Group: Applications/Text
-Requires: %{name}-libs = %{version}-%{release}
-Requires: mecab-dic
-
-%description tokenizer-mecab
-MeCab tokenizer for Groonga
-%endif
-
-%package plugin-suggest
-Summary: Suggest plugin for Groonga
-Group: Applications/Text
-Requires: %{name}-libs = %{version}-%{release}
-
-%description plugin-suggest
-Sugget plugin for Groonga
-
-%package munin-plugins
-Summary: Munin plugins for Groonga
-Group: Applications/System
-Requires: %{name}-libs = %{version}-%{release}
-Requires: munin-node
-Requires(post): munin-node
-Requires(post): /sbin/service
-Requires(postun): /sbin/service
-
-%description munin-plugins
-Munin plugins for Groonga
-
-%prep
-#% define optflags -O0
-%setup -q
-
-
-%build
-%configure \
- --disable-static \
- --with-package-platform=redhat \
- --with-zlib \
-%if %{use_lzo}
- --with-lzo \
-%endif
-%if %{use_mecab}
- --with-mecab \
-%else
- --without-mecab \
-%endif
- --with-munin-plugins \
-%if %{use_additional_configure_options}
- %{additional_configure_options}
-%endif
-
-sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
-sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
-make %{?_smp_mflags}
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
-rm $RPM_BUILD_ROOT%{_libdir}/groonga/plugins/*/*.la
-rm $RPM_BUILD_ROOT%{_libdir}/*.la
-
-mv $RPM_BUILD_ROOT%{_datadir}/doc/groonga groonga-doc
-
-mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/groonga
-mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/groonga/db
-mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/groonga
-
-mv $RPM_BUILD_ROOT%{_datadir}/groonga/munin/ $RPM_BUILD_ROOT%{_datadir}/
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/munin/plugin-conf.d/
-cat <<EOC > $RPM_BUILD_ROOT%{_sysconfdir}/munin/plugin-conf.d/groonga
-[groonga_*]
- user groonga
- group groonga
- env.PATH ${_bindir}
- env.database_path %{_localstatedir}/lib/groonga/db/db
- env.host 127.0.0.1
-
- env.http_host 127.0.0.1
- env.http_port 10041
- env.http_database_path %{_localstatedir}/lib/groonga/db/db
- env.http_pid_path %{_localstatedir}/run/groonga/groonga-http.pid
- env.http_query_log_path %{_localstatedir}/log/groonga/query-http.log
-
- env.httpd_host 127.0.0.1
- env.httpd_port 10041
- env.httpd_database_path %{_localstatedir}/lib/groonga/db/db
- env.httpd_pid_path %{_localstatedir}/run/groonga/groonga-httpd.pid
- env.httpd_query_log_path %{_localstatedir}/log/groonga/httpd/groonga-query.log
-
- env.gqtp_host 127.0.0.1
- env.gqtp_port 10043
- env.gqtp_database_path %{_localstatedir}/lib/groonga/db/db
- env.gqtp_pid_path %{_localstatedir}/run/groonga/groonga-gqtp.pid
- env.gqtp_query_log_path %{_localstatedir}/log/groonga/query-gqtp.log
-EOC
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%pre server-common
-getent group groonga >/dev/null || groupadd -r groonga
-getent passwd groonga >/dev/null || \
- useradd -r -g groonga -d %{_localstatedir}/lib/groonga -s /sbin/nologin \
- -c 'groonga' groonga
-if [ $1 = 1 ]; then
- mkdir -p %{_localstatedir}/lib/groonga/db
- groonga -n %{_localstatedir}/lib/groonga/db/db shutdown > /dev/null
- chown -R groonga:groonga %{_localstatedir}/lib/groonga
- mkdir -p %{_localstatedir}/run/groonga
- chown -R groonga:groonga %{_localstatedir}/run/groonga
-fi
-exit 0
-
-%post server-gqtp
-/sbin/chkconfig --add groonga-server-gqtp
-
-%post server-http
-/sbin/chkconfig --add groonga-server-http
-
-%post httpd
-if [ $1 = 1 ] ; then
- mkdir -p %{_localstatedir}/log/groonga/httpd
- chown -R groonga:groonga %{_localstatedir}/log/groonga/httpd
-elif [ $1 = 2 ] ; then
- /sbin/service groonga-httpd restart >/dev/null 2>&1 || :
-fi
-
-%post libs -p /sbin/ldconfig
-
-%post munin-plugins
-%{_sbindir}/munin-node-configure --shell --remove-also | grep -e 'groonga_' | sh
-[ -f %{_localstatedir}/lock/subsys/munin-node ] && \
- /sbin/service munin-node restart > /dev/null 2>&1
-:
-
-%preun server-http
-if [ $1 = 0 ] ; then
- /sbin/service groonga-server-http stop >/dev/null 2>&1 || :
- /sbin/chkconfig --del groonga-server-http
-fi
-
-%postun server-http
-if [ $1 -ge 1 ] ; then
- /sbin/service groonga-server-http condrestart >/dev/null 2>&1 || :
-fi
-
-%preun server-gqtp
-if [ $1 = 0 ] ; then
- /sbin/service groonga-server-http stop >/dev/null 2>&1 || :
- /sbin/chkconfig --del groonga-server-gqtp
-fi
-
-%postun server-gqtp
-if [ $1 -ge 1 ] ; then
- /sbin/service groonga-server-gqtp condrestart >/dev/null 2>&1 || :
-fi
-
-%postun libs -p /sbin/ldconfig
-
-%postun munin-plugins
-if [ $1 -eq 0 ]; then
- [ -f %{_localstatedir}/lock/subsys/munin-node ] && \
- /sbin/service munin-node restart >/dev/null 2>&1
- :
-fi
-
-
-%files
-%defattr(-,root,root,-)
-%{_datadir}/man/man1/*
-%{_datadir}/man/*/man1/*
-%{_bindir}/groonga
-%{_bindir}/groonga-benchmark
-
-%files libs
-%defattr(-,root,root,-)
-%doc README.md COPYING
-%{_libdir}/*.so.*
-%dir %{_libdir}/groonga
-%dir %{_libdir}/groonga/plugins
-%dir %{_libdir}/groonga/plugins/tokenizers
-%dir %{_libdir}/groonga/plugins/token_filters
-%{_libdir}/groonga/plugins/table/table.so
-%{_libdir}/groonga/plugins/query_expanders/tsv.so
-%{_libdir}/groonga/plugins/token_filters/stop_word.so
-%{_datadir}/groonga/
-%config(noreplace) %{_sysconfdir}/groonga/synonyms.tsv
-
-%files server-common
-
-%files server-gqtp
-%defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/groonga/
-%config(noreplace) %{_sysconfdir}/sysconfig/groonga-server-gqtp
-%config(noreplace) %{_sysconfdir}/logrotate.d/groonga-server-gqtp
-%{_initddir}/groonga-server-gqtp
-%ghost %dir %{_localstatedir}/run/%{name}
-%attr(0750,groonga,groonga) %dir %{_localstatedir}/lib/%{name}
-%attr(0750,groonga,groonga) %dir %{_localstatedir}/lib/%{name}/db
-
-%files server-http
-%defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/groonga/
-%config(noreplace) %{_sysconfdir}/sysconfig/groonga-server-http
-%config(noreplace) %{_sysconfdir}/logrotate.d/groonga-server-http
-%{_initddir}/groonga-server-http
-%ghost %dir %{_localstatedir}/run/%{name}
-%attr(0750,groonga,groonga) %dir %{_localstatedir}/lib/%{name}
-%attr(0750,groonga,groonga) %dir %{_localstatedir}/lib/%{name}/db
-
-%files httpd
-%defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/groonga/httpd/*
-%config(noreplace) %{_sysconfdir}/sysconfig/groonga-httpd
-%config(noreplace) %{_sysconfdir}/logrotate.d/groonga-httpd
-%{_initddir}/groonga-httpd
-%{_sbindir}/groonga-httpd
-%{_sbindir}/groonga-httpd-restart
-
-%files doc
-%defattr(-,root,root,-)
-%doc README.md COPYING
-%doc groonga-doc/*
-
-%files devel
-%defattr(-,root,root,-)
-%{_includedir}/groonga/
-%{_libdir}/*.so
-%{_libdir}/pkgconfig/groonga*.pc
-
-%files plugin-suggest
-%defattr(-,root,root,-)
-%{_bindir}/groonga-suggest-*
-%dir %{_libdir}/groonga/plugins
-%{_libdir}/groonga/plugins/suggest/suggest.so
-
-%if %{use_mecab}
-%files tokenizer-mecab
-%defattr(-,root,root,-)
-%{_libdir}/groonga/plugins/tokenizers/mecab.so
-%endif
-
-%files munin-plugins
-%defattr(-,root,root,-)
-%{_datadir}/munin/plugins/*
-%config(noreplace) %{_sysconfdir}/munin/plugin-conf.d/*
-
-%changelog
-* Mon Sep 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.0.6-1
-- new upstream release.
-
-* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.0.5-1
-- new upstream release.
-
-* Tue Jul 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.0.4-1
-- new upstream release.
-
-* Sun Jun 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.0.3-1
-- new upstream release.
-
-* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.0.2-0
-- new upstream release.
-
-* Sat Mar 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.0.1-1
-- new upstream release.
-
-* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.0.0-1
-- new upstream release.
-
-* Wed Jan 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 3.1.2-1
-- new upstream release.
-
-* Sun Dec 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.1.1-1
-- new upstream release.
-
-* Fri Nov 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.1.0-1
-- new upstream release.
-
-* Tue Oct 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.9-1
-- new upstream release.
-
-* Sun Sep 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.8-1
-- new upstream release.
-
-* Thu Aug 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.7-1
-- new upstream release.
-
-* Mon Jul 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.6-1
-- new upstream release.
-
-* Sat Jun 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.5-0
-- new upstream release.
-
-* Wed May 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.4-0
-- new upstream release.
-
-* Mon Apr 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.3-0
-- Add additional_configure_options parameter.
-- Make MeCab optional. Use use_mecab parameter for it.
-
-* Fri Mar 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.2-0
-- new upstream release.
-
-* Thu Feb 28 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.1-0
-- new upstream release.
-
-* Sat Feb 09 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.0-0
-- new upstream release.
-
-* Tue Jan 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 2.1.2-0
-- new upstream release.
-
-* Sat Dec 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.1.1-0
-- new upstream release.
-
-* Sat Dec 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.1.0-0
-- new upstream release.
-
-* Thu Nov 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.0.9-0
-- new upstream release.
-
-* Mon Oct 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.8-0
-- new upstream release.
-- Remove needless "Requires". They will be added by rpmbuild automatically.
- Reported by by Daiki Ueno. Thanks!!!
-- Fix license of server-gqtp.
-- Fix license of server-http.
-- Add more description to server-http and httpd.
-
-* Sat Sep 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.0.7-0
-- new upstream release.
-- Split groonga-server package into groonga-server-gqtp and
- groonga-server-http package.
-
-* Wed Aug 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.0.6-0
-- new upstream release.
-- Split common tasks for server use into groonga-server-common package.
-- groonga-server and groonga-httpd require groonga-server-common package.
-
-* Sun Jul 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.5-0
-- new upstream release.
-- split groonga-httpd related files into groonga-httpd package.
-
-* Fri Jun 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.4-0
-- new upstream release.
-- groonga package does not require groonga-tokenizer-mecab package.
-
-* Tue May 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.3-0
-- new upstream release.
-
-* Sun Apr 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.2-0
-- new upstream release.
-
-* Fri Mar 30 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.1-2
-- Use shutdown command for stop.
-
-* Fri Mar 30 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.1-1
-- Fix bind address argument parameter.
- Patch by Masaharu IWAI. Thanks!!!
-
-* Thu Mar 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.1-0
-- new upstream release.
-- grntest -> groonga-benchmark.
-- remove groong-tools package.
-
-* Wed Feb 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.0-0
-- new upstream release.
-- remove other permission from DB directory.
-- install init.d related files directly.
-- use HTTP as the default protocol.
-
-* Sun Jan 29 2012 Kouhei Sutou <kou@clear-code.com> - 1.3.0-0
-- new upstream release.
-- groonga-server package does not require groonga-munin-plugins package.
- suggested by Masaharu IWAI. Thanks!!!
-- groonga package does not require groonga-doc package.
- suggested by Masaharu IWAI. Thanks!!!
-
-* Thu Dec 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.9-0
-- new upstream release.
-
-* Tue Nov 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.8-0
-- new upstream release.
-- enable zlib support.
-- enable lzo support.
-- add --with-package-platform=redhat configure option to install init script.
-- add --with-munin-plugins cofnigure option to install Munin plugins.
-
-* Sat Oct 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.7-0
-- new upstream release.
-
-* Thu Sep 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.6-0
-- new upstream release.
-
-* Mon Aug 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.5-0
-- new upstream release.
-
-* Fri Jul 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.4-0
-- new upstream release.
-
-* Wed Jun 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.3-0
-- new upstream release.
-- add a new groong-tools package.
-
-* Sun May 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.2-0
-- new upstream release.
-- split server files into groonga-server package.
-
-* Fri Apr 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.1-0
-- new upstream release.
-
-* Tue Mar 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.0-0
-- new upstream release.
-
-* Wed Feb 09 2011 Kouhei Sutou <kou@clear-code.com> - 1.1.0-0
-- new upstream release.
-
-* Wed Feb 02 2011 Kouhei Sutou <kou@clear-code.com> - 1.0.8-0
-- new upstream release.
-
-* Sat Jan 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.0.7-0
-- new upstream release.
-
-* Fri Dec 31 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.6-0
-- new upstream release
-
-* Wed Dec 29 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.5-0
-- new upstream release.
-
-* Mon Nov 29 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.4-1
-- new upstream release
-
-* Wed Nov 24 2010 Daiki Ueno <dueno@redhat.com> - 1.0.3-2
-- %%ghost /var/run/*.
-
-* Fri Oct 29 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.3-1
-- new upstream release.
-
-* Thu Oct 09 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.2-2
-- merge Fedora changes.
-
-* Thu Sep 09 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.2-1
-- new upstream release.
-
-* Mon Sep 06 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.1-1
-- new upstream release.
-
-* Thu Sep 02 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.0-1
-- split packages.
-
-* Tue Aug 24 2010 Daiki Ueno <dueno@redhat.com> - 0.7.6-1
-- initial packaging for Fedora
diff --git a/storage/mroonga/vendor/groonga/packages/rpm/fedora/Makefile.am b/storage/mroonga/vendor/groonga/packages/rpm/fedora/Makefile.am
deleted file mode 100644
index 0fe3a443eed..00000000000
--- a/storage/mroonga/vendor/groonga/packages/rpm/fedora/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-EXTRA_DIST = groonga.spec.in
-noinst_DATA = groonga.spec
-
diff --git a/storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in b/storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in
deleted file mode 100644
index 31cc1c150c7..00000000000
--- a/storage/mroonga/vendor/groonga/packages/rpm/fedora/groonga.spec.in
+++ /dev/null
@@ -1,646 +0,0 @@
-%global php_extdir %(php-config --extension-dir 2>/dev/null || echo "undefined")
-
-Name: groonga
-Version: @VERSION@
-Release: 1%{?dist}
-Summary: An Embeddable Fulltext Search Engine
-
-Group: Applications/Text
-License: LGPLv2
-URL: http://groonga.org/
-Source0: http://packages.groonga.org/source/groonga/groonga-%{version}.tar.gz
-
-BuildRequires: mecab-devel
-BuildRequires: zlib-devel
-BuildRequires: lzo-devel
-#BuildRequires: messagepack-devel
-#BuildRequires: zeromq-devel
-#BuildRequires: libevent-devel
-BuildRequires: python2-devel
-BuildRequires: php-devel
-BuildRequires: libedit-devel
-BuildRequires: pcre-devel
-BuildRequires: systemd
-Requires: %{name}-libs = %{version}-%{release}
-Requires: %{name}-plugin-suggest = %{version}-%{release}
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
-ExclusiveArch: %{ix86} x86_64
-
-%description
-Groonga is an embeddable full-text search engine library. It can
-integrate with DBMS and scripting languages to enhance their search
-functionality. It also provides a standalone data store server based
-on relational data model.
-
-%package libs
-Summary: Runtime libraries for Groonga
-Group: System Environment/Libraries
-License: LGPLv2 and (MIT or GPLv2)
-Requires(post): /sbin/ldconfig
-Requires(postun): /sbin/ldconfig
-
-%description libs
-This package contains the libraries for Groonga
-
-%package server-common
-Summary: Common packages for the Groonga server and the Groonga HTTP server
-Group: Applications/Text
-License: LGPLv2
-Requires: %{name} = %{version}-%{release}
-Requires(pre): shadow-utils
-
-%description server-common
-This package provides common settings for server use
-
-%package server-gqtp
-Summary: Groonga GQTP server
-Group: Applications/Text
-License: LGPLv2
-Requires: %{name}-server-common = %{version}-%{release}
-Requires(pre): shadow-utils
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
-Requires(postun): /sbin/service
-Obsoletes: %{name}-server < 2.0.7-0
-
-%description server-gqtp
-This package contains the Groonga GQTP server
-
-%package server-http
-Summary: Groonga HTTP server (stable)
-Group: Applications/Text
-License: LGPLv2
-Requires: %{name}-server-common = %{version}-%{release}
-Requires: curl
-Requires(pre): shadow-utils
-Requires(post): /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Requires(preun): /sbin/service
-Requires(postun): /sbin/service
-Obsoletes: %{name}-server < 2.0.7-0
-Conflicts: %{name}-httpd
-
-%description server-http
-This package contains the Groonga HTTP server. It is stable but
-has only requisite minimum features.
-
-%package httpd
-Summary: Groonga HTTP server (experimental)
-Group: Applications/Text
-License: LGPLv2 and BSD
-Requires: %{name}-server-common = %{version}-%{release}
-Conflicts: %{name}-server-http
-
-%description httpd
-This package contains the Groonga HTTP server. It is experimental
-but has many features. Because it is based on nginx HTTP server.
-It will obsolete groonga-server-http when it is stable.
-
-%package doc
-Summary: Documentation for Groonga
-Group: Documentation
-License: LGPLv2 and BSD
-
-%description doc
-Documentation for Groonga
-
-%package devel
-Summary: Libraries and header files for Groonga
-Group: Development/Libraries
-Requires: %{name}-libs = %{version}-%{release}
-
-%description devel
-Libraries and header files for Groonga
-
-%package tokenizer-mecab
-Summary: MeCab tokenizer for Groonga
-Group: Applications/Text
-Requires: %{name}-libs = %{version}-%{release}
-Requires: mecab-dic
-
-%description tokenizer-mecab
-MeCab tokenizer for Groonga
-
-%package plugin-suggest
-Summary: Suggest plugin for Groonga
-Group: Applications/Text
-Requires: %{name}-libs = %{version}-%{release}
-
-%description plugin-suggest
-Sugget plugin for Groonga
-
-%package munin-plugins
-Summary: Munin plugins for Groonga
-Group: Applications/System
-Requires: %{name}-libs = %{version}-%{release}
-Requires: munin-node
-Requires(post): munin-node
-Requires(post): /sbin/service
-Requires(postun): /sbin/service
-
-%description munin-plugins
-Munin plugins for Groonga
-
-%package python
-Summary: Python language binding for Groonga
-Group: Development/Libraries
-Requires: %{name}-libs = %{version}-%{release}
-
-%description python
-Python language binding for Groonga
-
-%package php
-Summary: PHP language binding for Groonga
-Group: Development/Libraries
-Requires: %{name}-libs = %{version}-%{release}
-
-%description php
-PHP language binding for Groonga
-
-
-%prep
-#% define optflags -O0
-%setup -q
-
-
-%build
-%configure \
- --disable-static \
- --with-package-platform=fedora \
- --with-zlib --with-lzo \
- --with-munin-plugins
-sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
-sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
-make %{?_smp_mflags}
-
-# build python binding
-cd %{_builddir}/%{name}-%{version}/bindings/python/ql
-python setup.py config
-sed -i.cflags -e 's|^cflags =.*|cflags = []|' setup.py
-CFLAGS=-I%{_builddir}/%{name}-%{version}/include
-export CFLAGS
-LDFLAGS=-L%{_builddir}/%{name}-%{version}/lib/.libs
-export LDFLAGS
-python setup.py build
-
-# build php binding
-cd %{_builddir}/%{name}-%{version}/bindings/php
-sed -i.ldflags -e 's|PHP_ADD_LIBRARY_WITH_PATH(groonga, .*)|PHP_ADD_LIBRARY(groonga, GROONGA_SHARED_LIBADD)|' config.m4
-phpize
-CFLAGS="%{optflags}"
-export CFLAGS
-LDFLAGS=-L%{_builddir}/%{name}-%{version}/lib/.libs
-export LDFLAGS
-# --with-groonga is only necessary to avoid error in configure
-%configure --disable-static --with-groonga=%{_builddir}/%{name}-%{version}
-make %{?_smp_mflags}
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
-rm $RPM_BUILD_ROOT%{_libdir}/groonga/plugins/*/*.la
-rm $RPM_BUILD_ROOT%{_libdir}/*.la
-
-mv $RPM_BUILD_ROOT%{_datadir}/doc/groonga groonga-doc
-
-mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/groonga
-mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/groonga/db
-mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/groonga
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/groonga/plugins/normalizers
-
-mv $RPM_BUILD_ROOT%{_datadir}/groonga/munin/ $RPM_BUILD_ROOT%{_datadir}/
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/munin/plugin-conf.d/
-cat <<EOC > $RPM_BUILD_ROOT%{_sysconfdir}/munin/plugin-conf.d/groonga
-[groonga_*]
- user groonga
- group groonga
- env.PATH ${_bindir}
- env.database_path %{_localstatedir}/lib/groonga/db/db
- env.host 127.0.0.1
-
- env.http_host 127.0.0.1
- env.http_port 10041
- env.http_database_path %{_localstatedir}/lib/groonga/db/db
- env.http_pid_path %{_localstatedir}/run/groonga/groonga-http.pid
- env.http_query_log_path %{_localstatedir}/log/groonga/query-http.log
-
- env.httpd_host 127.0.0.1
- env.httpd_port 10041
- env.httpd_database_path %{_localstatedir}/lib/groonga/db/db
- env.httpd_pid_path %{_localstatedir}/run/groonga/groonga-httpd.pid
- env.httpd_query_log_path %{_localstatedir}/log/groonga/httpd/groonga-query.log
-
- env.gqtp_host 127.0.0.1
- env.gqtp_port 10043
- env.gqtp_database_path %{_localstatedir}/lib/groonga/db/db
- env.gqtp_pid_path %{_localstatedir}/run/groonga/groonga-gqtp.pid
- env.gqtp_query_log_path %{_localstatedir}/log/groonga/query-gqtp.log
-EOC
-
-# install python binding
-cd %{_builddir}/%{name}-%{version}/bindings/python/ql
-python setup.py install --root=$RPM_BUILD_ROOT
-
-# install php binding
-cd %{_builddir}/%{name}-%{version}/bindings/php
-make install INSTALL_ROOT=$RPM_BUILD_ROOT INSTALL="install -p"
-
-
-%pre server-common
-getent group groonga >/dev/null || groupadd -r groonga
-getent passwd groonga >/dev/null || \
- useradd -r -g groonga -d %{_localstatedir}/lib/groonga -s /sbin/nologin \
- -c 'groonga' groonga
-if [ $1 = 1 ] ; then
- mkdir -p %{_localstatedir}/lib/groonga/db
- groonga -n %{_localstatedir}/lib/groonga/db/db shutdown > /dev/null
- chown -R groonga:groonga %{_localstatedir}/lib/groonga
- mkdir -p %{_localstatedir}/run/groonga
- chown -R groonga:groonga %{_localstatedir}/run/groonga
-fi
-exit 0
-
-%post server-http
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-
-%post server-gqtp
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-
-%post httpd
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 = 1 ]; then
- mkdir -p %{_localstatedir}/log/groonga/httpd
- chown -R groonga:groonga %{_localstatedir}/log/groonga/httpd
-elif [ $1 = 2 ]; then
- %{_sbindir}/groonga-httpd-restart
-fi
-
-%post libs -p /sbin/ldconfig
-
-%post munin-plugins
-%{_sbindir}/munin-node-configure --shell --remove-also | grep -e 'groonga_' | sh
-[ -f %{_localstatedir}/lock/subsys/munin-node ] && \
- /sbin/service munin-node restart > /dev/null 2>&1
-:
-
-%preun server-http
-if [ $1 = 0 ] ; then
- /bin/systemctl --no-reload disable groonga.service > /dev/null 2>&1 || :
- /bin/systemctl stop groonga.service > /dev/null 2>&1 || :
-fi
-
-%postun server-http
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
- /bin/systemctl try-restart groonga.service >/dev/null 2>&1 || :
-fi
-
-%preun httpd
-if [ $1 = 0 ] ; then
- /bin/systemctl --no-reload disable groonga-httpd.service > /dev/null 2>&1 || :
- /bin/systemctl stop groonga-httpd.service > /dev/null 2>&1 || :
-fi
-
-%postun httpd
-/bin/systemctl daemon-reload >/dev/null 2>&1 || :
-if [ $1 -ge 1 ] ; then
- %{_sbindir}/groonga-httpd-restart try-restart >/dev/null 2>&1 || :
-fi
-
-%triggerun -- groonga < 1.3.0-1
-/usr/bin/systemd-sysv-convert --save groonga >/dev/null 2>&1 ||:
-/bin/systemctl --no-reload enable groonga.service >/dev/null 2>&1 ||:
-/sbin/chkconfig --del groonga >/dev/null 2>&1 || :
-/bin/systemctl try-restart groonga.service >/dev/null 2>&1 || :
-
-%postun libs -p /sbin/ldconfig
-
-%postun munin-plugins
-if [ $1 -eq 0 ]; then
- [ -f %{_localstatedir}/lock/subsys/munin-node ] && \
- /sbin/service munin-node restart >/dev/null 2>&1
- :
-fi
-
-
-%files
-%defattr(-,root,root,-)
-%{_datadir}/man/man1/*
-%{_datadir}/man/*/man1/*
-%{_bindir}/groonga
-%{_bindir}/groonga-benchmark
-
-%files libs
-%defattr(-,root,root,-)
-%doc README.md COPYING
-%{_libdir}/*.so.*
-%dir %{_libdir}/groonga
-%dir %{_libdir}/groonga/plugins
-%dir %{_libdir}/groonga/plugins/normalizers
-%dir %{_libdir}/groonga/plugins/query_expanders
-%dir %{_libdir}/groonga/plugins/suggest
-%dir %{_libdir}/groonga/plugins/table
-%dir %{_libdir}/groonga/plugins/tokenizers
-%dir %{_libdir}/groonga/plugins/token_filters
-%{_libdir}/groonga/plugins/table/table.so
-%{_libdir}/groonga/plugins/query_expanders/tsv.so
-%{_libdir}/groonga/plugins/token_filters/stop_word
-%{_datadir}/groonga/
-%config(noreplace) %{_sysconfdir}/groonga/synonyms.tsv
-
-%files server-common
-
-%files server-http
-%defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/groonga/
-%config(noreplace) %{_sysconfdir}/sysconfig/groonga-server-http
-%{_unitdir}/groonga-server-http.service
-%ghost %dir %{_localstatedir}/run/%{name}
-%attr(0750,groonga,groonga) %dir %{_localstatedir}/lib/%{name}
-%attr(0750,groonga,groonga) %dir %{_localstatedir}/lib/%{name}/db
-
-%files server-gqtp
-%defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/groonga/
-%config(noreplace) %{_sysconfdir}/sysconfig/groonga-server-gqtp
-%{_unitdir}/groonga-server-gqtp.service
-%ghost %dir %{_localstatedir}/run/%{name}
-%attr(0750,groonga,groonga) %dir %{_localstatedir}/lib/%{name}
-%attr(0750,groonga,groonga) %dir %{_localstatedir}/lib/%{name}/db
-
-%files httpd
-%defattr(-,root,root,-)
-%config(noreplace) %{_sysconfdir}/groonga/httpd/*
-%{_unitdir}/groonga-httpd.service
-%{_sbindir}/groonga-httpd
-%{_sbindir}/groonga-httpd-restart
-
-%files doc
-%defattr(-,root,root,-)
-%doc README.md COPYING
-%doc groonga-doc/*
-
-%files devel
-%defattr(-,root,root,-)
-%{_includedir}/groonga/
-%{_libdir}/*.so
-%{_libdir}/pkgconfig/groonga*.pc
-
-%files tokenizer-mecab
-%defattr(-,root,root,-)
-%{_libdir}/groonga/plugins/tokenizers/mecab.so
-
-%files plugin-suggest
-%defattr(-,root,root,-)
-%{_bindir}/groonga-suggest-*
-%{_libdir}/groonga/plugins/suggest/suggest.so
-
-%files munin-plugins
-%defattr(-,root,root,-)
-%{_datadir}/munin/plugins/*
-%config(noreplace) %{_sysconfdir}/munin/plugin-conf.d/*
-
-%files python
-%defattr(-,root,root,-)
-%{python_sitearch}/groongaql*
-
-%files php
-%defattr(-,root,root,-)
-%{php_extdir}/groonga.so
-
-%changelog
-* Mon Sep 29 2014 Kouhei Sutou <kou@cozmixng.org> - 4.0.6-1
-- new upstream release.
-
-* Fri Aug 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.0.5-1
-- new upstream release.
-
-* Tue Jul 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.0.4-1
-- new upstream release.
-
-* Sun Jun 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.0.3-1
-- new upstream release.
-
-* Thu May 29 2014 Kouhei Sutou <kou@clear-code.com> - 4.0.2-0
-- new upstream release.
-
-* Sat Mar 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.0.1-1
-- new upstream release.
-
-* Sun Feb 09 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 4.0.0-1
-- new upstream release.
-
-* Wed Jan 29 2014 HAYASHI Kentaro <hayashi@clear-code.com> - 3.1.2-1
-- new upstream release.
-
-* Sun Dec 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.1.1-1
-- new upstream release.
-
-* Fri Nov 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.1.0-1
-- new upstream release.
-
-* Tue Oct 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.9-1
-- new upstream release.
-
-* Sun Sep 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.8-1
-- new upstream release.
-
-* Thu Aug 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.7-1
-- new upstream release.
-
-* Fri Mar 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.2-0
-- new upstream release.
-
-* Thu Feb 28 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.1-0
-- new upstream release.
-
-* Sat Feb 09 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 3.0.0-0
-- new upstream release.
-
-* Tue Jan 29 2013 HAYASHI Kentaro <hayashi@clear-code.com> - 2.1.2-0
-- new upstream release.
-
-* Sat Dec 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.1.1-0
-- new upstream release.
-
-* Sat Dec 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.1.0-0
-- new upstream release.
-
-* Thu Nov 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.0.9-0
-- new upstream release.
-
-* Mon Oct 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.8-0
-- new upstream release.
-- Remove needless "Requires". They will be added by rpmbuild automatically.
- Reported by by Daiki Ueno. Thanks!!!
-- Fix license of server-gqtp.
-- Fix license of server-http.
-- Add more description to server-http and httpd.
-
-* Sat Sep 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.0.7-0
-- new upstream release.
-- Split groonga-server package into groonga-server-gqtp and
- groonga-server-http package.
-
-* Wed Aug 29 2012 HAYASHI Kentaro <hayashi@clear-code.com> - 2.0.6-0
-- new upstream release.
-- Split common tasks for server use into groonga-server-common package.
-- groonga-server and groonga-httpd require groonga-server-common package.
-
-* Sun Jul 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.5-0
-- new upstream release.
-
-* Fri Jun 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.4-0
-- new upstream release.
-- groonga package does not require groonga-tokenizer-mecab package.
-
-* Tue May 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.3-0
-- new upstream release.
-
-* Sun Apr 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.2-0
-- new upstream release.
-- use libedit.
-
-* Fri Mar 30 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.1-2
-- Use shutdown command for stop.
-
-* Fri Mar 30 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.1-1
-- Fix bind address argument parameter.
- Patch by Masaharu IWAI. Thanks!!!
-
-* Thu Mar 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.1-0
-- new upstream release.
-- ensure removing build directory before installing.
-- grntest -> groonga-benchmark.
-- remove groonga-tools package.
-
-* Wed Feb 29 2012 Kouhei Sutou <kou@clear-code.com> - 2.0.0-0
-- new upstream release.
-- remove other permission from DB directory.
-- use HTTP as the default protocol.
-- support effective user and group in systemd.
- Patch by Daiki Ueno. Thanks!!!
-
-* Mon Jan 30 2012 Daiki Ueno <dueno@redhat.com> - 1.3.0-1
-- built in Fedora
-- migrate groonga-server initscript to systemd service (#781503)
-
-* Sun Jan 29 2012 Kouhei Sutou <kou@clear-code.com> - 1.3.0-0
-- new upstream release.
-- groonga-server package does not require groonga-munin-plugins package.
- suggested by Masaharu IWAI. Thanks!!!
-- groonga package does not require groonga-doc package.
- suggested by Masaharu IWAI. Thanks!!!
-
-* Thu Dec 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.9-0
-- new upstream release.
-
-* Tue Nov 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.8-0
-- new upstream release.
-- enable zlib support.
-- enable lzo support.
-- add --with-package-platform=redhat configure option to install init script.
-- add --with-munin-plugins cofnigure option to install Munin plugins.
-
-* Sat Oct 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.7-0
-- new upstream release.
-
-* Thu Sep 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.6-0
-- new upstream release.
-
-* Mon Aug 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.5-0
-- new upstream release.
-
-* Fri Jul 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.4-0
-- new upstream release.
-
-* Wed Jun 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.3-0
-- new upstream release.
-- add a new groong-tools package.
-
-* Sun May 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.2-0
-- new upstream release.
-- split server files into groonga-server package.
-
-* Fri Apr 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.1-0
-- new upstream release.
-
-* Tue Mar 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.2.0-0
-- new upstream release.
-
-* Wed Feb 09 2011 Kouhei Sutou <kou@clear-code.com> - 1.1.0-0
-- new upstream release.
-
-* Wed Feb 02 2011 Kouhei Sutou <kou@clear-code.com> - 1.0.8-0
-- new upstream release.
-
-* Sat Jan 29 2011 Kouhei Sutou <kou@clear-code.com> - 1.0.7-0
-- new upstream release.
-
-* Fri Dec 31 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.6-0
-- new upstream release
-
-* Wed Dec 29 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.5-0
-- new upstream release.
-
-* Mon Nov 29 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.4-1
-- new upstream release
-
-* Wed Nov 24 2010 Daiki Ueno <dueno@redhat.com> - 1.0.3-2
-- %%ghost /var/run/*.
-
-* Sat Oct 09 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.3-1
-- new upstream release.
-
-* Thu Oct 7 2010 Daiki Ueno <dueno@redhat.com> - 1.0.2-7
-- own %%_localstatedir/lib/%%name/db.
-- use %%_sbindir RPM macro.
-
-* Wed Oct 6 2010 Daiki Ueno <dueno@redhat.com> - 1.0.2-6
-- use %%python_sitearch and %%php_extdir macros.
-- correct directory ownership for -munin-plugins subpackage.
-- supply %%optflags when building PHP binding.
-- don't set CGROUP_DAEMON in initscript.
-
-* Tue Oct 5 2010 Daiki Ueno <dueno@redhat.com> - 1.0.2-5
-- correct directory ownership for -munin-plugins subpackage.
-- make -doc subpackage require -libs.
-- correct directory ownership for directories under %%_localstatedir.
-- make initscript disabled by default
-- move "build process" of Python and PHP bindings to %%build from %%install
-- build against Python 2.7
-- fix naming of Python and PHP bindings (python-%%{name} to %%{name}-python)
-
-* Mon Oct 4 2010 Daiki Ueno <dueno@redhat.com> - 1.0.2-4
-- package Python and PHP bindings.
-
-* Mon Oct 4 2010 Daiki Ueno <dueno@redhat.com> - 1.0.2-3
-- fix License.
-- pass "-p" to the install command to preserve timestamps.
-- use RPM macros %%_initddir, %%_localstatedir, %%_prefix, etc.
-- use the standard snippet to creating user/group for groonga; don't
- call userdel/groupdel.
-- add missing "Require(foo): bar" for /sbin/service, /sbin/chkconfig,
- /sbin/ldconfig, and /usr/sbin/munin-node-configure.
-- fix attributes in %%files.
-- correct directory ownership.
-
-* Fri Oct 1 2010 Daiki Ueno <dueno@redhat.com> - 1.0.2-2
-- don't require autotools when building
-- pass --disable-static to %%configure
-
-* Thu Sep 09 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.2-1
-- new upstream release.
-
-* Mon Sep 06 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.1-1
-- new upstream release.
-
-* Thu Sep 02 2010 Kouhei Sutou <kou@clear-code.com> - 1.0.0-1
-- split packages.
-
-* Tue Aug 24 2010 Daiki Ueno <dueno@redhat.com> - 0.7.6-1
-- initial packaging for Fedora
diff --git a/storage/mroonga/vendor/groonga/packages/source/Makefile.am b/storage/mroonga/vendor/groonga/packages/source/Makefile.am
deleted file mode 100644
index 9940b6800df..00000000000
--- a/storage/mroonga/vendor/groonga/packages/source/Makefile.am
+++ /dev/null
@@ -1,25 +0,0 @@
-all:
-
-release: upload
-
-ensure-rsync-path:
- @if test -z "$(RSYNC_PATH)"; then \
- echo "--with-rsync-path configure option must be specified."; \
- false; \
- fi
-
-download: ensure-rsync-path
- rsync -avz --progress $(RSYNC_PATH)/source/groonga/ files
-
-upload: ensure-rsync-path files/$(PACKAGE)-$(VERSION).tar.gz files/$(PACKAGE)-$(VERSION).zip
- rsync -avz --progress --delete files/ $(RSYNC_PATH)/source/groonga
-
-files/$(PACKAGE)-$(VERSION).tar.gz: $(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
- mkdir -p files
- cp -p $< $@
-
-files/$(PACKAGE)-$(VERSION).zip: files/$(PACKAGE)-$(VERSION).tar.gz
- rm -rf $(PACKAGE)-$(VERSION)
- tar xvzf files/$(PACKAGE)-$(VERSION).tar.gz
- zip -r $@ $(PACKAGE)-$(VERSION)
- rm -rf $(PACKAGE)-$(VERSION)
diff --git a/storage/mroonga/vendor/groonga/packages/ubuntu/Makefile.am b/storage/mroonga/vendor/groonga/packages/ubuntu/Makefile.am
deleted file mode 100644
index af677d733e0..00000000000
--- a/storage/mroonga/vendor/groonga/packages/ubuntu/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-CODE_NAMES = precise,trusty
-SOURCE = ../$(PACKAGE)-$(VERSION).tar.gz
-
-all:
-
-ensure-launchpad-configuration:
- @if test -z "$(LAUNCHPAD_UPLOADER_PGP_KEY)"; then \
- echo "--with-launchpad-uploader-pgp-key configure option must be specified."; \
- false; \
- fi
-
-upload: source ensure-launchpad-configuration
- ./upload.rb \
- --package '$(PACKAGE)' \
- --version '$(VERSION)' \
- --source-archive '$(SOURCE)' \
- --code-names '$(CODE_NAMES)' \
- --debian-directory '$(srcdir)/../debian/' \
- --pgp-sign-key '$(LAUNCHPAD_UPLOADER_PGP_KEY)'
-
-source: $(SOURCE)
-
-$(SOURCE):
- ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz $(SOURCE)
diff --git a/storage/mroonga/vendor/groonga/packages/ubuntu/upload.rb b/storage/mroonga/vendor/groonga/packages/ubuntu/upload.rb
deleted file mode 100755
index 508d1d4f447..00000000000
--- a/storage/mroonga/vendor/groonga/packages/ubuntu/upload.rb
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Copyright(C) 2014 Kouhei Sutou <kou@clear-code.com>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-require "optparse"
-require "fileutils"
-require "pathname"
-
-class Uploader
- def initialize
- @dput_configuration_name = "groonga-ppa"
- end
-
- def run
- ensure_dput_configuration
-
- parse_command_line!
-
- @code_names.each do |code_name|
- upload(code_name)
- end
- end
-
- private
- def ensure_dput_configuration
- dput_cf_path = Pathname.new("~/.dput.cf").expand_path
- if dput_cf_path.exist?
- dput_cf_content = dput_cf_path.read
- else
- dput_cf_content = ""
- end
- dput_cf_content.each_line do |line|
- return if line.chomp == "[#{@dput_configuration_name}]"
- end
-
- dput_cf_path.open("w") do |dput_cf|
- dput_cf.puts(dput_cf_content)
- dput_cf.puts(<<-CONFIGURATION)
-[#{@dput_configuration_name}]
-fqdn = ppa.launchpad.net
-method = ftp
-incoming = ~groonga/ppa/ubuntu/
-login = anonymous
-allow_unsigned_uploads = 0
- CONFIGURATION
- end
- end
-
- def parse_command_line!
-
- parser = OptionParser.new
- parser.on("--package=NAME",
- "The package name") do |name|
- @package = name
- end
- parser.on("--version=VERSION",
- "The version") do |version|
- @version = version
- end
- parser.on("--source-archive=ARCHIVE",
- "The source archive") do |source_archive|
- @source_archive = Pathname.new(source_archive).expand_path
- end
- parser.on("--code-names=CODE_NAME1,CODE_NAME2,CODE_NAME3,...", Array,
- "The target code names") do |code_names|
- @code_names = code_names
- end
- parser.on("--debian-directory=DIRECTORY",
- "The debian/ directory") do |debian_directory|
- @debian_directory = Pathname.new(debian_directory).expand_path
- end
- parser.on("--pgp-sign-key=KEY",
- "The PGP key to sign .changes and .dsc") do |pgp_sign_key|
- @pgp_sign_key = pgp_sign_key
- end
-
- parser.parse!
- end
-
- def upload(code_name)
- in_temporary_directory do
- FileUtils.cp(@source_archive.to_s,
- "#{@package}_#{@version}.orig.tar.gz")
- run_command("tar", "xf", @source_archive.to_s)
- directory_name = "#{@package}-#{@version}"
- Dir.chdir(directory_name) do
- FileUtils.cp_r(@debian_directory.to_s, "debian")
- deb_version = "#{current_deb_version.succ}~#{code_name}1"
- run_command("dch",
- "--distribution", code_name,
- "--newversion", deb_version,
- "Build for #{code_name}.")
- run_command("debuild", "-S", "-sa", "-pgpg2", "-k#{@pgp_sign_key}")
- run_command("dput", @dput_configuration_name,
- "../#{@package}_#{deb_version}_source.changes")
- end
- end
- end
-
- def current_deb_version
- /\((.+)\)/ =~ File.read("debian/changelog").lines.first
- $1
- end
-
- def in_temporary_directory
- name = "tmp"
- FileUtils.rm_rf(name)
- FileUtils.mkdir_p(name)
- Dir.chdir(name) do
- yield
- end
- end
-
- def run_command(*command_line)
- unless system(*command_line)
- raise "failed to run command: #{command_line.join(' ')}"
- end
- end
-end
-
-uploader = Uploader.new
-uploader.run
diff --git a/storage/mroonga/vendor/groonga/packages/windows/Makefile.am b/storage/mroonga/vendor/groonga/packages/windows/Makefile.am
deleted file mode 100644
index fe8ce243b3c..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/Makefile.am
+++ /dev/null
@@ -1,130 +0,0 @@
-SUBDIRS = \
- patches \
- language-files
-EXTRA_DIST = Rakefile
-LICENSE_DIR = dist-x64/share/license
-ARCHITECTURES = x86 x64
-
-all:
-
-release: build package installer upload
-
-ensure-rsync-path:
- @if test -z "$(RSYNC_PATH)"; then \
- echo "--with-rsync-path configure option must be specified."; \
- false; \
- fi
-
-download: ensure-rsync-path
- rsync -avz --progress $(RSYNC_PATH)/windows/groonga/ files
-
-upload: ensure-rsync-path
- rsync -avz --progress --delete files/ $(RSYNC_PATH)/windows/groonga
-
-build_options = \
- VERSION=$(VERSION) \
- SOURCE=$(SOURCE) \
- DEBUG_BUILD=$(DEBUG_BUILD)
-
-build: source
- for architecture in $(ARCHITECTURES); do \
- $(RUBY) -S rake build $(build_options) \
- ARCHITECTURE=$${architecture}; \
- done
-
-build-groonga: source
- for architecture in $(ARCHITECTURES); do \
- $(RUBY) -S rake build:groonga $(build_options) \
- ARCHITECTURE=$${architecture}; \
- done
-
-LICENSE:
- @(echo "Groonga"; \
- echo "======="; \
- echo; \
- echo "AUTHORS"; \
- echo "-------"; \
- echo; \
- cat $(LICENSE_DIR)/groonga/AUTHORS; \
- echo; \
- echo "COPYING"; \
- echo "-------"; \
- echo; \
- cat $(LICENSE_DIR)/groonga/COPYING; \
- echo; \
- echo; \
- echo "MeCab"; \
- echo "====="; \
- echo; \
- echo "AUTHORS"; \
- echo "-------"; \
- echo; \
- cat $(LICENSE_DIR)/mecab/AUTHORS; \
- echo; \
- echo "COPYING"; \
- echo "-------"; \
- echo; \
- cat $(LICENSE_DIR)/mecab/COPYING; \
- echo; \
- echo "BSD"; \
- echo "---"; \
- echo; \
- echo; cat $(LICENSE_DIR)/mecab/BSD; \
- echo; \
- echo "GPL"; \
- echo "---"; \
- echo; \
- cat $(LICENSE_DIR)/mecab/GPL; \
- echo; \
- echo "LGPL"; \
- echo "----"; \
- echo; \
- cat $(LICENSE_DIR)/mecab/LGPL; \
- echo; \
- echo; \
- echo "NAIST-jdic"; \
- echo "=========="; \
- echo; \
- echo "AUTHORS"; \
- echo "-------"; \
- echo; \
- cat $(LICENSE_DIR)/naist-jdic/AUTHORS; \
- echo; \
- echo "COPYING"; \
- echo "-------"; \
- echo; \
- cat $(LICENSE_DIR)/naist-jdic/COPYING; \
- ) > LICENSE
-
-installer: installer-x86 installer-x64
-
-setup-x86.nsi: setup-x64.nsi
- sed \
- -e 's/64/86/g' \
- -e 's/PROGRAMFILES86/PROGRAMFILES32/g' \
- setup-x64.nsi > setup-x86.nsi
-
-installer-x86: LICENSE setup-x86.nsi
- makensis setup-x86.nsi
-
-installer-x64: LICENSE setup-x64.nsi
- makensis setup-x64.nsi
-
-package:
- for architecture in $(ARCHITECTURES); do \
- mkdir -p files; \
- rm -rf files/$(PACKAGE)-$(VERSION)-$${architecture}; \
- cp -a dist-$${architecture} \
- files/$(PACKAGE)-$(VERSION)-$${architecture}; \
- (cd files && \
- zip -r $(PACKAGE)-$(VERSION)-$${architecture}.zip \
- $(PACKAGE)-$(VERSION)-$${architecture}); \
- rm -rf files/$(PACKAGE)-$(VERSION)-$${architecture}; \
- done
-
-SOURCE=../$(PACKAGE)-$(VERSION).tar.gz
-
-source: $(SOURCE)
-
-$(SOURCE):
- ln -s $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz ../
diff --git a/storage/mroonga/vendor/groonga/packages/windows/Rakefile b/storage/mroonga/vendor/groonga/packages/windows/Rakefile
deleted file mode 100644
index ec95ad59779..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/Rakefile
+++ /dev/null
@@ -1,270 +0,0 @@
-# -*- coding: utf-8; mode: ruby -*-
-#
-# Copyright (C) 2011-2014 Kouhei Sutou <kou@clear-code.com>
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License version 2.1 as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-require 'pathname'
-
-base_dir = Pathname.new(__FILE__).dirname
-
-groonga_win32_x86_p = ENV["ARCHITECTURE"] == "x86"
-groonga_version = ENV["VERSION"]
-groonga_source = Pathname.new(ENV["SOURCE"]).expand_path
-debug_build_p = ENV["DEBUG_BUILD"] == "yes"
-debug_flags = ["CFLAGS=-ggdb3 -O0", "CXXFLAGS=-ggdb3 -O0"]
-
-if groonga_win32_x86_p
- dist_dir = Pathname.new("dist-x86").expand_path
-else
- dist_dir = Pathname.new("dist-x64").expand_path
-end
-license_dir = dist_dir + "share" + "license"
-binary_dir = base_dir + dist_dir
-
-patches_dir = (base_dir + "patches").expand_path
-mecab_patches = [
- "mecab-0.98-not-use-locale-on-mingw.diff",
- "mecab-0.98-add-missing-dll-export.diff",
-]
-if groonga_win32_x86_p
- host = "i686-w64-mingw32"
-else
- host = "x86_64-w64-mingw32"
- mecab_patches << "mecab-0.98-mingw-w64.diff"
-end
-
-namespace :build do
- download_dir = Pathname.new("tmp/download").expand_path
-
- desc "Build MessagePack and install it into #{dist_dir}."
- task :msgpack do
- tmp_dir = Pathname.new("tmp/msgpack")
- rm_rf(tmp_dir)
- mkdir_p(tmp_dir)
- require 'open-uri'
- msgpack_version = "0.5.9"
- msgpack_base = "msgpack-#{msgpack_version}"
- msgpack_tar_gz = "#{msgpack_base}.tar.gz"
- msgpack_tar_gz_url_base =
- "https://github.com/msgpack/msgpack-c/releases/download"
- msgpack_tar_gz_url =
- "#{msgpack_tar_gz_url_base}/cpp-#{msgpack_version}/#{msgpack_tar_gz}"
- Dir.chdir(tmp_dir) do
- msgpack_tar_gz = download_dir + msgpack_tar_gz
- unless msgpack_tar_gz.exist?
- mkdir_p(download_dir)
- open(msgpack_tar_gz_url) do |downloaded_tar_gz|
- File.open(msgpack_tar_gz, "wb") do |tar_gz|
- tar_gz.print(downloaded_tar_gz.read)
- end
- end
- end
- sh("tar", "xzf", msgpack_tar_gz.to_s) or exit(false)
- end
- Dir.chdir(tmp_dir + msgpack_base) do
- sh("autoreconf", "--install", "--force")
- sh("./configure",
- "--prefix=#{binary_dir}",
- "--host=#{host}") or exit(false)
- sh("env", "GREP_OPTIONS=--text", "nice", "make", "-j8") or exit(false)
- sh("env", "GREP_OPTIONS=--text", "make", "install") or exit(false)
-
- msgpack_license_dir = license_dir + "msgpack"
- mkdir_p(msgpack_license_dir)
- files = ["AUTHORS", "COPYING", "LICENSE"]
- cp(files, msgpack_license_dir)
- end
- end
-
- desc "Build MeCab and install it into #{dist_dir}."
- task :mecab do
- tmp_dir = Pathname.new("tmp/mecab")
- rm_rf(tmp_dir)
- mkdir_p(tmp_dir)
- require 'open-uri'
- mecab_version = "0.98"
- mecab_base = "mecab-#{mecab_version}"
- mecab_tar_gz = "#{mecab_base}.tar.gz"
- mecab_tar_gz_url = "http://mecab.googlecode.com/files/#{mecab_tar_gz}"
- Dir.chdir(tmp_dir) do
- mecab_tar_gz = download_dir + mecab_tar_gz
- unless mecab_tar_gz.exist?
- mkdir_p(download_dir)
- open(mecab_tar_gz_url) do |downloaded_tar_gz|
- File.open(mecab_tar_gz, "wb") do |tar_gz|
- tar_gz.print(downloaded_tar_gz.read)
- end
- end
- end
- sh("tar", "xzf", mecab_tar_gz.to_s) or exit(false)
- end
- Dir.chdir(tmp_dir + mecab_base) do
- mecab_patches.each do |patch|
- sh("patch -p1 < #{patches_dir + patch}")
- end
- sh("autoreconf", "--install", "--force")
- sh("./configure",
- "--prefix=#{binary_dir}",
- "--host=#{host}") or exit(false)
- sh("env", "GREP_OPTIONS=--text", "nice", "make", "-j8") or exit(false)
- sh("env", "GREP_OPTIONS=--text", "make", "install") or exit(false)
-
- mecab_rc_path = binary_dir + "etc" + "mecabrc"
- win32_mecab_rc_path = binary_dir + "bin" + "mecabrc"
- mv(mecab_rc_path, win32_mecab_rc_path)
-
- mecab_license_dir = license_dir + "mecab"
- mkdir_p(mecab_license_dir)
- files = ["AUTHORS", "BSD", "COPYING", "GPL", "LGPL"]
- cp(files, mecab_license_dir)
- end
- end
-
- desc "Build MeCab dictionary and install it into #{dist_dir}."
- task :mecab_dict do
- tmp_dir = Pathname.new("tmp/mecab_dict")
- rm_rf(tmp_dir)
- mkdir_p(tmp_dir)
- require 'open-uri'
- naist_jdic_base = "mecab-naist-jdic-0.6.3-20100801"
- naist_jdic_tar_gz = "#{naist_jdic_base}.tar.gz"
- naist_jdic_tar_gz_url = "http://osdn.dl.sourceforge.jp/naist-jdic/48487/#{naist_jdic_tar_gz}"
- Dir.chdir(tmp_dir) do
- naist_jdic_tar_gz = download_dir + naist_jdic_tar_gz
- unless naist_jdic_tar_gz.exist?
- mkdir_p(download_dir)
- open(naist_jdic_tar_gz_url) do |downloaded_tar_gz|
- File.open(naist_jdic_tar_gz, "wb") do |tar_gz|
- tar_gz.print(downloaded_tar_gz.read)
- end
- end
- end
- sh("tar", "xzf", naist_jdic_tar_gz.to_s) or exit(false)
- end
- Dir.chdir(tmp_dir + naist_jdic_base) do
- sh("./configure",
- "--with-dicdir=#{binary_dir}/share/mecab/dic/naist-jdic",
- "--with-charset=utf-8") or exit(false)
- sh("make", "-j8") or exit(false)
- sh("make", "install-data") or exit(false)
-
- naist_jdic_license_dir = license_dir + "naist-jdic"
- mkdir_p(naist_jdic_license_dir)
- files = ["AUTHORS", "COPYING"]
- cp(files, naist_jdic_license_dir)
- end
- dictionary_dir = '$(rcpath)\..\share\mecab\dic\naist-jdic'
- mecab_rc_path = binary_dir + "bin" + "mecabrc"
- mecab_rc_content = mecab_rc_path.read
- File.open(mecab_rc_path, "w") do |mecab_rc|
- mecab_rc.print(mecab_rc_content.gsub(/^dicdir\s*=.+$/,
- "dicdir = #{dictionary_dir}"))
- end
- end
-
- desc "Build groonga and install it into #{dist_dir}/."
- task :groonga do
- tmp_dir = Pathname.new("tmp/groonga")
- rm_rf(tmp_dir)
- mkdir_p(tmp_dir)
- Dir.chdir(tmp_dir) do
- sh("tar", "xzf", groonga_source.to_s) or exit(false)
- end
- Dir.chdir(tmp_dir + "groonga-#{groonga_version}") do
- mecab_config = binary_dir + "bin" + "mecab-config"
- options = [
- "--prefix=#{binary_dir}",
- "--host=#{host}",
- "--disable-libedit",
- "--without-kytea",
- "--without-cutter",
- "--disable-benchmark",
- "--disable-groonga-httpd",
- "--with-message-pack=#{binary_dir}",
- "--enable-mruby",
- "--enable-shared-onigmo",
- ]
- if mecab_config.exist?
- options << "--with-mecab-config=#{mecab_config}"
- else
- options << "--without-mecab"
- end
- options.concat(debug_flags) if debug_build_p
- sh("./configure", *options) or exit(false)
- sh("env", "GREP_OPTIONS=--text", "nice", "make", "-j8") or exit(false)
- sh("env", "GREP_OPTIONS=--text", "make", "install") or exit(false)
-
- groonga_license_dir = license_dir + "groonga"
- mkdir_p(groonga_license_dir)
- files = ["README.md", "COPYING"]
- cp(files, groonga_license_dir)
-
- mruby_license_dir = license_dir + "mruby"
- mkdir_p(mruby_license_dir)
- files = [
- "vendor/mruby-source/README.md",
- "vendor/mruby-source/AUTHORS",
- "vendor/mruby-source/LEGAL",
- "vendor/mruby-source/MITL",
- ]
- cp(files, mruby_license_dir)
-
- onigmo_license_dir = license_dir + "onigmo"
- mkdir_p(onigmo_license_dir)
- files = [
- "vendor/onigmo-source/README",
- "vendor/onigmo-source/README",
- "vendor/onigmo-source/AUTHORS",
- "vendor/onigmo-source/COPYING",
- ]
- cp(files, onigmo_license_dir)
- end
- end
-
- task :clean do
- rm_rf(dist_dir)
- end
-
- task :pre => :clean
- task :post
-end
-
-namespace :gcc do
- namespace :dll do
- desc "Bundle GCC related DLLs"
- task :bundle do
- dlls = ["libstdc++-6.dll", "libwinpthread-1.dll"]
- if groonga_win32_x86_p
- dlls << "libgcc_s_sjlj-1.dll"
- else
- dlls << "libgcc_s_seh-1.dll"
- end
- dlls.each do |dll|
- full_path = `#{host}-g++ -print-file-name=#{dll}`.strip
- cp(full_path, (binary_dir + "bin").to_s)
- end
- end
- end
-end
-
-task "build:post" => "gcc:dll:bundle"
-
-desc "Build MeCab and groonga and install them into #{dist_dir}/."
-task :build => ["build:pre",
- "build:msgpack",
- "build:mecab",
- "build:mecab_dict",
- "build:groonga",
- "build:post"]
diff --git a/storage/mroonga/vendor/groonga/packages/windows/create-setup.bat b/storage/mroonga/vendor/groonga/packages/windows/create-setup.bat
deleted file mode 100644
index 1496f758411..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/create-setup.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-echo @echo off > %1\setup.bat
-echo set PATH=%1;%%PATH%% >> %1\setup.bat
diff --git a/storage/mroonga/vendor/groonga/packages/windows/language-files/Makefile.am b/storage/mroonga/vendor/groonga/packages/windows/language-files/Makefile.am
deleted file mode 100644
index 34025ea6409..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/language-files/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-EXTRA_DIST = \
- english.nsi \
- japanese.nsi
diff --git a/storage/mroonga/vendor/groonga/packages/windows/language-files/english.nsi b/storage/mroonga/vendor/groonga/packages/windows/language-files/english.nsi
deleted file mode 100644
index 989b1e95d92..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/language-files/english.nsi
+++ /dev/null
@@ -1,2 +0,0 @@
-LangString FinishUninstallSuccessfully ${LANG_ENGLISH} "Uninstall $(^Name) successfully."
-LangString ConfirmUninstall ${LANG_ENGLISH} "Really uninstall $(^Name)?"
diff --git a/storage/mroonga/vendor/groonga/packages/windows/language-files/japanese.nsi b/storage/mroonga/vendor/groonga/packages/windows/language-files/japanese.nsi
deleted file mode 100644
index 25df8102fd6..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/language-files/japanese.nsi
+++ /dev/null
@@ -1,2 +0,0 @@
-LangString FinishUninstallSuccessfully ${LANG_JAPANESE} "$(^Name)‚ðŠ®‘S‚É휂µ‚Ü‚µ‚½B"
-LangString ConfirmUninstall ${LANG_JAPANESE} "–{“–‚É$(^Name)‚ðƒAƒ“ƒCƒ“ƒXƒg[ƒ‹‚µ‚Ä‚¢‚¢‚Å‚·‚©H"
diff --git a/storage/mroonga/vendor/groonga/packages/windows/patches/Makefile.am b/storage/mroonga/vendor/groonga/packages/windows/patches/Makefile.am
deleted file mode 100644
index 1012252c155..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/patches/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-EXTRA_DIST = \
- mecab-0.98-mingw-w64.diff \
- mecab-0.98-not-use-locale-on-mingw.diff
diff --git a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-add-missing-dll-export.diff b/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-add-missing-dll-export.diff
deleted file mode 100644
index e10adb442fb..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-add-missing-dll-export.diff
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -ru mecab-0.98.orig/src/Makefile.am mecab-0.98/src/Makefile.am
---- mecab-0.98.orig/src/Makefile.am 2008-09-14 02:01:17.000000000 +0900
-+++ mecab-0.98/src/Makefile.am 2014-08-28 22:16:44.262074429 +0900
-@@ -3,6 +3,7 @@
- EXTRA_DIST = Makefile.msvc.in make.bat
- pkglibexecdir = ${libexecdir}/mecab
- INCLUDES = -DDIC_VERSION=$(DIC_VERSION) $(MECAB_WITHOUT_SHARE_DIC) $(MECAB_WITHOUT_MUTEX_LOCK) $(MECAB_USE_UTF8_ONLY) -DMECAB_DEFAULT_RC="\"$(MECAB_DEFAULT_RC)\""
-+libmecab_la_CPPFLAGS = -DDLL_EXPORT
- libmecab_la_LDFLAGS = -no-undefined -version-info $(LTVERSION)
- libmecab_la_SOURCES = utils.cpp utils.h eval.cpp iconv_utils.cpp iconv_utils.h \
- dictionary_rewriter.h dictionary_rewriter.cpp dictionary_generator.cpp \
diff --git a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-mingw-w64.diff b/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-mingw-w64.diff
deleted file mode 100644
index 07cc97ed38c..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-mingw-w64.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -ru mecab-0.98.orig/src/string_buffer.h mecab-0.98/src/string_buffer.h
---- mecab-0.98.orig/src/string_buffer.h 2009-04-19 00:03:04.000000000 +0900
-+++ mecab-0.98/src/string_buffer.h 2011-04-24 09:40:23.166985912 +0900
-@@ -45,6 +45,9 @@
- StringBuffer& operator<<(unsigned short int n) { _UITOA(n); }
- StringBuffer& operator<<(unsigned int n) { _UITOA(n); }
- StringBuffer& operator<<(unsigned long int n) { _UITOA(n); }
-+#if SIZEOF_SIZE_T == SIZEOF_LONG_LONG
-+ StringBuffer& operator<<(unsigned long long int n) { _UITOA(n); }
-+#endif
-
- StringBuffer& operator<< (char n) {
- return this->write(n);
diff --git a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-not-use-locale-on-mingw.diff b/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-not-use-locale-on-mingw.diff
deleted file mode 100644
index 386dda95153..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.98-not-use-locale-on-mingw.diff
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru mecab-0.98.orig/src/libmecab.cpp mecab-0.98/src/libmecab.cpp
---- mecab-0.98.orig/src/libmecab.cpp 2009-04-19 00:03:04.000000000 +0900
-+++ mecab-0.98/src/libmecab.cpp 2011-04-29 23:45:03.331006297 +0900
-@@ -57,9 +57,11 @@
- if (!DllInstance) {
- DllInstance = hinst;
- }
-+#if !defined(__GNUC__)
- std::locale loc(std::locale("japanese"),
- "C", std::locale::numeric);
- std::locale::global(loc);
-+#endif
- return TRUE;
- }
- #ifdef __cplusplus
diff --git a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-cflags.diff b/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-cflags.diff
deleted file mode 100644
index 1fe8cd61b85..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-cflags.diff
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ur mecab-0.994.orig/configure.in mecab-0.994/configure.in
---- mecab-0.994.orig/configure.in 2012-04-01 23:21:02.000000000 +0900
-+++ mecab-0.994/configure.in 2012-09-14 15:58:19.759200168 +0900
-@@ -302,6 +302,8 @@
- case "$host_os" in
- mingw* | os2*)
- MECAB_DEFAULT_RC='c:\\\\Program Files\\\\mecab\\\\etc\\\\mecabrc'
-+ CFLAGS="$CFLAGS -municode -DUNICODE -D_UNICODE"
-+ CXXFLAGS="$CXXFLAGS -municode -DUNICODE -D_UNICODE"
- ;;
- *)
- MECAB_DEFAULT_RC="$sysconfdir/mecabrc"
diff --git a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-externc.diff b/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-externc.diff
deleted file mode 100644
index 0e0a4e6b0a5..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-externc.diff
+++ /dev/null
@@ -1,12 +0,0 @@
---- mecab-0.994.orig/src/winmain.h 2011-11-01 23:50:54.000000000 +0900
-+++ mecab-0.994/src/winmain.h 2012-09-19 15:58:36.549360996 +0900
-@@ -59,6 +59,9 @@
-
- int wmain_to_main_wrapper(int argc, char **argv);
-
-+#if defined(__MINGW32__)
-+extern "C"
-+#endif
- int wmain(int argc, wchar_t **argv) {
- CommandLine cmd(argc, argv);
- return wmain_to_main_wrapper(cmd.argc(), cmd.argv());
diff --git a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-ltmain-wmain.diff b/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-ltmain-wmain.diff
deleted file mode 100644
index 9151c7b1695..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-ltmain-wmain.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- mecab-0.994.orig/ltmain.sh 2012-06-04 23:15:21.000000000 +0900
-+++ mecab-0.994/ltmain.sh 2012-09-19 11:42:59.429371976 +0900
-@@ -4348,7 +4348,7 @@
- static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
-
- int
--main (int argc, char *argv[])
-+wmain (int argc, wchar_t *argv[])
- {
- char **newargz;
- int newargc;
diff --git a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-yieldprocessor-macro.diff b/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-yieldprocessor-macro.diff
deleted file mode 100644
index 6058f19bb92..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-0.994-mingw-yieldprocessor-macro.diff
+++ /dev/null
@@ -1,11 +0,0 @@
---- mecab-0.994.orig/src/thread.h 2011-12-05 02:31:09.000000000 +0900
-+++ mecab-0.994/src/thread.h 2012-09-20 12:15:46.695377866 +0900
-@@ -47,7 +47,7 @@
- #undef yield_processor
- #define atomic_add(a, b) ::InterlockedExchangeAdd(a, b)
- #define compare_and_swap(a, b, c) ::InterlockedCompareExchange(a, c, b)
--#define yield_processor() ::YieldProcessor()
-+#define yield_processor() YieldProcessor()
- #define HAVE_ATOMIC_OPS 1
- #endif
-
diff --git a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-mingw-unsigned-long-long-int.diff b/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-mingw-unsigned-long-long-int.diff
deleted file mode 100644
index 9e115e6a6f4..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/patches/mecab-mingw-unsigned-long-long-int.diff
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --exclude .svn -ur mecab.orig/configure.in mecab/configure.in
---- mecab.orig/configure.in 2012-09-20 13:46:17.431392052 +0900
-+++ mecab/configure.in 2012-09-20 15:09:21.695405072 +0900
-@@ -47,6 +47,7 @@
- AC_CHECK_SIZEOF(long long)
- AC_CHECK_SIZEOF(size_t)
- AC_TYPE_SIZE_T
-+AC_TYPE_UNSIGNED_LONG_LONG_INT
-
- AC_FUNC_MMAP
- AC_CHECK_LIB(stdc++, main, MECAB_LIBS="-lstdc++")
-diff --exclude .svn -ur mecab.orig/src/string_buffer.h mecab/src/string_buffer.h
---- mecab.orig/src/string_buffer.h 2012-09-20 13:46:15.875392048 +0900
-+++ mecab/src/string_buffer.h 2012-09-20 15:09:46.783405140 +0900
-@@ -44,6 +44,9 @@
- StringBuffer& operator<<(unsigned short int n) { _UITOA(n); }
- StringBuffer& operator<<(unsigned int n) { _UITOA(n); }
- StringBuffer& operator<<(unsigned long int n) { _UITOA(n); }
-+#ifdef HAVE_UNSIGNED_LONG_LONG_INT
-+ StringBuffer& operator<<(unsigned long long int n) { _UITOA(n); }
-+#endif
-
- StringBuffer& operator<< (char n) {
- return this->write(n);
diff --git a/storage/mroonga/vendor/groonga/packages/windows/setup-x64.nsi.in b/storage/mroonga/vendor/groonga/packages/windows/setup-x64.nsi.in
deleted file mode 100644
index 67270f17fc7..00000000000
--- a/storage/mroonga/vendor/groonga/packages/windows/setup-x64.nsi.in
+++ /dev/null
@@ -1,112 +0,0 @@
-; Copyright (c) 2010-2011 Kouhei Sutou <kou@clear-code.com>
-
-!define PRODUCT_NAME "@PACKAGE@"
-!define PRODUCT_VERSION "@VERSION@"
-!define PRODUCT_PUBLISHER "Brazil"
-!define PRODUCT_WEB_SITE "http://groonga.org/"
-!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
-!define PRODUCT_UNINST_ROOT_KEY "HKLM"
-!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
-
-SetCompress force
-SetCompressor lzma
-
-!include "MUI2.nsh"
-!include "LogicLib.nsh"
-
-; MUI Settings
-!define MUI_ABORTWARNING
-!define MUI_LANGDLL_ALLLANGUAGES
-!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
-!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
-
-!insertmacro MUI_PAGE_WELCOME
-!define MUI_LICENSEPAGE_CHECKBOX
-!insertmacro MUI_PAGE_LICENSE "LICENSE"
-!insertmacro MUI_PAGE_COMPONENTS
-!insertmacro MUI_PAGE_DIRECTORY
-Var START_MENU_FOLDER
-!define MUI_STARTMENUPAGE_NODISABLE
-!define MUI_STARTMENUPAGE_DEFAULTFOLDER "${PRODUCT_NAME}"
-!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
-!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
-!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
-!insertmacro MUI_PAGE_STARTMENU Application $START_MENU_FOLDER
-!insertmacro MUI_PAGE_INSTFILES
-; !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\README.txt"
-!insertmacro MUI_PAGE_FINISH
-
-!insertmacro MUI_UNPAGE_WELCOME
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-!insertmacro MUI_UNPAGE_FINISH
-
-!insertmacro MUI_LANGUAGE "English"
-!insertmacro MUI_LANGUAGE "Japanese"
-!insertmacro MUI_RESERVEFILE_LANGDLL
-
-!include "language-files\english.nsi"
-!include "language-files\japanese.nsi"
-
-Function .onInit
- !insertmacro MUI_LANGDLL_DISPLAY
-FunctionEnd
-
-
-Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
-OutFile "files\${PRODUCT_NAME}-${PRODUCT_VERSION}-x64.exe"
-InstallDir "$PROGRAMFILES64\${PRODUCT_NAME}"
-ShowInstDetails show
-ShowUnInstDetails show
-
-
-# Installer
-
-Section "groonga"
- SectionIn 1 RO
- SetOverwrite ifdiff
-
- SetOutPath $INSTDIR
- File /r dist-x64\*
- File /oname=bin\create-setup.bat create-setup.bat
-
- ExecWait '"$INSTDIR\bin\create-setup.bat" "$INSTDIR\bin"'
-
- !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
- SetShellVarContext all
- CreateDirectory "$SMPROGRAMS\$START_MENU_FOLDER"
- CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\Uninstall.lnk" $INSTDIR\uninstall.exe
- CreateShortCut "$SMPROGRAMS\$START_MENU_FOLDER\groonga command prompt.lnk" "$SYSDIR\cmd.exe" '/E:ON /K ""$INSTDIR\bin\setup.bat""'
- !insertmacro MUI_STARTMENU_WRITE_END
-SectionEnd
-
-Section -Post
- WriteUninstaller $INSTDIR\uninstall.exe
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" $INSTDIR\uninstall.exe
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
- WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenuFolder" "$START_MENU_FOLDER"
-SectionEnd
-
-# Uninstaller
-
-Function un.onUninstSuccess
- HideWindow
- MessageBox MB_ICONINFORMATION|MB_OK $(FinishUninstallSuccessfully)
-FunctionEnd
-
-Function un.onInit
- !insertmacro MUI_UNGETLANGUAGE
-FunctionEnd
-
-Section "Uninstall"
- ReadRegStr $START_MENU_FOLDER ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenuFolder"
- DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
-
- RMDir /r $INSTDIR
-
- SetShellVarContext all
- RMDir /r "$SMPROGRAMS\$START_MENU_FOLDER"
-SectionEnd
diff --git a/storage/mroonga/vendor/groonga/packages/yum/Makefile.am b/storage/mroonga/vendor/groonga/packages/yum/Makefile.am
deleted file mode 100644
index 93cf4b8f5b6..00000000000
--- a/storage/mroonga/vendor/groonga/packages/yum/Makefile.am
+++ /dev/null
@@ -1,82 +0,0 @@
-REPOSITORIES_PATH = repositories
-DISTRIBUTIONS = centos
-ARCHITECTURES = i386 x86_64
-BASE_URL_PREFIX = http://packages.groonga.org
-HAVE_DEVELOPMENT_BRANCH = no
-
-release: download build sign-packages update-repository upload
-
-ensure-rsync-path:
- @if test -z "$(RSYNC_PATH)"; then \
- echo "--with-rsync-path configure option must be specified."; \
- false; \
- fi
-
-sign-packages:
- ./sign-rpm.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' \
- '$(DISTRIBUTIONS)'
-
-update-repository:
- ./update-repository.sh '$(PACKAGE)' '$(REPOSITORIES_PATH)/' \
- '$(DISTRIBUTIONS)'
-
-upload: ensure-rsync-path
- for distribution in $(DISTRIBUTIONS); do \
- rsync -avz --progress --delete --exclude .gitignore \
- $(REPOSITORIES_PATH)/$${distribution}/ \
- $(RSYNC_PATH)/$${distribution}; \
- done
-
-download: ensure-rsync-path
- mkdir -p $(REPOSITORIES_PATH)
- for distribution in $(DISTRIBUTIONS); do \
- rsync -avz --progress --delete \
- $(RSYNC_PATH)/$${distribution}/ \
- $(REPOSITORIES_PATH)/$${distribution}; \
- done
-
-build: build-in-vm build-release-rpm
-
-build-in-vm: source specs env.sh
- vagrant destroy --force
- for architecture in $(ARCHITECTURES); do \
- for version in 5 6 7; do \
- if [ $$version = 7 -a $$architecture = i386 ]; then \
- continue; \
- fi; \
- id=centos-$$version-$$architecture; \
- vagrant up $$id; \
- vagrant destroy --force $$id; \
- done; \
- done
-
-build-release-rpm: RPM-GPG-KEY-$(PACKAGE)
- ./build-release-rpm.sh \
- $(PACKAGE) \
- '$(PACKAGE_TITLE)' \
- $(BASE_URL_PREFIX) \
- $(REPOSITORIES_PATH)/ \
- '$(DISTRIBUTIONS)' \
- $(HAVE_DEVELOPMENT_BRANCH)
-
-ensure-public-key:
- gpg --list-keys '$(GPG_UID)' > /dev/null || \
- gpg --keyserver keyserver.ubuntu.com --recv-key '$(GPG_UID)'
-
-RPM-GPG-KEY-$(PACKAGE): ensure-public-key
- gpg --armor --export '$(GPG_UID)' > $@
-
-source: tmp/$(PACKAGE)-$(VERSION).tar.gz
-
-tmp/$(PACKAGE)-$(VERSION).tar.gz: $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
- mkdir -p tmp/
- cp $(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz tmp/
-
-$(abs_top_builddir)/$(PACKAGE)-$(VERSION).tar.gz:
- cd $(abs_top_builddir) && $(MAKE) dist
-
-specs: tmp/centos/$(PACKAGE).spec
-
-tmp/centos/$(PACKAGE).spec: $(builddir)/../rpm/centos/$(PACKAGE).spec
- mkdir -p tmp/centos
- cp $(builddir)/../rpm/centos/$(PACKAGE).spec tmp/centos/
diff --git a/storage/mroonga/vendor/groonga/packages/yum/Vagrantfile b/storage/mroonga/vendor/groonga/packages/yum/Vagrantfile
deleted file mode 100644
index 97c2176dac0..00000000000
--- a/storage/mroonga/vendor/groonga/packages/yum/Vagrantfile
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
-VAGRANTFILE_API_VERSION = "2"
-
-Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
- vms = [
- {
- :id => "centos-5-i386",
- :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10-i386_chef-provisionerless.box",
- },
- {
- :id => "centos-5-x86_64",
- :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-5.10_chef-provisionerless.box",
- },
- {
- :id => "centos-6-i386",
- :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5-i386_chef-provisionerless.box",
- },
- {
- :id => "centos-6-x86_64",
- :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box",
- },
- {
- :id => "centos-7-x86_64",
- :box_url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box",
- },
- ]
-
- vms.each do |vm|
- config.vm.define(vm[:id]) do |node|
- node.vm.box = vm[:id]
- node.vm.box_url = vm[:box_url]
- hour_in_seconds = 60 * 60
- node.vm.boot_timeout = 1 * hour_in_seconds
- node.vm.provision(:shell, :privileged => false, :path => "build-rpm.sh")
- node.vm.provider("virtualbox") do |virtual_box|
- virtual_box.memory = 512
- virtual_box.customize ["modifyvm", :id, "--hwvirtex", "off"]
- end
- end
- end
-end
diff --git a/storage/mroonga/vendor/groonga/packages/yum/build-release-rpm.sh b/storage/mroonga/vendor/groonga/packages/yum/build-release-rpm.sh
deleted file mode 100755
index f606c5d9c26..00000000000
--- a/storage/mroonga/vendor/groonga/packages/yum/build-release-rpm.sh
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/sh
-
-script_base_dir=`dirname $0`
-
-if [ $# != 6 ]; then
- echo "Usage: $0 PACKAGE PACKAGE_TITLE BASE_URL_PREFIX DESTINATION DISTRIBUTIONS HAVE_DEVELOPMENT_BRANCH"
- echo " e.g.: $0 milter-manager 'milter manager' http://downloads.sourceforge.net/milter-manager' repositories/ 'fedora centos' yes"
- exit 1
-fi
-
-PACKAGE=$1
-PACKAGE_TITLE=$2
-BASE_URL_PREFIX=$3
-DESTINATION=$4
-DISTRIBUTIONS=$5
-HAVE_DEVELOPMENT_BRANCH=$6
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-rpm_base_dir=$HOME/rpm
-
-if [ ! -f ~/.rpmmacros ]; then
- run cat <<EOM > ~/.rpmmacros
-%_topdir $rpm_base_dir
-EOM
-fi
-
-run mkdir -p $rpm_base_dir/SOURCES
-run mkdir -p $rpm_base_dir/SPECS
-run mkdir -p $rpm_base_dir/BUILD
-run mkdir -p $rpm_base_dir/RPMS
-run mkdir -p $rpm_base_dir/SRPMS
-
-for distribution in ${DISTRIBUTIONS}; do
- case $distribution in
- fedora)
- distribution_label=Fedora
- distribution_versions="20"
- ;;
- centos)
- distribution_label=CentOS
- distribution_versions="5 6"
- ;;
- esac
- repo=${PACKAGE}.repo
- if test "$HAVE_DEVELOPMENT_BRANCH" = "yes"; then
- run cat <<EOR > $repo
-[$PACKAGE]
-name=$PACKAGE_TITLE for $distribution_label \$releasever - \$basearch
-baseurl=$BASE_URL_PREFIX/$distribution/\$releasever/stable/\$basearch/
-gpgcheck=1
-enabled=1
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-$PACKAGE
-
-[$PACKAGE-development]
-name=$PACKAGE_TITLE for $distribution_label \$releasever - development - \$basearch
-baseurl=$BASE_URL_PREFIX/$distribution/\$releasever/development/\$basearch/
-gpgcheck=1
-enabled=0
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-$PACKAGE
-EOR
- else
- run cat <<EOR > $repo
-[$PACKAGE]
-name=$PACKAGE_TITLE for $distribution_label \$releasever - \$basearch
-baseurl=$BASE_URL_PREFIX/$distribution/\$releasever/\$basearch/
-gpgcheck=1
-enabled=1
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-$PACKAGE
-EOR
- fi
- run tar cfz $rpm_base_dir/SOURCES/${PACKAGE}-release.tar.gz \
- -C ${script_base_dir} ${repo} RPM-GPG-KEY-${PACKAGE}
- run cp ${script_base_dir}/${PACKAGE}-release.spec $rpm_base_dir/SPECS/
-
- run rpmbuild -ba $rpm_base_dir/SPECS/${PACKAGE}-release.spec
-
- top_dir=${DESTINATION}${distribution}
-
- run mkdir -p $top_dir
- run cp -p \
- $rpm_base_dir/RPMS/noarch/${PACKAGE}-release-* \
- $rpm_base_dir/SRPMS/${PACKAGE}-release-* \
- ${script_base_dir}/RPM-GPG-KEY-${PACKAGE} \
- $top_dir
-
- for distribution_version in $distribution_versions; do
- cp $top_dir/*.src.rpm $top_dir/$distribution_version/source/SRPMS/
- cp $top_dir/*.noarch.rpm $top_dir/$distribution_version/i386/Packages/
- cp $top_dir/*.noarch.rpm $top_dir/$distribution_version/x86_64/Packages/
- done
-done
diff --git a/storage/mroonga/vendor/groonga/packages/yum/build-rpm.sh b/storage/mroonga/vendor/groonga/packages/yum/build-rpm.sh
deleted file mode 100755
index 30b0135aa9b..00000000000
--- a/storage/mroonga/vendor/groonga/packages/yum/build-rpm.sh
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/sh
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-rpmbuild_options=
-
-. /vagrant/env.sh
-
-swap_file=/tmp/swap
-run sudo dd if=/dev/zero of="$swap_file" bs=1024 count=4096K
-run sudo /sbin/mkswap "$swap_file"
-run sudo /sbin/swapon "$swap_file"
-
-distribution=$(cut -d " " -f 1 /etc/redhat-release | tr "A-Z" "a-z")
-if grep -q Linux /etc/redhat-release; then
- distribution_version=$(cut -d " " -f 4 /etc/redhat-release)
-else
- distribution_version=$(cut -d " " -f 3 /etc/redhat-release)
-fi
-distribution_version=$(echo ${distribution_version} | sed -e 's/\..*$//g')
-
-architecture="$(arch)"
-case "${architecture}" in
- i*86)
- architecture=i386
- ;;
-esac
-
-run sudo yum groupinstall -y "Development Tools"
-run sudo yum install -y rpm-build rpmdevtools tar ${DEPENDED_PACKAGES}
-
-if [ -x /usr/bin/rpmdev-setuptree ]; then
- rm -rf .rpmmacros
- run rpmdev-setuptree
-else
- run cat <<EOM > ~/.rpmmacros
-%_topdir ${HOME}/rpmbuild
-EOM
- run mkdir -p ~/rpmbuild/SOURCES
- run mkdir -p ~/rpmbuild/SPECS
- run mkdir -p ~/rpmbuild/BUILD
- run mkdir -p ~/rpmbuild/RPMS
- run mkdir -p ~/rpmbuild/SRPMS
-fi
-
-repository="/vagrant/repositories/${distribution}/${distribution_version}"
-rpm_dir="${repository}/${architecture}/Packages"
-srpm_dir="${repository}/source/SRPMS"
-run mkdir -p "${rpm_dir}" "${srpm_dir}"
-
-build_fedora_srpm()
-{
- base=http://download.fedoraproject.org/pub/fedora/linux/releases/20/Everything/source/SRPMS/m
- update=http://download.fedoraproject.org/pub/fedora/linux/updates/20/SRPMS
- srpm="$1"
- srpm_base="$2"
-
- run cd
-
- run mkdir -p tmp
- run cd tmp
- wget "${update}/${srpm}"
- if [ $? -ne 0 ]; then
- run wget "${base}/${srpm}"
- fi
- run rpm2cpio "${srpm}" | run cpio -id
- run rm "${srpm}"
-
- case "${srpm}" in
- mecab-ipadic*)
- patch -p0 < /vagrant/patches/mecab-ipadic-provides-mecab-dic.diff
- ;;
- mecab-jumandic-*)
- patch -p0 < /vagrant/patches/mecab-jumandic-provides-mecab-dic.diff
- ;;
- esac
- run rm -rf ~/rpmbuild/SPECS/
- run mkdir -p ~/rpmbuild/SPECS/
- run mv *.spec ~/rpmbuild/SPECS/
- run mv * ~/rpmbuild/SOURCES/
- run cd -
- rn rm -rf tmp
-
- mecab_build_options="--buildroot ${HOME}/rpmbuild/BUILDROOT/${srpm_base}"
- case "${architecture}" in
- i*86)
- run rpmbuild -ba rpmbuild/SPECS/*.spec ${mecab_build_options} \
- --define "optflags -O2 -g -march=i586"
- ;;
- *)
- run rpmbuild -ba rpmbuild/SPECS/*.spec ${mecab_build_options}
- ;;
- esac
-
- run sudo rpm -Uvh rpmbuild/RPMS/*/*.rpm
- run mv rpmbuild/RPMS/*/*.rpm "${rpm_dir}/"
- run mv rpmbuild/SRPMS/*.rpm "${srpm_dir}/"
-}
-
-if ! rpm -q mecab-devel > /dev/null; then
- run sudo yum install -y wget
-
- for rpm in mecab-0.996-1.fc20.src.rpm \
- mecab-ipadic-2.7.0.20070801-8.fc20.1.src.rpm \
- mecab-jumandic-5.1.20070304-9.fc20.src.rpm; do
- srpm_base=`echo $rpm | sed -e 's/\.fc20.*//g'`
- run build_fedora_srpm "${rpm}" "${srpm_base}"
- done
-fi
-
-# for debug
-# rpmbuild_options="$rpmbuild_options --define 'optflags -O0 -g3'"
-
-cd
-
-run cp /vagrant/tmp/${PACKAGE}-${VERSION}.* rpmbuild/SOURCES/
-run cp /vagrant/tmp/${distribution}/${PACKAGE}.spec rpmbuild/SPECS/
-
-run rpmbuild -ba ${rpmbuild_options} rpmbuild/SPECS/${PACKAGE}.spec
-
-run mv rpmbuild/RPMS/*/* "${rpm_dir}/"
-run mv rpmbuild/SRPMS/* "${srpm_dir}/"
diff --git a/storage/mroonga/vendor/groonga/packages/yum/env.sh.in b/storage/mroonga/vendor/groonga/packages/yum/env.sh.in
deleted file mode 100644
index 3dbe0fd76a5..00000000000
--- a/storage/mroonga/vendor/groonga/packages/yum/env.sh.in
+++ /dev/null
@@ -1,19 +0,0 @@
-PACKAGE=@PACKAGE@
-VERSION=@VERSION@
-DEPENDED_PACKAGES="
-intltool
-gcc-c++
-make
-mecab
-mecab-devel
-zeromq3-devel
-libevent-devel
-python2-devel
-php-devel
-zlib-devel
-lzo-devel
-libedit-devel
-ruby
-tar
-pcre-devel
-"
diff --git a/storage/mroonga/vendor/groonga/packages/yum/patches/mecab-ipadic-provides-mecab-dic.diff b/storage/mroonga/vendor/groonga/packages/yum/patches/mecab-ipadic-provides-mecab-dic.diff
deleted file mode 100644
index 79df8114bbc..00000000000
--- a/storage/mroonga/vendor/groonga/packages/yum/patches/mecab-ipadic-provides-mecab-dic.diff
+++ /dev/null
@@ -1,10 +0,0 @@
---- mecab-ipadic.spec.orig 2013-01-15 21:57:41.969580098 -0500
-+++ mecab-ipadic.spec 2013-01-15 21:58:32.629580230 -0500
-@@ -27,6 +27,7 @@
-
- BuildRequires: mecab-devel >= %{mecabver}
- Requires: mecab >= %{mecabver}
-+Provides: mecab-dic
-
- %description
- MeCab IPA is a dictionary for MeCab using CRF estimation
diff --git a/storage/mroonga/vendor/groonga/packages/yum/patches/mecab-jumandic-provides-mecab-dic.diff b/storage/mroonga/vendor/groonga/packages/yum/patches/mecab-jumandic-provides-mecab-dic.diff
deleted file mode 100644
index edfb899e6f2..00000000000
--- a/storage/mroonga/vendor/groonga/packages/yum/patches/mecab-jumandic-provides-mecab-dic.diff
+++ /dev/null
@@ -1,10 +0,0 @@
---- mecab-jumandic.spec.orig 2013-01-15 21:57:48.337580114 -0500
-+++ mecab-jumandic.spec 2013-01-15 21:58:47.513580269 -0500
-@@ -20,6 +20,7 @@
-
- BuildRequires: mecab-devel
- Requires: mecab
-+Provides: mecab-dic
-
- %description
- MeCab JUMAN is a dictionary for MeCab using CRF estimation
diff --git a/storage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh b/storage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh
deleted file mode 100755
index b3a45afe7f5..00000000000
--- a/storage/mroonga/vendor/groonga/packages/yum/sign-rpm.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-script_base_dir=`dirname $0`
-
-if [ $# != 3 ]; then
- echo "Usage: $0 GPG_UID DESTINATION DISTRIBUTIONS"
- echo " e.g.: $0 'F10399C0' repositories/ 'fedora centos'"
- exit 1
-fi
-
-GPG_UID=$1
-DESTINATION=$2
-DISTRIBUTIONS=$3
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-unsigned_rpms()
-{
- while read rpm; do
- rpm --checksig "$rpm" | grep -v 'gpg OK' | cut -d":" -f1
- done
-}
-
-if ! gpg --list-keys "${GPG_UID}" > /dev/null 2>&1; then
- run gpg --keyserver keyserver.ubuntu.com --recv-key "${GPG_UID}"
-fi
-run mkdir -p tmp
-run gpg --armor --export "${GPG_UID}" > tmp/sign-key
-run rpm --import tmp/sign-key
-run rm -rf tmp/sign-key
-
-rpms=""
-for distribution in ${DISTRIBUTIONS}; do
- rpms="${rpms} $(find ${DESTINATION}${distribution} -name '*.rpm' | unsigned_rpms)"
-done
-
-echo "NOTE: YOU JUST ENTER! YOU DON'T NEED TO INPUT PASSWORD!"
-echo " IT'S JUST FOR rpm COMMAND RESTRICTION!"
-run echo $rpms | xargs rpm \
- -D "_gpg_name ${GPG_UID}" \
- -D "_gpg_digest_algo sha1" \
- -D "__gpg /usr/bin/gpg2" \
- -D "__gpg_check_password_cmd /bin/true true" \
- -D "__gpg_sign_cmd %{__gpg} gpg --batch --no-verbose --no-armor %{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} --no-secmem-warning -u \"%{_gpg_name}\" -sbo %{__signature_filename} %{__plaintext_filename}" \
- --resign
diff --git a/storage/mroonga/vendor/groonga/packages/yum/update-repository.sh b/storage/mroonga/vendor/groonga/packages/yum/update-repository.sh
deleted file mode 100755
index 04058598dce..00000000000
--- a/storage/mroonga/vendor/groonga/packages/yum/update-repository.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/sh
-
-script_base_dir=`dirname $0`
-
-if [ $# != 3 ]; then
- echo "Usage: $0 GPG_KEY_NAME DESTINATION DISTRIBUTIONS"
- echo " e.g.: $0 mitler-manager repositories/ 'fedora centos'"
- exit 1
-fi
-
-GPG_KEY_NAME=$1
-DESTINATION=$2
-DISTRIBUTIONS=$3
-
-run()
-{
- "$@"
- if test $? -ne 0; then
- echo "Failed $@"
- exit 1
- fi
-}
-
-for distribution in ${DISTRIBUTIONS}; do
- for dir in ${DESTINATION}${distribution}/*/*; do
- # "--checksum sha" is for CentOS 5. If we drop CentOS 5 support,
- # we can remove the option.
- test -d $dir && run createrepo --checksum sha $dir
- done;
-
- run cp $script_base_dir/RPM-GPG-KEY-${GPG_KEY_NAME} \
- ${DESTINATION}${distribution}/RPM-GPG-KEY-${GPG_KEY_NAME};
-done
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES
deleted file mode 100644
index ddfb80014d9..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES
+++ /dev/null
@@ -1,6822 +0,0 @@
-
-Changes with nginx 1.7.6 30 Sep 2014
-
- *) Change: the deprecated "limit_zone" directive is not supported
- anymore.
-
- *) Feature: the "limit_conn_zone" and "limit_req_zone" directives now
- can be used with combinations of multiple variables.
-
- *) Bugfix: request body might be transmitted incorrectly when retrying a
- FastCGI request to the next upstream server.
-
- *) Bugfix: in logging to syslog.
-
-
-Changes with nginx 1.7.5 16 Sep 2014
-
- *) Security: it was possible to reuse SSL sessions in unrelated contexts
- if a shared SSL session cache or the same TLS session ticket key was
- used for multiple "server" blocks (CVE-2014-3616).
- Thanks to Antoine Delignat-Lavaud.
-
- *) Change: now the "stub_status" directive does not require a parameter.
-
- *) Feature: the "always" parameter of the "add_header" directive.
-
- *) Feature: the "proxy_next_upstream_tries",
- "proxy_next_upstream_timeout", "fastcgi_next_upstream_tries",
- "fastcgi_next_upstream_timeout", "memcached_next_upstream_tries",
- "memcached_next_upstream_timeout", "scgi_next_upstream_tries",
- "scgi_next_upstream_timeout", "uwsgi_next_upstream_tries", and
- "uwsgi_next_upstream_timeout" directives.
-
- *) Bugfix: in the "if" parameter of the "access_log" directive.
-
- *) Bugfix: in the ngx_http_perl_module.
- Thanks to Piotr Sikora.
-
- *) Bugfix: the "listen" directive of the mail proxy module did not allow
- to specify more than two parameters.
-
- *) Bugfix: the "sub_filter" directive did not work with a string to
- replace consisting of a single character.
-
- *) Bugfix: requests might hang if resolver was used and a timeout
- occurred during a DNS request.
-
- *) Bugfix: in the ngx_http_spdy_module when using with AIO.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "set" directive was used to change the "$http_...", "$sent_http_...",
- or "$upstream_http_..." variables.
-
- *) Bugfix: in memory allocation error handling.
- Thanks to Markus Linnala and Feng Gu.
-
-
-Changes with nginx 1.7.4 05 Aug 2014
-
- *) Security: pipelined commands were not discarded after STARTTLS
- command in SMTP proxy (CVE-2014-3556); the bug had appeared in 1.5.6.
- Thanks to Chris Boulton.
-
- *) Change: URI escaping now uses uppercase hexadecimal digits.
- Thanks to Piotr Sikora.
-
- *) Feature: now nginx can be build with BoringSSL and LibreSSL.
- Thanks to Piotr Sikora.
-
- *) Bugfix: requests might hang if resolver was used and a DNS server
- returned a malformed response; the bug had appeared in 1.5.8.
-
- *) Bugfix: in the ngx_http_spdy_module.
- Thanks to Piotr Sikora.
-
- *) Bugfix: the $uri variable might contain garbage when returning errors
- with code 400.
- Thanks to Sergey Bobrov.
-
- *) Bugfix: in error handling in the "proxy_store" directive and the
- ngx_http_dav_module.
- Thanks to Feng Gu.
-
- *) Bugfix: a segmentation fault might occur if logging of errors to
- syslog was used; the bug had appeared in 1.7.1.
-
- *) Bugfix: the $geoip_latitude, $geoip_longitude, $geoip_dma_code, and
- $geoip_area_code variables might not work.
- Thanks to Yichun Zhang.
-
- *) Bugfix: in memory allocation error handling.
- Thanks to Tatsuhiko Kubo and Piotr Sikora.
-
-
-Changes with nginx 1.7.3 08 Jul 2014
-
- *) Feature: weak entity tags are now preserved on response
- modifications, and strong ones are changed to weak.
-
- *) Feature: cache revalidation now uses If-None-Match header if
- possible.
-
- *) Feature: the "ssl_password_file" directive.
-
- *) Bugfix: the If-None-Match request header line was ignored if there
- was no Last-Modified header in a response returned from cache.
-
- *) Bugfix: "peer closed connection in SSL handshake" messages were
- logged at "info" level instead of "error" while connecting to
- backends.
-
- *) Bugfix: in the ngx_http_dav_module module in nginx/Windows.
-
- *) Bugfix: SPDY connections might be closed prematurely if caching was
- used.
-
-
-Changes with nginx 1.7.2 17 Jun 2014
-
- *) Feature: the "hash" directive inside the "upstream" block.
-
- *) Feature: defragmentation of free shared memory blocks.
- Thanks to Wandenberg Peixoto and Yichun Zhang.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- default value of the "access_log" directive was used; the bug had
- appeared in 1.7.0.
- Thanks to Piotr Sikora.
-
- *) Bugfix: trailing slash was mistakenly removed from the last parameter
- of the "try_files" directive.
-
- *) Bugfix: nginx could not be built on OS X in some cases.
-
- *) Bugfix: in the ngx_http_spdy_module.
-
-
-Changes with nginx 1.7.1 27 May 2014
-
- *) Feature: the "$upstream_cookie_..." variables.
-
- *) Feature: the $ssl_client_fingerprint variable.
-
- *) Feature: the "error_log" and "access_log" directives now support
- logging to syslog.
-
- *) Feature: the mail proxy now logs client port on connect.
-
- *) Bugfix: memory leak if the "ssl_stapling" directive was used.
- Thanks to Filipe da Silva.
-
- *) Bugfix: the "alias" directive used inside a location given by a
- regular expression worked incorrectly if the "if" or "limit_except"
- directives were used.
-
- *) Bugfix: the "charset" directive did not set a charset to encoded
- backend responses.
-
- *) Bugfix: a "proxy_pass" directive without URI part might use original
- request after the $args variable was set.
- Thanks to Yichun Zhang.
-
- *) Bugfix: in the "none" parameter in the "smtp_auth" directive; the bug
- had appeared in 1.5.6.
- Thanks to Svyatoslav Nikolsky.
-
- *) Bugfix: if sub_filter and SSI were used together, then responses
- might be transferred incorrectly.
-
- *) Bugfix: nginx could not be built with the --with-file-aio option on
- Linux/aarch64.
-
-
-Changes with nginx 1.7.0 24 Apr 2014
-
- *) Feature: backend SSL certificate verification.
-
- *) Feature: support for SNI while working with SSL backends.
-
- *) Feature: the $ssl_server_name variable.
-
- *) Feature: the "if" parameter of the "access_log" directive.
-
-
-Changes with nginx 1.5.13 08 Apr 2014
-
- *) Change: improved hash table handling; the default values of the
- "variables_hash_max_size" and "types_hash_bucket_size" were changed
- to 1024 and 64 respectively.
-
- *) Feature: the ngx_http_mp4_module now supports the "end" argument.
-
- *) Feature: byte ranges support in the ngx_http_mp4_module and while
- saving responses to cache.
-
- *) Bugfix: alerts "ngx_slab_alloc() failed: no memory" no longer logged
- when using shared memory in the "ssl_session_cache" directive and in
- the ngx_http_limit_req_module.
-
- *) Bugfix: the "underscores_in_headers" directive did not allow
- underscore as a first character of a header.
- Thanks to Piotr Sikora.
-
- *) Bugfix: cache manager might hog CPU on exit in nginx/Windows.
-
- *) Bugfix: nginx/Windows terminated abnormally if the
- "ssl_session_cache" directive was used with the "shared" parameter.
-
- *) Bugfix: in the ngx_http_spdy_module.
-
-
-Changes with nginx 1.5.12 18 Mar 2014
-
- *) Security: a heap memory buffer overflow might occur in a worker
- process while handling a specially crafted request by
- ngx_http_spdy_module, potentially resulting in arbitrary code
- execution (CVE-2014-0133).
- Thanks to Lucas Molas, researcher at Programa STIC, Fundación Dr.
- Manuel Sadosky, Buenos Aires, Argentina.
-
- *) Feature: the "proxy_protocol" parameters of the "listen" and
- "real_ip_header" directives, the $proxy_protocol_addr variable.
-
- *) Bugfix: in the "fastcgi_next_upstream" directive.
- Thanks to Lucas Molas.
-
-
-Changes with nginx 1.5.11 04 Mar 2014
-
- *) Security: memory corruption might occur in a worker process on 32-bit
- platforms while handling a specially crafted request by
- ngx_http_spdy_module, potentially resulting in arbitrary code
- execution (CVE-2014-0088); the bug had appeared in 1.5.10.
- Thanks to Lucas Molas, researcher at Programa STIC, Fundación Dr.
- Manuel Sadosky, Buenos Aires, Argentina.
-
- *) Feature: the $ssl_session_reused variable.
-
- *) Bugfix: the "client_max_body_size" directive might not work when
- reading a request body using chunked transfer encoding; the bug had
- appeared in 1.3.9.
- Thanks to Lucas Molas.
-
- *) Bugfix: a segmentation fault might occur in a worker process when
- proxying WebSocket connections.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- ngx_http_spdy_module was used on 32-bit platforms; the bug had
- appeared in 1.5.10.
-
- *) Bugfix: the $upstream_status variable might contain wrong data if the
- "proxy_cache_use_stale" or "proxy_cache_revalidate" directives were
- used.
- Thanks to Piotr Sikora.
-
- *) Bugfix: a segmentation fault might occur in a worker process if
- errors with code 400 were redirected to a named location using the
- "error_page" directive.
-
- *) Bugfix: nginx/Windows could not be built with Visual Studio 2013.
-
-
-Changes with nginx 1.5.10 04 Feb 2014
-
- *) Feature: the ngx_http_spdy_module now uses SPDY 3.1 protocol.
- Thanks to Automattic and MaxCDN for sponsoring this work.
-
- *) Feature: the ngx_http_mp4_module now skips tracks too short for a
- seek requested.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- $ssl_session_id variable was used in logs; the bug had appeared in
- 1.5.9.
-
- *) Bugfix: the $date_local and $date_gmt variables used wrong format
- outside of the ngx_http_ssi_filter_module.
-
- *) Bugfix: client connections might be immediately closed if deferred
- accept was used; the bug had appeared in 1.3.15.
-
- *) Bugfix: alerts "getsockopt(TCP_FASTOPEN) ... failed" appeared in logs
- during binary upgrade on Linux; the bug had appeared in 1.5.8.
- Thanks to Piotr Sikora.
-
-
-Changes with nginx 1.5.9 22 Jan 2014
-
- *) Change: now nginx expects escaped URIs in "X-Accel-Redirect" headers.
-
- *) Feature: the "ssl_buffer_size" directive.
-
- *) Feature: the "limit_rate" directive can now be used to rate limit
- responses sent in SPDY connections.
-
- *) Feature: the "spdy_chunk_size" directive.
-
- *) Feature: the "ssl_session_tickets" directive.
- Thanks to Dirkjan Bussink.
-
- *) Bugfix: the $ssl_session_id variable contained full session
- serialized instead of just a session id.
- Thanks to Ivan Ristić.
-
- *) Bugfix: nginx incorrectly handled escaped "?" character in the
- "include" SSI command.
-
- *) Bugfix: the ngx_http_dav_module did not unescape destination URI of
- the COPY and MOVE methods.
-
- *) Bugfix: resolver did not understand domain names with a trailing dot.
- Thanks to Yichun Zhang.
-
- *) Bugfix: alerts "zero size buf in output" might appear in logs while
- proxying; the bug had appeared in 1.3.9.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- ngx_http_spdy_module was used.
-
- *) Bugfix: proxied WebSocket connections might hang right after
- handshake if the select, poll, or /dev/poll methods were used.
-
- *) Bugfix: the "xclient" directive of the mail proxy module incorrectly
- handled IPv6 client addresses.
-
-
-Changes with nginx 1.5.8 17 Dec 2013
-
- *) Feature: IPv6 support in resolver.
-
- *) Feature: the "listen" directive supports the "fastopen" parameter.
- Thanks to Mathew Rodley.
-
- *) Feature: SSL support in the ngx_http_uwsgi_module.
- Thanks to Roberto De Ioris.
-
- *) Feature: vim syntax highlighting scripts were added to contrib.
- Thanks to Evan Miller.
-
- *) Bugfix: a timeout might occur while reading client request body in an
- SSL connection using chunked transfer encoding.
-
- *) Bugfix: the "master_process" directive did not work correctly in
- nginx/Windows.
-
- *) Bugfix: the "setfib" parameter of the "listen" directive might not
- work.
-
- *) Bugfix: in the ngx_http_spdy_module.
-
-
-Changes with nginx 1.5.7 19 Nov 2013
-
- *) Security: a character following an unescaped space in a request line
- was handled incorrectly (CVE-2013-4547); the bug had appeared in
- 0.8.41.
- Thanks to Ivan Fratric of the Google Security Team.
-
- *) Change: a logging level of auth_basic errors about no user/password
- provided has been lowered from "error" to "info".
-
- *) Feature: the "proxy_cache_revalidate", "fastcgi_cache_revalidate",
- "scgi_cache_revalidate", and "uwsgi_cache_revalidate" directives.
-
- *) Feature: the "ssl_session_ticket_key" directive.
- Thanks to Piotr Sikora.
-
- *) Bugfix: the directive "add_header Cache-Control ''" added a
- "Cache-Control" response header line with an empty value.
-
- *) Bugfix: the "satisfy any" directive might return 403 error instead of
- 401 if auth_request and auth_basic directives were used.
- Thanks to Jan Marc Hoffmann.
-
- *) Bugfix: the "accept_filter" and "deferred" parameters of the "listen"
- directive were ignored for listen sockets created during binary
- upgrade.
- Thanks to Piotr Sikora.
-
- *) Bugfix: some data received from a backend with unbufferred proxy
- might not be sent to a client immediately if "gzip" or "gunzip"
- directives were used.
- Thanks to Yichun Zhang.
-
- *) Bugfix: in error handling in ngx_http_gunzip_filter_module.
-
- *) Bugfix: responses might hang if the ngx_http_spdy_module was used
- with the "auth_request" directive.
-
- *) Bugfix: memory leak in nginx/Windows.
-
-
-Changes with nginx 1.5.6 01 Oct 2013
-
- *) Feature: the "fastcgi_buffering" directive.
-
- *) Feature: the "proxy_ssl_protocols" and "proxy_ssl_ciphers"
- directives.
- Thanks to Piotr Sikora.
-
- *) Feature: optimization of SSL handshakes when using long certificate
- chains.
-
- *) Feature: the mail proxy supports SMTP pipelining.
-
- *) Bugfix: in the ngx_http_auth_basic_module when using "$apr1$"
- password encryption method.
- Thanks to Markus Linnala.
-
- *) Bugfix: in MacOSX, Cygwin, and nginx/Windows incorrect location might
- be used to process a request if locations were given using characters
- in different cases.
-
- *) Bugfix: automatic redirect with appended trailing slash for proxied
- locations might not work.
-
- *) Bugfix: in the mail proxy server.
-
- *) Bugfix: in the ngx_http_spdy_module.
-
-
-Changes with nginx 1.5.5 17 Sep 2013
-
- *) Change: now nginx assumes HTTP/1.0 by default if it is not able to
- detect protocol reliably.
-
- *) Feature: the "disable_symlinks" directive now uses O_PATH on Linux.
-
- *) Feature: now nginx uses EPOLLRDHUP events to detect premature
- connection close by clients if the "epoll" method is used.
-
- *) Bugfix: in the "valid_referers" directive if the "server_names"
- parameter was used.
-
- *) Bugfix: the $request_time variable did not work in nginx/Windows.
-
- *) Bugfix: in the "image_filter" directive.
- Thanks to Lanshun Zhou.
-
- *) Bugfix: OpenSSL 1.0.1f compatibility.
- Thanks to Piotr Sikora.
-
-
-Changes with nginx 1.5.4 27 Aug 2013
-
- *) Change: the "js" extension MIME type has been changed to
- "application/javascript"; default value of the "charset_types"
- directive was changed accordingly.
-
- *) Change: now the "image_filter" directive with the "size" parameter
- returns responses with the "application/json" MIME type.
-
- *) Feature: the ngx_http_auth_request_module.
-
- *) Bugfix: a segmentation fault might occur on start or during
- reconfiguration if the "try_files" directive was used with an empty
- parameter.
-
- *) Bugfix: memory leak if relative paths were specified using variables
- in the "root" or "auth_basic_user_file" directives.
-
- *) Bugfix: the "valid_referers" directive incorrectly executed regular
- expressions if a "Referer" header started with "https://".
- Thanks to Liangbin Li.
-
- *) Bugfix: responses might hang if subrequests were used and an SSL
- handshake error happened during subrequest processing.
- Thanks to Aviram Cohen.
-
- *) Bugfix: in the ngx_http_autoindex_module.
-
- *) Bugfix: in the ngx_http_spdy_module.
-
-
-Changes with nginx 1.5.3 30 Jul 2013
-
- *) Change in internal API: now u->length defaults to -1 if working with
- backends in unbuffered mode.
-
- *) Change: now after receiving an incomplete response from a backend
- server nginx tries to send an available part of the response to a
- client, and then closes client connection.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- ngx_http_spdy_module was used with the "client_body_in_file_only"
- directive.
-
- *) Bugfix: the "so_keepalive" parameter of the "listen" directive might
- be handled incorrectly on DragonFlyBSD.
- Thanks to Sepherosa Ziehau.
-
- *) Bugfix: in the ngx_http_xslt_filter_module.
-
- *) Bugfix: in the ngx_http_sub_filter_module.
-
-
-Changes with nginx 1.5.2 02 Jul 2013
-
- *) Feature: now several "error_log" directives can be used.
-
- *) Bugfix: the $r->header_in() embedded perl method did not return value
- of the "Cookie" and "X-Forwarded-For" request header lines; the bug
- had appeared in 1.3.14.
-
- *) Bugfix: in the ngx_http_spdy_module.
- Thanks to Jim Radford.
-
- *) Bugfix: nginx could not be built on Linux with x32 ABI.
- Thanks to Serguei Ivantsov.
-
-
-Changes with nginx 1.5.1 04 Jun 2013
-
- *) Feature: the "ssi_last_modified", "sub_filter_last_modified", and
- "xslt_last_modified" directives.
- Thanks to Alexey Kolpakov.
-
- *) Feature: the "http_403" parameter of the "proxy_next_upstream",
- "fastcgi_next_upstream", "scgi_next_upstream", and
- "uwsgi_next_upstream" directives.
-
- *) Feature: the "allow" and "deny" directives now support unix domain
- sockets.
-
- *) Bugfix: nginx could not be built with the ngx_mail_ssl_module, but
- without ngx_http_ssl_module; the bug had appeared in 1.3.14.
-
- *) Bugfix: in the "proxy_set_body" directive.
- Thanks to Lanshun Zhou.
-
- *) Bugfix: in the "lingering_time" directive.
- Thanks to Lanshun Zhou.
-
- *) Bugfix: the "fail_timeout" parameter of the "server" directive in the
- "upstream" context might not work if "max_fails" parameter was used;
- the bug had appeared in 1.3.0.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "ssl_stapling" directive was used.
- Thanks to Piotr Sikora.
-
- *) Bugfix: in the mail proxy server.
- Thanks to Filipe Da Silva.
-
- *) Bugfix: nginx/Windows might stop accepting connections if several
- worker processes were used.
-
-
-Changes with nginx 1.5.0 07 May 2013
-
- *) Security: a stack-based buffer overflow might occur in a worker
- process while handling a specially crafted request, potentially
- resulting in arbitrary code execution (CVE-2013-2028); the bug had
- appeared in 1.3.9.
- Thanks to Greg MacManus, iSIGHT Partners Labs.
-
-
-Changes with nginx 1.4.0 24 Apr 2013
-
- *) Bugfix: nginx could not be built with the ngx_http_perl_module if the
- --with-openssl option was used; the bug had appeared in 1.3.16.
-
- *) Bugfix: in a request body handling in the ngx_http_perl_module; the
- bug had appeared in 1.3.9.
-
-
-Changes with nginx 1.3.16 16 Apr 2013
-
- *) Bugfix: a segmentation fault might occur in a worker process if
- subrequests were used; the bug had appeared in 1.3.9.
-
- *) Bugfix: the "tcp_nodelay" directive caused an error if a WebSocket
- connection was proxied into a unix domain socket.
-
- *) Bugfix: the $upstream_response_length variable has an incorrect value
- "0" if buffering was not used.
- Thanks to Piotr Sikora.
-
- *) Bugfix: in the eventport and /dev/poll methods.
-
-
-Changes with nginx 1.3.15 26 Mar 2013
-
- *) Change: opening and closing a connection without sending any data in
- it is no longer logged to access_log with error code 400.
-
- *) Feature: the ngx_http_spdy_module.
- Thanks to Automattic for sponsoring this work.
-
- *) Feature: the "limit_req_status" and "limit_conn_status" directives.
- Thanks to Nick Marden.
-
- *) Feature: the "image_filter_interlace" directive.
- Thanks to Ian Babrou.
-
- *) Feature: $connections_waiting variable in the
- ngx_http_stub_status_module.
-
- *) Feature: the mail proxy module now supports IPv6 backends.
-
- *) Bugfix: request body might be transmitted incorrectly when retrying a
- request to the next upstream server; the bug had appeared in 1.3.9.
- Thanks to Piotr Sikora.
-
- *) Bugfix: in the "client_body_in_file_only" directive; the bug had
- appeared in 1.3.9.
-
- *) Bugfix: responses might hang if subrequests were used and a DNS error
- happened during subrequest processing.
- Thanks to Lanshun Zhou.
-
- *) Bugfix: in backend usage accounting.
-
-
-Changes with nginx 1.3.14 05 Mar 2013
-
- *) Feature: $connections_active, $connections_reading, and
- $connections_writing variables in the ngx_http_stub_status_module.
-
- *) Feature: support of WebSocket connections in the
- ngx_http_uwsgi_module and ngx_http_scgi_module.
-
- *) Bugfix: in virtual servers handling with SNI.
-
- *) Bugfix: new sessions were not always stored if the "ssl_session_cache
- shared" directive was used and there was no free space in shared
- memory.
- Thanks to Piotr Sikora.
-
- *) Bugfix: multiple X-Forwarded-For headers were handled incorrectly.
- Thanks to Neal Poole for sponsoring this work.
-
- *) Bugfix: in the ngx_http_mp4_module.
- Thanks to Gernot Vormayr.
-
-
-Changes with nginx 1.3.13 19 Feb 2013
-
- *) Change: a compiler with name "cc" is now used by default.
-
- *) Feature: support for proxying of WebSocket connections.
- Thanks to Apcera and CloudBees for sponsoring this work.
-
- *) Feature: the "auth_basic_user_file" directive supports "{SHA}"
- password encryption method.
- Thanks to Louis Opter.
-
-
-Changes with nginx 1.3.12 05 Feb 2013
-
- *) Feature: variables support in the "proxy_bind", "fastcgi_bind",
- "memcached_bind", "scgi_bind", and "uwsgi_bind" directives.
-
- *) Feature: the $pipe, $request_length, $time_iso8601, and $time_local
- variables can now be used not only in the "log_format" directive.
- Thanks to Kiril Kalchev.
-
- *) Feature: IPv6 support in the ngx_http_geoip_module.
- Thanks to Gregor Kališnik.
-
- *) Bugfix: in the "proxy_method" directive.
-
- *) Bugfix: a segmentation fault might occur in a worker process if
- resolver was used with the poll method.
-
- *) Bugfix: nginx might hog CPU during SSL handshake with a backend if
- the select, poll, or /dev/poll methods were used.
-
- *) Bugfix: the "[crit] SSL_write() failed (SSL:)" error.
-
- *) Bugfix: in the "client_body_in_file_only" directive; the bug had
- appeared in 1.3.9.
-
- *) Bugfix: in the "fastcgi_keep_conn" directive.
-
-
-Changes with nginx 1.3.11 10 Jan 2013
-
- *) Bugfix: a segmentation fault might occur if logging was used; the bug
- had appeared in 1.3.10.
-
- *) Bugfix: the "proxy_pass" directive did not work with IP addresses
- without port specified; the bug had appeared in 1.3.10.
-
- *) Bugfix: a segmentation fault occurred on start or during
- reconfiguration if the "keepalive" directive was specified more than
- once in a single upstream block.
-
- *) Bugfix: parameter "default" of the "geo" directive did not set
- default value for IPv6 addresses.
-
-
-Changes with nginx 1.3.10 25 Dec 2012
-
- *) Change: domain names specified in configuration file are now resolved
- to IPv6 addresses as well as IPv4 ones.
-
- *) Change: now if the "include" directive with mask is used on Unix
- systems, included files are sorted in alphabetical order.
-
- *) Change: the "add_header" directive adds headers to 201 responses.
-
- *) Feature: the "geo" directive now supports IPv6 addresses in CIDR
- notation.
-
- *) Feature: the "flush" and "gzip" parameters of the "access_log"
- directive.
-
- *) Feature: variables support in the "auth_basic" directive.
-
- *) Bugfix: nginx could not be built with the ngx_http_perl_module in
- some cases.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- ngx_http_xslt_module was used.
-
- *) Bugfix: nginx could not be built on MacOSX in some cases.
- Thanks to Piotr Sikora.
-
- *) Bugfix: the "limit_rate" directive with high rates might result in
- truncated responses on 32-bit platforms.
- Thanks to Alexey Antropov.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "if" directive was used.
- Thanks to Piotr Sikora.
-
- *) Bugfix: a "100 Continue" response was issued with "413 Request Entity
- Too Large" responses.
-
- *) Bugfix: the "image_filter", "image_filter_jpeg_quality" and
- "image_filter_sharpen" directives might be inherited incorrectly.
- Thanks to Ian Babrou.
-
- *) Bugfix: "crypt_r() failed" errors might appear if the "auth_basic"
- directive was used on Linux.
-
- *) Bugfix: in backup servers handling.
- Thanks to Thomas Chen.
-
- *) Bugfix: proxied HEAD requests might return incorrect response if the
- "gzip" directive was used.
-
-
-Changes with nginx 1.3.9 27 Nov 2012
-
- *) Feature: support for chunked transfer encoding while reading client
- request body.
-
- *) Feature: the $request_time and $msec variables can now be used not
- only in the "log_format" directive.
-
- *) Bugfix: cache manager and cache loader processes might not be able to
- start if more than 512 listen sockets were used.
-
- *) Bugfix: in the ngx_http_dav_module.
-
-
-Changes with nginx 1.3.8 30 Oct 2012
-
- *) Feature: the "optional_no_ca" parameter of the "ssl_verify_client"
- directive.
- Thanks to Mike Kazantsev and Eric O'Connor.
-
- *) Feature: the $bytes_sent, $connection, and $connection_requests
- variables can now be used not only in the "log_format" directive.
- Thanks to Benjamin Grössing.
-
- *) Feature: the "auto" parameter of the "worker_processes" directive.
-
- *) Bugfix: "cache file ... has md5 collision" alert.
-
- *) Bugfix: in the ngx_http_gunzip_filter_module.
-
- *) Bugfix: in the "ssl_stapling" directive.
-
-
-Changes with nginx 1.3.7 02 Oct 2012
-
- *) Feature: OCSP stapling support.
- Thanks to Comodo, DigiCert and GlobalSign for sponsoring this work.
-
- *) Feature: the "ssl_trusted_certificate" directive.
-
- *) Feature: resolver now randomly rotates addresses returned from cache.
- Thanks to Anton Jouline.
-
- *) Bugfix: OpenSSL 0.9.7 compatibility.
-
-
-Changes with nginx 1.3.6 12 Sep 2012
-
- *) Feature: the ngx_http_gunzip_filter_module.
-
- *) Feature: the "memcached_gzip_flag" directive.
-
- *) Feature: the "always" parameter of the "gzip_static" directive.
-
- *) Bugfix: in the "limit_req" directive; the bug had appeared in 1.1.14.
- Thanks to Charles Chen.
-
- *) Bugfix: nginx could not be built by gcc 4.7 with -O2 optimization if
- the --with-ipv6 option was used.
-
-
-Changes with nginx 1.3.5 21 Aug 2012
-
- *) Change: the ngx_http_mp4_module module no longer skips tracks in
- formats other than H.264 and AAC.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "map" directive was used with variables as values.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "geo" directive was used with the "ranges" parameter but without the
- "default" parameter; the bug had appeared in 0.8.43.
- Thanks to Zhen Chen and Weibin Yao.
-
- *) Bugfix: in the -p command-line parameter handling.
-
- *) Bugfix: in the mail proxy server.
-
- *) Bugfix: of minor potential bugs.
- Thanks to Coverity.
-
- *) Bugfix: nginx/Windows could not be built with Visual Studio 2005
- Express.
- Thanks to HAYASHI Kentaro.
-
-
-Changes with nginx 1.3.4 31 Jul 2012
-
- *) Change: the "ipv6only" parameter is now turned on by default for
- listening IPv6 sockets.
-
- *) Feature: the Clang compiler support.
-
- *) Bugfix: extra listening sockets might be created.
- Thanks to Roman Odaisky.
-
- *) Bugfix: nginx/Windows might hog CPU if a worker process failed to
- start.
- Thanks to Ricardo Villalobos Guevara.
-
- *) Bugfix: the "proxy_pass_header", "fastcgi_pass_header",
- "scgi_pass_header", "uwsgi_pass_header", "proxy_hide_header",
- "fastcgi_hide_header", "scgi_hide_header", and "uwsgi_hide_header"
- directives might be inherited incorrectly.
-
-
-Changes with nginx 1.3.3 10 Jul 2012
-
- *) Feature: entity tags support and the "etag" directive.
-
- *) Bugfix: trailing dot in a source value was not ignored if the "map"
- directive was used with the "hostnames" parameter.
-
- *) Bugfix: incorrect location might be used to process a request if a
- URI was changed via a "rewrite" directive before an internal redirect
- to a named location.
-
-
-Changes with nginx 1.3.2 26 Jun 2012
-
- *) Change: the "single" parameter of the "keepalive" directive is now
- ignored.
-
- *) Change: SSL compression is now disabled when using all versions of
- OpenSSL, including ones prior to 1.0.0.
-
- *) Feature: it is now possible to use the "ip_hash" directive to balance
- IPv6 clients.
-
- *) Feature: the $status variable can now be used not only in the
- "log_format" directive.
-
- *) Bugfix: a segmentation fault might occur in a worker process on
- shutdown if the "resolver" directive was used.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- ngx_http_mp4_module was used.
-
- *) Bugfix: in the ngx_http_mp4_module.
-
- *) Bugfix: a segmentation fault might occur in a worker process if
- conflicting wildcard server names were used.
-
- *) Bugfix: nginx might be terminated abnormally on a SIGBUS signal on
- ARM platform.
-
- *) Bugfix: an alert "sendmsg() failed (9: Bad file number)" on HP-UX
- while reconfiguration.
-
-
-Changes with nginx 1.3.1 05 Jun 2012
-
- *) Security: now nginx/Windows ignores trailing dot in URI path
- component, and does not allow URIs with ":$" in it.
- Thanks to Vladimir Kochetkov, Positive Research Center.
-
- *) Feature: the "proxy_pass", "fastcgi_pass", "scgi_pass", "uwsgi_pass"
- directives, and the "server" directive inside the "upstream" block,
- now support IPv6 addresses.
-
- *) Feature: the "resolver" directive now supports IPv6 addresses and an
- optional port specification.
-
- *) Feature: the "least_conn" directive inside the "upstream" block.
-
- *) Feature: it is now possible to specify a weight for servers while
- using the "ip_hash" directive.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "image_filter" directive was used; the bug had appeared in 1.3.0.
-
- *) Bugfix: nginx could not be built with ngx_cpp_test_module; the bug
- had appeared in 1.1.12.
-
- *) Bugfix: access to variables from SSI and embedded perl module might
- not work after reconfiguration.
- Thanks to Yichun Zhang.
-
- *) Bugfix: in the ngx_http_xslt_filter_module.
- Thanks to Kuramoto Eiji.
-
- *) Bugfix: memory leak if $geoip_org variable was used.
- Thanks to Denis F. Latypoff.
-
- *) Bugfix: in the "proxy_cookie_domain" and "proxy_cookie_path"
- directives.
-
-
-Changes with nginx 1.3.0 15 May 2012
-
- *) Feature: the "debug_connection" directive now supports IPv6 addresses
- and the "unix:" parameter.
-
- *) Feature: the "set_real_ip_from" directive and the "proxy" parameter
- of the "geo" directive now support IPv6 addresses.
-
- *) Feature: the "real_ip_recursive", "geoip_proxy", and
- "geoip_proxy_recursive" directives.
-
- *) Feature: the "proxy_recursive" parameter of the "geo" directive.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "resolver" directive was used.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "fastcgi_pass", "scgi_pass", or "uwsgi_pass" directives were used and
- backend returned incorrect response.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "rewrite" directive was used and new request arguments in a
- replacement used variables.
-
- *) Bugfix: nginx might hog CPU if the open file resource limit was
- reached.
-
- *) Bugfix: nginx might loop infinitely over backends if the
- "proxy_next_upstream" directive with the "http_404" parameter was
- used and there were backup servers specified in an upstream block.
-
- *) Bugfix: adding the "down" parameter of the "server" directive might
- cause unneeded client redistribution among backend servers if the
- "ip_hash" directive was used.
-
- *) Bugfix: socket leak.
- Thanks to Yichun Zhang.
-
- *) Bugfix: in the ngx_http_fastcgi_module.
-
-
-Changes with nginx 1.2.0 23 Apr 2012
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "try_files" directive was used; the bug had appeared in 1.1.19.
-
- *) Bugfix: response might be truncated if there were more than IOV_MAX
- buffers used.
-
- *) Bugfix: in the "crop" parameter of the "image_filter" directive.
- Thanks to Maxim Bublis.
-
-
-Changes with nginx 1.1.19 12 Apr 2012
-
- *) Security: specially crafted mp4 file might allow to overwrite memory
- locations in a worker process if the ngx_http_mp4_module was used,
- potentially resulting in arbitrary code execution (CVE-2012-2089).
- Thanks to Matthew Daley.
-
- *) Bugfix: nginx/Windows might be terminated abnormally.
- Thanks to Vincent Lee.
-
- *) Bugfix: nginx hogged CPU if all servers in an upstream were marked as
- "backup".
-
- *) Bugfix: the "allow" and "deny" directives might be inherited
- incorrectly if they were used with IPv6 addresses.
-
- *) Bugfix: the "modern_browser" and "ancient_browser" directives might
- be inherited incorrectly.
-
- *) Bugfix: timeouts might be handled incorrectly on Solaris/SPARC.
-
- *) Bugfix: in the ngx_http_mp4_module.
-
-
-Changes with nginx 1.1.18 28 Mar 2012
-
- *) Change: keepalive connections are no longer disabled for Safari by
- default.
-
- *) Feature: the $connection_requests variable.
-
- *) Feature: $tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd and
- $tcpinfo_rcv_space variables.
-
- *) Feature: the "worker_cpu_affinity" directive now works on FreeBSD.
-
- *) Feature: the "xslt_param" and "xslt_string_param" directives.
- Thanks to Samuel Behan.
-
- *) Bugfix: in configure tests.
- Thanks to Piotr Sikora.
-
- *) Bugfix: in the ngx_http_xslt_filter_module.
-
- *) Bugfix: nginx could not be built on Debian GNU/Hurd.
-
-
-Changes with nginx 1.1.17 15 Mar 2012
-
- *) Security: content of previously freed memory might be sent to a
- client if backend returned specially crafted response.
- Thanks to Matthew Daley.
-
- *) Bugfix: in the embedded perl module if used from SSI.
- Thanks to Matthew Daley.
-
- *) Bugfix: in the ngx_http_uwsgi_module.
-
-
-Changes with nginx 1.1.16 29 Feb 2012
-
- *) Change: the simultaneous subrequest limit has been raised to 200.
-
- *) Feature: the "from" parameter of the "disable_symlinks" directive.
-
- *) Feature: the "return" and "error_page" directives can now be used to
- return 307 redirections.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "resolver" directive was used and there was no "error_log" directive
- specified at global level.
- Thanks to Roman Arutyunyan.
-
- *) Bugfix: a segmentation fault might occur in a worker process if the
- "proxy_http_version 1.1" or "fastcgi_keep_conn on" directives were
- used.
-
- *) Bugfix: memory leaks.
- Thanks to Lanshun Zhou.
-
- *) Bugfix: in the "disable_symlinks" directive.
-
- *) Bugfix: on ZFS filesystem disk cache size might be calculated
- incorrectly; the bug had appeared in 1.0.1.
-
- *) Bugfix: nginx could not be built by the icc 12.1 compiler.
-
- *) Bugfix: nginx could not be built by gcc on Solaris; the bug had
- appeared in 1.1.15.
-
-
-Changes with nginx 1.1.15 15 Feb 2012
-
- *) Feature: the "disable_symlinks" directive.
-
- *) Feature: the "proxy_cookie_domain" and "proxy_cookie_path"
- directives.
-
- *) Bugfix: nginx might log incorrect error "upstream prematurely closed
- connection" instead of correct "upstream sent too big header" one.
- Thanks to Feibo Li.
-
- *) Bugfix: nginx could not be built with the ngx_http_perl_module if the
- --with-openssl option was used.
-
- *) Bugfix: the number of internal redirects to named locations was not
- limited.
-
- *) Bugfix: calling $r->flush() multiple times might cause errors in the
- ngx_http_gzip_filter_module.
-
- *) Bugfix: temporary files might be not removed if the "proxy_store"
- directive was used with SSI includes.
-
- *) Bugfix: in some cases non-cacheable variables (such as the $args
- variable) returned old empty cached value.
-
- *) Bugfix: a segmentation fault might occur in a worker process if too
- many SSI subrequests were issued simultaneously; the bug had appeared
- in 0.7.25.
-
-
-Changes with nginx 1.1.14 30 Jan 2012
-
- *) Feature: multiple "limit_req" limits may be used simultaneously.
-
- *) Bugfix: in error handling while connecting to a backend.
- Thanks to Piotr Sikora.
-
- *) Bugfix: in AIO error handling on FreeBSD.
-
- *) Bugfix: in the OpenSSL library initialization.
-
- *) Bugfix: the "proxy_redirect" directives might be inherited
- incorrectly.
-
- *) Bugfix: memory leak during reconfiguration if the "pcre_jit"
- directive was used.
-
-
-Changes with nginx 1.1.13 16 Jan 2012
-
- *) Feature: the "TLSv1.1" and "TLSv1.2" parameters of the
- "ssl_protocols" directive.
-
- *) Bugfix: the "limit_req" directive parameters were not inherited
- correctly; the bug had appeared in 1.1.12.
-
- *) Bugfix: the "proxy_redirect" directive incorrectly processed
- "Refresh" header if regular expression were used.
-
- *) Bugfix: the "proxy_cache_use_stale" directive with "error" parameter
- did not return answer from cache if there were no live upstreams.
-
- *) Bugfix: the "worker_cpu_affinity" directive might not work.
-
- *) Bugfix: nginx could not be built on Solaris; the bug had appeared in
- 1.1.12.
-
- *) Bugfix: in the ngx_http_mp4_module.
-
-
-Changes with nginx 1.1.12 26 Dec 2011
-
- *) Change: a "proxy_pass" directive without URI part now uses changed
- URI after redirection with the "error_page" directive.
- Thanks to Lanshun Zhou.
-
- *) Feature: the "proxy/fastcgi/scgi/uwsgi_cache_lock",
- "proxy/fastcgi/scgi/uwsgi_cache_lock_timeout" directives.
-
- *) Feature: the "pcre_jit" directive.
-
- *) Feature: the "if" SSI command supports captures in regular
- expressions.
-
- *) Bugfix: the "if" SSI command did not work inside the "block" command.
-
- *) Bugfix: the "limit_conn_log_level" and "limit_req_log_level"
- directives might not work.
-
- *) Bugfix: the "limit_rate" directive did not allow to use full
- throughput, even if limit value was very high.
-
- *) Bugfix: the "sendfile_max_chunk" directive did not work, if the
- "limit_rate" directive was used.
-
- *) Bugfix: a "proxy_pass" directive without URI part always used
- original request URI if variables were used.
-
- *) Bugfix: a "proxy_pass" directive without URI part might use original
- request after redirection with the "try_files" directive.
- Thanks to Lanshun Zhou.
-
- *) Bugfix: in the ngx_http_scgi_module.
-
- *) Bugfix: in the ngx_http_mp4_module.
-
- *) Bugfix: nginx could not be built on Solaris; the bug had appeared in
- 1.1.9.
-
-
-Changes with nginx 1.1.11 12 Dec 2011
-
- *) Feature: the "so_keepalive" parameter of the "listen" directive.
- Thanks to Vsevolod Stakhov.
-
- *) Feature: the "if_not_empty" parameter of the
- "fastcgi/scgi/uwsgi_param" directives.
-
- *) Feature: the $https variable.
-
- *) Feature: the "proxy_redirect" directive supports variables in the
- first parameter.
-
- *) Feature: the "proxy_redirect" directive supports regular expressions.
-
- *) Bugfix: the $sent_http_cache_control variable might contain a wrong
- value if the "expires" directive was used.
- Thanks to Yichun Zhang.
-
- *) Bugfix: the "read_ahead" directive might not work combined with
- "try_files" and "open_file_cache".
-
- *) Bugfix: a segmentation fault might occur in a worker process if small
- time was used in the "inactive" parameter of the "proxy_cache_path"
- directive.
-
- *) Bugfix: responses from cache might hang.
-
-
-Changes with nginx 1.1.10 30 Nov 2011
-
- *) Bugfix: a segmentation fault occured in a worker process if AIO was
- used on Linux; the bug had appeared in 1.1.9.
-
-
-Changes with nginx 1.1.9 28 Nov 2011
-
- *) Change: now double quotes are encoded in an "echo" SSI-command
- output.
- Thanks to Zaur Abasmirzoev.
-
- *) Feature: the "valid" parameter of the "resolver" directive. By
- default TTL returned by a DNS server is used.
- Thanks to Kirill A. Korinskiy.
-
- *) Bugfix: nginx might hang after a worker process abnormal termination.
-
- *) Bugfix: a segmentation fault might occur in a worker process if SNI
- was used; the bug had appeared in 1.1.2.
-
- *) Bugfix: in the "keepalive_disable" directive; the bug had appeared in
- 1.1.8.
- Thanks to Alexander Usov.
-
- *) Bugfix: SIGWINCH signal did not work after first binary upgrade; the
- bug had appeared in 1.1.1.
-
- *) Bugfix: backend responses with length not matching "Content-Length"
- header line are no longer cached.
-
- *) Bugfix: in the "scgi_param" directive, if complex parameters were
- used.
-
- *) Bugfix: in the "epoll" event method.
- Thanks to Yichun Zhang.
-
- *) Bugfix: in the ngx_http_flv_module.
- Thanks to Piotr Sikora.
-
- *) Bugfix: in the ngx_http_mp4_module.
-
- *) Bugfix: IPv6 addresses are now handled properly in a request line and
- in a "Host" request header line.
-
- *) Bugfix: "add_header" and "expires" directives did not work if a
- request was proxied and response status code was 206.
-
- *) Bugfix: nginx could not be built on FreeBSD 10.
-
- *) Bugfix: nginx could not be built on AIX.
-
-
-Changes with nginx 1.1.8 14 Nov 2011
-
- *) Change: the ngx_http_limit_zone_module was renamed to the
- ngx_http_limit_conn_module.
-
- *) Change: the "limit_zone" directive was superseded by the
- "limit_conn_zone" directive with a new syntax.
-
- *) Feature: support for multiple "limit_conn" limits on the same level.
-
- *) Feature: the "image_filter_sharpen" directive.
-
- *) Bugfix: a segmentation fault might occur in a worker process if
- resolver got a big DNS response.
- Thanks to Ben Hawkes.
-
- *) Bugfix: in cache key calculation if internal MD5 implementation was
- used; the bug had appeared in 1.0.4.
-
- *) Bugfix: the "If-Modified-Since", "If-Range", etc. client request
- header lines might be passed to backend while caching; or not passed
- without caching if caching was enabled in another part of the
- configuration.
-
- *) Bugfix: the module ngx_http_mp4_module sent incorrect
- "Content-Length" response header line if the "start" argument was
- used.
- Thanks to Piotr Sikora.
-
-
-Changes with nginx 1.1.7 31 Oct 2011
-
- *) Feature: support of several DNS servers in the "resolver" directive.
- Thanks to Kirill A. Korinskiy.
-
- *) Bugfix: a segmentation fault occurred on start or during
- reconfiguration if the "ssl" directive was used at http level and
- there was no "ssl_certificate" defined.
-
- *) Bugfix: reduced memory consumption while proxying big files if they
- were buffered to disk.
-
- *) Bugfix: a segmentation fault might occur in a worker process if
- "proxy_http_version 1.1" directive was used.
-
- *) Bugfix: in the "expires @time" directive.
-
-
-Changes with nginx 1.1.6 17 Oct 2011
-
- *) Change in internal API: now module context data are cleared while
- internal redirect to named location.
- Requested by Yichun Zhang.
-
- *) Change: if a server in an upstream failed, only one request will be
- sent to it after fail_timeout; the server will be considered alive if
- it will successfully respond to the request.
-
- *) Change: now the 0x7F-0x1F characters are escaped as \xXX in an
- access_log.
-
- *) Feature: "proxy/fastcgi/scgi/uwsgi_ignore_headers" directives support
- the following additional values: X-Accel-Limit-Rate,
- X-Accel-Buffering, X-Accel-Charset.
-
- *) Feature: decrease of memory consumption if SSL is used.
-
- *) Bugfix: some UTF-8 characters were processed incorrectly.
- Thanks to Alexey Kuts.
-
- *) Bugfix: the ngx_http_rewrite_module directives specified at "server"
- level were executed twice if no matching locations were defined.
-
- *) Bugfix: a socket leak might occurred if "aio sendfile" was used.
-
- *) Bugfix: connections with fast clients might be closed after
- send_timeout if file AIO was used.
-
- *) Bugfix: in the ngx_http_autoindex_module.
-
- *) Bugfix: the module ngx_http_mp4_module did not support seeking on
- 32-bit platforms.
-
-
-Changes with nginx 1.1.5 05 Oct 2011
-
- *) Feature: the "uwsgi_buffering" and "scgi_buffering" directives.
- Thanks to Peter Smit.
-
- *) Bugfix: non-cacheable responses might be cached if
- "proxy_cache_bypass" directive was used.
- Thanks to John Ferlito.
-
- *) Bugfix: in HTTP/1.1 support in the ngx_http_proxy_module.
-
- *) Bugfix: cached responses with an empty body were returned
- incorrectly; the bug had appeared in 0.8.31.
-
- *) Bugfix: 201 responses of the ngx_http_dav_module were incorrect; the
- bug had appeared in 0.8.32.
-
- *) Bugfix: in the "return" directive.
-
- *) Bugfix: the "ssl_session_cache builtin" directive caused segmentation
- fault; the bug had appeared in 1.1.1.
-
-
-Changes with nginx 1.1.4 20 Sep 2011
-
- *) Feature: the ngx_http_upstream_keepalive module.
-
- *) Feature: the "proxy_http_version" directive.
-
- *) Feature: the "fastcgi_keep_conn" directive.
-
- *) Feature: the "worker_aio_requests" directive.
-
- *) Bugfix: if nginx was built --with-file-aio it could not be run on
- Linux kernel which did not support AIO.
-
- *) Bugfix: in Linux AIO error processing.
- Thanks to Hagai Avrahami.
-
- *) Bugfix: reduced memory consumption for long-lived requests.
-
- *) Bugfix: the module ngx_http_mp4_module did not support 64-bit MP4
- "co64" atom.
-
-
-Changes with nginx 1.1.3 14 Sep 2011
-
- *) Feature: the module ngx_http_mp4_module.
-
- *) Bugfix: in Linux AIO combined with open_file_cache.
-
- *) Bugfix: open_file_cache did not update file info on retest if file
- was not atomically changed.
-
- *) Bugfix: nginx could not be built on MacOSX 10.7.
-
-
-Changes with nginx 1.1.2 05 Sep 2011
-
- *) Change: now if total size of all ranges is greater than source
- response size, then nginx disables ranges and returns just the source
- response.
-
- *) Feature: the "max_ranges" directive.
-
- *) Bugfix: the "ssl_verify_client", "ssl_verify_depth", and
- "ssl_prefer_server_ciphers" directives might work incorrectly if SNI
- was used.
-
- *) Bugfix: in the "proxy/fastcgi/scgi/uwsgi_ignore_client_abort"
- directives.
-
-
-Changes with nginx 1.1.1 22 Aug 2011
-
- *) Change: now cache loader processes either as many files as specified
- by "loader_files" parameter or works no longer than time specified by
- the "loader_threshold" parameter during each iteration.
-
- *) Change: now SIGWINCH signal works only in daemon mode.
-
- *) Feature: now shared zones and caches use POSIX semaphores on Solaris.
- Thanks to Den Ivanov.
-
- *) Feature: accept filters are now supported on NetBSD.
-
- *) Bugfix: nginx could not be built on Linux 3.0.
-
- *) Bugfix: nginx did not use gzipping in some cases; the bug had
- appeared in 1.1.0.
-
- *) Bugfix: request body might be processed incorrectly if client used
- pipelining.
-
- *) Bugfix: in the "request_body_in_single_buf" directive.
-
- *) Bugfix: in "proxy_set_body" and "proxy_pass_request_body" directives
- if SSL connection to backend was used.
-
- *) Bugfix: nginx hogged CPU if all servers in an upstream were marked as
- "down".
-
- *) Bugfix: a segmentation fault might occur during reconfiguration if
- ssl_session_cache was defined but not used in previous configuration.
-
- *) Bugfix: a segmentation fault might occur in a worker process if many
- backup servers were used in an upstream.
-
- *) Bugfix: a segmentation fault might occur in a worker process if
- "fastcgi/scgi/uwsgi_param" directives were used with values starting
- with "HTTP_"; the bug had appeared in 0.8.40.
-
-
-Changes with nginx 1.1.0 01 Aug 2011
-
- *) Feature: cache loader run time decrease.
-
- *) Feature: "loader_files", "loader_sleep", and "loader_threshold"
- options of the "proxy/fastcgi/scgi/uwsgi_cache_path" directives.
-
- *) Feature: loading time decrease of configuration with large number of
- HTTPS sites.
-
- *) Feature: now nginx supports ECDHE key exchange ciphers.
- Thanks to Adrian Kotelba.
-
- *) Feature: the "lingering_close" directive.
- Thanks to Maxim Dounin.
-
- *) Bugfix: in closing connection for pipelined requests.
- Thanks to Maxim Dounin.
-
- *) Bugfix: nginx did not disable gzipping if client sent "gzip;q=0" in
- "Accept-Encoding" request header line.
-
- *) Bugfix: in timeout in unbuffered proxied mode.
- Thanks to Maxim Dounin.
-
- *) Bugfix: memory leaks when a "proxy_pass" directive contains variables
- and proxies to an HTTPS backend.
- Thanks to Maxim Dounin.
-
- *) Bugfix: in parameter validaiton of a "proxy_pass" directive with
- variables.
- Thanks to Lanshun Zhou.
-
- *) Bugfix: SSL did not work on QNX.
- Thanks to Maxim Dounin.
-
- *) Bugfix: SSL modules could not be built by gcc 4.6 without
- --with-debug option.
-
-
-Changes with nginx 1.0.5 19 Jul 2011
-
- *) Change: now default SSL ciphers are "HIGH:!aNULL:!MD5".
- Thanks to Rob Stradling.
-
- *) Feature: the "referer_hash_max_size" and "referer_hash_bucket_size"
- directives.
- Thanks to Witold Filipczyk.
-
- *) Feature: $uid_reset variable.
-
- *) Bugfix: a segmentation fault might occur in a worker process, if a
- caching was used.
- Thanks to Lanshun Zhou.
-
- *) Bugfix: worker processes may got caught in an endless loop during
- reconfiguration, if a caching was used; the bug had appeared in
- 0.8.48.
- Thanks to Maxim Dounin.
-
- *) Bugfix: "stalled cache updating" alert.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 1.0.4 01 Jun 2011
-
- *) Change: now regular expressions case sensitivity in the "map"
- directive is given by prefixes "~" or "~*".
-
- *) Feature: now shared zones and caches use POSIX semaphores on Linux.
- Thanks to Denis F. Latypoff.
-
- *) Bugfix: "stalled cache updating" alert.
-
- *) Bugfix: nginx could not be built --without-http_auth_basic_module;
- the bug had appeared in 1.0.3.
-
-
-Changes with nginx 1.0.3 25 May 2011
-
- *) Feature: the "auth_basic_user_file" directive supports "$apr1",
- "{PLAIN}", and "{SSHA}" password encryption methods.
- Thanks to Maxim Dounin.
-
- *) Feature: the "geoip_org" directive and $geoip_org variable.
- Thanks to Alexander Uskov, Arnaud Granal, and Denis F. Latypoff.
-
- *) Feature: ngx_http_geo_module and ngx_http_geoip_module support IPv4
- addresses mapped to IPv6 addresses.
-
- *) Bugfix: a segmentation fault occurred in a worker process during
- testing IPv4 address mapped to IPv6 address, if access or deny rules
- were defined only for IPv6; the bug had appeared in 0.8.22.
-
- *) Bugfix: a cached response may be broken if "proxy/fastcgi/scgi/
- uwsgi_cache_bypass" and "proxy/fastcgi/scgi/uwsgi_no_cache" directive
- values were different; the bug had appeared in 0.8.46.
-
-
-Changes with nginx 1.0.2 10 May 2011
-
- *) Feature: now shared zones and caches use POSIX semaphores.
-
- *) Bugfix: in the "rotate" parameter of the "image_filter" directive.
- Thanks to Adam Bocim.
-
- *) Bugfix: nginx could not be built on Solaris; the bug had appeared in
- 1.0.1.
-
-
-Changes with nginx 1.0.1 03 May 2011
-
- *) Change: now the "split_clients" directive uses MurmurHash2 algorithm
- because of better distribution.
- Thanks to Oleg Mamontov.
-
- *) Change: now long strings starting with zero are not considered as
- false values.
- Thanks to Maxim Dounin.
-
- *) Change: now nginx uses a default listen backlog value 511 on Linux.
-
- *) Feature: the $upstream_... variables may be used in the SSI and perl
- modules.
-
- *) Bugfix: now nginx limits better disk cache size.
- Thanks to Oleg Mamontov.
-
- *) Bugfix: a segmentation fault might occur while parsing incorrect IPv4
- address; the bug had appeared in 0.9.3.
- Thanks to Maxim Dounin.
-
- *) Bugfix: nginx could not be built by gcc 4.6 without --with-debug
- option.
-
- *) Bugfix: nginx could not be built on Solaris 9 and earlier; the bug
- had appeared in 0.9.3.
- Thanks to Dagobert Michelsen.
-
- *) Bugfix: $request_time variable had invalid values if subrequests were
- used; the bug had appeared in 0.8.47.
- Thanks to Igor A. Valcov.
-
-
-Changes with nginx 1.0.0 12 Apr 2011
-
- *) Bugfix: a cache manager might hog CPU after reload.
- Thanks to Maxim Dounin.
-
- *) Bugfix: an "image_filter crop" directive worked incorrectly coupled
- with an "image_filter rotate 180" directive.
-
- *) Bugfix: a "satisfy any" directive disabled custom 401 error page.
-
-
-Changes with nginx 0.9.7 04 Apr 2011
-
- *) Feature: now keepalive connections may be closed premature, if there
- are no free worker connections.
- Thanks to Maxim Dounin.
-
- *) Feature: the "rotate" parameter of the "image_filter" directive.
- Thanks to Adam Bocim.
-
- *) Bugfix: a case when a backend in "fastcgi_pass", "scgi_pass", or
- "uwsgi_pass" directives is given by expression and refers to a
- defined upstream.
-
-
-Changes with nginx 0.9.6 21 Mar 2011
-
- *) Feature: the "map" directive supports regular expressions as value of
- the first parameter.
-
- *) Feature: $time_iso8601 access_log variable.
- Thanks to Michael Lustfield.
-
-
-Changes with nginx 0.9.5 21 Feb 2011
-
- *) Change: now nginx uses a default listen backlog value -1 on Linux.
- Thanks to Andrei Nigmatulin.
-
- *) Feature: the "utf8" parameter of "geoip_country" and "geoip_city"
- directives.
- Thanks to Denis F. Latypoff.
-
- *) Bugfix: in a default "proxy_redirect" directive if "proxy_pass"
- directive has no URI part.
- Thanks to Maxim Dounin.
-
- *) Bugfix: an "error_page" directive did not work with nonstandard error
- codes; the bug had appeared in 0.8.53.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.9.4 21 Jan 2011
-
- *) Feature: the "server_name" directive supports the $hostname variable.
-
- *) Feature: 494 code for "Request Header Too Large" error.
-
-
-Changes with nginx 0.9.3 13 Dec 2010
-
- *) Bugfix: if there was a single server for given IPv6 address:port
- pair, then captures in regular expressions in a "server_name"
- directive did not work.
-
- *) Bugfix: nginx could not be built on Solaris; the bug had appeared in
- 0.9.0.
-
-
-Changes with nginx 0.9.2 06 Dec 2010
-
- *) Feature: the "If-Unmodified-Since" client request header line
- support.
-
- *) Workaround: fallback to accept() syscall if accept4() was not
- implemented; the issue had appeared in 0.9.0.
-
- *) Bugfix: nginx could not be built on Cygwin; the bug had appeared in
- 0.9.0.
-
- *) Bugfix: for OpenSSL vulnerability CVE-2010-4180.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.9.1 30 Nov 2010
-
- *) Bugfix: "return CODE message" directives did not work; the bug had
- appeared in 0.9.0.
-
-
-Changes with nginx 0.9.0 29 Nov 2010
-
- *) Feature: the "keepalive_disable" directive.
-
- *) Feature: the "map" directive supports variables as value of a defined
- variable.
-
- *) Feature: the "map" directive supports empty strings as value of the
- first parameter.
-
- *) Feature: the "map" directive supports expressions as the first
- parameter.
-
- *) Feature: nginx(8) manual page.
- Thanks to Sergey Osokin.
-
- *) Feature: Linux accept4() support.
- Thanks to Simon Liu.
-
- *) Workaround: elimination of Linux linker warning about "sys_errlist"
- and "sys_nerr"; the warning had appeared in 0.8.35.
-
- *) Bugfix: a segmentation fault might occur in a worker process, if the
- "auth_basic" directive was used.
- Thanks to Michail Laletin.
-
- *) Bugfix: compatibility with ngx_http_eval_module; the bug had appeared
- in 0.8.42.
-
-
-Changes with nginx 0.8.53 18 Oct 2010
-
- *) Feature: now the "error_page" directive allows to change a status
- code in a redirect.
-
- *) Feature: the "gzip_disable" directive supports special "degradation"
- mask.
-
- *) Bugfix: a socket leak might occurred if file AIO was used.
- Thanks to Maxim Dounin.
-
- *) Bugfix: if the first server had no "listen" directive and there was
- no explicit default server, then a next server with a "listen"
- directive became the default server; the bug had appeared in 0.8.21.
-
-
-Changes with nginx 0.8.52 28 Sep 2010
-
- *) Bugfix: nginx used SSL mode for a listen socket if any listen option
- was set; the bug had appeared in 0.8.51.
-
-
-Changes with nginx 0.8.51 27 Sep 2010
-
- *) Change: the "secure_link_expires" directive has been canceled.
-
- *) Change: a logging level of resolver errors has been lowered from
- "alert" to "error".
-
- *) Feature: now a listen socket "ssl" parameter may be set several
- times.
-
-
-Changes with nginx 0.8.50 02 Sep 2010
-
- *) Feature: the "secure_link", "secure_link_md5", and
- "secure_link_expires" directives of the ngx_http_secure_link_module.
-
- *) Feature: the -q switch.
- Thanks to Gena Makhomed.
-
- *) Bugfix: worker processes may got caught in an endless loop during
- reconfiguration, if a caching was used; the bug had appeared in
- 0.8.48.
-
- *) Bugfix: in the "gzip_disable" directive.
- Thanks to Derrick Petzold.
-
- *) Bugfix: nginx/Windows could not send stop, quit, reopen, and reload
- signals to a process run in other session.
-
-
-Changes with nginx 0.8.49 09 Aug 2010
-
- *) Feature: the "image_filter_jpeg_quality" directive supports
- variables.
-
- *) Bugfix: a segmentation fault might occur in a worker process, if the
- $geoip_region_name variables was used; the bug had appeared in
- 0.8.48.
-
- *) Bugfix: errors intercepted by error_page were cached only for next
- request; the bug had appeared in 0.8.48.
-
-
-Changes with nginx 0.8.48 03 Aug 2010
-
- *) Change: now the "server_name" directive default value is an empty
- name "".
- Thanks to Gena Makhomed.
-
- *) Change: now the "server_name_in_redirect" directive default value is
- "off".
-
- *) Feature: the $geoip_dma_code, $geoip_area_code, and
- $geoip_region_name variables.
- Thanks to Christine McGonagle.
-
- *) Bugfix: the "proxy_pass", "fastcgi_pass", "uwsgi_pass", and
- "scgi_pass" directives were not inherited inside "limit_except"
- blocks.
-
- *) Bugfix: the "proxy_cache_min_uses", "fastcgi_cache_min_uses"
- "uwsgi_cache_min_uses", and "scgi_cache_min_uses" directives did not
- work; the bug had appeared in 0.8.46.
-
- *) Bugfix: the "fastcgi_split_path_info" directive used incorrectly
- captures, if only parts of an URI were captured.
- Thanks to Yuriy Taraday and Frank Enderle.
-
- *) Bugfix: the "rewrite" directive did not escape a ";" character during
- copying from URI to query string.
- Thanks to Daisuke Murase.
-
- *) Bugfix: the ngx_http_image_filter_module closed a connection, if an
- image was larger than "image_filter_buffer" size.
-
-
-Changes with nginx 0.8.47 28 Jul 2010
-
- *) Bugfix: $request_time variable had invalid values for subrequests.
-
- *) Bugfix: errors intercepted by error_page could not be cached.
-
- *) Bugfix: a cache manager process may got caught in an endless loop, if
- max_size parameter was used; the bug had appeared in 0.8.46.
-
-
-Changes with nginx 0.8.46 19 Jul 2010
-
- *) Change: now the "proxy_no_cache", "fastcgi_no_cache",
- "uwsgi_no_cache", and "scgi_no_cache" directives affect on a cached
- response saving only.
-
- *) Feature: the "proxy_cache_bypass", "fastcgi_cache_bypass",
- "uwsgi_cache_bypass", and "scgi_cache_bypass" directives.
-
- *) Bugfix: nginx did not free memory in cache keys zones if there was an
- error during working with backend: the memory was freed only after
- inactivity time or on memory low condition.
-
-
-Changes with nginx 0.8.45 13 Jul 2010
-
- *) Feature: ngx_http_xslt_filter improvements.
- Thanks to Laurence Rowe.
-
- *) Bugfix: SSI response might be truncated after include with
- wait="yes"; the bug had appeared in 0.7.25.
- Thanks to Maxim Dounin.
-
- *) Bugfix: the "listen" directive did not support the "setfib=0"
- parameter.
-
-
-Changes with nginx 0.8.44 05 Jul 2010
-
- *) Change: now nginx does not cache by default backend responses, if
- they have a "Set-Cookie" header line.
-
- *) Feature: the "listen" directive supports the "setfib" parameter.
- Thanks to Andrew Filonov.
-
- *) Bugfix: the "sub_filter" directive might change character case on
- partial match.
-
- *) Bugfix: compatibility with HP/UX.
-
- *) Bugfix: compatibility with AIX xlC_r compiler.
-
- *) Bugfix: nginx treated large SSLv2 packets as plain requests.
- Thanks to Miroslaw Jaworski.
-
-
-Changes with nginx 0.8.43 30 Jun 2010
-
- *) Feature: large geo ranges base loading speed-up.
-
- *) Bugfix: an error_page redirection to "location /zero {return 204;}"
- without changing status code kept the error body; the bug had
- appeared in 0.8.42.
-
- *) Bugfix: nginx might close IPv6 listen socket during reconfiguration.
- Thanks to Maxim Dounin.
-
- *) Bugfix: the $uid_set variable may be used at any request processing
- stage.
-
-
-Changes with nginx 0.8.42 21 Jun 2010
-
- *) Change: now nginx tests locations given by regular expressions, if
- request was matched exactly by a location given by a prefix string.
- The previous behavior has been introduced in 0.7.1.
-
- *) Feature: the ngx_http_scgi_module.
- Thanks to Manlio Perillo.
-
- *) Feature: a text answer may be added to a "return" directive.
-
-
-Changes with nginx 0.8.41 15 Jun 2010
-
- *) Security: nginx/Windows worker might be terminated abnormally if a
- requested file name has invalid UTF-8 encoding.
-
- *) Change: now nginx allows to use spaces in a request line.
-
- *) Bugfix: the "proxy_redirect" directive changed incorrectly a backend
- "Refresh" response header line.
- Thanks to Andrey Andreew and Max Sogin.
-
- *) Bugfix: nginx did not support path without host name in "Destination"
- request header line.
-
-
-Changes with nginx 0.8.40 07 Jun 2010
-
- *) Security: now nginx/Windows ignores default file stream name.
- Thanks to Jose Antonio Vazquez Gonzalez.
-
- *) Feature: the ngx_http_uwsgi_module.
- Thanks to Roberto De Ioris.
-
- *) Feature: a "fastcgi_param" directive with value starting with "HTTP_"
- overrides a client request header line.
-
- *) Bugfix: the "If-Modified-Since", "If-Range", etc. client request
- header lines were passed to FastCGI-server while caching.
-
- *) Bugfix: listen unix domain socket could not be changed during
- reconfiguration.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.8.39 31 May 2010
-
- *) Bugfix: an inherited "alias" directive worked incorrectly in
- inclusive location.
-
- *) Bugfix: in "alias" with variables and "try_files" directives
- combination.
-
- *) Bugfix: listen unix domain and IPv6 sockets did not inherit while
- online upgrade.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.8.38 24 May 2010
-
- *) Feature: the "proxy_no_cache" and "fastcgi_no_cache" directives.
-
- *) Feature: now the "rewrite" directive does a redirect automatically if
- the $scheme variable is used.
- Thanks to Piotr Sikora.
-
- *) Bugfix: now "limit_req" delay directive conforms to the described
- algorithm.
- Thanks to Maxim Dounin.
-
- *) Bugfix: the $uid_got variable might not be used in the SSI and perl
- modules.
-
-
-Changes with nginx 0.8.37 17 May 2010
-
- *) Feature: the ngx_http_split_clients_module.
-
- *) Feature: the "map" directive supports keys more than 255 characters.
-
- *) Bugfix: nginx ignored the "private" and "no-store" values in the
- "Cache-Control" backend response header line.
-
- *) Bugfix: a "stub" parameter of an "include" SSI directive was not
- used, if empty response has 200 status code.
-
- *) Bugfix: if a proxied or FastCGI request was internally redirected to
- another proxied or FastCGI location, then a segmentation fault might
- occur in a worker process; the bug had appeared in 0.8.33.
- Thanks to Yichun Zhang.
-
- *) Bugfix: IMAP connections may hang until they timed out while talking
- to Zimbra server.
- Thanks to Alan Batie.
-
-
-Changes with nginx 0.8.36 22 Apr 2010
-
- *) Bugfix: the ngx_http_dav_module handled incorrectly the DELETE, COPY,
- and MOVE methods for symlinks.
-
- *) Bugfix: values of the $query_string, $arg_..., etc. variables cached
- in main request were used by the SSI module in subrequests.
-
- *) Bugfix: a variable value was repeatedly encoded after each an "echo"
- SSI-command output; the bug had appeared in 0.6.14.
-
- *) Bugfix: a worker process hung if a FIFO file was requested.
- Thanks to Vicente Aguilar and Maxim Dounin.
-
- *) Bugfix: OpenSSL-1.0.0 compatibility on 64-bit Linux.
- Thanks to Maxim Dounin.
-
- *) Bugfix: nginx could not be built --without-http-cache; the bug had
- appeared in 0.8.35.
-
-
-Changes with nginx 0.8.35 01 Apr 2010
-
- *) Change: now the charset filter runs before the SSI filter.
-
- *) Feature: the "chunked_transfer_encoding" directive.
-
- *) Bugfix: an "&" character was not escaped when it was copied in
- arguments part in a rewrite rule.
-
- *) Bugfix: nginx might be terminated abnormally while a signal
- processing or if the directive "timer_resolution" was used on
- platforms which do not support kqueue or eventport notification
- methods.
- Thanks to George Xie and Maxim Dounin.
-
- *) Bugfix: if temporary files and permanent storage area resided at
- different file systems, then permanent file modification times were
- incorrect.
- Thanks to Maxim Dounin.
-
- *) Bugfix: ngx_http_memcached_module might issue the error message
- "memcached sent invalid trailer".
- Thanks to Maxim Dounin.
-
- *) Bugfix: nginx could not built zlib-1.2.4 library using the library
- sources.
- Thanks to Maxim Dounin.
-
- *) Bugfix: a segmentation fault occurred in a worker process, if there
- was large stderr output before FastCGI response; the bug had appeared
- in 0.8.34.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.8.34 03 Mar 2010
-
- *) Bugfix: nginx did not support all ciphers and digests used in client
- certificates.
- Thanks to Innocenty Enikeew.
-
- *) Bugfix: nginx cached incorrectly FastCGI responses if there was large
- stderr output before response.
-
- *) Bugfix: nginx did not support HTTPS referrers.
-
- *) Bugfix: nginx/Windows might not find file if path in configuration
- was given in other character case; the bug had appeared in 0.8.33.
-
- *) Bugfix: the $date_local variable has an incorrect value, if the "%s"
- format was used.
- Thanks to Maxim Dounin.
-
- *) Bugfix: if ssl_session_cache was not set or was set to "none", then
- during client certificate verify the error "session id context
- uninitialized" might occur; the bug had appeared in 0.7.1.
-
- *) Bugfix: a geo range returned default value if the range included two
- or more /16 networks and did not begin at /16 network boundary.
-
- *) Bugfix: a block used in a "stub" parameter of an "include" SSI
- directive was output with "text/plain" MIME type.
-
- *) Bugfix: $r->sleep() did not work; the bug had appeared in 0.8.11.
-
-
-Changes with nginx 0.8.33 01 Feb 2010
-
- *) Security: now nginx/Windows ignores trailing spaces in URI.
- Thanks to Dan Crowley, Core Security Technologies.
-
- *) Security: now nginx/Windows ignores short files names.
- Thanks to Dan Crowley, Core Security Technologies.
-
- *) Change: now keepalive connections after POST requests are not
- disabled for MSIE 7.0+.
- Thanks to Adam Lounds.
-
- *) Workaround: now keepalive connections are disabled for Safari.
- Thanks to Joshua Sierles.
-
- *) Bugfix: if a proxied or FastCGI request was internally redirected to
- another proxied or FastCGI location, then $upstream_response_time
- variable may have abnormally large value; the bug had appeared in
- 0.8.7.
-
- *) Bugfix: a segmentation fault might occur in a worker process, while
- discarding a request body; the bug had appeared in 0.8.11.
-
-
-Changes with nginx 0.8.32 11 Jan 2010
-
- *) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module.
- Thanks to Maxim Dounin.
-
- *) Bugfix: regular expression named captures worked for two names only.
- Thanks to Maxim Dounin.
-
- *) Bugfix: now the "localhost" name is used in the "Host" request header
- line, if an unix domain socket is defined in the "auth_http"
- directive.
- Thanks to Maxim Dounin.
-
- *) Bugfix: nginx did not support chunked transfer encoding for 201
- responses.
- Thanks to Julian Reich.
-
- *) Bugfix: if the "expires modified" set date in the past, then a
- negative number was set in the "Cache-Control" response header line.
- Thanks to Alex Kapranoff.
-
-
-Changes with nginx 0.8.31 23 Dec 2009
-
- *) Feature: now the "error_page" directive may redirect the 301 and 302
- responses.
-
- *) Feature: the $geoip_city_continent_code, $geoip_latitude, and
- $geoip_longitude variables.
- Thanks to Arvind Sundararajan.
-
- *) Feature: now the ngx_http_image_filter_module deletes always EXIF and
- other application specific data if the data consume more than 5% of a
- JPEG file.
-
- *) Bugfix: nginx closed a connection if a cached response had an empty
- body.
- Thanks to Piotr Sikora.
-
- *) Bugfix: nginx might not be built by gcc 4.x if the -O2 or higher
- optimization option was used.
- Thanks to Maxim Dounin and Denis F. Latypoff.
-
- *) Bugfix: regular expressions in location were always tested in
- case-sensitive mode; the bug had appeared in 0.8.25.
-
- *) Bugfix: nginx cached a 304 response if there was the "If-None-Match"
- header line in a proxied request.
- Thanks to Tim Dettrick and David Kostal.
-
- *) Bugfix: nginx/Windows tried to delete a temporary file twice if the
- file should replace an already existent file.
-
-
-Changes with nginx 0.8.30 15 Dec 2009
-
- *) Change: now the default buffer size of the
- "large_client_header_buffers" directive is 8K.
- Thanks to Andrew Cholakian.
-
- *) Feature: the conf/fastcgi.conf for simple FastCGI configurations.
-
- *) Bugfix: nginx/Windows tried to rename a temporary file twice if the
- file should replace an already existent file.
-
- *) Bugfix: of "double free or corruption" error issued if host could not
- be resolved; the bug had appeared in 0.8.22.
- Thanks to Konstantin Svist.
-
- *) Bugfix: in libatomic usage on some platforms.
- Thanks to W-Mark Kubacki.
-
-
-Changes with nginx 0.8.29 30 Nov 2009
-
- *) Change: now the "009" status code is written to an access log for
- proxied HTTP/0.9 responses.
-
- *) Feature: the "addition_types", "charset_types", "gzip_types",
- "ssi_types", "sub_filter_types", and "xslt_types" directives support
- an "*" parameter.
-
- *) Feature: GCC 4.1+ built-in atomic operations usage.
- Thanks to W-Mark Kubacki.
-
- *) Feature: the --with-libatomic[=DIR] option in the configure.
- Thanks to W-Mark Kubacki.
-
- *) Bugfix: listen unix domain socket had limited access rights.
-
- *) Bugfix: cached HTTP/0.9 responses were handled incorrectly.
-
- *) Bugfix: regular expression named captures given by "?P<...>" did not
- work in a "server_name" directive.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.8.28 23 Nov 2009
-
- *) Bugfix: nginx could not be built with the --without-pcre parameter;
- the bug had appeared in 0.8.25.
-
-
-Changes with nginx 0.8.27 17 Nov 2009
-
- *) Bugfix: regular expressions did not work in nginx/Windows; the bug
- had appeared in 0.8.25.
-
-
-Changes with nginx 0.8.26 16 Nov 2009
-
- *) Bugfix: in captures usage in "rewrite" directive; the bug had
- appeared in 0.8.25.
-
- *) Bugfix: nginx could not be built without the --with-debug option; the
- bug had appeared in 0.8.25.
-
-
-Changes with nginx 0.8.25 16 Nov 2009
-
- *) Change: now no message is written in an error log if a variable is
- not found by $r->variable() method.
-
- *) Feature: the ngx_http_degradation_module.
-
- *) Feature: regular expression named captures.
-
- *) Feature: now URI part is not required a "proxy_pass" directive if
- variables are used.
-
- *) Feature: now the "msie_padding" directive works for Chrome too.
-
- *) Bugfix: a segmentation fault occurred in a worker process on low
- memory condition; the bug had appeared in 0.8.18.
-
- *) Bugfix: nginx sent gzipped responses to clients those do not support
- gzip, if "gzip_static on" and "gzip_vary off"; the bug had appeared
- in 0.8.16.
-
-
-Changes with nginx 0.8.24 11 Nov 2009
-
- *) Bugfix: nginx always added "Content-Encoding: gzip" response header
- line in 304 responses sent by ngx_http_gzip_static_module.
-
- *) Bugfix: nginx could not be built without the --with-debug option; the
- bug had appeared in 0.8.23.
-
- *) Bugfix: the "unix:" parameter of the "set_real_ip_from" directive
- inherited incorrectly from previous level.
-
- *) Bugfix: in resolving empty name.
-
-
-Changes with nginx 0.8.23 11 Nov 2009
-
- *) Security: now SSL/TLS renegotiation is disabled.
- Thanks to Maxim Dounin.
-
- *) Bugfix: listen unix domain socket did not inherit while online
- upgrade.
-
- *) Bugfix: the "unix:" parameter of the "set_real_ip_from" directive did
- not without yet another directive with any IP address.
-
- *) Bugfix: segmentation fault and infinite looping in resolver.
-
- *) Bugfix: in resolver.
- Thanks to Artem Bokhan.
-
-
-Changes with nginx 0.8.22 03 Nov 2009
-
- *) Feature: the "proxy_bind", "fastcgi_bind", and "memcached_bind"
- directives.
-
- *) Feature: the "access" and the "deny" directives support IPv6.
-
- *) Feature: the "set_real_ip_from" directive supports IPv6 addresses in
- request headers.
-
- *) Feature: the "unix:" parameter of the "set_real_ip_from" directive.
-
- *) Bugfix: nginx did not delete unix domain socket after configuration
- testing.
-
- *) Bugfix: nginx deleted unix domain socket while online upgrade.
-
- *) Bugfix: the "!-x" operator did not work.
- Thanks to Maxim Dounin.
-
- *) Bugfix: a segmentation fault might occur in a worker process, if
- limit_rate was used in HTTPS server.
- Thanks to Maxim Dounin.
-
- *) Bugfix: a segmentation fault might occur in a worker process while
- $limit_rate logging.
- Thanks to Maxim Dounin.
-
- *) Bugfix: a segmentation fault might occur in a worker process, if
- there was no "listen" directive in "server" block; the bug had
- appeared in 0.8.21.
-
-
-Changes with nginx 0.8.21 26 Oct 2009
-
- *) Feature: now the "-V" switch shows TLS SNI support.
-
- *) Feature: the "listen" directive of the HTTP module supports unix
- domain sockets.
- Thanks to Hongli Lai.
-
- *) Feature: the "default_server" parameter of the "listen" directive.
-
- *) Feature: now a "default" parameter is not required to set listen
- socket options.
-
- *) Bugfix: nginx did not support dates in 2038 year on 32-bit platforms;
-
- *) Bugfix: socket leak; the bug had appeared in 0.8.11.
-
-
-Changes with nginx 0.8.20 14 Oct 2009
-
- *) Change: now default SSL ciphers are "HIGH:!ADH:!MD5".
-
- *) Bugfix: the ngx_http_autoindex_module did not show the trailing slash
- in links to a directory; the bug had appeared in 0.7.15.
-
- *) Bugfix: nginx did not close a log file set by the --error-log-path
- configuration option; the bug had appeared in 0.7.53.
-
- *) Bugfix: nginx did not treat a comma as separator in the
- "Cache-Control" backend response header line.
-
- *) Bugfix: nginx/Windows might not create temporary file, a cache file,
- or "proxy/fastcgi_store"d file if a worker had no enough access
- rights for top level directories.
-
- *) Bugfix: the "Set-Cookie" and "P3P" FastCGI response header lines were
- not hidden while caching if no "fastcgi_hide_header" directives were
- used with any parameters.
-
- *) Bugfix: nginx counted incorrectly disk cache size.
-
-
-Changes with nginx 0.8.19 06 Oct 2009
-
- *) Change: now SSLv2 protocol is disabled by default.
-
- *) Change: now default SSL ciphers are "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM".
-
- *) Bugfix: a "limit_req" directive did not work; the bug had appeared in
- 0.8.18.
-
-
-Changes with nginx 0.8.18 06 Oct 2009
-
- *) Feature: the "read_ahead" directive.
-
- *) Feature: now several "perl_modules" directives may be used.
-
- *) Feature: the "limit_req_log_level" and "limit_conn_log_level"
- directives.
-
- *) Bugfix: now "limit_req" directive conforms to the leaky bucket
- algorithm.
- Thanks to Maxim Dounin.
-
- *) Bugfix: nginx did not work on Linux/sparc.
- Thanks to Marcus Ramberg.
-
- *) Bugfix: nginx sent '\0' in a "Location" response header line on MKCOL
- request.
- Thanks to Xie Zhenye.
-
- *) Bugfix: zero status code was logged instead of 499 status code; the
- bug had appeared in 0.8.11.
-
- *) Bugfix: socket leak; the bug had appeared in 0.8.11.
-
-
-Changes with nginx 0.8.17 28 Sep 2009
-
- *) Security: now "/../" are disabled in "Destination" request header
- line.
-
- *) Change: now $host variable value is always low case.
-
- *) Feature: the $ssl_session_id variable.
-
- *) Bugfix: socket leak; the bug had appeared in 0.8.11.
-
-
-Changes with nginx 0.8.16 22 Sep 2009
-
- *) Feature: the "image_filter_transparency" directive.
-
- *) Bugfix: "addition_types" directive was incorrectly named
- "addtion_types".
-
- *) Bugfix: resolver cache poisoning.
- Thanks to Matthew Dempsky.
-
- *) Bugfix: memory leak in resolver.
- Thanks to Matthew Dempsky.
-
- *) Bugfix: invalid request line in $request variable was written in
- access_log only if error_log was set to "info" or "debug" level.
-
- *) Bugfix: in PNG alpha-channel support in the
- ngx_http_image_filter_module.
-
- *) Bugfix: nginx always added "Vary: Accept-Encoding" response header
- line, if both "gzip_static" and "gzip_vary" were on.
-
- *) Bugfix: in UTF-8 encoding support by "try_files" directive in
- nginx/Windows.
-
- *) Bugfix: in "post_action" directive usage; the bug had appeared in
- 0.8.11.
- Thanks to Igor Artemiev.
-
-
-Changes with nginx 0.8.15 14 Sep 2009
-
- *) Security: a segmentation fault might occur in worker process while
- specially crafted request handling.
- Thanks to Chris Ries.
-
- *) Bugfix: if names .domain.tld, .sub.domain.tld, and .domain-some.tld
- were defined, then the name .sub.domain.tld was matched by
- .domain.tld.
-
- *) Bugfix: in transparency support in the ngx_http_image_filter_module.
-
- *) Bugfix: in file AIO.
-
- *) Bugfix: in X-Accel-Redirect usage; the bug had appeared in 0.8.11.
-
- *) Bugfix: in embedded perl module; the bug had appeared in 0.8.11.
-
-
-Changes with nginx 0.8.14 07 Sep 2009
-
- *) Bugfix: an expired cached response might stick in the "UPDATING"
- state.
-
- *) Bugfix: a segmentation fault might occur in worker process, if
- error_log was set to info or debug level.
- Thanks to Sergey Bochenkov.
-
- *) Bugfix: in embedded perl module; the bug had appeared in 0.8.11.
-
- *) Bugfix: an "error_page" directive did not redirect a 413 error; the
- bug had appeared in 0.6.10.
-
-
-Changes with nginx 0.8.13 31 Aug 2009
-
- *) Bugfix: in the "aio sendfile" directive; the bug had appeared in
- 0.8.12.
-
- *) Bugfix: nginx could not be built without the --with-file-aio option
- on FreeBSD; the bug had appeared in 0.8.12.
-
-
-Changes with nginx 0.8.12 31 Aug 2009
-
- *) Feature: the "sendfile" parameter in the "aio" directive on FreeBSD.
-
- *) Bugfix: in try_files; the bug had appeared in 0.8.11.
-
- *) Bugfix: in memcached; the bug had appeared in 0.8.11.
-
-
-Changes with nginx 0.8.11 28 Aug 2009
-
- *) Change: now directive "gzip_disable msie6" does not disable gzipping
- for MSIE 6.0 SV1.
-
- *) Feature: file AIO support on FreeBSD and Linux.
-
- *) Feature: the "directio_alignment" directive.
-
-
-Changes with nginx 0.8.10 24 Aug 2009
-
- *) Bugfix: memory leaks if GeoIP City database was used.
-
- *) Bugfix: in copying temporary files to permanent storage area; the bug
- had appeared in 0.8.9.
-
-
-Changes with nginx 0.8.9 17 Aug 2009
-
- *) Feature: now the start cache loader runs in a separate process; this
- should improve large caches handling.
-
- *) Feature: now temporary files and permanent storage area may reside at
- different file systems.
-
-
-Changes with nginx 0.8.8 10 Aug 2009
-
- *) Bugfix: in handling FastCGI headers split in records.
-
- *) Bugfix: a segmentation fault occurred in worker process, if a request
- was handled in two proxied or FastCGIed locations and a caching was
- enabled in the first location; the bug had appeared in 0.8.7.
-
-
-Changes with nginx 0.8.7 27 Jul 2009
-
- *) Change: minimum supported OpenSSL version is 0.9.7.
-
- *) Change: the "ask" parameter of the "ssl_verify_client" directive was
- changed to the "optional" parameter and now it checks a client
- certificate if it was offered.
- Thanks to Brice Figureau.
-
- *) Feature: the $ssl_client_verify variable.
- Thanks to Brice Figureau.
-
- *) Feature: the "ssl_crl" directive.
- Thanks to Brice Figureau.
-
- *) Feature: the "proxy" parameter of the "geo" directive.
-
- *) Feature: the "image_filter" directive supports variables for setting
- size.
-
- *) Bugfix: the $ssl_client_cert variable usage corrupted memory; the bug
- had appeared in 0.7.7.
- Thanks to Sergey Zhuravlev.
-
- *) Bugfix: "proxy_pass_header" and "fastcgi_pass_header" directives did
- not pass to a client the "X-Accel-Redirect", "X-Accel-Limit-Rate",
- "X-Accel-Buffering", and "X-Accel-Charset" lines from backend
- response header.
- Thanks to Maxim Dounin.
-
- *) Bugfix: in handling "Last-Modified" and "Accept-Ranges" backend
- response header lines; the bug had appeared in 0.7.44.
- Thanks to Maxim Dounin.
-
- *) Bugfix: the "[alert] zero size buf" error if subrequest returns an
- empty response; the bug had appeared in 0.8.5.
-
-
-Changes with nginx 0.8.6 20 Jul 2009
-
- *) Feature: the ngx_http_geoip_module.
-
- *) Bugfix: XSLT filter may fail with message "not well formed XML
- document" for valid XML document.
- Thanks to Kuramoto Eiji.
-
- *) Bugfix: now in MacOSX, Cygwin, and nginx/Windows locations given by a
- regular expression are always tested in case insensitive mode.
-
- *) Bugfix: now nginx/Windows ignores trailing dots in URI.
- Thanks to Hugo Leisink.
-
- *) Bugfix: name of file specified in --conf-path was not honored during
- installation; the bug had appeared in 0.6.6.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.8.5 13 Jul 2009
-
- *) Bugfix: now nginx allows underscores in a request method.
-
- *) Bugfix: a 500 error code was returned for invalid login/password
- while HTTP Basic authentication on Windows.
-
- *) Bugfix: ngx_http_perl_module responses did not work in subrequests.
-
- *) Bugfix: in ngx_http_limit_req_module.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.8.4 22 Jun 2009
-
- *) Bugfix: nginx could not be built --without-http-cache; the bug had
- appeared in 0.8.3.
-
-
-Changes with nginx 0.8.3 19 Jun 2009
-
- *) Feature: the $upstream_cache_status variable.
-
- *) Bugfix: nginx could not be built on MacOSX 10.6.
-
- *) Bugfix: nginx could not be built --without-http-cache; the bug had
- appeared in 0.8.2.
-
- *) Bugfix: a segmentation fault occurred in worker process, if a backend
- 401 error was intercepted and the backend did not set the
- "WWW-Authenticate" response header line.
- Thanks to Eugene Mychlo.
-
-
-Changes with nginx 0.8.2 15 Jun 2009
-
- *) Bugfix: in open_file_cache and proxy/fastcgi cache interaction on
- start up.
-
- *) Bugfix: open_file_cache might cache open file descriptors too long;
- the bug had appeared in 0.7.4.
-
-
-Changes with nginx 0.8.1 08 Jun 2009
-
- *) Feature: the "updating" parameter in "proxy_cache_use_stale" and
- "fastcgi_cache_use_stale" directives.
-
- *) Bugfix: the "If-Modified-Since", "If-Range", etc. client request
- header lines were passed to backend while caching if no
- "proxy_set_header" directive was used with any parameters.
-
- *) Bugfix: the "Set-Cookie" and "P3P" response header lines were not
- hidden while caching if no "proxy_hide_header/fastcgi_hide_header"
- directives were used with any parameters.
-
- *) Bugfix: the ngx_http_image_filter_module did not support GIF87a
- format.
- Thanks to Denis Ilyinyh.
-
- *) Bugfix: nginx could not be built modules on Solaris 10 and early; the
- bug had appeared in 0.7.56.
-
-
-Changes with nginx 0.8.0 02 Jun 2009
-
- *) Feature: the "keepalive_requests" directive.
-
- *) Feature: the "limit_rate_after" directive.
- Thanks to Ivan Debnar.
-
- *) Bugfix: XLST filter did not work in subrequests.
-
- *) Bugfix: in relative paths handling in nginx/Windows.
-
- *) Bugfix: in proxy_store, fastcgi_store, proxy_cache, and fastcgi_cache
- in nginx/Windows.
-
- *) Bugfix: in memory allocation error handling.
- Thanks to Maxim Dounin and Kirill A. Korinskiy.
-
-
-Changes with nginx 0.7.59 25 May 2009
-
- *) Feature: the "proxy_cache_methods" and "fastcgi_cache_methods"
- directives.
-
- *) Bugfix: socket leak; the bug had appeared in 0.7.25.
- Thanks to Maxim Dounin.
-
- *) Bugfix: a segmentation fault occurred in worker process, if a request
- had no body and the $request_body variable was used;
- the bug had appeared in 0.7.58.
-
- *) Bugfix: the SSL modules might not built on Solaris and Linux;
- the bug had appeared in 0.7.56.
-
- *) Bugfix: ngx_http_xslt_filter_module responses were not handled by
- SSI, charset, and gzip filters.
-
- *) Bugfix: a "charset" directive did not set a charset to
- ngx_http_gzip_static_module responses.
-
-
-Changes with nginx 0.7.58 18 May 2009
-
- *) Feature: a "listen" directive of the mail proxy module supports IPv6.
-
- *) Feature: the "image_filter_jpeg_quality" directive.
-
- *) Feature: the "client_body_in_single_buffer" directive.
-
- *) Feature: the $request_body variable.
-
- *) Bugfix: in ngx_http_autoindex_module in file name links having a ":"
- symbol in the name.
-
- *) Bugfix: "make upgrade" procedure did not work; the bug had appeared
- in 0.7.53.
- Thanks to Denis F. Latypoff.
-
-
-Changes with nginx 0.7.57 12 May 2009
-
- *) Bugfix: a floating-point fault occurred in worker process, if the
- ngx_http_image_filter_module errors were redirected to named
- location; the bug had appeared in 0.7.56.
-
-
-Changes with nginx 0.7.56 11 May 2009
-
- *) Feature: nginx/Windows supports IPv6 in a "listen" directive of the
- HTTP module.
-
- *) Bugfix: in ngx_http_image_filter_module.
-
-
-Changes with nginx 0.7.55 06 May 2009
-
- *) Bugfix: the http_XXX parameters in "proxy_cache_use_stale" and
- "fastcgi_cache_use_stale" directives did not work.
-
- *) Bugfix: fastcgi cache did not cache header only responses.
-
- *) Bugfix: of "select() failed (9: Bad file descriptor)" error in
- nginx/Unix and "select() failed (10038: ...)" error in nginx/Windows.
-
- *) Bugfix: a segmentation fault might occur in worker process, if an
- "debug_connection" directive was used; the bug had appeared in
- 0.7.54.
-
- *) Bugfix: fix ngx_http_image_filter_module building errors.
-
- *) Bugfix: the files bigger than 2G could not be transferred using
- $r->sendfile.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.7.54 01 May 2009
-
- *) Feature: the ngx_http_image_filter_module.
-
- *) Feature: the "proxy_ignore_headers" and "fastcgi_ignore_headers"
- directives.
-
- *) Bugfix: a segmentation fault might occur in worker process, if an
- "open_file_cache_errors off" directive was used; the bug had appeared
- in 0.7.53.
-
- *) Bugfix: the "port_in_redirect off" directive did not work; the bug
- had appeared in 0.7.39.
-
- *) Bugfix: improve handling of "select" method errors.
-
- *) Bugfix: of "select() failed (10022: ...)" error in nginx/Windows.
-
- *) Bugfix: in error text descriptions in nginx/Windows; the bug had
- appeared in 0.7.53.
-
-
-Changes with nginx 0.7.53 27 Apr 2009
-
- *) Change: now a log set by --error-log-path is created from the very
- start-up.
-
- *) Feature: now the start up errors and warnings are outputted to an
- error_log and stderr.
-
- *) Feature: the empty --prefix= configure parameter forces nginx to use
- a directory where it was run as prefix.
-
- *) Feature: the -p switch.
-
- *) Feature: the -s switch on Unix platforms.
-
- *) Feature: the -? and -h switches.
- Thanks to Jerome Loyet.
-
- *) Feature: now switches may be set in condensed form.
-
- *) Bugfix: nginx/Windows did not work if configuration file was given by
- the -c switch.
-
- *) Bugfix: temporary files might be not removed if the "proxy_store",
- "fastcgi_store", "proxy_cache", or "fastcgi_cache" were used.
- Thanks to Maxim Dounin.
-
- *) Bugfix: an incorrect value was passed to mail proxy authentication
- server in "Auth-Method" header line; the bug had appeared
- in 0.7.34.
- Thanks to Simon Lecaille.
-
- *) Bugfix: system error text descriptions were not logged on Linux;
- the bug had appeared in 0.7.45.
-
- *) Bugfix: the "fastcgi_cache_min_uses" directive did not work.
- Thanks to Andrew Vorobyoff.
-
-
-Changes with nginx 0.7.52 20 Apr 2009
-
- *) Feature: the first native Windows binary release.
-
- *) Bugfix: in processing HEAD method while caching.
-
- *) Bugfix: in processing the "If-Modified-Since", "If-Range", etc.
- client request header lines while caching.
-
- *) Bugfix: now the "Set-Cookie" and "P3P" header lines are hidden in
- cacheable responses.
-
- *) Bugfix: if nginx was built with the ngx_http_perl_module and with a
- perl which supports threads, then during a master process exit the
- message "panic: MUTEX_LOCK" might be issued.
-
- *) Bugfix: nginx could not be built --without-http-cache; the bug had
- appeared in 0.7.48.
-
- *) Bugfix: nginx could not be built on platforms different from i386,
- amd64, sparc, and ppc; the bug had appeared in 0.7.42.
-
-
-Changes with nginx 0.7.51 12 Apr 2009
-
- *) Feature: the "try_files" directive supports a response code in the
- fallback parameter.
-
- *) Feature: now any response code can be used in the "return" directive.
-
- *) Bugfix: the "error_page" directive made an external redirect without
- query string; the bug had appeared in 0.7.44.
-
- *) Bugfix: if servers listened on several defined explicitly addresses,
- then virtual servers might not work; the bug had appeared in 0.7.39.
-
-
-Changes with nginx 0.7.50 06 Apr 2009
-
- *) Bugfix: the $arg_... variables did not work; the bug had appeared in
- 0.7.49.
-
-
-Changes with nginx 0.7.49 06 Apr 2009
-
- *) Bugfix: a segmentation fault might occur in worker process, if the
- $arg_... variables were used; the bug had appeared in 0.7.48.
-
-
-Changes with nginx 0.7.48 06 Apr 2009
-
- *) Feature: the "proxy_cache_key" directive.
-
- *) Bugfix: now nginx takes into account the "X-Accel-Expires",
- "Expires", and "Cache-Control" header lines in a backend response.
-
- *) Bugfix: now nginx caches responses for the GET requests only.
-
- *) Bugfix: the "fastcgi_cache_key" directive was not inherited.
-
- *) Bugfix: the $arg_... variables did not work with SSI subrequests.
- Thanks to Maxim Dounin.
-
- *) Bugfix: nginx could not be built with uclibc library.
- Thanks to Timothy Redaelli.
-
- *) Bugfix: nginx could not be built on OpenBSD; the bug had
- appeared in 0.7.46.
-
-
-Changes with nginx 0.7.47 01 Apr 2009
-
- *) Bugfix: nginx could not be built on FreeBSD 6 and early versions; the
- bug had appeared in 0.7.46.
-
- *) Bugfix: nginx could not be built on MacOSX; the bug had
- appeared in 0.7.46.
-
- *) Bugfix: if the "max_size" parameter was set, then the cache manager
- might purge a whole cache; the bug had appeared in 0.7.46.
-
- *) Change: a segmentation fault might occur in worker process, if the
- "proxy_cache"/"fastcgi_cache" and the "proxy_cache_valid"/
- "fastcgi_cache_valid" were set on different levels; the bug had
- appeared in 0.7.46.
-
- *) Bugfix: a segmentation fault might occur in worker process, if a
- request was redirected to a proxied or FastCGI server via error_page
- or try_files; the bug had appeared in 0.7.44.
-
-
-Changes with nginx 0.7.46 30 Mar 2009
-
- *) Bugfix: the previous release tarball was incorrect.
-
-
-Changes with nginx 0.7.45 30 Mar 2009
-
- *) Change: now the "proxy_cache" and the "proxy_cache_valid" directives
- can be set on different levels.
-
- *) Change: the "clean_time" parameter of the "proxy_cache_path"
- directive is canceled.
-
- *) Feature: the "max_size" parameter of the "proxy_cache_path"
- directive.
-
- *) Feature: the ngx_http_fastcgi_module preliminary cache support.
-
- *) Feature: now on shared memory allocation errors directive and zone
- names are logged.
-
- *) Bugfix: the directive "add_header last-modified ''" did not delete a
- "Last-Modified" response header line; the bug had appeared in 0.7.44.
-
- *) Bugfix: a relative path in the "auth_basic_user_file" directive given
- without variables did not work; the bug had appeared in 0.7.44.
- Thanks to Jerome Loyet.
-
- *) Bugfix: in an "alias" directive given using variables without
- references to captures of regular expressions; the bug had appeared
- in 0.7.42.
-
-
-Changes with nginx 0.7.44 23 Mar 2009
-
- *) Feature: the ngx_http_proxy_module preliminary cache support.
-
- *) Feature: the --with-pcre option in the configure.
-
- *) Feature: the "try_files" directive is now allowed on the server block
- level.
-
- *) Bugfix: the "try_files" directive handled incorrectly a query string
- in a fallback parameter.
-
- *) Bugfix: the "try_files" directive might test incorrectly directories.
-
- *) Bugfix: if there was a single server for given address:port pair,
- then captures in regular expressions in a "server_name" directive did
- not work.
-
-
-Changes with nginx 0.7.43 18 Mar 2009
-
- *) Bugfix: a request was handled incorrectly, if a "root" directive used
- variables; the bug had appeared in 0.7.42.
-
- *) Bugfix: if a server listened on wildcard address, then the
- $server_addr variable value was "0.0.0.0"; the bug had appeared in
- 0.7.36.
-
-
-Changes with nginx 0.7.42 16 Mar 2009
-
- *) Change: now the "Invalid argument" error returned by
- setsockopt(TCP_NODELAY) on Solaris, is ignored.
-
- *) Change: now if a file specified in a "auth_basic_user_file" directive
- is absent, then the 403 error is returned instead of the 500 one.
-
- *) Feature: the "auth_basic_user_file" directive supports variables.
- Thanks to Kirill A. Korinskiy.
-
- *) Feature: the "listen" directive supports the "ipv6only" parameter.
- Thanks to Zhang Hua.
-
- *) Bugfix: in an "alias" directive with references to captures of
- regular expressions; the bug had appeared in 0.7.40.
-
- *) Bugfix: compatibility with Tru64 UNIX.
- Thanks to Dustin Marquess.
-
- *) Bugfix: nginx could not be built without PCRE library; the bug had
- appeared in 0.7.41.
-
-
-Changes with nginx 0.7.41 11 Mar 2009
-
- *) Bugfix: a segmentation fault might occur in worker process, if a
- "server_name" or a "location" directives had captures in regular
- expressions; the issue had appeared in 0.7.40.
- Thanks to Vladimir Sopot.
-
-
-Changes with nginx 0.7.40 09 Mar 2009
-
- *) Feature: the "location" directive supports captures in regular
- expressions.
-
- *) Feature: an "alias" directive with capture references may be used
- inside a location given by a regular expression with captures.
-
- *) Feature: the "server_name" directive supports captures in regular
- expressions.
-
- *) Workaround: the ngx_http_autoindex_module did not show the trailing
- slash in directories on XFS filesystem; the issue had appeared in
- 0.7.15.
- Thanks to Dmitry Kuzmenko.
-
-
-Changes with nginx 0.7.39 02 Mar 2009
-
- *) Bugfix: large response with SSI might hang, if gzipping was enabled;
- the bug had appeared in 0.7.28.
- Thanks to Artem Bokhan.
-
- *) Bugfix: a segmentation fault might occur in worker process, if short
- static variants are used in a "try_files" directive.
-
-
-Changes with nginx 0.7.38 23 Feb 2009
-
- *) Feature: authentication failures logging.
-
- *) Bugfix: name/password in auth_basic_user_file were ignored after odd
- number of empty lines.
- Thanks to Alexander Zagrebin.
-
- *) Bugfix: a segmentation fault occurred in a master process, if long
- path was used in unix domain socket; the bug had appeared in 0.7.36.
-
-
-Changes with nginx 0.7.37 21 Feb 2009
-
- *) Bugfix: directives using upstreams did not work; the bug had appeared
- in 0.7.36.
-
-
-Changes with nginx 0.7.36 21 Feb 2009
-
- *) Feature: a preliminary IPv6 support; the "listen" directive of the
- HTTP module supports IPv6.
-
- *) Bugfix: the $ancient_browser variable did not work for browsers
- preset by a "modern_browser" directives.
-
-
-Changes with nginx 0.7.35 16 Feb 2009
-
- *) Bugfix: a "ssl_engine" directive did not use a SSL-accelerator for
- asymmetric ciphers.
- Thanks to Marcin Gozdalik.
-
- *) Bugfix: a "try_files" directive set MIME type depending on an
- original request extension.
-
- *) Bugfix: "*domain.tld" names were handled incorrectly in
- "server_name", "valid_referers", and "map" directives, if
- ".domain.tld" and ".subdomain.domain.tld" wildcards were used;
- the bug had appeared in 0.7.9.
-
-
-Changes with nginx 0.7.34 10 Feb 2009
-
- *) Feature: the "off" parameter of the "if_modified_since" directive.
-
- *) Feature: now nginx sends an HELO/EHLO command after a XCLIENT
- command.
- Thanks to Maxim Dounin.
-
- *) Feature: Microsoft specific "AUTH LOGIN with User Name" mode support
- in mail proxy server.
- Thanks to Maxim Dounin.
-
- *) Bugfix: in a redirect rewrite directive original arguments were
- concatenated with new arguments by a "?" rather than an "&";
- the bug had appeared in 0.1.18.
- Thanks to Maxim Dounin.
-
- *) Bugfix: nginx could not be built on AIX.
-
-
-Changes with nginx 0.7.33 02 Feb 2009
-
- *) Bugfix: a double response might be returned if the epoll or rtsig
- methods are used and a redirect was returned to a request with body.
- Thanks to Eden Li.
-
- *) Bugfix: the $sent_http_location variable was empty for some redirects
- types.
-
- *) Bugfix: a segmentation fault might occur in worker process if
- "resolver" directive was used in SMTP proxy.
-
-
-Changes with nginx 0.7.32 26 Jan 2009
-
- *) Feature: now a directory existence testing can be set explicitly in
- the "try_files" directive.
-
- *) Bugfix: fastcgi_store stored files not always.
-
- *) Bugfix: in geo ranges.
-
- *) Bugfix: in shared memory allocations if nginx was built without
- debugging.
- Thanks to Andrey Kvasov.
-
-
-Changes with nginx 0.7.31 19 Jan 2009
-
- *) Change: now the "try_files" directive tests files only and ignores
- directories.
-
- *) Feature: the "fastcgi_split_path_info" directive.
-
- *) Bugfixes in an "Expect" request header line support.
-
- *) Bugfixes in geo ranges.
-
- *) Bugfix: in a miss case ngx_http_memcached_module returned the "END"
- line as response body instead of default 404 page body; the bug had
- appeared in 0.7.18.
- Thanks to Maxim Dounin.
-
- *) Bugfix: while SMTP proxying nginx issued message "250 2.0.0 OK"
- instead of "235 2.0.0 OK"; the bug had appeared in 0.7.22.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.7.30 24 Dec 2008
-
- *) Bugfix: a segmentation fault occurred in worker process, if variables
- were used in the "fastcgi_pass" or "proxy_pass" directives and host
- name must be resolved; the bug had appeared in 0.7.29.
-
-
-Changes with nginx 0.7.29 24 Dec 2008
-
- *) Bugfix: the "fastcgi_pass" and "proxy_pass" directives did not
- support variables if unix domain sockets were used.
-
- *) Bugfixes in subrequest processing; the bugs had appeared in 0.7.25.
-
- *) Bugfix: a "100 Continue" response was issued for HTTP/1.0 requests;
- Thanks to Maxim Dounin.
-
- *) Bugfix: in memory allocation in the ngx_http_gzip_filter_module on
- Cygwin.
-
-
-Changes with nginx 0.7.28 22 Dec 2008
-
- *) Change: in memory allocation in the ngx_http_gzip_filter_module.
-
- *) Change: the default "gzip_buffers" directive values have been changed
- to 32 4k or 16 8k from 4 4k/8k.
-
-
-Changes with nginx 0.7.27 15 Dec 2008
-
- *) Feature: the "try_files" directive.
-
- *) Feature: variables support in the "fastcgi_pass" directive.
-
- *) Feature: now the $geo variable may get an address from a variable.
- Thanks to Andrei Nigmatulin.
-
- *) Feature: now a location's modifier may be used without space before
- name.
-
- *) Feature: the $upstream_response_length variable.
-
- *) Bugfix: now a "add_header" directive does not add an empty value.
-
- *) Bugfix: if zero length static file was requested, then nginx just
- closed connection; the bug had appeared in 0.7.25.
-
- *) Bugfix: a MOVE method could not move file in non-existent directory.
-
- *) Bugfix: a segmentation fault occurred in worker process, if no one
- named location was defined in server, but some one was used in an
- error_page directive.
- Thanks to Sergey Bochenkov.
-
-
-Changes with nginx 0.7.26 08 Dec 2008
-
- *) Bugfix: in subrequest processing; the bug had appeared in 0.7.25.
-
-
-Changes with nginx 0.7.25 08 Dec 2008
-
- *) Change: in subrequest processing.
-
- *) Change: now POSTs without "Content-Length" header line are allowed.
-
- *) Bugfix: now the "limit_req" and "limit_conn" directives log a
- prohibition reason.
-
- *) Bugfix: in the "delete" parameter of the "geo" directive.
-
-
-Changes with nginx 0.7.24 01 Dec 2008
-
- *) Feature: the "if_modified_since" directive.
-
- *) Bugfix: nginx did not process a FastCGI server response, if the
- server send too many messages to stderr before response.
-
- *) Bugfix: the "$cookie_..." variables did not work in the SSI and the
- perl module.
-
-
-Changes with nginx 0.7.23 27 Nov 2008
-
- *) Feature: the "delete" and "ranges" parameters in the "geo" directive.
-
- *) Feature: speeding up loading of geo base with large number of values.
-
- *) Feature: decrease of memory required for geo base load.
-
-
-Changes with nginx 0.7.22 20 Nov 2008
-
- *) Feature: the "none" parameter in the "smtp_auth" directive.
- Thanks to Maxim Dounin.
-
- *) Feature: the "$cookie_..." variables.
-
- *) Bugfix: the "directio" directive did not work in XFS filesystem.
-
- *) Bugfix: the resolver did not understand big DNS responses.
- Thanks to Zyb.
-
-
-Changes with nginx 0.7.21 11 Nov 2008
-
- *) Changes in the ngx_http_limit_req_module.
-
- *) Feature: the EXSLT support in the ngx_http_xslt_module.
- Thanks to Denis F. Latypoff.
-
- *) Workaround: compatibility with glibc 2.3.
- Thanks to Eric Benson and Maxim Dounin.
-
- *) Bugfix: nginx could not run on MacOSX 10.4 and earlier; the bug had
- appeared in 0.7.6.
-
-
-Changes with nginx 0.7.20 10 Nov 2008
-
- *) Changes in the ngx_http_gzip_filter_module.
-
- *) Feature: the ngx_http_limit_req_module.
-
- *) Bugfix: worker processes might exit on a SIGBUS signal on sparc and
- ppc platforms; the bug had appeared in 0.7.3.
- Thanks to Maxim Dounin.
-
- *) Bugfix: the "proxy_pass http://host/some:uri" directives did not
- work; the bug had appeared in 0.7.12.
-
- *) Bugfix: in HTTPS mode requests might fail with the "bad write retry"
- error.
-
- *) Bugfix: the ngx_http_secure_link_module did not work inside
- locations, whose names are less than 3 characters.
-
- *) Bugfix: $server_addr variable might have no value.
-
-
-Changes with nginx 0.7.19 13 Oct 2008
-
- *) Bugfix: version number update.
-
-
-Changes with nginx 0.7.18 13 Oct 2008
-
- *) Change: the "underscores_in_headers" directive; now nginx does not
- allows underscores in a client request header line names.
-
- *) Feature: the ngx_http_secure_link_module.
-
- *) Feature: the "real_ip_header" directive supports any header.
-
- *) Feature: the "log_subrequest" directive.
-
- *) Feature: the $realpath_root variable.
-
- *) Feature: the "http_502" and "http_504" parameters of the
- "proxy_next_upstream" directive.
-
- *) Bugfix: the "http_503" parameter of the "proxy_next_upstream" or
- "fastcgi_next_upstream" directives did not work.
-
- *) Bugfix: nginx might send a "Transfer-Encoding: chunked" header line
- for HEAD requests.
-
- *) Bugfix: now accept threshold depends on worker_connections.
-
-
-Changes with nginx 0.7.17 15 Sep 2008
-
- *) Feature: now the "directio" directive works on Linux.
-
- *) Feature: the $pid variable.
-
- *) Bugfix: the "directio" optimization that had appeared in 0.7.15 did
- not work with open_file_cache.
-
- *) Bugfix: the "access_log" with variables did not work on Linux; the
- bug had appeared in 0.7.7.
-
- *) Bugfix: the ngx_http_charset_module did not understand quoted charset
- name received from backend.
-
-
-Changes with nginx 0.7.16 08 Sep 2008
-
- *) Bugfix: nginx could not be built on 64-bit platforms; the bug had
- appeared in 0.7.15.
-
-
-Changes with nginx 0.7.15 08 Sep 2008
-
- *) Feature: the ngx_http_random_index_module.
-
- *) Feature: the "directio" directive has been optimized for file
- requests starting from arbitrary position.
-
- *) Feature: the "directio" directive turns off sendfile if it is
- necessary.
-
- *) Feature: now nginx allows underscores in a client request header line
- names.
-
-
-Changes with nginx 0.7.14 01 Sep 2008
-
- *) Change: now the ssl_certificate and ssl_certificate_key directives
- have no default values.
-
- *) Feature: the "listen" directive supports the "ssl" parameter.
-
- *) Feature: now nginx takes into account a time zone change while
- reconfiguration on FreeBSD and Linux.
-
- *) Bugfix: the "listen" directive parameters such as "backlog",
- "rcvbuf", etc. were not set, if a default server was not the first
- one.
-
- *) Bugfix: if URI part captured by a "rewrite" directive was used as a
- query string, then the query string was not escaped.
-
- *) Bugfix: configuration file validity test improvements.
-
-
-Changes with nginx 0.7.13 26 Aug 2008
-
- *) Bugfix: nginx could not be built on Linux and Solaris; the bug had
- appeared in 0.7.12.
-
-
-Changes with nginx 0.7.12 26 Aug 2008
-
- *) Feature: the "server_name" directive supports empty name "".
-
- *) Feature: the "gzip_disable" directive supports special "msie6" mask.
-
- *) Bugfix: if the "max_fails=0" parameter was used in upstream with
- several servers, then a worker process exited on a SIGFPE signal.
- Thanks to Maxim Dounin.
-
- *) Bugfix: a request body was dropped while redirection via an
- "error_page" directive.
-
- *) Bugfix: a full response was returned for request method HEAD while
- redirection via an "error_page" directive.
-
- *) Bugfix: the $r->header_in() method did not return value of the
- "Host", "User-Agent", and "Connection" request header lines; the bug
- had appeared in 0.7.0.
-
-
-Changes with nginx 0.7.11 18 Aug 2008
-
- *) Change: now ngx_http_charset_module does not work by default with
- text/css MIME type.
-
- *) Feature: now nginx returns the 405 status code for POST method
- requesting a static file only if the file exists.
-
- *) Feature: the "proxy_ssl_session_reuse" directive.
-
- *) Bugfix: a "proxy_pass" directive without URI part might use original
- request after the "X-Accel-Redirect" redirection was used;
-
- *) Bugfix: if a directory has search only rights and the first index
- file was absent, then nginx returned the 500 status code.
-
- *) Bugfix: in inclusive locations; the bugs had appeared in 0.7.1.
-
-
-Changes with nginx 0.7.10 13 Aug 2008
-
- *) Bugfix: in the "addition_types", "charset_types", "gzip_types",
- "ssi_types", "sub_filter_types", and "xslt_types" directives; the
- bugs had appeared in 0.7.9.
-
- *) Bugfix: of recursive error_page for 500 status code.
-
- *) Bugfix: now the ngx_http_realip_module sets address not for whole
- keepalive connection, but for each request passed via the connection.
-
-
-Changes with nginx 0.7.9 12 Aug 2008
-
- *) Change: now ngx_http_charset_module works by default with following
- MIME types: text/html, text/css, text/xml, text/plain,
- text/vnd.wap.wml, application/x-javascript, and application/rss+xml.
-
- *) Feature: the "charset_types" and "addition_types" directives.
-
- *) Feature: now the "gzip_types", "ssi_types", and "sub_filter_types"
- directives use hash.
-
- *) Feature: the ngx_cpp_test_module.
-
- *) Feature: the "expires" directive supports daily time.
-
- *) Feature: the ngx_http_xslt_module improvements and bug fixing.
- Thanks to Denis F. Latypoff and Maxim Dounin.
-
- *) Bugfix: the "log_not_found" directive did not work for index files
- tests.
-
- *) Bugfix: HTTPS connections might hang, if kqueue, epoll, rtsig, or
- eventport methods were used; the bug had appeared in 0.7.7.
-
- *) Bugfix: if the "server_name", "valid_referers", and "map" directives
- used an "*.domain.tld" wildcard and exact name "domain.tld" was not
- set, then the exact name was matched by the wildcard; the bug had
- appeared in 0.3.18.
-
-
-Changes with nginx 0.7.8 04 Aug 2008
-
- *) Feature: the ngx_http_xslt_module.
-
- *) Feature: the "$arg_..." variables.
-
- *) Feature: Solaris directio support.
- Thanks to Ivan Debnar.
-
- *) Bugfix: now if FastCGI server sends a "Location" header line without
- status line, then nginx uses 302 status code.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.7.7 30 Jul 2008
-
- *) Change: now the EAGAIN error returned by connect() is not considered
- as temporary error.
-
- *) Change: now the $ssl_client_cert variable value is a certificate with
- TAB character intended before each line except first one; an
- unchanged certificate is available in the $ssl_client_raw_cert
- variable.
-
- *) Feature: the "ask" parameter in the "ssl_verify_client" directive.
-
- *) Feature: byte-range processing improvements.
- Thanks to Maxim Dounin.
-
- *) Feature: the "directio" directive.
- Thanks to Jiang Hong.
-
- *) Feature: MacOSX 10.5 sendfile() support.
-
- *) Bugfix: now in MacOSX and Cygwin locations are tested in case
- insensitive mode; however, the compare is provided by single-byte
- locales only.
-
- *) Bugfix: mail proxy SSL connections hanged, if select, poll, or
- /dev/poll methods were used.
-
- *) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module.
-
-
-Changes with nginx 0.7.6 07 Jul 2008
-
- *) Bugfix: now if variables are used in the "access_log" directive a
- request root existence is always tested.
-
- *) Bugfix: the ngx_http_flv_module did not support several values in a
- query string.
-
-
-Changes with nginx 0.7.5 01 Jul 2008
-
- *) Bugfixes in variables support in the "access_log" directive; the bugs
- had appeared in 0.7.4.
-
- *) Bugfix: nginx could not be built --without-http_gzip_module; the bug
- had appeared in 0.7.3.
- Thanks to Kirill A. Korinskiy.
-
- *) Bugfix: if sub_filter and SSI were used together, then responses
- might were transferred incorrectly.
-
-
-Changes with nginx 0.7.4 30 Jun 2008
-
- *) Feature: variables support in the "access_log" directive.
-
- *) Feature: the "open_log_file_cache" directive.
-
- *) Feature: the -g switch.
-
- *) Feature: the "Expect" request header line support.
-
- *) Bugfix: large SSI inclusions might be truncated.
-
-
-Changes with nginx 0.7.3 23 Jun 2008
-
- *) Change: the "rss" extension MIME type has been changed to
- "application/rss+xml".
-
- *) Change: now the "gzip_vary" directive turned on issues a
- "Vary: Accept-Encoding" header line for uncompressed responses too.
-
- *) Feature: now the "rewrite" directive does a redirect automatically if
- the "https://" protocol is used.
-
- *) Bugfix: the "proxy_pass" directive did not work with the HTTPS
- protocol; the bug had appeared in 0.6.9.
-
-
-Changes with nginx 0.7.2 16 Jun 2008
-
- *) Feature: now nginx supports EDH key exchange ciphers.
-
- *) Feature: the "ssl_dhparam" directive.
-
- *) Feature: the $ssl_client_cert variable.
- Thanks to Manlio Perillo.
-
- *) Bugfix: after changing URI via a "rewrite" directive nginx did not
- search a new location; the bug had appeared in 0.7.1.
- Thanks to Maxim Dounin.
-
- *) Bugfix: nginx could not be built without PCRE library; the bug had
- appeared in 0.7.1.
-
- *) Bugfix: when a request to a directory was redirected with the slash
- added, nginx dropped a query string from the original request.
-
-
-Changes with nginx 0.7.1 26 May 2008
-
- *) Change: now locations are searched in a tree.
-
- *) Change: the "optimize_server_names" directive was canceled due to the
- "server_name_in_redirect" directive introduction.
-
- *) Change: some long deprecated directives are not supported anymore.
-
- *) Change: the "none" parameter in the "ssl_session_cache" directive;
- now this is default parameter.
- Thanks to Rob Mueller.
-
- *) Bugfix: worker processes might not catch reconfiguration and log
- rotation signals.
-
- *) Bugfix: nginx could not be built on latest Fedora 9 Linux.
- Thanks to Roxis.
-
-
-Changes with nginx 0.7.0 19 May 2008
-
- *) Change: now the 0x00-0x1F, '"' and '\' characters are escaped as \xXX
- in an access_log.
- Thanks to Maxim Dounin.
-
- *) Change: now nginx allows several "Host" request header line.
-
- *) Feature: the "modified" flag in the "expires" directive.
-
- *) Feature: the $uid_got and $uid_set variables may be used at any
- request processing stage.
-
- *) Feature: the $hostname variable.
- Thanks to Andrei Nigmatulin.
-
- *) Feature: DESTDIR support.
- Thanks to Todd A. Fisher and Andras Voroskoi.
-
- *) Bugfix: a segmentation fault might occur in worker process on Linux,
- if keepalive was enabled.
-
-
-Changes with nginx 0.6.31 12 May 2008
-
- *) Bugfix: nginx did not process FastCGI response if header was at the
- end of FastCGI record; the bug had appeared in 0.6.2.
- Thanks to Sergey Serov.
-
- *) Bugfix: a segmentation fault might occur in worker process if a file
- was deleted and the "open_file_cache_errors" directive was off.
-
-
-Changes with nginx 0.6.30 29 Apr 2008
-
- *) Change: now if an "include" directive pattern does not match any
- file, then nginx does not issue an error.
-
- *) Feature: now the time in directives may be specified without spaces,
- for example, "1h50m".
-
- *) Bugfix: memory leaks if the "ssl_verify_client" directive was on.
- Thanks to Chavelle Vincent.
-
- *) Bugfix: the "sub_filter" directive might set text to change into
- output.
-
- *) Bugfix: the "error_page" directive did not take into account
- arguments in redirected URI.
-
- *) Bugfix: now nginx always opens files in binary mode under Cygwin.
-
- *) Bugfix: nginx could not be built on OpenBSD; the bug had appeared in
- 0.6.15.
-
-
-Changes with nginx 0.6.29 18 Mar 2008
-
- *) Feature: the ngx_google_perftools_module.
-
- *) Bugfix: the ngx_http_perl_module could not be built on 64-bit
- platforms; the bug had appeared in 0.6.27.
-
-
-Changes with nginx 0.6.28 13 Mar 2008
-
- *) Bugfix: the rtsig method could not be built; the bug had appeared in
- 0.6.27.
-
-
-Changes with nginx 0.6.27 12 Mar 2008
-
- *) Change: now by default the rtsig method is not built on
- Linux 2.6.18+.
-
- *) Change: now a request method is not changed while redirection to a
- named location via an "error_page" directive.
-
- *) Feature: the "resolver" and "resolver_timeout" directives in SMTP
- proxy.
-
- *) Feature: the "post_action" directive supports named locations.
-
- *) Bugfix: a segmentation fault occurred in worker process, if a request
- was redirected from proxy, FastCGI, or memcached location to static
- named locations.
-
- *) Bugfix: browsers did not repeat SSL handshake if there is no valid
- client certificate in first handshake.
- Thanks to Alexander V. Inyukhin.
-
- *) Bugfix: if response code 495-497 was redirected via an "error_page"
- directive without code change, then nginx tried to allocate too many
- memory.
-
- *) Bugfix: memory leak in long-lived non buffered connections.
-
- *) Bugfix: memory leak in resolver.
-
- *) Bugfix: a segmentation fault occurred in worker process, if a request
- was redirected from proxy, FastCGI, or memcached location to static
- named locations.
-
- *) Bugfix: in the $proxy_host and $proxy_port variables caching.
- Thanks to Sergey Bochenkov.
-
- *) Bugfix: a "proxy_pass" directive with variables used incorrectly the
- same port as in another "proxy_pass" directive with the same host
- name and without variables.
- Thanks to Sergey Bochenkov.
-
- *) Bugfix: an alert "sendmsg() failed (9: Bad file descriptor)" on some
- 64-bit platforms while reconfiguration.
-
- *) Bugfix: a segmentation fault occurred in worker process, if empty
- stub block was used second time in SSI.
-
- *) Bugfix: in copying URI part contained escaped symbols into arguments.
-
-
-Changes with nginx 0.6.26 11 Feb 2008
-
- *) Bugfix: the "proxy_store" and "fastcgi_store" directives did not
- check a response length.
-
- *) Bugfix: a segmentation fault occurred in worker process, if big value
- was used in a "expires" directive.
- Thanks to Joaquin Cuenca Abela.
-
- *) Bugfix: nginx incorrectly detected cache line size on Pentium 4.
- Thanks to Gena Makhomed.
-
- *) Bugfix: in proxied or FastCGI subrequests a client original method
- was used instead of the GET method.
-
- *) Bugfix: socket leak in HTTPS mode if deferred accept was used.
- Thanks to Ben Maurer.
-
- *) Bugfix: nginx issued the bogus error message "SSL_shutdown() failed
- (SSL: )"; the bug had appeared in 0.6.23.
-
- *) Bugfix: in HTTPS mode requests might fail with the "bad write retry"
- error; the bug had appeared in 0.6.23.
-
-
-Changes with nginx 0.6.25 08 Jan 2008
-
- *) Change: now the "server_name_in_redirect" directive is used instead
- of the "server_name" directive's special "*" parameter.
-
- *) Change: now wildcard and regex names can be used as main name in a
- "server_name" directive.
-
- *) Change: the "satisfy_any" directive was replaced by the "satisfy"
- directive.
-
- *) Workaround: old worker processes might hog CPU after reconfiguration
- if they was run under Linux OpenVZ.
-
- *) Feature: the "min_delete_depth" directive.
-
- *) Bugfix: the COPY and MOVE methods did not work with single files.
-
- *) Bugfix: the ngx_http_gzip_static_module did not allow the
- ngx_http_dav_module to work; the bug had appeared in 0.6.23.
-
- *) Bugfix: socket leak in HTTPS mode if deferred accept was used.
- Thanks to Ben Maurer.
-
- *) Bugfix: nginx could not be built without PCRE library; the bug had
- appeared in 0.6.23.
-
-
-Changes with nginx 0.6.24 27 Dec 2007
-
- *) Bugfix: a segmentation fault might occur in worker process if HTTPS
- was used; the bug had appeared in 0.6.23.
-
-
-Changes with nginx 0.6.23 27 Dec 2007
-
- *) Change: the "off" parameter in the "ssl_session_cache" directive; now
- this is default parameter.
-
- *) Change: the "open_file_cache_retest" directive was renamed to the
- "open_file_cache_valid".
-
- *) Feature: the "open_file_cache_min_uses" directive.
-
- *) Feature: the ngx_http_gzip_static_module.
-
- *) Feature: the "gzip_disable" directive.
-
- *) Feature: the "memcached_pass" directive may be used inside the "if"
- block.
-
- *) Bugfix: a segmentation fault occurred in worker process, if the
- "memcached_pass" and "if" directives were used in the same location.
-
- *) Bugfix: if a "satisfy_any on" directive was used and not all access
- and auth modules directives were set, then other given access and
- auth directives were not tested;
-
- *) Bugfix: regex parameters in a "valid_referers" directive were not
- inherited from previous level.
-
- *) Bugfix: a "post_action" directive did run if a request was completed
- with 499 status code.
-
- *) Bugfix: optimization of 16K buffer usage in a SSL connection.
- Thanks to Ben Maurer.
-
- *) Bugfix: the STARTTLS in SMTP mode did not work.
- Thanks to Oleg Motienko.
-
- *) Bugfix: in HTTPS mode requests might fail with the "bad write retry"
- error; the bug had appeared in 0.5.13.
-
-
-Changes with nginx 0.6.22 19 Dec 2007
-
- *) Change: now all ngx_http_perl_module methods return values copied to
- perl's allocated memory.
-
- *) Bugfix: if nginx was built with ngx_http_perl_module, the perl before
- 5.8.6 was used, and perl supported threads, then during
- reconfiguration the master process aborted; the bug had appeared in
- 0.5.9.
- Thanks to Boris Zhmurov.
-
- *) Bugfix: the ngx_http_perl_module methods may get invalid values of
- the regex captures.
-
- *) Bugfix: a segmentation fault occurred in worker process, if the
- $r->has_request_body() method was called for a request whose small
- request body was already received.
-
- *) Bugfix: large_client_header_buffers did not freed before going to
- keep-alive state.
- Thanks to Olexander Shtepa.
-
- *) Bugfix: the last address was missed in the $upstream_addr variable;
- the bug had appeared in 0.6.18.
-
- *) Bugfix: the "fastcgi_catch_stderr" directive did return error code;
- now it returns 502 code, that can be rerouted to a next server using
- the "fastcgi_next_upstream invalid_header" directive.
-
- *) Bugfix: a segmentation fault occurred in master process if the
- "fastcgi_catch_stderr" directive was used; the bug had appeared in
- 0.6.10.
- Thanks to Manlio Perillo.
-
-
-Changes with nginx 0.6.21 03 Dec 2007
-
- *) Change: if variable values used in a "proxy_pass" directive contain
- IP-addresses only, then a "resolver" directive is not mandatory.
-
- *) Bugfix: a segmentation fault might occur in worker process if a
- "proxy_pass" directive with URI-part was used; the bug had appeared
- in 0.6.19.
-
- *) Bugfix: if resolver was used on platform that does not support
- kqueue, then nginx issued an alert "name is out of response".
- Thanks to Andrei Nigmatulin.
-
- *) Bugfix: if the $server_protocol was used in FastCGI parameters and a
- request line length was near to the "client_header_buffer_size"
- directive value, then nginx issued an alert "fastcgi: the request
- record is too big".
-
- *) Bugfix: if a plain text HTTP/0.9 version request was made to HTTPS
- server, then nginx returned usual response.
-
-
-Changes with nginx 0.6.20 28 Nov 2007
-
- *) Bugfix: a segmentation fault might occur in worker process if a
- "proxy_pass" directive with URI-part was used; the bug had appeared
- in 0.6.19.
-
-
-Changes with nginx 0.6.19 27 Nov 2007
-
- *) Bugfix: the 0.6.18 version could not be built.
-
-
-Changes with nginx 0.6.18 27 Nov 2007
-
- *) Change: now the ngx_http_userid_module adds start time microseconds
- to the cookie field contains a pid value.
-
- *) Change: now the full request line instead of URI only is written to
- error_log.
-
- *) Feature: variables support in the "proxy_pass" directive.
-
- *) Feature: the "resolver" and "resolver_timeout" directives.
-
- *) Feature: now the directive "add_header last-modified ''" deletes a
- "Last-Modified" response header line.
-
- *) Bugfix: the "limit_rate" directive did not allow to use full
- throughput, even if limit value was very high.
-
-
-Changes with nginx 0.6.17 15 Nov 2007
-
- *) Feature: the "If-Range" request header line support.
- Thanks to Alexander V. Inyukhin.
-
- *) Bugfix: URL double escaping in a redirect of the "msie_refresh"
- directive; the bug had appeared in 0.6.4.
-
- *) Bugfix: the "autoindex" directive did not work with the "alias /"
- directive.
-
- *) Bugfix: a segmentation fault might occur in worker process if
- subrequests were used.
-
- *) Bugfix: the big responses may be transferred truncated if SSL and
- gzip were used.
-
- *) Bugfix: the $status variable was equal to 0 if a proxied server
- returned response in HTTP/0.9 version.
-
-
-Changes with nginx 0.6.16 29 Oct 2007
-
- *) Change: now the uname(2) is used on Linux instead of procfs.
- Thanks to Ilya Novikov.
-
- *) Bugfix: if the "?" character was in a "error_page" directive, then it
- was escaped in a proxied request; the bug had appeared in 0.6.11.
-
- *) Bugfix: compatibility with mget.
-
-
-Changes with nginx 0.6.15 22 Oct 2007
-
- *) Feature: Cygwin compatibility.
- Thanks to Vladimir Kutakov.
-
- *) Feature: the "merge_slashes" directive.
-
- *) Feature: the "gzip_vary" directive.
-
- *) Feature: the "server_tokens" directive.
-
- *) Bugfix: nginx did not unescape URI in the "include" SSI command.
-
- *) Bugfix: the segmentation fault was occurred on start or while
- reconfiguration if variable was used in the "charset" or
- "source_charset" directives.
-
- *) Bugfix: nginx returned the 400 response on requests like
- "GET http://www.domain.com HTTP/1.0".
- Thanks to James Oakley.
-
- *) Bugfix: if request with request body was redirected using the
- "error_page" directive, then nginx tried to read the request body
- again; the bug had appeared in 0.6.7.
-
- *) Bugfix: a segmentation fault occurred in worker process if no
- server_name was explicitly defined for server processing request; the
- bug had appeared in 0.6.7.
-
-
-Changes with nginx 0.6.14 15 Oct 2007
-
- *) Change: now by default the "echo" SSI command uses entity encoding.
-
- *) Feature: the "encoding" parameter in the "echo" SSI command.
-
- *) Feature: the "access_log" directive may be used inside the
- "limit_except" block.
-
- *) Bugfix: if all upstream servers were failed, then all servers had got
- weight the was equal one until servers became alive; the bug had
- appeared in 0.6.6.
-
- *) Bugfix: a segmentation fault occurred in worker process if
- $date_local and $date_gmt were used outside the
- ngx_http_ssi_filter_module.
-
- *) Bugfix: a segmentation fault might occur in worker process if debug
- log was enabled.
- Thanks to Andrei Nigmatulin.
-
- *) Bugfix: ngx_http_memcached_module did not set
- $upstream_response_time.
- Thanks to Maxim Dounin.
-
- *) Bugfix: a worker process may got caught in an endless loop, if the
- memcached was used.
-
- *) Bugfix: nginx supported low case only "close" and "keep-alive" values
- in the "Connection" request header line; the bug had appeared in
- 0.6.11.
-
- *) Bugfix: sub_filter did not work with empty substitution.
-
- *) Bugfix: in sub_filter parsing.
-
-
-Changes with nginx 0.6.13 24 Sep 2007
-
- *) Bugfix: nginx did not close directory file on HEAD request if
- autoindex was used.
- Thanks to Arkadiusz Patyk.
-
-
-Changes with nginx 0.6.12 21 Sep 2007
-
- *) Change: mail proxy was split on three modules: pop3, imap and smtp.
-
- *) Feature: the --without-mail_pop3_module, --without-mail_imap_module,
- and --without-mail_smtp_module configuration parameters.
-
- *) Feature: the "smtp_greeting_delay" and "smtp_client_buffer"
- directives of the ngx_mail_smtp_module.
-
- *) Bugfix: the trailing wildcards did not work; the bug had appeared in
- 0.6.9.
-
- *) Bugfix: nginx could not start on Solaris if the shared PCRE library
- located in non-standard place was used.
-
- *) Bugfix: the "proxy_hide_header" and "fastcgi_hide_header" directives
- did not hide response header lines whose name was longer than 32
- characters.
- Thanks to Manlio Perillo.
-
-
-Changes with nginx 0.6.11 11 Sep 2007
-
- *) Bugfix: active connection counter always increased if mail proxy was
- used.
-
- *) Bugfix: if backend returned response header only using non-buffered
- proxy, then nginx closed backend connection on timeout.
-
- *) Bugfix: nginx did not support several "Connection" request header
- lines.
-
- *) Bugfix: if the "max_fails" was set for upstream server, then after
- first failure server weight was always one; the bug had appeared in
- 0.6.6.
-
-
-Changes with nginx 0.6.10 03 Sep 2007
-
- *) Feature: the "open_file_cache", "open_file_cache_retest", and
- "open_file_cache_errors" directives.
-
- *) Bugfix: socket leak; the bug had appeared in 0.6.7.
-
- *) Bugfix: a charset set by the "charset" directive was not appended to
- the "Content-Type" header set by $r->send_http_header().
-
- *) Bugfix: a segmentation fault might occur in worker process if
- /dev/poll method was used.
-
-
-Changes with nginx 0.6.9 28 Aug 2007
-
- *) Bugfix: a worker process may got caught in an endless loop, if the
- HTTPS protocol was used; the bug had appeared in 0.6.7.
-
- *) Bugfix: if server listened on two addresses or ports and trailing
- wildcard was used, then nginx did not run.
-
- *) Bugfix: the "ip_hash" directive might incorrectly mark servers as
- down.
-
- *) Bugfix: nginx could not be built on amd64; the bug had appeared in
- 0.6.8.
-
-
-Changes with nginx 0.6.8 20 Aug 2007
-
- *) Change: now nginx tries to set the "worker_priority",
- "worker_rlimit_nofile", "worker_rlimit_core", and
- "worker_rlimit_sigpending" without super-user privileges.
-
- *) Change: now nginx escapes space and "%" in request to a mail proxy
- authentication server.
-
- *) Change: now nginx escapes "%" in $memcached_key variable.
-
- *) Bugfix: nginx used path relative to configuration prefix for
- non-absolute configuration file path specified in the "-c" key; the
- bug had appeared in 0.6.6.
-
- *) Bugfix: nginx did not work on FreeBSD/sparc64.
-
-
-Changes with nginx 0.6.7 15 Aug 2007
-
- *) Change: now the paths specified in the "include",
- "auth_basic_user_file", "perl_modules", "ssl_certificate",
- "ssl_certificate_key", and "ssl_client_certificate" directives are
- relative to directory of nginx configuration file nginx.conf, but not
- to nginx prefix directory.
-
- *) Change: the --sysconfdir=PATH option in configure was canceled.
-
- *) Change: the special make target "upgrade1" was defined for online
- upgrade of 0.1.x versions.
-
- *) Feature: the "server_name" and "valid_referers" directives support
- regular expressions.
-
- *) Feature: the "server" directive in the "upstream" context supports
- the "backup" parameter.
-
- *) Feature: the ngx_http_perl_module supports the
- $r->discard_request_body.
-
- *) Feature: the "add_header Last-Modified ..." directive changes the
- "Last-Modified" response header line.
-
- *) Bugfix: if a response different than 200 was returned to a request
- with body and connection went to the keep-alive state after the
- request, then nginx returned 400 for the next request.
-
- *) Bugfix: a segmentation fault occurred in worker process if invalid
- address was set in the "auth_http" directive.
-
- *) Bugfix: now nginx uses default listen backlog value 511 on all
- platforms except FreeBSD.
- Thanks to Jiang Hong.
-
- *) Bugfix: a worker process may got caught in an endless loop, if a
- "server" inside "upstream" block was marked as "down"; the bug had
- appeared in 0.6.6.
-
- *) Bugfix: now Solaris sendfilev() is not used to transfer the client
- request body to FastCGI-server via the unix domain socket.
-
-
-Changes with nginx 0.6.6 30 Jul 2007
-
- *) Feature: the --sysconfdir=PATH option in configure.
-
- *) Feature: named locations.
-
- *) Feature: the $args variable can be set with the "set" directive.
-
- *) Feature: the $is_args variable.
-
- *) Bugfix: fair big weight upstream balancer.
-
- *) Bugfix: if a client has closed connection to mail proxy then nginx
- might not close connection to backend.
-
- *) Bugfix: if the same host without specified port was used as backend
- for HTTP and HTTPS, then nginx used only one port - 80 or 443.
-
- *) Bugfix: fix building on Solaris/amd64 by Sun Studio 11 and early
- versions; the bug had appeared in 0.6.4.
-
-
-Changes with nginx 0.6.5 23 Jul 2007
-
- *) Feature: $nginx_version variable.
- Thanks to Nick S. Grechukh.
-
- *) Feature: the mail proxy supports AUTHENTICATE in IMAP mode.
- Thanks to Maxim Dounin.
-
- *) Feature: the mail proxy supports STARTTLS in SMTP mode.
- Thanks to Maxim Dounin.
-
- *) Bugfix: now nginx escapes space in $memcached_key variable.
-
- *) Bugfix: nginx was incorrectly built by Sun Studio on Solaris/amd64.
- Thanks to Jiang Hong.
-
- *) Bugfix: of minor potential bugs.
- Thanks to Coverity's Scan.
-
-
-Changes with nginx 0.6.4 17 Jul 2007
-
- *) Security: the "msie_refresh" directive allowed XSS.
- Thanks to Maxim Boguk.
-
- *) Change: the "proxy_store" and "fastcgi_store" directives were
- changed.
-
- *) Feature: the "proxy_store_access" and "fastcgi_store_access"
- directives.
-
- *) Bugfix: nginx did not work on Solaris/sparc64 if it was built by Sun
- Studio.
- Thanks to Andrei Nigmatulin.
-
- *) Workaround: for Sun Studio 12.
- Thanks to Jiang Hong.
-
-
-Changes with nginx 0.6.3 12 Jul 2007
-
- *) Feature: the "proxy_store" and "fastcgi_store" directives.
-
- *) Bugfix: a segmentation fault might occur in worker process if the
- "auth_http_header" directive was used.
- Thanks to Maxim Dounin.
-
- *) Bugfix: a segmentation fault occurred in worker process if the
- CRAM-MD5 authentication method was used, but it was not enabled.
-
- *) Bugfix: a segmentation fault might occur in worker process when the
- HTTPS protocol was used in the "proxy_pass" directive.
-
- *) Bugfix: a segmentation fault might occur in worker process if the
- eventport method was used.
-
- *) Bugfix: the "proxy_ignore_client_abort" and
- "fastcgi_ignore_client_abort" directives did not work; the bug had
- appeared in 0.5.13.
-
-
-Changes with nginx 0.6.2 09 Jul 2007
-
- *) Bugfix: if the FastCGI header was split in records, then nginx passed
- garbage in the header to a client.
-
-
-Changes with nginx 0.6.1 17 Jun 2007
-
- *) Bugfix: in SSI parsing.
-
- *) Bugfix: if remote SSI subrequest was used, then posterior local file
- subrequest might transferred to client in wrong order.
-
- *) Bugfix: large SSI inclusions buffered in temporary files were
- truncated.
-
- *) Bugfix: the perl $$ variable value in ngx_http_perl_module was equal
- to the master process identification number.
-
-
-Changes with nginx 0.6.0 14 Jun 2007
-
- *) Feature: the "server_name", "map", and "valid_referers" directives
- support the "www.example.*" wildcards.
-
-
-Changes with nginx 0.5.25 11 Jun 2007
-
- *) Bugfix: nginx could not be built with the
- --without-http_rewrite_module parameter; the bug had appeared in
- 0.5.24.
-
-
-Changes with nginx 0.5.24 06 Jun 2007
-
- *) Security: the "ssl_verify_client" directive did not work if request
- was made using HTTP/0.9.
-
- *) Bugfix: a part of response body might be passed uncompressed if gzip
- was used; the bug had appeared in 0.5.23.
-
-
-Changes with nginx 0.5.23 04 Jun 2007
-
- *) Feature: the ngx_http_ssl_module supports Server Name Indication TLS
- extension.
-
- *) Feature: the "fastcgi_catch_stderr" directive.
- Thanks to Nick S. Grechukh, OWOX project.
-
- *) Bugfix: a segmentation fault occurred in master process if two
- virtual servers should bind() to the overlapping ports.
-
- *) Bugfix: if nginx was built with ngx_http_perl_module and perl
- supported threads, then during second reconfiguration the error
- messages "panic: MUTEX_LOCK" and "perl_parse() failed" were issued.
-
- *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive.
-
-
-Changes with nginx 0.5.22 29 May 2007
-
- *) Bugfix: a big request body might not be passed to backend; the bug
- had appeared in 0.5.21.
-
-
-Changes with nginx 0.5.21 28 May 2007
-
- *) Bugfix: if server has more than about ten locations, then regex
- locations might be choosen not in that order as they were specified.
-
- *) Bugfix: a worker process may got caught in an endless loop on 64-bit
- platform, if the 33-rd or next in succession backend has failed.
- Thanks to Anton Povarov.
-
- *) Bugfix: a bus error might occur on Solaris/sparc64 if the PCRE
- library was used.
- Thanks to Andrei Nigmatulin.
-
- *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive.
-
-
-Changes with nginx 0.5.20 07 May 2007
-
- *) Feature: the "sendfile_max_chunk" directive.
-
- *) Feature: the "$http_...", "$sent_http_...", and "$upstream_http_..."
- variables may be changed using the "set" directive.
-
- *) Bugfix: a segmentation fault might occur in worker process if the SSI
- command 'if expr="$var = /"' was used.
-
- *) Bugfix: trailing boundary of multipart range response was transferred
- incorrectly.
- Thanks to Evan Miller.
-
- *) Bugfix: nginx did not work on Solaris/sparc64 if it was built by Sun
- Studio.
- Thanks to Andrei Nigmatulin.
-
- *) Bugfix: the ngx_http_perl_module could not be built by Solaris make.
- Thanks to Andrei Nigmatulin.
-
-
-Changes with nginx 0.5.19 24 Apr 2007
-
- *) Change: now the $request_time variable has millisecond precision.
-
- *) Change: the method $r->rflush of ngx_http_perl_module was renamed to
- the $r->flush.
-
- *) Feature: the $upstream_addr variable.
-
- *) Feature: the "proxy_headers_hash_max_size" and
- "proxy_headers_hash_bucket_size" directives.
- Thanks to Volodymyr Kostyrko.
-
- *) Bugfix: the files more than 2G could not be transferred using
- sendfile and limit_rate on 64-bit platforms.
-
- *) Bugfix: the files more than 2G could not be transferred using
- sendfile on 64-bit Linux.
-
-
-Changes with nginx 0.5.18 19 Apr 2007
-
- *) Feature: the ngx_http_sub_filter_module.
-
- *) Feature: the "$upstream_http_..." variables.
-
- *) Feature: now the $upstream_status and $upstream_response_time
- variables keep data about all upstreams before X-Accel-Redirect.
-
- *) Bugfix: a segmentation fault occurred in master process after first
- reconfiguration and receiving any signal if nginx was built with
- ngx_http_perl_module and perl did not support multiplicity; the bug
- had appeared in 0.5.9.
-
- *) Bugfix: if perl did not support multiplicity, then after
- reconfiguration perl code did not work; the bug had appeared in
- 0.3.38.
-
-
-Changes with nginx 0.5.17 02 Apr 2007
-
- *) Change: now nginx always returns the 405 status for the TRACE method.
-
- *) Feature: now nginx supports the "include" directive inside the
- "types" block.
-
- *) Bugfix: the $document_root variable usage in the "root" and "alias"
- directives is disabled: this caused recursive stack overflow.
-
- *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive.
-
- *) Bugfix: in some cases non-cachable variables (such as $uri variable)
- returned old cached value.
-
-
-Changes with nginx 0.5.16 26 Mar 2007
-
- *) Bugfix: the C-class network was not used as hash key in the "ip_hash"
- directive.
- Thanks to Pavel Yarkovoy.
-
- *) Bugfix: a segmentation fault might occur in worker process if a
- charset was set in the "Content-Type" header line and the line has
- trailing ";"; the bug had appeared in 0.3.50.
-
- *) Bugfix: the "[alert] zero size buf" error when FastCGI server was
- used and a request body written in a temporary file was multiple of
- 32K.
-
- *) Bugfix: nginx could not be built on Solaris without the --with-debug
- option; the bug had appeared in 0.5.15.
-
-
-Changes with nginx 0.5.15 19 Mar 2007
-
- *) Feature: the mail proxy supports authenticated SMTP proxying and the
- "smtp_auth", "smtp_capablities", and "xclient" directives.
- Thanks to Anton Yuzhaninov and Maxim Dounin.
-
- *) Feature: now the keep-alive connections are closed just after
- receiving the reconfiguration signal.
-
- *) Change: the "imap" and "auth" directives were renamed to the "mail"
- and "pop3_auth" directives.
-
- *) Bugfix: a segmentation fault occurred in worker process if the
- CRAM-MD5 authentication method was used and the APOP method was
- disabled.
-
- *) Bugfix: if the "starttls only" directive was used in POP3 protocol,
- then nginx allowed authentication without switching to the SSL mode.
-
- *) Bugfix: worker processes did not exit after reconfiguration and did
- not rotate logs if the eventport method was used.
-
- *) Bugfix: a worker process may got caught in an endless loop, if the
- "ip_hash" directive was used.
-
- *) Bugfix: now nginx does not log some alerts if eventport or /dev/poll
- methods are used.
-
-
-Changes with nginx 0.5.14 23 Feb 2007
-
- *) Bugfix: nginx ignored superfluous closing "}" in the end of
- configuration file.
-
-
-Changes with nginx 0.5.13 19 Feb 2007
-
- *) Feature: the COPY and MOVE methods.
-
- *) Bugfix: the ngx_http_realip_module set garbage for requests passed
- via keep-alive connection.
-
- *) Bugfix: nginx did not work on big-endian 64-bit Linux.
- Thanks to Andrei Nigmatulin.
-
- *) Bugfix: now when IMAP/POP3 proxy receives too long command it closes
- the connection right away, but not after timeout.
-
- *) Bugfix: if the "epoll" method was used and a client closed a
- connection prematurely, then nginx closed the connection after a send
- timeout only.
-
- *) Bugfix: nginx could not be built on platforms different from i386,
- amd64, sparc, and ppc; the bug had appeared in 0.5.8.
-
-
-Changes with nginx 0.5.12 12 Feb 2007
-
- *) Bugfix: nginx could not be built on platforms different from i386,
- amd64, sparc, and ppc; the bug had appeared in 0.5.8.
-
- *) Bugfix: a segmentation fault might occur in worker process if the
- temporary files were used while working with FastCGI server; the bug
- had appeared in 0.5.8.
-
- *) Bugfix: a segmentation fault might occur in worker process if the
- $fastcgi_script_name variable was logged.
-
- *) Bugfix: ngx_http_perl_module could not be built on Solaris.
-
-
-Changes with nginx 0.5.11 05 Feb 2007
-
- *) Feature: now configure detects system PCRE library in MacPorts.
- Thanks to Chris McGrath.
-
- *) Bugfix: the response was incorrect if several ranges were requested;
- the bug had appeared in 0.5.6.
-
- *) Bugfix: the "create_full_put_path" directive could not create the
- intermediate directories if no "dav_access" directive was set.
- Thanks to Evan Miller.
-
- *) Bugfix: the "0" response code might be logged in the access_log
- instead of the "400" and "408" error codes.
-
- *) Bugfix: a segmentation fault might occur in worker process if nginx
- was built with -O2 optimization.
-
-
-Changes with nginx 0.5.10 26 Jan 2007
-
- *) Bugfix: while online executable file upgrade the new master process
- did not inherit the listening sockets; the bug had appeared in 0.5.9.
-
- *) Bugfix: a segmentation fault might occur in worker process if nginx
- was built with -O2 optimization; the bug had appeared in 0.5.1.
-
-
-Changes with nginx 0.5.9 25 Jan 2007
-
- *) Change: now the ngx_http_memcached_module uses the $memcached_key
- variable value as a key.
-
- *) Feature: the $memcached_key variable.
-
- *) Feature: the "clean" parameter in the "client_body_in_file_only"
- directive.
-
- *) Feature: the "env" directive.
-
- *) Feature: the "sendfile" directive is available inside the "if" block.
-
- *) Feature: now on failure of the writing to access nginx logs a message
- to error_log, but not more often than once a minute.
-
- *) Bugfix: the "access_log off" directive did not always turn off the
- logging.
-
-
-Changes with nginx 0.5.8 19 Jan 2007
-
- *) Bugfix: a segmentation fault might occur if
- "client_body_in_file_only on" was used and a request body was small.
-
- *) Bugfix: a segmentation fault occurred if
- "client_body_in_file_only on" and "proxy_pass_request_body off" or
- "fastcgi_pass_request_body off" directives were used, and nginx
- switched to a next upstream.
-
- *) Bugfix: if the "proxy_buffering off" directive was used and a client
- connection was non-active, then the connection was closed after send
- timeout; the bug had appeared in 0.4.7.
-
- *) Bugfix: if the "epoll" method was used and a client closed a
- connection prematurely, then nginx closed the connection after a send
- timeout only.
-
- *) Bugfix: the "[alert] zero size buf" error when FastCGI server was
- used.
-
- *) Bugfixes in the "limit_zone" directive.
-
-
-Changes with nginx 0.5.7 15 Jan 2007
-
- *) Feature: the ssl_session_cache storage optimization.
-
- *) Bugfixes in the "ssl_session_cache" and "limit_zone" directives.
-
- *) Bugfix: the segmentation fault was occurred on start or while
- reconfiguration if the "ssl_session_cache" or "limit_zone" directives
- were used on 64-bit platforms.
-
- *) Bugfix: a segmentation fault occurred if the "add_before_body" or
- "add_after_body" directives were used and there was no "Content-Type"
- header line in response.
-
- *) Bugfix: the OpenSSL library was always built with the threads
- support.
- Thanks to Den Ivanov.
-
- *) Bugfix: the PCRE-6.5+ library and the icc compiler compatibility.
-
-
-Changes with nginx 0.5.6 09 Jan 2007
-
- *) Change: now the ngx_http_index_module ignores all methods except the
- GET, HEAD, and POST methods.
-
- *) Feature: the ngx_http_limit_zone_module.
-
- *) Feature: the $binary_remote_addr variable.
-
- *) Feature: the "ssl_session_cache" directives of the
- ngx_http_ssl_module and ngx_imap_ssl_module.
-
- *) Feature: the DELETE method supports recursive removal.
-
- *) Bugfix: the byte-ranges were transferred incorrectly if the
- $r->sendfile() was used.
-
-
-Changes with nginx 0.5.5 24 Dec 2006
-
- *) Change: the -v switch does not show compiler information any more.
-
- *) Feature: the -V switch.
-
- *) Feature: the "worker_rlimit_core" directive supports size in K, M,
- and G.
-
- *) Bugfix: the nginx.pm module now could be installed by an unprivileged
- user.
-
- *) Bugfix: a segmentation fault might occur if the $r->request_body or
- $r->request_body_file methods were used.
-
- *) Bugfix: the ppc platform specific bugs.
-
-
-Changes with nginx 0.5.4 15 Dec 2006
-
- *) Feature: the "perl" directive may be used inside the "limit_except"
- block.
-
- *) Bugfix: the ngx_http_dav_module required the "Date" request header
- line for the DELETE method.
-
- *) Bugfix: if one only parameter was used in the "dav_access" directive,
- then nginx might report about configuration error.
-
- *) Bugfix: a segmentation fault might occur if the $host variable was
- used; the bug had appeared in 0.4.14.
-
-
-Changes with nginx 0.5.3 13 Dec 2006
-
- *) Feature: the ngx_http_perl_module supports the $r->status,
- $r->log_error, and $r->sleep methods.
-
- *) Feature: the $r->variable method supports variables that do not exist
- in nginx configuration.
-
- *) Bugfix: the $r->has_request_body method did not work.
-
-
-Changes with nginx 0.5.2 11 Dec 2006
-
- *) Bugfix: if the "proxy_pass" directive used the name of the "upstream"
- block, then nginx tried to resolve the name; the bug had appeared in
- 0.5.1.
-
-
-Changes with nginx 0.5.1 11 Dec 2006
-
- *) Bugfix: the "post_action" directive might not run after a
- unsuccessful completion of a request.
-
- *) Workaround: for Eudora for Mac; the bug had appeared in 0.4.11.
- Thanks to Bron Gondwana.
-
- *) Bugfix: if the "upstream" name was used in the "fastcgi_pass", then
- the message "no port in upstream" was issued; the bug had appeared in
- 0.5.0.
-
- *) Bugfix: if the "proxy_pass" and "fastcgi_pass" directives used the
- same servers but different ports, then these directives uses the
- first described port; the bug had appeared in 0.5.0.
-
- *) Bugfix: if the "proxy_pass" and "fastcgi_pass" directives used the
- unix domain sockets, then these directives used first described
- socket; the bug had appeared in 0.5.0.
-
- *) Bugfix: ngx_http_auth_basic_module ignored the user if it was in the
- last line in the password file and there was no the carriage return,
- the line feed, or the ":" symbol after the password.
-
- *) Bugfix: the $upstream_response_time variable might be equal to
- "0.000", although response time was more than 1 millisecond.
-
-
-Changes with nginx 0.5.0 04 Dec 2006
-
- *) Change: the parameters in the "%name" form in the "log_format"
- directive are not supported anymore.
-
- *) Change: the "proxy_upstream_max_fails",
- "proxy_upstream_fail_timeout", "fastcgi_upstream_max_fails",
- "fastcgi_upstream_fail_timeout", "memcached_upstream_max_fails", and
- "memcached_upstream_fail_timeout" directives are not supported
- anymore.
-
- *) Feature: the "server" directive in the "upstream" context supports
- the "max_fails", "fail_timeout", and "down" parameters.
-
- *) Feature: the "ip_hash" directive inside the "upstream" block.
-
- *) Feature: the WAIT status in the "Auth-Status" header line of the
- IMAP/POP3 proxy authentication server response.
-
- *) Bugfix: nginx could not be built on 64-bit platforms; the bug had
- appeared in 0.4.14.
-
-
-Changes with nginx 0.4.14 27 Nov 2006
-
- *) Feature: the "proxy_pass_error_message" directive in IMAP/POP3 proxy.
-
- *) Feature: now configure detects system PCRE library on FreeBSD, Linux,
- and NetBSD.
-
- *) Bugfix: ngx_http_perl_module did not work with perl built with the
- threads support; the bug had appeared in 0.3.38.
-
- *) Bugfix: ngx_http_perl_module did not work if perl was called
- recursively.
-
- *) Bugfix: nginx ignored a host name in a request line.
-
- *) Bugfix: a worker process may got caught in an endless loop, if a
- FastCGI server sent too many data to the stderr.
-
- *) Bugfix: the $upstream_response_time variable may be negative if the
- system time was changed backward.
-
- *) Bugfix: the "Auth-Login-Attempt" parameter was not sent to IMAP/POP3
- proxy authentication server when POP3 was used.
-
- *) Bugfix: a segmentation fault might occur if connect to IMAP/POP3
- proxy authentication server failed.
-
-
-Changes with nginx 0.4.13 15 Nov 2006
-
- *) Feature: the "proxy_pass" directive may be used inside the
- "limit_except" block.
-
- *) Feature: the "limit_except" directive supports all WebDAV methods.
-
- *) Bugfix: if the "add_before_body" directive was used without the
- "add_after_body" directive, then a response did not transferred
- complete.
-
- *) Bugfix: a large request body did not receive if the epoll method and
- the deferred accept() were used.
-
- *) Bugfix: a charset could not be set for ngx_http_autoindex_module
- responses; the bug had appeared in 0.3.50.
-
- *) Bugfix: the "[alert] zero size buf" error when FastCGI server was
- used;
-
- *) Bugfix: the --group= configuration parameter was ignored.
- Thanks to Thomas Moschny.
-
- *) Bugfix: the 50th subrequest in SSI response did not work; the bug had
- appeared in 0.3.50.
-
-
-Changes with nginx 0.4.12 31 Oct 2006
-
- *) Feature: the ngx_http_perl_module supports the $r->variable method.
-
- *) Bugfix: if a big static file was included using SSI in a response,
- then the response may be transferred incomplete.
-
- *) Bugfix: nginx did not omit the "#fragment" part in URI.
-
-
-Changes with nginx 0.4.11 25 Oct 2006
-
- *) Feature: the POP3 proxy supports the AUTH LOGIN PLAIN and CRAM-MD5.
-
- *) Feature: the ngx_http_perl_module supports the $r->allow_ranges
- method.
-
- *) Bugfix: if the APOP was enabled in the POP3 proxy, then the USER/PASS
- commands might not work; the bug had appeared in 0.4.10.
-
-
-Changes with nginx 0.4.10 23 Oct 2006
-
- *) Feature: the POP3 proxy supports the APOP command.
-
- *) Bugfix: if the select, poll or /dev/poll methods were used, then
- while waiting authentication server response the IMAP/POP3 proxy
- hogged CPU.
-
- *) Bugfix: a segmentation fault might occur if the $server_addr variable
- was used in the "map" directive.
-
- *) Bugfix: the ngx_http_flv_module did not support the byte ranges for
- full responses; the bug had appeared in 0.4.7.
-
- *) Bugfix: nginx could not be built on Debian amd64; the bug had
- appeared in 0.4.9.
-
-
-Changes with nginx 0.4.9 13 Oct 2006
-
- *) Feature: the "set" parameter in the "include" SSI command.
-
- *) Feature: the ngx_http_perl_module now tests the nginx.pm module
- version.
-
-
-Changes with nginx 0.4.8 11 Oct 2006
-
- *) Bugfix: if an "include" SSI command were before another "include" SSI
- command with a "wait" parameter, then the "wait" parameter might not
- work.
-
- *) Bugfix: the ngx_http_flv_module added the FLV header to the full
- responses.
- Thanks to Alexey Kovyrin.
-
-
-Changes with nginx 0.4.7 10 Oct 2006
-
- *) Feature: the ngx_http_flv_module.
-
- *) Feature: the $request_body_file variable.
-
- *) Feature: the "charset" and "source_charset" directives support the
- variables.
-
- *) Bugfix: if an "include" SSI command were before another "include" SSI
- command with a "wait" parameter, then the "wait" parameter might not
- work.
-
- *) Bugfix: if the "proxy_buffering off" directive was used or while
- working with memcached the connections might not be closed on
- timeout.
-
- *) Bugfix: nginx did not run on 64-bit platforms except amd64, sparc64,
- and ppc64.
-
-
-Changes with nginx 0.4.6 06 Oct 2006
-
- *) Bugfix: nginx did not run on 64-bit platforms except amd64, sparc64,
- and ppc64.
-
- *) Bugfix: nginx sent the chunked response for HTTP/1.1 request,
- if its length was set by text string in the
- $r->headers_out("Content-Length", ...) method.
-
- *) Bugfix: after redirecting error by an "error_page" directive any
- ngx_http_rewrite_module directive returned this error code; the bug
- had appeared in 0.4.4.
-
-
-Changes with nginx 0.4.5 02 Oct 2006
-
- *) Bugfix: nginx could not be built on Linux and Solaris; the bug had
- appeared in 0.4.4.
-
-
-Changes with nginx 0.4.4 02 Oct 2006
-
- *) Feature: the $scheme variable.
-
- *) Feature: the "expires" directive supports the "max" parameter.
-
- *) Feature: the "include" directive supports the "*" mask.
- Thanks to Jonathan Dance.
-
- *) Bugfix: the "return" directive always overrode the "error_page"
- response code redirected by the "error_page" directive.
-
- *) Bugfix: a segmentation fault occurred if zero-length body was in PUT
- method.
-
- *) Bugfix: the redirect was changed incorrectly if the variables were
- used in the "proxy_redirect" directive.
-
-
-Changes with nginx 0.4.3 26 Sep 2006
-
- *) Change: now the 499 error could not be redirected using an
- "error_page" directive.
-
- *) Feature: the Solaris 10 event ports support.
-
- *) Feature: the ngx_http_browser_module.
-
- *) Bugfix: a segmentation fault may occur while redirecting the 400
- error to the proxied server using a "proxy_pass" directive.
-
- *) Bugfix: a segmentation fault occurred if an unix domain socket was
- used in a "proxy_pass" directive; the bug had appeared in 0.3.47.
-
- *) Bugfix: SSI did work with memcached and nonbuffered responses.
-
- *) Workaround: of the Sun Studio PAUSE hardware capability bug.
-
-
-Changes with nginx 0.4.2 14 Sep 2006
-
- *) Bugfix: the O_NOATIME flag support on Linux was canceled; the bug had
- appeared in 0.4.1.
-
-
-Changes with nginx 0.4.1 14 Sep 2006
-
- *) Bugfix: the DragonFlyBSD compatibility.
- Thanks to Pavel Nazarov.
-
- *) Workaround: of bug in 64-bit Linux sendfile(), when file is more than
- 2G.
-
- *) Feature: now on Linux nginx uses O_NOATIME flag for static requests.
- Thanks to Yusuf Goolamabbas.
-
-
-Changes with nginx 0.4.0 30 Aug 2006
-
- *) Change in internal API: the HTTP modules initialization was moved
- from the init module phase to the HTTP postconfiguration phase.
-
- *) Change: now the request body is not read beforehand for the
- ngx_http_perl_module: it's required to start the reading using the
- $r->has_request_body method.
-
- *) Feature: the ngx_http_perl_module supports the DECLINED return code.
-
- *) Feature: the ngx_http_dav_module supports the incoming "Date" header
- line for the PUT method.
-
- *) Feature: the "ssi" directive is available inside the "if" block.
-
- *) Bugfix: a segmentation fault occurred if there was an "index"
- directive with variables and the first index name was without
- variables; the bug had appeared in 0.1.29.
-
-
-Changes with nginx 0.3.61 28 Aug 2006
-
- *) Change: now the "tcp_nodelay" directive is turned on by default.
-
- *) Feature: the "msie_refresh" directive.
-
- *) Feature: the "recursive_error_pages" directive.
-
- *) Bugfix: the "rewrite" directive returned incorrect redirect, if the
- redirect had the captured escaped symbols from original URI.
-
-
-Changes with nginx 0.3.60 18 Aug 2006
-
- *) Bugfix: a worker process may got caught in an endless loop while an
- error redirection; the bug had appeared in 0.3.59.
-
-
-Changes with nginx 0.3.59 16 Aug 2006
-
- *) Feature: now is possible to do several redirection using the
- "error_page" directive.
-
- *) Bugfix: the "dav_access" directive did not support three parameters.
-
- *) Bugfix: the "error_page" directive did not changes the "Content-Type"
- header line after the "X-Accel-Redirect" was used; the bug had
- appeared in 0.3.58.
-
-
-Changes with nginx 0.3.58 14 Aug 2006
-
- *) Feature: the "error_page" directive supports the variables.
-
- *) Change: now the procfs interface instead of sysctl is used on Linux.
-
- *) Change: now the "Content-Type" header line is inherited from first
- response when the "X-Accel-Redirect" was used.
-
- *) Bugfix: the "error_page" directive did not redirect the 413 error.
-
- *) Bugfix: the trailing "?" did not remove old arguments if no new
- arguments were added to a rewritten URI.
-
- *) Bugfix: nginx could not run on 64-bit FreeBSD 7.0-CURRENT.
-
-
-Changes with nginx 0.3.57 09 Aug 2006
-
- *) Feature: the $ssl_client_serial variable.
-
- *) Bugfix: in the "!-e" operator of the "if" directive.
- Thanks to Andrian Budanstov.
-
- *) Bugfix: while a client certificate verification nginx did not send to
- a client the required certificates information.
-
- *) Bugfix: the $document_root variable did not support the variables in
- the "root" directive.
-
-
-Changes with nginx 0.3.56 04 Aug 2006
-
- *) Feature: the "dav_access" directive.
-
- *) Feature: the "if" directive supports the "-d", "!-d", "-e", "!-e",
- "-x", and "!-x" operators.
-
- *) Bugfix: a segmentation fault occurred if a request returned a
- redirect and some sent to client header lines were logged in the
- access log.
-
-
-Changes with nginx 0.3.55 28 Jul 2006
-
- *) Feature: the "stub" parameter in the "include" SSI command.
-
- *) Feature: the "block" SSI command.
-
- *) Feature: the unicode2nginx script was added to contrib.
-
- *) Bugfix: if a "root" was specified by variable only, then the root was
- relative to a server prefix.
-
- *) Bugfix: if the request contained "//" or "/./" and escaped symbols
- after them, then the proxied request was sent unescaped.
-
- *) Bugfix: the $r->header_in("Cookie") of the ngx_http_perl_module now
- returns all "Cookie" header lines.
-
- *) Bugfix: a segmentation fault occurred if
- "client_body_in_file_only on" was used and nginx switched to a next
- upstream.
-
- *) Bugfix: on some condition while reconfiguration character codes
- inside the "charset_map" may be treated invalid; the bug had appeared
- in 0.3.50.
-
-
-Changes with nginx 0.3.54 11 Jul 2006
-
- *) Feature: nginx now logs the subrequest information to the error log.
-
- *) Feature: the "proxy_next_upstream", "fastcgi_next_upstream", and
- "memcached_next_upstream" directives support the "off" parameter.
-
- *) Feature: the "debug_connection" directive supports the CIDR address
- form.
-
- *) Bugfix: if a response of proxied server or FastCGI server was
- converted from UTF-8 or back, then it may be transferred incomplete.
-
- *) Bugfix: the $upstream_response_time variable had the time of the
- first request to a backend only.
-
- *) Bugfix: nginx could not be built on amd64 platform; the bug had
- appeared in 0.3.53.
-
-
-Changes with nginx 0.3.53 07 Jul 2006
-
- *) Change: the "add_header" directive adds the string to 204, 301, and
- 302 responses.
-
- *) Feature: the "server" directive in the "upstream" context supports
- the "weight" parameter.
-
- *) Feature: the "server_name" directive supports the "*" wildcard.
-
- *) Feature: nginx supports the request body size more than 2G.
-
- *) Bugfix: if a client was successfully authorized using "satisfy_any
- on", then anyway the message "access forbidden by rule" was written
- in the log.
-
- *) Bugfix: the "PUT" method may erroneously not create a file and return
- the 409 code.
-
- *) Bugfix: if the IMAP/POP3 backend returned an error, then nginx
- continued proxying anyway.
-
-
-Changes with nginx 0.3.52 03 Jul 2006
-
- *) Change: the ngx_http_index_module behavior for the "POST /" requests
- is reverted to the 0.3.40 version state: the module now does not
- return the 405 error.
-
- *) Bugfix: the worker process may got caught in an endless loop if the
- limit rate was used; the bug had appeared in 0.3.37.
-
- *) Bugfix: ngx_http_charset_module logged "unknown charset" alert, even
- if the recoding was not needed; the bug had appeared in 0.3.50.
-
- *) Bugfix: if a code response of the PUT request was 409, then a
- temporary file was not removed.
-
-
-Changes with nginx 0.3.51 30 Jun 2006
-
- *) Bugfix: the "<" symbols might disappeared some conditions in the SSI;
- the bug had appeared in 0.3.50.
-
-
-Changes with nginx 0.3.50 28 Jun 2006
-
- *) Change: the "proxy_redirect_errors" and "fastcgi_redirect_errors"
- directives was renamed to the "proxy_intercept_errors" and
- "fastcgi_intercept_errors" directives.
-
- *) Feature: the ngx_http_charset_module supports the recoding from the
- single byte encodings to the UTF-8 encoding and back.
-
- *) Feature: the "X-Accel-Charset" response header line is supported in
- proxy and FastCGI mode.
-
- *) Bugfix: the "\" escape symbol in the "\"" and "\'" pairs in the SSI
- command was removed only if the command also has the "$" symbol.
-
- *) Bugfix: the "<!--" string might be added on some conditions in the
- SSI after inclusion.
-
- *) Bugfix: if the "Content-Length: 0" header line was in response, then
- in nonbuffered proxying mode the client connection was not closed.
-
-
-Changes with nginx 0.3.49 31 May 2006
-
- *) Bugfix: in the "set" directive.
-
- *) Bugfix: if two or more FastCGI subrequests was in SSI, then first
- subrequest output was included instead of second and following
- subrequests.
-
-
-Changes with nginx 0.3.48 29 May 2006
-
- *) Change: now the ngx_http_charset_module works for subrequests, if the
- response has no "Content-Type" header line.
-
- *) Bugfix: if the "proxy_pass" directive has no URI part, then the
- "proxy_redirect default" directive add the unnecessary slash in start
- of the rewritten redirect.
-
- *) Bugfix: the internal redirect always transform client's HTTP method
- to GET, now the transformation is made for the "X-Accel-Redirect"
- redirects only and if the method is not HEAD; the bug had appeared in
- 0.3.42.
-
- *) Bugfix: the ngx_http_perl_module could not be built, if the perl was
- built with the threads support; the bug had appeared in 0.3.46.
-
-
-Changes with nginx 0.3.47 23 May 2006
-
- *) Feature: the "upstream" directive.
-
- *) Change: now the "\" escape symbol in the "\"" and "\'" pairs in the
- SSI command is always removed.
-
-
-Changes with nginx 0.3.46 11 May 2006
-
- *) Feature: the "proxy_hide_header", "proxy_pass_header",
- "fastcgi_hide_header", and "fastcgi_pass_header" directives.
-
- *) Change: the "proxy_pass_x_powered_by", "fastcgi_x_powered_by", and
- "proxy_pass_server" directives were canceled.
-
- *) Feature: the "X-Accel-Buffering" response header line is supported in
- proxy mode.
-
- *) Bugfix: the reconfiguration bug and memory leaks in the
- ngx_http_perl_module.
-
-
-Changes with nginx 0.3.45 06 May 2006
-
- *) Feature: the "ssl_verify_client", "ssl_verify_depth", and
- "ssl_client_certificate" directives.
-
- *) Change: the $request_method variable now returns the main request
- method.
-
- *) Change: the &deg; symbol codes were changed in koi-win conversion
- table.
-
- *) Feature: the euro and N symbols were added to koi-win conversion
- table.
-
- *) Bugfix: if nginx distributed the requests among several backends and
- some backend failed, then requests intended for this backend was
- directed to one live backend only instead of being distributed among
- the rest.
-
-
-Changes with nginx 0.3.44 04 May 2006
-
- *) Feature: the "wait" parameter in the "include" SSI command.
-
- *) Feature: the Ukrainian and Byelorussian characters were added to
- koi-win conversion table.
-
- *) Bugfix: in the SSI.
-
-
-Changes with nginx 0.3.43 26 Apr 2006
-
- *) Bugfix: in the SSI.
-
-
-Changes with nginx 0.3.42 26 Apr 2006
-
- *) Feature: the "bind" option of the "listen" directive in IMAP/POP3
- proxy.
-
- *) Bugfix: if the same capture in the "rewrite" directive was used more
- then once.
-
- *) Bugfix: the $sent_http_content_type, $sent_http_content_length,
- $sent_http_last_modified, $sent_http_connection,
- $sent_http_keep_alive, and $sent_http_transfer_encoding variables
- were not written to access log.
-
- *) Bugfix: the $sent_http_cache_control returned value of the single
- "Cache-Control" response header line.
-
-
-Changes with nginx 0.3.41 21 Apr 2006
-
- *) Feature: the -v switch.
-
- *) Bugfix: the segmentation fault may occurred if the SSI page has
- remote subrequests.
-
- *) Bugfix: in FastCGI handling.
-
- *) Bugfix: if the perl modules path was not set using
- --with-perl_modules_path=PATH or the "perl_modules", then the
- segmentation fault was occurred.
-
-
-Changes with nginx 0.3.40 19 Apr 2006
-
- *) Feature: the ngx_http_dav_module supports the MKCOL method.
-
- *) Feature: the "create_full_put_path" directive.
-
- *) Feature: the "$limit_rate" variable.
-
-
-Changes with nginx 0.3.39 17 Apr 2006
-
- *) Feature: the "uninitialized_variable_warn" directive; the logging
- level of the "uninitialized variable" message was lowered from
- "alert" to "warn".
-
- *) Feature: the "override_charset" directive.
-
- *) Change: now if the unknown variable is used in the "echo" and "if
- expr='$name'" SSI-commands, then the "unknown variable" message is
- not logged.
-
- *) Bugfix: the active connection counter increased on the exceeding of
- the connection limit specified by the "worker_connections" directive;
- the bug had appeared in 0.2.0.
-
- *) Bugfix: the limit rate might not work on some condition; the bug had
- appeared in 0.3.38.
-
-
-Changes with nginx 0.3.38 14 Apr 2006
-
- *) Feature: the ngx_http_dav_module.
-
- *) Change: the ngx_http_perl_module optimizations.
- Thanks to Sergey Skvortsov.
-
- *) Feature: the ngx_http_perl_module supports the $r->request_body_file
- method.
-
- *) Feature: the "client_body_in_file_only" directive.
-
- *) Workaround: now on disk overflow nginx tries to write access logs
- once a second only.
- Thanks to Anton Yuzhaninov and Maxim Dounin.
-
- *) Bugfix: now the "limit_rate" directive more precisely limits rate if
- rate is more than 100 Kbyte/s.
- Thanks to ForJest.
-
- *) Bugfix: now the IMAP/POP3 proxy escapes the "\r" and "\n" symbols in
- login and password to pass authorization server.
- Thanks to Maxim Dounin.
-
-
-Changes with nginx 0.3.37 07 Apr 2006
-
- *) Feature: the "limit_except" directive.
-
- *) Feature: the "if" directive supports the "!~", "!~*", "-f", and "!-f"
- operators.
-
- *) Feature: the ngx_http_perl_module supports the $r->request_body
- method.
-
- *) Bugfix: in the ngx_http_addition_filter_module.
-
-
-Changes with nginx 0.3.36 05 Apr 2006
-
- *) Feature: the ngx_http_addition_filter_module.
-
- *) Feature: the "proxy_pass" and "fastcgi_pass" directives may be used
- inside the "if" block.
-
- *) Feature: the "proxy_ignore_client_abort" and
- "fastcgi_ignore_client_abort" directives.
-
- *) Feature: the "$request_completion" variable.
-
- *) Feature: the ngx_http_perl_module supports the $r->request_method and
- $r->remote_addr.
-
- *) Feature: the ngx_http_ssi_module supports the "elif" command.
-
- *) Bugfix: the "\/" string in the expression of the "if" command of the
- ngx_http_ssi_module was treated incorrectly.
-
- *) Bugfix: in the regular expressions in the "if" command of the
- ngx_http_ssi_module.
-
- *) Bugfix: if the relative path was specified in the
- "client_body_temp_path", "proxy_temp_path", "fastcgi_temp_path", and
- "perl_modules" directives, then the directory was used relatively to
- a current path but not to a server prefix.
-
-
-Changes with nginx 0.3.35 22 Mar 2006
-
- *) Bugfix: the accept-filter and the TCP_DEFER_ACCEPT option were set
- for first "listen" directive only; the bug had appeared in 0.3.31.
-
- *) Bugfix: in the "proxy_pass" directive without the URI part in a
- subrequest.
-
-
-Changes with nginx 0.3.34 21 Mar 2006
-
- *) Feature: the "add_header" directive supports the variables.
-
-
-Changes with nginx 0.3.33 15 Mar 2006
-
- *) Feature: the "http_503" parameter of the "proxy_next_upstream" or
- "fastcgi_next_upstream" directives.
-
- *) Bugfix: ngx_http_perl_module did not work with inlined in the
- configuration code, if it was not started with the "sub" word.
-
- *) Bugfix: in the "post_action" directive.
-
-
-Changes with nginx 0.3.32 11 Mar 2006
-
- *) Bugfix: the debug logging on startup and reconfiguration time was
- removed; the bug had appeared in 0.3.31.
-
-
-Changes with nginx 0.3.31 10 Mar 2006
-
- *) Change: now nginx passes the malformed proxied backend responses.
-
- *) Feature: the "listen" directives support the address in the "*:port"
- form.
-
- *) Feature: the EVFILER_TIMER support in MacOSX 10.4.
-
- *) Workaround: for MacOSX 64-bit kernel kqueue millisecond timeout bug.
- Thanks to Andrei Nigmatulin.
-
- *) Bugfix: if there were several "listen" directives listening one
- various addresses inside one server, then server names like
- "*.domain.tld" worked for first address only; the bug had appeared in
- 0.3.18.
-
- *) Bugfix: if the HTTPS protocol was used in the "proxy_pass" directive
- and the request body was in temporary file then the request was not
- transferred.
-
- *) Bugfix: perl 5.8.8 compatibility.
-
-
-Changes with nginx 0.3.30 22 Feb 2006
-
- *) Change: the ECONNABORTED error log level was changed to "error" from
- "crit".
-
- *) Bugfix: the ngx_http_perl_module could not be build without the
- ngx_http_ssi_filter_module.
-
- *) Bugfix: nginx could not be built on i386 platform, if the PIC was
- used; the bug had appeared in 0.3.27.
-
-
-Changes with nginx 0.3.29 20 Feb 2006
-
- *) Feature: now nginx uses less memory, if PHP in FastCGI mode sends
- many warnings before the response.
-
- *) Bugfix: the "Transfer-Encoding: chunked" header line was issued in
- the 204 responses for the HTTP/1.1 requests.
-
- *) Bugfix: nginx returned the 502 response, if the complete response
- header lines were transferred in a separate FastCGI records.
-
- *) Bugfix: if the proxied URI was specified in the "post_action"
- directive, then it ran only after a successful completion of a
- request.
-
-
-Changes with nginx 0.3.28 16 Feb 2006
-
- *) Feature: the "restrict_host_names" directive was canceled.
-
- *) Feature: the --with-cpu-opt=ppc64 configuration parameter.
-
- *) Bugfix: on some condition the proxied connection with a client was
- terminated prematurely.
- Thanks to Vladimir Shutoff.
-
- *) Bugfix: the "X-Accel-Limit-Rate" header line was not taken into
- account if the request was redirected using the "X-Accel-Redirect"
- header line.
-
- *) Bugfix: the "post_action" directive ran only after a successful
- completion of a request.
-
- *) Bugfix: the proxied response body generated by the "post_action"
- directive was transferred to a client.
-
-
-Changes with nginx 0.3.27 08 Feb 2006
-
- *) Change: the "variables_hash_max_size" and
- "variables_hash_bucket_size" directives.
-
- *) Feature: the $body_bytes_sent variable can be used not only in the
- "log_format" directive.
-
- *) Feature: the $ssl_protocol and $ssl_cipher variables.
-
- *) Feature: the cache line size detection for widespread CPUs at start
- time.
-
- *) Feature: now the "accept_mutex" directive is supported using fcntl(2)
- on platforms different from i386, amd64, sparc64, and ppc.
-
- *) Feature: the "lock_file" directive and the --with-lock-path=PATH
- autoconfiguration directive.
-
- *) Bugfix: if the HTTPS protocol was used in the "proxy_pass" directive
- then the requests with the body was not transferred.
-
-
-Changes with nginx 0.3.26 03 Feb 2006
-
- *) Change: the "optimize_host_names" directive was renamed to the
- "optimize_server_names".
-
- *) Bugfix: if in the "proxy_pass" directive was no the URI part, then
- the main request URI was transferred to a backend while proxying the
- SSI subrequest.
-
-
-Changes with nginx 0.3.25 01 Feb 2006
-
- *) Bugfix: the segmentation fault was occurred on start or while
- reconfiguration if there was invalid configuration; the bug had
- appeared in 0.3.24.
-
-
-Changes with nginx 0.3.24 01 Feb 2006
-
- *) Workaround: for bug in FreeBSD kqueue.
-
- *) Bugfix: now a response generated by the "post_action" directive is
- not transferred to a client.
-
- *) Bugfix: the memory leaks were occurring if many log files were used.
-
- *) Bugfix: the first "proxy_redirect" directive was working inside one
- location.
-
- *) Bugfix: on 64-bit platforms segmentation fault may occurred on start
- if the many names were used in the "server_name" directives; the bug
- had appeared in 0.3.18.
-
-
-Changes with nginx 0.3.23 24 Jan 2006
-
- *) Feature: the "optimize_host_names" directive.
-
- *) Bugfix: in using of the variables in the "path" and "alias"
- directives.
-
- *) Bugfix: the ngx_http_perl_module was incorrectly built on Linux and
- Solaris.
-
-
-Changes with nginx 0.3.22 17 Jan 2006
-
- *) Feature: the ngx_http_perl_module supports the $r->args and
- $r->unescape methods.
-
- *) Feature: the method $r->query_string of ngx_http_perl_module was
- canceled.
-
- *) Bugfix: segmentation fault was occurred if the "none" or "blocked"
- values was specified in the "valid_referers" directive; the bug had
- appeared in 0.3.18.
-
-
-Changes with nginx 0.3.21 16 Jan 2006
-
- *) Feature: the ngx_http_perl_module.
-
- *) Change: the "valid_referers" directive allows the referreres without
- URI part.
-
-
-Changes with nginx 0.3.20 11 Jan 2006
-
- *) Bugfix: in SSI handling.
-
- *) Bugfix: the ngx_http_memcached_module did not support the keys in the
- "/usr?args" form.
-
-
-Changes with nginx 0.3.19 28 Dec 2005
-
- *) Feature: the "path" and "alias" directives support the variables.
-
- *) Change: now the "valid_referers" directive again checks the URI part.
-
- *) Bugfix: in SSI handling.
-
-
-Changes with nginx 0.3.18 26 Dec 2005
-
- *) Feature: the "server_names" directive supports the ".domain.tld"
- names.
-
- *) Feature: the "server_names" directive uses the hash for the
- "*.domain.tld" names and more effective hash for usual names.
-
- *) Change: the "server_names_hash_max_size" and
- "server_names_hash_bucket_size" directives.
-
- *) Change: the "server_names_hash" and "server_names_hash_threshold"
- directives were canceled.
-
- *) Feature: the "valid_referers" directive uses the hash site names.
-
- *) Change: now the "valid_referers" directive checks the site names only
- without the URI part.
-
- *) Bugfix: some ".domain.tld" names incorrectly processed by the
- ngx_http_map_module.
-
- *) Bugfix: segmentation fault was occurred if configuration file did not
- exist; the bug had appeared in 0.3.12.
-
- *) Bugfix: on 64-bit platforms segmentation fault may occurred on start;
- the bug had appeared in 0.3.16.
-
-
-Changes with nginx 0.3.17 18 Dec 2005
-
- *) Change: now on Linux configure checks the presence of epoll and
- sendfile64() in kernel.
-
- *) Feature: the "map" directive supports domain names in the
- ".domain.tld" form.
-
- *) Bugfix: the timeouts were not used in SSL handshake; the bug had
- appeared in 0.2.4.
-
- *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive.
-
- *) Bugfix: when the HTTPS protocol was used in the "proxy_pass"
- directive the port 80 was used by default.
-
-
-Changes with nginx 0.3.16 16 Dec 2005
-
- *) Feature: the ngx_http_map_module.
-
- *) Feature: the "types_hash_max_size" and "types_hash_bucket_size"
- directives.
-
- *) Feature: the "ssi_value_length" directive.
-
- *) Feature: the "worker_rlimit_core" directive.
-
- *) Workaround: the connection number in logs was always 1 if nginx was
- built by the icc 8.1 or 9.0 compilers with optimization for
- Pentium 4.
-
- *) Bugfix: the "config timefmt" SSI command set incorrect time format.
-
- *) Bugfix: nginx did not close connection to IMAP/POP3 backend for the
- SSL connections; the bug had appeared in 0.3.13.
- Thanks to Rob Mueller.
-
- *) Bugfix: segmentation fault may occurred in at SSL shutdown; the bug
- had appeared in 0.3.13.
-
-
-Changes with nginx 0.3.15 07 Dec 2005
-
- *) Feature: the new 444 code of the "return" directive to close
- connection.
-
- *) Feature: the "so_keepalive" directive in IMAP/POP3 proxy.
-
- *) Bugfix: if there are unclosed connection nginx now calls abort() only
- on gracefull quit and active "debug_points" directive.
-
-
-Changes with nginx 0.3.14 05 Dec 2005
-
- *) Bugfix: in the 304 response the body was transferred; the bug had
- appeared in 0.3.13.
-
-
-Changes with nginx 0.3.13 05 Dec 2005
-
- *) Feature: the IMAP/POP3 proxy supports STARTTLS and STLS.
-
- *) Bugfix: the IMAP/POP3 proxy did not work with the select, poll, and
- /dev/poll methods.
-
- *) Bugfix: in SSI handling.
-
- *) Bugfix: now Solaris sendfilev() is not used to transfer the client
- request body to FastCGI-server via the unix domain socket.
-
- *) Bugfix: the "auth_basic" directive did not disable the authorization;
- the bug had appeared in 0.3.11.
-
-
-Changes with nginx 0.3.12 26 Nov 2005
-
- *) Security: if nginx was built with the ngx_http_realip_module and the
- "satisfy_any on" directive was used, then access and authorization
- directives did not work. The ngx_http_realip_module was not built and
- is not built by default.
-
- *) Change: the "$time_gmt" variable name was changed to "$time_local".
-
- *) Change: the "proxy_header_buffer_size" and
- "fastcgi_header_buffer_size" directives was renamed to the
- "proxy_buffer_size" and "fastcgi_buffer_size" directives.
-
- *) Feature: the ngx_http_memcached_module.
-
- *) Feature: the "proxy_buffering" directive.
-
- *) Bugfix: the changes in accept mutex handling when the "rtsig" method
- was used; the bug had appeared in 0.3.0.
-
- *) Bugfix: if the client sent the "Transfer-Encoding: chunked" header
- line, then nginx returns the 411 error.
-
- *) Bugfix: if the "auth_basic" directive was inherited from the http
- level, then the realm in the "WWW-Authenticate" header line was
- without the "Basic realm" text.
-
- *) Bugfix: if the "combined" format was explicitly specified in the
- "access_log" directive, then the empty lines was written to the log;
- the bug had appeared in 0.3.8.
-
- *) Bugfix: nginx did not run on the sparc platform under any OS except
- Solaris.
-
- *) Bugfix: now it is not necessary to place space between the quoted
- string and closing bracket in the "if" directive.
-
-
-Changes with nginx 0.3.11 15 Nov 2005
-
- *) Bugfix: nginx did not pass the client request headers and body while
- proxying; the bug had appeared in 0.3.10.
-
-
-Changes with nginx 0.3.10 15 Nov 2005
-
- *) Change: the "valid_referers" directive and the "$invalid_referer"
- variable were moved to the new ngx_http_referer_module from the
- ngx_http_rewrite_module.
-
- *) Change: the "$apache_bytes_sent" variable name was changed to
- "$body_bytes_sent".
-
- *) Feature: the "$sent_http_..." variables.
-
- *) Feature: the "if" directive supports the "=" and "!=" operations.
-
- *) Feature: the "proxy_pass" directive supports the HTTPS protocol.
-
- *) Feature: the "proxy_set_body" directive.
-
- *) Feature: the "post_action" directive.
-
- *) Feature: the ngx_http_empty_gif_module.
-
- *) Feature: the "worker_cpu_affinity" directive for Linux.
-
- *) Bugfix: the "rewrite" directive did not unescape URI part in
- redirect, now it is unescaped except the %00-%25 and %7F-%FF
- characters.
-
- *) Bugfix: nginx could not be built by the icc 9.0 compiler.
-
- *) Bugfix: if the SSI was enabled for zero size static file, then the
- chunked response was encoded incorrectly.
-
-
-Changes with nginx 0.3.9 10 Nov 2005
-
- *) Bugfix: nginx considered URI as unsafe if two any symbols was between
- two slashes; the bug had appeared in 0.3.8.
-
-
-Changes with nginx 0.3.8 09 Nov 2005
-
- *) Security: nginx now checks URI got from a backend in
- "X-Accel-Redirect" header line or in SSI file for the "/../" paths
- and zeroes.
-
- *) Change: nginx now does not treat the empty user name in the
- "Authorization" header line as valid one.
-
- *) Feature: the "ssl_session_timeout" directives of the
- ngx_http_ssl_module and ngx_imap_ssl_module.
-
- *) Feature: the "auth_http_header" directive of the
- ngx_imap_auth_http_module.
-
- *) Feature: the "add_header" directive.
-
- *) Feature: the ngx_http_realip_module.
-
- *) Feature: the new variables to use in the "log_format" directive:
- $bytes_sent, $apache_bytes_sent, $status, $time_gmt, $uri,
- $request_time, $request_length, $upstream_status,
- $upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
- $connection, $pipe, and $msec. The parameters in the "%name" form
- will be canceled soon.
-
- *) Change: now the false variable values in the "if" directive are the
- empty string "" and string starting with "0".
-
- *) Bugfix: while using proxied or FastCGI-server nginx may leave
- connections and temporary files with client requests in open state.
-
- *) Bugfix: the worker processes did not flush the buffered logs on
- graceful exit.
-
- *) Bugfix: if the request URI was changes by the "rewrite" directive and
- the request was proxied in location given by regular expression, then
- the incorrect request was transferred to backend; the bug had
- appeared in 0.2.6.
-
- *) Bugfix: the "expires" directive did not remove the previous "Expires"
- header.
-
- *) Bugfix: nginx may stop to accept requests if the "rtsig" method and
- several worker processes were used.
-
- *) Bugfix: the "\"" and "\'" escape symbols were incorrectly handled in
- SSI commands.
-
- *) Bugfix: if the response was ended just after the SSI command and
- gzipping was used, then the response did not transferred complete or
- did not transferred at all.
-
-
-Changes with nginx 0.3.7 27 Oct 2005
-
- *) Feature: the "access_log" supports the "buffer=" parameter.
-
- *) Bugfix: nginx could not be built on platforms different from i386,
- amd64, sparc, and ppc; the bug had appeared in 0.3.2.
-
-
-Changes with nginx 0.3.6 24 Oct 2005
-
- *) Change: now the IMAP/POP3 proxy do not send the empty login to
- authorization server.
-
- *) Feature: the "log_format" supports the variables in the $name form.
-
- *) Bugfix: if at least in one server was no the "listen" directive, then
- nginx did not listen on the 80 port; the bug had appeared in 0.3.3.
-
- *) Bugfix: if the URI part is omitted in "proxy_pass" directive, the 80
- port was always used.
-
-
-Changes with nginx 0.3.5 21 Oct 2005
-
- *) Bugfix: the segmentation fault may occurred if the IMAP/POP3 login
- was changed by authorization server; the bug had appeared in 0.2.2.
-
- *) Bugfix: the accept mutex did not work and all connections were
- handled by one process; the bug had appeared in 0.3.3.
-
- *) Bugfix: the timeout did not work if the "rtsig" method and the
- "timer_resolution" directive were used.
-
-
-Changes with nginx 0.3.4 19 Oct 2005
-
- *) Bugfix: nginx could not be built on Linux 2.4+ and MacOS X; the bug
- had appeared in 0.3.3.
-
-
-Changes with nginx 0.3.3 19 Oct 2005
-
- *) Change: the "bl" and "af" parameters of the "listen" directive was
- renamed to the "backlog" and "accept_filter".
-
- *) Feature: the "rcvbuf" and "sndbuf" parameters of the "listen"
- directive.
-
- *) Change: the "$msec" log parameter does not require now the additional
- the gettimeofday() system call.
-
- *) Feature: the -t switch now tests the "listen" directives.
-
- *) Bugfix: if the invalid address was specified in the "listen"
- directive, then after the -HUP signal nginx left an open socket in
- the CLOSED state.
-
- *) Bugfix: the mime type may be incorrectly set to default value for
- index file with variable in the name; the bug had appeared in 0.3.0.
-
- *) Feature: the "timer_resolution" directive.
-
- *) Feature: the millisecond "$upstream_response_time" log parameter.
-
- *) Bugfix: a temporary file with client request body now is removed just
- after the response header was transferred to a client.
-
- *) Bugfix: OpenSSL 0.9.6 compatibility.
-
- *) Bugfix: the SSL certificate and key file paths could not be relative.
-
- *) Bugfix: the "ssl_prefer_server_ciphers" directive did not work in the
- ngx_imap_ssl_module.
-
- *) Bugfix: the "ssl_protocols" directive allowed to specify the single
- protocol only.
-
-
-Changes with nginx 0.3.2 12 Oct 2005
-
- *) Feature: the Sun Studio 10 C compiler support.
-
- *) Feature: the "proxy_upstream_max_fails",
- "proxy_upstream_fail_timeout", "fastcgi_upstream_max_fails", and
- "fastcgi_upstream_fail_timeout" directives.
-
-
-Changes with nginx 0.3.1 10 Oct 2005
-
- *) Bugfix: the segmentation fault occurred when the signal queue
- overflowed if the "rtsig" method was used; the bug had appeared in
- 0.2.0.
-
- *) Change: correct handling of the "\\", "\"", "\'", and "\$" pairs in
- SSI.
-
-
-Changes with nginx 0.3.0 07 Oct 2005
-
- *) Change: the 10-days live time limit of worker process was eliminated.
- The limit was introduced because of millisecond timers overflow.
-
-
-Changes with nginx 0.2.6 05 Oct 2005
-
- *) Change: while using load-balancing the time before the failed backend
- retry was decreased from 60 to 10 seconds.
-
- *) Change: the "proxy_pass_unparsed_uri" was canceled, the original URI
- now passed, if the URI part is omitted in "proxy_pass" directive.
-
- *) Feature: the "error_page" directive supports redirects and allows
- more flexible to change an error code.
-
- *) Change: the charset in the "Content-Type" header line now is ignored
- in proxied subrequests.
-
- *) Bugfix: if the URI was changed in the "if" block and request did not
- found new configuration, then the ngx_http_rewrite_module rules ran
- again.
-
- *) Bugfix: if the "set" directive set the ngx_http_geo_module variable
- in some configuration part, the this variable was not available in
- other configuration parts and the "using uninitialized variable"
- error was occurred; the bug had appeared in 0.2.2.
-
-
-Changes with nginx 0.2.5 04 Oct 2005
-
- *) Change: the duplicate value of the ngx_http_geo_module variable now
- causes the warning and changes old value.
-
- *) Feature: the ngx_http_ssi_module supports the "set" command.
-
- *) Feature: the ngx_http_ssi_module supports the "file" parameter in the
- "include" command.
-
- *) Feature: the ngx_http_ssi_module supports the variable value
- substitutions in expressions of the "if" command.
-
-
-Changes with nginx 0.2.4 03 Oct 2005
-
- *) Feature: the ngx_http_ssi_module supports "$var=text", "$var!=text",
- "$var=/text/", and "$var!=/text/" expressions in the "if" command.
-
- *) Bugfix: in proxying location without trailing slash; the bug had
- appeared in 0.1.44.
-
- *) Bugfix: the segmentation fault may occurred if the "rtsig" method was
- used; the bug had appeared in 0.2.0.
-
-
-Changes with nginx 0.2.3 30 Sep 2005
-
- *) Bugfix: nginx could not be built without the --with-debug option; the
- bug had appeared in 0.2.2.
-
-
-Changes with nginx 0.2.2 30 Sep 2005
-
- *) Feature: the "config errmsg" command of the ngx_http_ssi_module.
-
- *) Change: the ngx_http_geo_module variables can be overridden by the
- "set" directive.
-
- *) Feature: the "ssl_protocols" and "ssl_prefer_server_ciphers"
- directives of the ngx_http_ssl_module and ngx_imap_ssl_module.
-
- *) Bugfix: the ngx_http_autoindex_module did not show correctly the long
- file names;
-
- *) Bugfix: the ngx_http_autoindex_module now do not show the files
- starting by dot.
-
- *) Bugfix: if the SSL handshake failed then another connection may be
- closed too.
- Thanks to Rob Mueller.
-
- *) Bugfix: the export versions of MSIE 5.x could not connect via HTTPS.
-
-
-Changes with nginx 0.2.1 23 Sep 2005
-
- *) Bugfix: if all backend using in load-balancing failed after one
- error, then nginx may got caught in an endless loop; the bug had
- appeared in 0.2.0.
-
-
-Changes with nginx 0.2.0 23 Sep 2005
-
- *) The pid-file names used during online upgrade was changed and now is
- not required a manual rename operation. The old master process adds
- the ".oldbin" suffix to its pid-file and executes a new binary file.
- The new master process creates usual pid-file without the ".newbin"
- suffix. If the master process exits, then old master process renames
- back its pid-file with the ".oldbin" suffix to the pid-file without
- suffix.
-
- *) Change: the "worker_connections" directive, new name of the
- "connections" directive; now the directive specifies maximum number
- of connections, but not maximum socket descriptor number.
-
- *) Feature: SSL supports the session cache inside one worker process.
-
- *) Feature: the "satisfy_any" directive.
-
- *) Change: the ngx_http_access_module and ngx_http_auth_basic_module do
- not run for subrequests.
-
- *) Feature: the "worker_rlimit_nofile" and "worker_rlimit_sigpending"
- directives.
-
- *) Bugfix: if all backend using in load-balancing failed after one
- error, then nginx did not try do connect to them during 60 seconds.
-
- *) Bugfix: in IMAP/POP3 command argument parsing.
- Thanks to Rob Mueller.
-
- *) Bugfix: errors while using SSL in IMAP/POP3 proxy.
-
- *) Bugfix: errors while using SSI and gzipping.
-
- *) Bugfix: the "Expires" and "Cache-Control" header lines were omitted
- from the 304 responses.
- Thanks to Alexandr Kukushkin.
-
-
-Changes with nginx 0.1.45 08 Sep 2005
-
- *) Change: the "ssl_engine" directive was canceled in the
- ngx_http_ssl_module and now is introduced at global level.
-
- *) Bugfix: the responses with SSI subrequests did not transferred via
- SSL connection.
-
- *) Various bug fixes in the IMAP/POP3 proxy.
-
-
-Changes with nginx 0.1.44 06 Sep 2005
-
- *) Feature: the IMAP/POP3 proxy supports SSL.
-
- *) Feature: the "proxy_timeout" directive of the ngx_imap_proxy_module.
-
- *) Feature: the "userid_mark" directive.
-
- *) Feature: the $remote_user variable value is determined independently
- of authorization use.
-
-
-Changes with nginx 0.1.43 30 Aug 2005
-
- *) Feature: the listen(2) backlog in the "listen" directive can be
- changed using the -HUP signal.
-
- *) Feature: the geo2nginx.pl script was added to contrib.
-
- *) Change: the FastCGI parameters with the empty values now are passed
- to a server.
-
- *) Bugfix: the segmentation fault occurred or the worker process may got
- caught in an endless loop if the proxied or FastCGI server sent the
- "Cache-Control" header line and the "expires" directive was used; in
- the proxied mode the bug had appeared in 0.1.29.
-
-
-Changes with nginx 0.1.42 23 Aug 2005
-
- *) Bugfix: if the request URI had a zero length after the processing in
- the ngx_http_proxy_module, then the segmentation fault or bus error
- occurred in the ngx_http_proxy_module.
-
- *) Bugfix: the "limit_rate" directive did not work inside the "if"
- block; the bug had appeared in 0.1.38.
-
-
-Changes with nginx 0.1.41 25 Jul 2005
-
- *) Bugfix: if the variable was used in the configuration file, then it
- can not be used in SSI.
-
-
-Changes with nginx 0.1.40 22 Jul 2005
-
- *) Bugfix: if a client sent too long header line, then the request
- information did not logged in the error log.
-
- *) Bugfix: the "Set-Cookie" header line was not transferred when the
- "X-Accel-Redirect" was used; the bug had appeared in 0.1.39.
-
- *) Bugfix: the "Content-Disposition" header line was not transferred
- when the "X-Accel-Redirect" was used.
-
- *) Bugfix: the master process did not close the listen socket on the
- SIGQUIT signal.
-
- *) Bugfix: after on-line upgrade on Linux and Solaris the process name
- became shorter in the "ps" command.
-
-
-Changes with nginx 0.1.39 14 Jul 2005
-
- *) The changes in the ngx_http_charset_module: the "default_charset"
- directive was canceled; the "charset" directive sets the response
- charset; the "source_charset" directive sets the source charset only.
-
- *) Bugfix: the backend "WWW-Authenticate" header line did not
- transferred while the 401 response code redirecting.
-
- *) Bugfix: the ngx_http_proxy_module and ngx_http_fastcgi_module may
- close a connection before anything was transferred to a client; the
- bug had appeared in 0.1.38.
-
- *) Workaround: the Linux glibc crypt_r() initialization bug.
-
- *) Bugfix: the ngx_http_ssi_module did not support the relative URI in
- the "include virtual" command.
-
- *) Bugfix: if the backend response had the "Location" header line and
- nginx should not rewrite this line, then the 500 code response body
- was transferred; the bug had appeared in 0.1.29.
-
- *) Bugfix: some directives of the ngx_http_proxy_module and
- ngx_http_fastcgi_module were not inherited from the server to the
- location level; the bug had appeared in 0.1.29.
-
- *) Bugfix: the ngx_http_ssl_module did not support the certificate
- chain.
-
- *) Bugfix: the ngx_http_autoindex_module did not show correctly the long
- file names; the bug had appeared in 0.1.38.
-
- *) Bugfixes in IMAP/POP3 proxy in interaction with a backend at the
- login state.
-
-
-Changes with nginx 0.1.38 08 Jul 2005
-
- *) Feature: the "limit_rate" directive is supported in proxy and FastCGI
- mode.
-
- *) Feature: the "X-Accel-Limit-Rate" response header line is supported
- in proxy and FastCGI mode.
-
- *) Feature: the "break" directive.
-
- *) Feature: the "log_not_found" directive.
-
- *) Bugfix: the response status code was not changed when request was
- redirected by the ""X-Accel-Redirect" header line.
-
- *) Bugfix: the variables set by the "set" directive could not be used in
- SSI.
-
- *) Bugfix: the segmentation fault may occurred if the SSI page has more
- than one remote subrequest.
-
- *) Bugfix: nginx treated the backend response as invalid if the status
- line in the header was transferred in two packets; the bug had
- appeared in 0.1.29.
-
- *) Feature: the "ssi_types" directive.
-
- *) Feature: the "autoindex_exact_size" directive.
-
- *) Bugfix: the ngx_http_autoindex_module did not support the long file
- names in UTF-8.
-
- *) Feature: the IMAP/POP3 proxy.
-
-
-Changes with nginx 0.1.37 23 Jun 2005
-
- *) Change: now the "\n" is added to the end of the "nginx.pid" file.
-
- *) Bugfix: the responses may be transferred not completely, if many
- parts or the big parts were included by SSI.
-
- *) Bugfix: if all backends had returned the 404 reponse and the
- "http_404" parameter of the "proxy_next_upstream" or
- "fastcgi_next_upstream" directives was used, then nginx started to
- request all backends again.
-
-
-Changes with nginx 0.1.36 15 Jun 2005
-
- *) Change: if the request header has duplicate the "Host", "Connection",
- "Content-Length", or "Authorization" lines, then nginx now returns
- the 400 error.
-
- *) Change: the "post_accept_timeout" directive was canceled.
-
- *) Feature: the "default", "af=", "bl=", "deferred", and "bind"
- parameters of the "listen" directive.
-
- *) Feature: the FreeBSD accept filters support.
-
- *) Feature: the Linux TCP_DEFER_ACCEPT support.
-
- *) Bugfix: the ngx_http_autoindex_module did not support the file names
- in UTF-8.
-
- *) Bugfix: the new log file can be rotated by the -USR1 signal only if
- the reconfiguration by the -HUP signal was made twice.
-
-
-Changes with nginx 0.1.35 07 Jun 2005
-
- *) Feature: the "working_directory" directive.
-
- *) Feature: the "port_in_redirect" directive.
-
- *) Bugfix: the segmentation fault was occurred if the backend response
- header was in several packets; the bug had appeared in 0.1.29.
-
- *) Bugfix: if more than 10 servers were configured or some server did
- not use the "listen" directive, then the segmentation fault was
- occurred on the start.
-
- *) Bugfix: the segmentation fault might occur if the response was bigger
- than the temporary file.
-
- *) Bugfix: nginx returned the 400 response on requests like
- "GET http://www.domain.com/uri HTTP/1.0"; the bug had appeared in
- 0.1.28.
-
-
-Changes with nginx 0.1.34 26 May 2005
-
- *) Bugfix: the worker process may got caught in an endless loop if the
- big response part were include by SSI.
-
- *) Bugfix: the variables set by the "set" directive were not available
- in SSI.
-
- *) Feature: the "autoindex_localtime" directive.
-
- *) Bugfix: the empty value of the "proxy_set_header" directive forbids
- the client request header line passing.
-
-
-Changes with nginx 0.1.33 23 May 2005
-
- *) Bugfix: nginx could not be built with the --without-pcre parameter;
- the bug had appeared in 0.1.29.
-
- *) Bugfix: 3, 4, 7, and 8 the "proxy_set_header" directives in one level
- cause the bus fault on start up.
-
- *) Bugfix: the HTTP protocol was specified in the HTTPS redirects.
-
- *) Bugfix: if the "rewrite" directive used the captures inside the "if"
- directive, then the 500 error code was returned.
-
-
-Changes with nginx 0.1.32 19 May 2005
-
- *) Bugfix: the arguments were omitted in the redirects, issued by the
- "rewrite" directive; the bug had appeared in 0.1.29.
-
- *) Feature: the "if" directive supports the captures in regular
- expressions.
-
- *) Feature: the "set" directive supports the variables and the captures
- of regular expressions.
-
- *) Feature: the "X-Accel-Redirect" response header line is supported in
- proxy and FastCGI mode.
-
-
-Changes with nginx 0.1.31 16 May 2005
-
- *) Bugfix: the response encrypted by SSL may not transferred complete.
-
- *) Bugfix: errors while processing FastCGI response by SSI.
-
- *) Bugfix: errors while using SSI and gzipping.
-
- *) Bugfix: the redirect with the 301 code was transferred without
- response body; the bug had appeared in 0.1.30.
-
-
-Changes with nginx 0.1.30 14 May 2005
-
- *) Bugfix: the worker process may got caught in an endless loop if the
- SSI was used.
-
- *) Bugfix: the response encrypted by SSL may not transferred complete.
-
- *) Bugfix: if the length of the response part received at once from
- proxied or FastCGI server was equal to 500, then nginx returns the
- 500 response code; in proxy mode the bug had appeared in 0.1.29 only.
-
- *) Bugfix: nginx did not consider the directives with 8 or 9 parameters
- as invalid.
-
- *) Feature: the "return" directive can return the 204 response code.
-
- *) Feature: the "ignore_invalid_headers" directive.
-
-
-Changes with nginx 0.1.29 12 May 2005
-
- *) Feature: the ngx_http_ssi_module supports "include virtual" command.
-
- *) Feature: the ngx_http_ssi_module supports the condition command like
- 'if expr="$NAME"' and "else" and "endif" commands. Only one nested
- level is supported.
-
- *) Feature: the ngx_http_ssi_module supports the DATE_LOCAL and DATE_GMT
- variables and "config timefmt" command.
-
- *) Feature: the "ssi_ignore_recycled_buffers" directive.
-
- *) Bugfix: the "echo" command did not show the default value for the
- empty QUERY_STRING variable.
-
- *) Change: the ngx_http_proxy_module was rewritten.
-
- *) Feature: the "proxy_redirect", "proxy_pass_request_headers",
- "proxy_pass_request_body", and "proxy_method" directives.
-
- *) Feature: the "proxy_set_header" directive. The "proxy_x_var" was
- canceled and must be replaced with the proxy_set_header directive.
-
- *) Change: the "proxy_preserve_host" is canceled and must be replaced
- with the "proxy_set_header Host $host" and the "proxy_redirect off"
- directives, the "proxy_set_header Host $host:$proxy_port" directive
- and the appropriate proxy_redirect directives.
-
- *) Change: the "proxy_set_x_real_ip" is canceled and must be replaced
- with the "proxy_set_header X-Real-IP $remote_addr" directive.
-
- *) Change: the "proxy_add_x_forwarded_for" is canceled and must be
- replaced with
- the "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for"
- directive.
-
- *) Change: the "proxy_set_x_url" is canceled and must be replaced with
- the "proxy_set_header X-URL http://$host:$server_port$request_uri"
- directive.
-
- *) Feature: the "fastcgi_param" directive.
-
- *) Change: the "fastcgi_root", "fastcgi_set_var" and "fastcgi_params"
- directive are canceled and must be replaced with the fastcgi_param
- directives.
-
- *) Feature: the "index" directive can use the variables.
-
- *) Feature: the "index" directive can be used at http and server levels.
-
- *) Change: the last index only in the "index" directive can be absolute.
-
- *) Feature: the "rewrite" directive can use the variables.
-
- *) Feature: the "internal" directive.
-
- *) Feature: the CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT, SERVER_ADDR,
- SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT, SERVER_NAME,
- REQUEST_METHOD, REQUEST_URI, and REMOTE_USER variables.
-
- *) Change: nginx now passes the invalid lines in a client request
- headers or a backend response header.
-
- *) Bugfix: if the backend did not transfer response for a long time and
- the "send_timeout" was less than "proxy_read_timeout", then nginx
- returned the 408 response.
-
- *) Bugfix: the segmentation fault was occurred if the backend sent an
- invalid line in response header; the bug had appeared in 0.1.26.
-
- *) Bugfix: the segmentation fault may occurred in FastCGI fault
- tolerance configuration.
-
- *) Bugfix: the "expires" directive did not remove the previous "Expires"
- and "Cache-Control" headers.
-
- *) Bugfix: nginx did not take into account trailing dot in "Host" header
- line.
-
- *) Bugfix: the ngx_http_auth_module did not work under Linux.
-
- *) Bugfix: the rewrite directive worked incorrectly, if the arguments
- were in a request.
-
- *) Bugfix: nginx could not be built on MacOS X.
-
-
-Changes with nginx 0.1.28 08 Apr 2005
-
- *) Bugfix: nginx hogs CPU while proxying the huge files.
-
- *) Bugfix: nginx could not be built by gcc 4.0 on Linux.
-
-
-Changes with nginx 0.1.27 28 Mar 2005
-
- *) Feature: the "blocked" parameter of the "valid_referers" directive.
-
- *) Change: the errors while handling the request header now logged at
- "info" level. The server name and the "Host" and "Referer" header
- lines also logged.
-
- *) Change: the "Host" header line is also logged in error log.
-
- *) Feature: the proxy_pass_unparsed_uri directive. The special handling
- of the "://" symbols in URI, appeared in 0.1.11 version, now is
- canceled.
-
- *) Bugfix: nginx could not be built on FreeBSD and Linux, if the
- --without-ngx_http_auth_basic_module configuration parameter was
- used.
-
-
-Changes with nginx 0.1.26 22 Mar 2005
-
- *) Change: the invalid client header lines are now ignored and logged at
- the info level.
-
- *) Change: the server name is also logged in error log.
-
- *) Feature: the ngx_http_auth_basic_module module and the auth_basic and
- auth_basic_user_file directives.
-
-
-Changes with nginx 0.1.25 19 Mar 2005
-
- *) Bugfix: nginx did run on Linux parisc.
-
- *) Feature: nginx now does not start under FreeBSD if the sysctl
- kern.ipc.somaxconn value is too big.
-
- *) Bugfix: if a request was internally redirected by the
- ngx_http_index_module module to the ngx_http_proxy_module or
- ngx_http_fastcgi_module modules, then the index file was not closed
- after request completion.
-
- *) Feature: the "proxy_pass" can be used in location with regular
- expression.
-
- *) Feature: the ngx_http_rewrite_filter_module module supports the
- condition like "if ($HTTP_USER_AGENT ~ MSIE)".
-
- *) Bugfix: nginx started too slow if the large number of addresses and
- text values were used in the "geo" directive.
-
- *) Change: a variable name must be declared as "$name" in the "geo"
- directive. The previous variant without "$" is still supported, but
- will be removed soon.
-
- *) Feature: the "%{VARIABLE}v" logging parameter.
-
- *) Feature: the "set $name value" directive.
-
- *) Bugfix: gcc 4.0 compatibility.
-
- *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
-
-
-Changes with nginx 0.1.24 04 Mar 2005
-
- *) Feature: the ngx_http_ssi_filter_module supports the QUERY_STRING and
- DOCUMENT_URI variables.
-
- *) Bugfix: the ngx_http_autoindex_module may some times return the 404
- response for existent directory, if this directory was used in
- "alias" directive.
-
- *) Bugfix: the ngx_http_ssi_filter_module ran incorrectly for large
- responses.
-
- *) Bugfix: the lack of the "Referer" header line was always accounted as
- valid referrer.
-
-
-Changes with nginx 0.1.23 01 Mar 2005
-
- *) Feature: the ngx_http_ssi_filter_module and the ssi,
- ssi_silent_errors, and ssi_min_file_chunk directives. The 'echo
- var="HTTP_..." default=""' and 'echo var="REMOTE_ADDR"' commands are
- supported.
-
- *) Feature: the %request_time log parameter.
-
- *) Feature: if the request has no the "Host" header line, then the
- "proxy_preserve_host" directive set this header line to the first
- server name of the "server_name" directive.
-
- *) Bugfix: nginx could not be built on platforms different from i386,
- amd64, sparc, and ppc; the bug had appeared in 0.1.22.
-
- *) Bugfix: the ngx_http_autoindex_module now shows the information not
- about the symlink, but about file or directory it points to.
-
- *) Bugfix: the %apache_length parameter logged the negative length of
- the response header if the no response was transferred to a client.
-
-
-Changes with nginx 0.1.22 22 Feb 2005
-
- *) Bugfix: the ngx_http_stub_status_module showed incorrect handled
- connections statistics if the proxying or FastCGI server were used.
-
- *) Bugfix: the installation paths were incorrectly quoted on Linux and
- Solaris; the bug had appeared in 0.1.21.
-
-
-Changes with nginx 0.1.21 22 Feb 2005
-
- *) Bugfix: the ngx_http_stub_status_module showed incorrect statistics
- if "rtsig" method was used or if several worker process ran on SMP.
-
- *) Bugfix: nginx could not be built by the icc compiler on Linux or if
- the zlib-1.2.x library was building from sources.
-
- *) Bugfix: nginx could not be built on NetBSD 2.0.
-
-
-Changes with nginx 0.1.20 17 Feb 2005
-
- *) Feature: the new "script_filename" and "remote_port" parameters of
- the fastcgi_params directive.
-
- *) Bugfix: the FastCGI stderr stream was handled incorrectly.
-
-
-Changes with nginx 0.1.19 16 Feb 2005
-
- *) Bugfix: now, if request contains the zero, then the 404 error is
- returned for the local requests.
-
- *) Bugfix: nginx could not be built on NetBSD 2.0.
-
- *) Bugfix: the timeout may occur while reading of the client request
- body via SSL connections.
-
-
-Changes with nginx 0.1.18 09 Feb 2005
-
- *) Workaround: the default values of the devpoll_events and the
- devpoll_changes directives changed from 512 to 32 to be compatible
- with Solaris 10.
-
- *) Bugfix: the proxy_set_x_var and fastcgi_set_var directives were not
- inherited.
-
- *) Bugfix: in a redirect rewrite directive arguments were concatenated
- with URI by an "&" rather than a "?".
-
- *) Bugfix: the lines without trailing ";" in the file being included by
- the ngx_http_geo_module were silently ignored.
-
- *) Feature: the ngx_http_stub_status_module.
-
- *) Bugfix: the unknown log format in the access_log directive caused the
- segmentation fault.
-
- *) Feature: the new "document_root" parameter of the fastcgi_params
- directive.
-
- *) Feature: the fastcgi_redirect_errors directive.
-
- *) Feature: the new "break" modifier of the "rewrite" directive allows
- to stop the rewrite/location cycle and sets the current configuration
- to the request.
-
-
-Changes with nginx 0.1.17 03 Feb 2005
-
- *) Change: the ngx_http_rewrite_module was rewritten from the scratch.
- Now it is possible to redirect, to return the error codes, to check
- the variables and referrers. The directives can be used inside
- locations. The redirect directive was canceled.
-
- *) Feature: the ngx_http_geo_module.
-
- *) Feature: the proxy_set_x_var and fastcgi_set_var directives.
-
- *) Bugfix: the location configuration with "=" modifier may be used in
- another location.
-
- *) Bugfix: the correct content type was set only for requests that use
- small caps letters in extension.
-
- *) Bugfix: if the proxy_pass or fastcgi_pass directives were set in the
- location, and access was denied, and the error was redirected to a
- static page, then the segmentation fault occurred.
-
- *) Bugfix: if in a proxied "Location" header was a relative URL, then a
- host name and a slash were added to them; the bug had appeared in
- 0.1.14.
-
- *) Bugfix: the system error message was not logged on Linux.
-
-
-Changes with nginx 0.1.16 25 Jan 2005
-
- *) Bugfix: if the response were transferred by chunks, then on the HEAD
- request the final chunk was issued.
-
- *) Bugfix: the "Connection: keep-alive" header were issued, even if the
- keepalive_timeout directive forbade the keep-alive use.
-
- *) Bugfix: the errors in the ngx_http_fastcgi_module caused the
- segmentation faults.
-
- *) Bugfix: the compressed response encrypted by SSL may not transferred
- complete.
-
- *) Bugfix: the TCP-specific TCP_NODELAY, TCP_NOPUSH, and TCP_CORK
- options, are not used for the unix domain sockets.
-
- *) Feature: the rewrite directive supports the arguments rewriting.
-
- *) Bugfix: the response code 400 was returned for the POST request with
- the "Content-Length: 0" header; the bug had appeared in 0.1.14.
-
-
-Changes with nginx 0.1.15 19 Jan 2005
-
- *) Bugfix: the error while the connecting to the FastCGI server caused
- segmentation fault.
-
- *) Bugfix: the correct handling of the regular expression, that has
- different number of the captures and substitutions.
-
- *) Feature: the location, that is passed to the FastCGI server, can be
- regular expression.
-
- *) Bugfix: the FastCGI's parameter REQUEST_URI is now passed with the
- arguments and in the original state.
-
- *) Bugfix: the ngx_http_rewrite_module module was required to be built
- to use the regular expressions in locations.
-
- *) Bugfix: the directive "proxy_preserve_host on" adds port 80 to the
- "Host" headers, if upstream listen on port 80; the bug had appeared
- in 0.1.14.
-
- *) Bugfix: the same paths in autoconfiguration parameters
- --http-client-body-temp-path=PATH and --http-proxy-temp-path=PATH, or
- --http-client-body-temp-path=PATH and --http-fastcgi-temp-path=PATH
- caused segmentation fault.
-
-
-Changes with nginx 0.1.14 18 Jan 2005
-
- *) Feature: the autoconfiguration directives:
- --http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and
- --http-fastcgi-temp-path=PATH
-
- *) Change: the directory name for the temporary files with the client
- request body is specified by directive client_body_temp_path, by
- default it is <prefix>/client_body_temp.
-
- *) Feature: the ngx_http_fastcgi_module and the directives:
- fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params,
- fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout,
- fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers,
- fastcgi_busy_buffers_size, fastcgi_temp_path,
- fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
- fastcgi_next_upstream, and fastcgi_x_powered_by.
-
- *) Bugfix: the "[alert] zero size buf" error; the bug had appeared in
- 0.1.3.
-
- *) Change: the URI must be specified after the host name in the
- proxy_pass directive.
-
- *) Change: the %3F symbol in the URI was considered as the argument
- string start.
-
- *) Feature: the unix domain sockets support in the
- ngx_http_proxy_module.
-
- *) Feature: the ssl_engine and ssl_ciphers directives.
- Thanks to Sergey Skvortsov for SSL-accelerator.
-
-
-Changes with nginx 0.1.13 21 Dec 2004
-
- *) Feature: the server_names_hash and server_names_hash_threshold
- directives.
-
- *) Bugfix: the *.domain.tld names in the "server_name" directive did not
- work.
-
- *) Bugfix: the %request_length log parameter logged the incorrect
- length.
-
-
-Changes with nginx 0.1.12 06 Dec 2004
-
- *) Feature: the %request_length log parameter.
-
- *) Bugfix: when using the /dev/poll, select and poll on the platforms,
- where these methods may do the false reports, there may be the long
- delay when the request was passed via the keep-alive connection. It
- may be at least on Solaris when using the /dev/poll.
-
- *) Bugfix: the send_lowat directive is ignored on Linux because Linux
- does not support the SO_SNDLOWAT option.
-
-
-Changes with nginx 0.1.11 02 Dec 2004
-
- *) Feature: the worker_priority directive.
-
- *) Change: both tcp_nopush and tcp_nodelay directives affect the
- transferred response.
-
- *) Bugfix: nginx did not call initgroups().
- Thanks to Andrew Sitnikov and Andrei Nigmatulin.
-
- *) Change: now the ngx_http_autoindex_module shows the file size in the
- bytes.
-
- *) Bugfix: the ngx_http_autoindex_module returned the 500 error if the
- broken symlink was in a directory.
-
- *) Bugfix: the files bigger than 4G could not be transferred using
- sendfile.
-
- *) Bugfix: if the backend was resolved to several backends and there was
- an error while the response waiting then process may got caught in an
- endless loop.
-
- *) Bugfix: the worker process may exit with the "unknown cycle" message
- when the /dev/poll method was used.
-
- *) Bugfix: "close() channel failed" errors.
-
- *) Bugfix: the autodetection of the "nobody" and "nogroup" groups.
-
- *) Bugfix: the send_lowat directive did not work on Linux.
-
- *) Bugfix: the segmentation fault occurred if there was no events
- section in configuration.
-
- *) Bugfix: nginx could not be built on OpenBSD.
-
- *) Bugfix: the double slashes in "://" in the URI were converted to
- ":/".
-
-
-Changes with nginx 0.1.10 26 Nov 2004
-
- *) Bugfix: if the request without arguments contains "//", "/./", "/../"
- or "%XX" then the last character in the request line was lost; the
- bug had appeared in 0.1.9.
-
- *) Bugfix: the fix in 0.1.9 for the files bigger than 2G on Linux did
- not work.
-
-
-Changes with nginx 0.1.9 25 Nov 2004
-
- *) Bugfix: the proxied request was sent without arguments if the request
- contains "//", "/./", "/../" or "%XX".
-
- *) Bugfix: the large compressed responses may be transferred not
- completely.
-
- *) Bugfix: the files bigger than 2G was not transferred on Linux that
- does not support sendfile64().
-
- *) Bugfix: while the build configuration on Linux the --with-poll_module
- parameter was required; the bug had appeared in 0.1.8.
-
-
-Changes with nginx 0.1.8 20 Nov 2004
-
- *) Bugfix: in the ngx_http_autoindex_module if the long file names were
- in the listing.
-
- *) Feature: the "^~" modifier in the location directive.
-
- *) Feature: the proxy_max_temp_file_size directive.
-
-
-Changes with nginx 0.1.7 12 Nov 2004
-
- *) Bugfix: on FreeBSD the segmentation fault may occur if the size of
- the transferred file was changed; the bug had appeared in 0.1.5.
-
-
-Changes with nginx 0.1.6 11 Nov 2004
-
- *) Bugfix: some location directive combinations with the regular
- expressions caused the wrong configuration choose.
-
-
-Changes with nginx 0.1.5 11 Nov 2004
-
- *) Bugfix: on Solaris and Linux there may be too many "recvmsg()
- returned not enough data" alerts.
-
- *) Bugfix: there were the "writev() failed (22: Invalid argument)"
- errors on Solaris in proxy mode without sendfile. On other platforms
- that do not support sendfile at all the process got caught in an
- endless loop.
-
- *) Bugfix: segmentation fault on Solaris in proxy mode and using
- sendfile.
-
- *) Bugfix: segmentation fault on Solaris.
-
- *) Bugfix: on-line upgrade did not work on Linux.
-
- *) Bugfix: the ngx_http_autoindex_module module did not escape the
- spaces, the quotes, and the percent signs in the directory listing.
-
- *) Change: the decrease of the copy operations.
-
- *) Feature: the userid_p3p directive.
-
-
-Changes with nginx 0.1.4 26 Oct 2004
-
- *) Bugfix: in the ngx_http_autoindex_module.
-
-
-Changes with nginx 0.1.3 25 Oct 2004
-
- *) Feature: the ngx_http_autoindex_module and the autoindex directive.
-
- *) Feature: the proxy_set_x_url directive.
-
- *) Bugfix: proxy module may get caught in an endless loop when sendfile
- is not used.
-
-
-Changes with nginx 0.1.2 21 Oct 2004
-
- *) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS
- options in configure.
-
- *) Feature: the server_name directive supports *.domain.tld.
-
- *) Bugfix: the portability improvements.
-
- *) Bugfix: if configuration file was set in command line, the
- reconfiguration was impossible; the bug had appeared in 0.1.1.
-
- *) Bugfix: proxy module may get caught in an endless loop when sendfile
- is not used.
-
- *) Bugfix: with sendfile the response was not recoded according to the
- charset module directives; the bug had appeared in 0.1.1.
-
- *) Bugfix: very seldom bug in the kqueue processing.
-
- *) Bugfix: the gzip module compressed the proxied responses that was
- already compressed.
-
-
-Changes with nginx 0.1.1 11 Oct 2004
-
- *) Feature: the gzip_types directive.
-
- *) Feature: the tcp_nodelay directive.
-
- *) Feature: the send_lowat directive is working not only on OSes that
- support kqueue NOTE_LOWAT, but also on OSes that support SO_SNDLOWAT.
-
- *) Feature: the setproctitle() emulation for Linux and Solaris.
-
- *) Bugfix: the "Location" header rewrite bug fixed while the proxying.
-
- *) Bugfix: the ngx_http_chunked_module module may get caught in an
- endless loop.
-
- *) Bugfix: the /dev/poll module bugs fixed.
-
- *) Bugfix: the responses were corrupted when the temporary files were
- used while the proxying.
-
- *) Bugfix: the unescaped requests were passed to the backend.
-
- *) Bugfix: while the build configuration on Linux 2.4 the
- --with-poll_module parameter was required.
-
-
-Changes with nginx 0.1.0 04 Oct 2004
-
- *) The first public version.
-
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES.ru b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES.ru
deleted file mode 100644
index 4eff3ccf929..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/CHANGES.ru
+++ /dev/null
@@ -1,6933 +0,0 @@
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.7.6 30.09.2014
-
- *) Изменение: уÑÑ‚Ð°Ñ€ÐµÐ²ÑˆÐ°Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¸Ð²Ð° limit_zone больше не поддерживаетÑÑ.
-
- *) Добавление: в директивах limit_conn_zone и limit_req_zone теперь
- можно иÑпользовать комбинации неÑкольких переменных.
-
- *) ИÑправление: при повторной отправке FastCGI-запроÑа на бÑкенд тело
- запроÑа могло передаватьÑÑ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð¾.
-
- *) ИÑправление: в логгировании в syslog.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.7.5 16.09.2014
-
- *) БезопаÑноÑÑ‚ÑŒ: при иÑпользовании общего Ð´Ð»Ñ Ð½ÐµÑкольких блоков server
- разделÑемого кÑша SSL-ÑеÑÑий или общего ключа Ð´Ð»Ñ ÑˆÐ¸Ñ„Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ TLS
- session tickets было возможно повторно иÑпользовать SSL-ÑеÑÑию в
- контекÑте другого блока server (CVE-2014-3616).
- СпаÑибо Antoine Delignat-Lavaud.
-
- *) Изменение: директиву stub_status теперь можно указывать без
- параметров.
-
- *) Добавление: параметр always директивы add_header.
-
- *) Добавление: директивы proxy_next_upstream_tries,
- proxy_next_upstream_timeout, fastcgi_next_upstream_tries,
- fastcgi_next_upstream_timeout, memcached_next_upstream_tries,
- memcached_next_upstream_timeout, scgi_next_upstream_tries,
- scgi_next_upstream_timeout, uwsgi_next_upstream_tries и
- uwsgi_next_upstream_timeout.
-
- *) ИÑправление: в параметре if директивы access_log.
-
- *) ИÑправление: в модуле ngx_http_perl_module.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: директива listen почтового прокÑи-Ñервера не позволÑла
- указать более двух параметров.
-
- *) ИÑправление: директива sub_filter не работала Ñ Ð·Ð°Ð¼ÐµÐ½Ñемой Ñтрокой из
- одного Ñимвола.
-
- *) ИÑправление: запроÑÑ‹ могли завиÑать, еÑли иÑпользовалÑÑ resolver и в
- процеÑÑе Ð¾Ð±Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Ðº DNS-Ñерверу проиÑходил таймаут.
-
- *) ИÑправление: в модуле ngx_http_spdy_module при иÑпользовании
- ÑовмеÑтно Ñ AIO.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы set изменÑлиÑÑŒ переменные "$http_...",
- "$sent_http_..." или "$upstream_http_...".
-
- *) ИÑправление: в обработке ошибок Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð¼Ñти.
- СпаÑибо Markus Linnala и Feng Gu.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.7.4 05.08.2014
-
- *) БезопаÑноÑÑ‚ÑŒ: pipelined-команды не отбраÑывалиÑÑŒ поÑле команды
- STARTTLS в SMTP прокÑи-Ñервере (CVE-2014-3556); ошибка поÑвилаÑÑŒ в
- 1.5.6.
- СпаÑибо Chris Boulton.
-
- *) Изменение: Ñкранирование Ñимволов в URI теперь иÑпользует
- шеÑтнадцатеричные цифры в верхнем региÑтре.
- СпаÑибо Piotr Sikora.
-
- *) Добавление: теперь nginx можно Ñобрать Ñ BoringSSL и LibreSSL.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: запроÑÑ‹ могли завиÑать, еÑли иÑпользовалÑÑ resolver и
- DNS-Ñервер возвращал некорректный ответ; ошибка поÑвилаÑÑŒ в 1.5.8.
-
- *) ИÑправление: в модуле ngx_http_spdy_module.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $uri могла Ñодержать муÑор при возврате
- ошибок Ñ ÐºÐ¾Ð´Ð¾Ð¼ 400.
- СпаÑибо Сергею Боброву.
-
- *) ИÑправление: в обработке ошибок в директиве proxy_store и в модуле
- ngx_http_dav_module.
- СпаÑибо Feng Gu.
-
- *) ИÑправление: при логгировании ошибок в syslog мог проиÑходить
- segmentation fault; ошибка поÑвилаÑÑŒ в 1.7.1.
-
- *) ИÑправление: переменные $geoip_latitude, $geoip_longitude,
- $geoip_dma_code и $geoip_area_code могли не работать.
- СпаÑибо Yichun Zhang.
-
- *) ИÑправление: в обработке ошибок Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð¼Ñти.
- СпаÑибо Tatsuhiko Kubo и Piotr Sikora.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.7.3 08.07.2014
-
- *) Добавление: weak entity tags теперь не удалÑÑŽÑ‚ÑÑ Ð¿Ñ€Ð¸ изменениÑÑ…
- ответа, а strong entity tags преобразуютÑÑ Ð² weak.
-
- *) Добавление: Ñ€ÐµÐ²Ð°Ð»Ð¸Ð´Ð°Ñ†Ð¸Ñ Ñлементов кÑша теперь, еÑли Ñто возможно,
- иÑпользует заголовок If-None-Match.
-
- *) Добавление: директива ssl_password_file.
-
- *) ИÑправление: при возврате ответа из кÑша заголовок запроÑа
- If-None-Match игнорировалÑÑ, еÑли в ответе не было заголовка
- Last-Modified.
-
- *) ИÑправление: ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ "peer closed connection in SSL handshake" при
- Ñоединении Ñ Ð±Ñкендами логгировалиÑÑŒ на уровне info вмеÑто error.
-
- *) ИÑправление: в модуле ngx_http_dav_module в nginx/Windows.
-
- *) ИÑправление: SPDY-ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð³Ð»Ð¸ неожиданно закрыватьÑÑ, еÑли
- иÑпользовалоÑÑŒ кÑширование.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.7.2 17.06.2014
-
- *) Добавление: директива hash в блоке upstream.
-
- *) Добавление: Ð´ÐµÑ„Ñ€Ð°Ð³Ð¼ÐµÐ½Ñ‚Ð°Ñ†Ð¸Ñ Ñвободных блоков разделÑемой памÑти.
- СпаÑибо Wandenberg Peixoto и Yichun Zhang.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалоÑÑŒ значение access_log по умолчанию; ошибка
- поÑвилаÑÑŒ в 1.7.0.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: завершающий ÑлÑш ошибочно удалÑлÑÑ Ð¸Ð· поÑледнего
- параметра директивы try_files.
-
- *) ИÑправление: nginx мог не ÑобиратьÑÑ Ð½Ð° OS X.
-
- *) ИÑправление: в модуле ngx_http_spdy_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.7.1 27.05.2014
-
- *) Добавление: переменные "$upstream_cookie_...".
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ssl_client_fingerprint.
-
- *) Добавление: директивы error_log и access_log теперь поддерживают
- логгирование в syslog.
-
- *) Добавление: почтовый прокÑи-Ñервер теперь логгирует порт клиента при
- Ñоединении.
-
- *) ИÑправление: утечки памÑти при иÑпользовании директивы
- "ssl_stapling".
- СпаÑибо Filipe da Silva.
-
- *) ИÑправление: директива alias внутри location'а, заданного регулÑрным
- выражением, работала неправильно, еÑли иÑпользовалиÑÑŒ директивы if
- или limit_except.
-
- *) ИÑправление: директива charset не Ñтавила кодировку Ð´Ð»Ñ Ñжатых
- ответов бÑкендов.
-
- *) ИÑправление: директива proxy_pass без URI могла иÑпользовать
- оригинальный Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¿Ð¾Ñле уÑтановки переменной $args.
- СпаÑибо Yichun Zhang.
-
- *) ИÑправление: в работе параметра none директивы smtp_auth; ошибка
- поÑвилаÑÑŒ в 1.5.6.
- СпаÑибо СвÑтоÑлаву ÐикольÑкому.
-
- *) ИÑправление: при ÑовмеÑтном иÑпользовании sub_filter и SSI ответы
- могли передаватьÑÑ Ð½ÐµÐ²ÐµÑ€Ð½Ð¾.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ --with-file-aio на
- Linux/aarch64.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.7.0 24.04.2014
-
- *) Добавление: проверка SSL-Ñертификатов бÑкендов.
-
- *) Добавление: поддержка SNI при работе Ñ Ð±Ñкендами по SSL.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ssl_server_name.
-
- *) Добавление: параметр if директивы access_log.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.13 08.04.2014
-
- *) Изменение: улучшена обработка Ñ…Ñш-таблиц; в директивах
- variables_hash_max_size и types_hash_bucket_size Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾
- умолчанию изменены на 1024 и 64 ÑоответÑтвенно.
-
- *) Добавление: модуль ngx_http_mp4_module теперь понимает аргумент end.
-
- *) Добавление: поддержка byte ranges модулем ngx_http_mp4_module и при
- Ñохранении ответов в кÑш.
-
- *) ИÑправление: теперь nginx не пишет в лог ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ "ngx_slab_alloc()
- failed: no memory" при иÑпользовании разделÑемой памÑти в
- ssl_session_cache и в модуле ngx_http_limit_req_module.
-
- *) ИÑправление: директива underscores_in_headers не разрешала
- подчёркивание в первом Ñимволе заголовка.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: cache manager мог нагружать процеÑÑор при выходе в
- nginx/Windows.
-
- *) ИÑправление: при иÑпользовании ssl_session_cache Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ shared
- рабочий процеÑÑ nginx/Windows завершалÑÑ Ð°Ð²Ð°Ñ€Ð¸Ð¹Ð½Ð¾.
-
- *) ИÑправление: в модуле ngx_http_spdy_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.12 18.03.2014
-
- *) БезопаÑноÑÑ‚ÑŒ: при обработке Ñпециально Ñозданного запроÑа модулем
- ngx_http_spdy_module могло проиÑходить переполнение буфера в рабочем
- процеÑÑе, что потенциально могло приводить к выполнению произвольного
- кода (CVE-2014-0133).
- СпаÑибо Lucas Molas из Programa STIC, Fundación Dr. Manuel Sadosky,
- Buenos Aires, Argentina.
-
- *) Добавление: параметр proxy_protocol в директивах listen и
- real_ip_header, Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $proxy_protocol_addr.
-
- *) ИÑправление: в директиве fastcgi_next_upstream.
- СпаÑибо Lucas Molas.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.11 04.03.2014
-
- *) БезопаÑноÑÑ‚ÑŒ: при обработке Ñпециально Ñозданного запроÑа модулем
- ngx_http_spdy_module на 32-битных платформах могла повреждатьÑÑ
- памÑÑ‚ÑŒ рабочего процеÑÑа, что потенциально могло приводить к
- выполнению произвольного кода (CVE-2014-0088); ошибка поÑвилаÑÑŒ в
- 1.5.10.
- СпаÑибо Lucas Molas из Programa STIC, Fundación Dr. Manuel Sadosky,
- Buenos Aires, Argentina.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ssl_session_reused.
-
- *) ИÑправление: директива client_max_body_size могла не работать при
- чтении тела запроÑа Ñ Ð¸Ñпользованием chunked transfer encoding;
- ошибка поÑвилаÑÑŒ в 1.3.9.
- СпаÑибо Lucas Molas.
-
- *) ИÑправление: при прокÑировании WebSocket-Ñоединений в рабочем
- процеÑÑе мог произойти segmentation fault.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалÑÑ Ð¼Ð¾Ð´ÑƒÐ»ÑŒ ngx_http_spdy_module на 32-битных
- платформах; ошибка поÑвилаÑÑŒ в 1.5.10.
-
- *) ИÑправление: значение переменной $upstream_status могло быть
- неверным, еÑли иÑпользовалиÑÑŒ директивы proxy_cache_use_stale или
- proxy_cache_revalidate.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли ошибки Ñ ÐºÐ¾Ð´Ð¾Ð¼ 400 Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы error_page
- перенаправлÑлиÑÑŒ в именованный location.
-
- *) ИÑправление: nginx/Windows не ÑобиралÑÑ Ñ Visual Studio 2013.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.10 04.02.2014
-
- *) Добавление: модуль ngx_http_spdy_module теперь иÑпользует протокол
- SPDY 3.1.
- СпаÑибо Automattic и MaxCDN за ÑпонÑирование разработки.
-
- *) Добавление: модуль ngx_http_mp4_module теперь пропуÑкает дорожки,
- имеющие меньшую длину, чем Ð·Ð°Ð¿Ñ€Ð¾ÑˆÐµÐ½Ð½Ð°Ñ Ð¿ÐµÑ€ÐµÐ¼Ð¾Ñ‚ÐºÐ°.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ssl_session_id иÑпользовалаÑÑŒ при логгировании;
- ошибка поÑвилаÑÑŒ в 1.5.9.
-
- *) ИÑправление: переменные $date_local и $date_gmt иÑпользовали неверный
- формат вне Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_ssi_filter_module.
-
- *) ИÑправление: клиентÑкие ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð³Ð»Ð¸ Ñразу закрыватьÑÑ, еÑли
- иÑпользовалÑÑ Ð¾Ñ‚Ð»Ð¾Ð¶ÐµÐ½Ð½Ñ‹Ð¹ accept; ошибка поÑвилаÑÑŒ в 1.3.15.
-
- *) ИÑправление: ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ "getsockopt(TCP_FASTOPEN) ... failed"
- запиÑывалиÑÑŒ в лог в процеÑÑе Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸ÑполнÑемого файла на Linux;
- ошибка поÑвилаÑÑŒ в 1.5.8.
- СпаÑибо Piotr Sikora.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.9 22.01.2014
-
- *) Изменение: теперь в заголовке X-Accel-Redirect nginx ожидает
- закодированный URI.
-
- *) Добавление: директива ssl_buffer_size.
-
- *) Добавление: директиву limit_rate теперь можно иÑпользовать длÑ
- Ð¾Ð³Ñ€Ð°Ð½Ð¸Ñ‡ÐµÐ½Ð¸Ñ ÑкороÑти передачи ответов клиенту в SPDY-ÑоединениÑÑ….
-
- *) Добавление: директива spdy_chunk_size.
-
- *) Добавление: директива ssl_session_tickets.
- СпаÑибо Dirkjan Bussink.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ssl_session_id Ñодержала вÑÑŽ ÑеÑÑию в
- Ñериализованном виде вмеÑто её идентификатора.
- СпаÑибо Ivan Ristić.
-
- *) ИÑправление: nginx неправильно обрабатывал закодированный Ñимвол "?"
- в команде SSI include.
-
- *) ИÑправление: модуль ngx_http_dav_module не раÑкодировал целевой URI
- при обработке методов COPY и MOVE.
-
- *) ИÑправление: resolver не понимал доменные имена Ñ Ñ‚Ð¾Ñ‡ÐºÐ¾Ð¹ в конце.
- СпаÑибо Yichun Zhang.
-
- *) ИÑправление: при прокÑировании в логах могли поÑвлÑÑ‚ÑŒÑÑ ÑообщениÑ
- "zero size buf in output"; ошибка поÑвилаÑÑŒ в 1.3.9.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалÑÑ Ð¼Ð¾Ð´ÑƒÐ»ÑŒ ngx_http_spdy_module.
-
- *) ИÑправление: при иÑпользовании методов обработки Ñоединений select,
- poll и /dev/poll прокÑируемые WebSocket-ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð³Ð»Ð¸ завиÑать
- Ñразу поÑле открытиÑ.
-
- *) ИÑправление: директива xclient почтового прокÑи-Ñервера некорректно
- передавала IPv6-адреÑа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.8 17.12.2013
-
- *) Добавление: теперь resolver поддерживает IPv6.
-
- *) Добавление: директива listen поддерживает параметр fastopen.
- СпаÑибо Mathew Rodley.
-
- *) Добавление: поддержка SSL в модуле ngx_http_uwsgi_module.
- СпаÑибо Roberto De Ioris.
-
- *) Добавление: Ñкрипты подÑветки ÑинтакÑиÑа Ð´Ð»Ñ vim добавлены в contrib.
- СпаÑибо Evan Miller.
-
- *) ИÑправление: при чтении тела запроÑа Ñ Ð¸Ñпользованием chunked
- transfer encoding по SSL-Ñоединению мог произойти таймаут.
-
- *) ИÑправление: директива master_process работала неправильно в
- nginx/Windows.
-
- *) ИÑправление: параметр setfib директивы listen мог не работать.
-
- *) ИÑправление: в модуле ngx_http_spdy_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.7 19.11.2013
-
- *) БезопаÑноÑÑ‚ÑŒ: Ñимвол, Ñледующий за незакодированным пробелом в Ñтроке
- запроÑа, обрабатывалÑÑ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð¾ (CVE-2013-4547); ошибка поÑвилаÑÑŒ
- в 0.8.41.
- СпаÑибо Ivan Fratric из Google Security Team.
-
- *) Изменение: уровень Ð»Ð¾Ð³Ð³Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¾ÑˆÐ¸Ð±Ð¾Ðº auth_basic об отÑутÑтвии
- Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð¿Ð¾Ð½Ð¸Ð¶ÐµÐ½ Ñ ÑƒÑ€Ð¾Ð²Ð½Ñ error до info.
-
- *) Добавление: директивы proxy_cache_revalidate,
- fastcgi_cache_revalidate, scgi_cache_revalidate и
- uwsgi_cache_revalidate.
-
- *) Добавление: директива ssl_session_ticket_key.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: директива "add_header Cache-Control ''" добавлÑла Ñтроку
- заголовка ответа "Cache-Control" Ñ Ð¿ÑƒÑтым значением.
-
- *) ИÑправление: директива "satisfy any" могла вернуть ошибку 403 вмеÑто
- 401 при иÑпользовании директив auth_request и auth_basic.
- СпаÑибо Jan Marc Hoffmann.
-
- *) ИÑправление: параметры accept_filter и deferred директивы listen
- игнорировалиÑÑŒ Ð´Ð»Ñ listen-Ñокетов, Ñоздаваемых в процеÑÑе обновлениÑ
- иÑполнÑемого файла.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: чаÑÑ‚ÑŒ данных, полученных от бÑкенда при
- небуферизированном прокÑировании, могла не отправлÑÑ‚ÑŒÑÑ ÐºÐ»Ð¸ÐµÐ½Ñ‚Ñƒ
- Ñразу, еÑли иÑпользовалиÑÑŒ директивы gzip или gunzip.
- СпаÑибо Yichun Zhang.
-
- *) ИÑправление: в обработке ошибок в модуле
- ngx_http_gunzip_filter_module.
-
- *) ИÑправление: ответы могли завиÑать, еÑли иÑпользовалÑÑ Ð¼Ð¾Ð´ÑƒÐ»ÑŒ
- ngx_http_spdy_module и директива auth_request.
-
- *) ИÑправление: утечки памÑти в nginx/Windows.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.6 01.10.2013
-
- *) Добавление: директива fastcgi_buffering.
-
- *) Добавление: директивы proxy_ssl_protocols и proxy_ssl_ciphers.
- СпаÑибо Piotr Sikora.
-
- *) Добавление: Ð¾Ð¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸Ñ SSL handshake при иÑпользовании длинных
- цепочек Ñертификатов.
-
- *) Добавление: почтовый прокÑи-Ñервер поддерживает SMTP pipelining.
-
- *) ИÑправление: в модуле ngx_http_auth_basic_module при иÑпользовании
- метода ÑˆÐ¸Ñ„Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¿Ð°Ñ€Ð¾Ð»ÐµÐ¹ "$apr1$".
- СпаÑибо Markus Linnala.
-
- *) ИÑправление: на MacOSX, Cygwin и nginx/Windows Ð´Ð»Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ¸ запроÑа
- мог иÑпользоватьÑÑ Ð½ÐµÐ²ÐµÑ€Ð½Ñ‹Ð¹ location, еÑли Ð´Ð»Ñ Ð·Ð°Ð´Ð°Ð½Ð¸Ñ location'ов
- иÑпользовалиÑÑŒ Ñимволы разных региÑтров.
-
- *) ИÑправление: автоматичеÑкое перенаправление Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸ÐµÐ¼
- завершающего ÑлÑша Ð´Ð»Ñ Ð¿Ñ€Ð¾ÐºÑированных location'ов могло не работать.
-
- *) ИÑправление: в почтовом прокÑи-Ñервере.
-
- *) ИÑправление: в модуле ngx_http_spdy_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.5 17.09.2013
-
- *) Изменение: теперь nginx по умолчанию иÑпользует HTTP/1.0, еÑли точно
- определить протокол не удалоÑÑŒ.
-
- *) Добавление: директива disable_symlinks теперь иÑпользует O_PATH на
- Linux.
-
- *) Добавление: Ð´Ð»Ñ Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ñ‚Ð¾Ð³Ð¾, что клиент закрыл Ñоединение, при
- иÑпользовании метода epoll теперь иÑпользуютÑÑ ÑÐ¾Ð±Ñ‹Ñ‚Ð¸Ñ EPOLLRDHUP.
-
- *) ИÑправление: в директиве valid_referers при иÑпользовании параметра
- server_names.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $request_time не работала в nginx/Windows.
-
- *) ИÑправление: в директиве image_filter.
- СпаÑибо Lanshun Zhou.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ OpenSSL 1.0.1f.
- СпаÑибо Piotr Sikora.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.4 27.08.2013
-
- *) Изменение: MIME-тип Ð´Ð»Ñ Ñ€Ð°ÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ js изменён на
- "application/javascript"; значение по умолчанию директивы
- charset_types изменено ÑоответÑтвенно.
-
- *) Изменение: теперь директива image_filter Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ size возвращает
- ответ Ñ MIME-типом "application/json".
-
- *) Добавление: модуль ngx_http_auth_request_module.
-
- *) ИÑправление: на Ñтарте или во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ мог произойти
- segmentation fault, еÑли иÑпользовалаÑÑŒ директива try_files Ñ Ð¿ÑƒÑтым
- параметром.
-
- *) ИÑправление: утечки памÑти при иÑпользовании в директивах root и
- auth_basic_user_file отноÑительных путей, заданных Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ
- переменных.
-
- *) ИÑправление: директива valid_referers неправильно выполнÑла
- регулÑрные выражениÑ, еÑли заголовок Referer начиналÑÑ Ñ "https://".
- СпаÑибо Liangbin Li.
-
- *) ИÑправление: ответы могли завиÑать, еÑли иÑпользовалиÑÑŒ подзапроÑÑ‹ и
- при обработке подзапроÑа проиÑходила ошибка во Ð²Ñ€ÐµÐ¼Ñ SSL handshake Ñ
- бÑкендом.
- СпаÑибо Aviram Cohen.
-
- *) ИÑправление: в модуле ngx_http_autoindex_module.
-
- *) ИÑправление: в модуле ngx_http_spdy_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.3 30.07.2013
-
- *) Изменение во внутреннем API: теперь при небуферизированной работе Ñ
- бÑкендами u->length по умолчанию уÑтанавливаетÑÑ Ð² -1.
-
- *) Изменение: теперь при получении неполного ответа от бÑкенда nginx
- отправлÑет полученную чаÑÑ‚ÑŒ ответа, поÑле чего закрывает Ñоединение Ñ
- клиентом.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалÑÑ Ð¼Ð¾Ð´ÑƒÐ»ÑŒ ngx_http_spdy_module и директива
- client_body_in_file_only.
-
- *) ИÑправление: параметр so_keepalive директивы listen мог работать
- некорректно на DragonFlyBSD.
- СпаÑибо Sepherosa Ziehau.
-
- *) ИÑправление: в модуле ngx_http_xslt_filter_module.
-
- *) ИÑправление: в модуле ngx_http_sub_filter_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.2 02.07.2013
-
- *) Добавление: теперь можно иÑпользовать неÑколько директив error_log.
-
- *) ИÑправление: метод $r->header_in() вÑтроенного перла не возвращал
- Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ñтрок "Cookie" и "X-Forwarded-For" из заголовка запроÑа;
- ошибка поÑвилаÑÑŒ в 1.3.14.
-
- *) ИÑправление: в модуле ngx_http_spdy_module.
- СпаÑибо Jim Radford.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Linux при иÑпользовании x32 ABI.
- СпаÑибо Сергею Иванцову.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.1 04.06.2013
-
- *) Добавление: директивы ssi_last_modified, sub_filter_last_modified и
- xslt_last_modified.
- СпаÑибо ÐлекÑею Колпакову.
-
- *) Добавление: параметр http_403 в директивах proxy_next_upstream,
- fastcgi_next_upstream, scgi_next_upstream и uwsgi_next_upstream.
-
- *) Добавление: директивы allow и deny теперь поддерживают unix domain
- Ñокеты.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_mail_ssl_module, но без
- Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_ssl_module; ошибка поÑвилаÑÑŒ в 1.3.14.
-
- *) ИÑправление: в директиве proxy_set_body.
- СпаÑибо Lanshun Zhou.
-
- *) ИÑправление: в директиве lingering_time.
- СпаÑибо Lanshun Zhou.
-
- *) ИÑправление: параметр fail_timeout директивы server в блоке upstream
- мог не работать, еÑли иÑпользовалÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€ max_fails; ошибка
- поÑвилаÑÑŒ в 1.3.0.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалаÑÑŒ директива ssl_stapling.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: в почтовом прокÑи-Ñервере.
- СпаÑибо Filipe Da Silva.
-
- *) ИÑправление: nginx/Windows мог переÑтать принимать ÑоединениÑ, еÑли
- иÑпользовалоÑÑŒ неÑколько рабочих процеÑÑов.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.5.0 07.05.2013
-
- *) БезопаÑноÑÑ‚ÑŒ: при обработке Ñпециально Ñозданного запроÑа мог
- перезапиÑыватьÑÑ Ñтек рабочего процеÑÑа, что могло приводить к
- выполнению произвольного кода (CVE-2013-2028); ошибка поÑвилаÑÑŒ в
- 1.3.9.
- СпаÑибо Greg MacManus, iSIGHT Partners Labs.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.4.0 24.04.2013
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_http_perl_module, еÑли
- иÑпользовалÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€ --with-openssl; ошибка поÑвилаÑÑŒ в 1.3.16.
-
- *) ИÑправление: в работе Ñ Ñ‚ÐµÐ»Ð¾Ð¼ запроÑа из Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_perl_module;
- ошибка поÑвилаÑÑŒ в 1.3.9.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.16 16.04.2013
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалиÑÑŒ подзапроÑÑ‹; ошибка поÑвилаÑÑŒ в 1.3.9.
-
- *) ИÑправление: директива tcp_nodelay вызывала ошибку при прокÑировании
- WebSocket-Ñоединений в unix domain Ñокет.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $upstream_response_length возвращала значение
- "0", еÑли не иÑпользовалаÑÑŒ буферизациÑ.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: в методах обработки Ñоединений eventport и /dev/poll.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.15 26.03.2013
-
- *) Изменение: открытие и закрытие ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð±ÐµÐ· отправки в нём
- каких-либо данных больше не запиÑываетÑÑ Ð² access_log Ñ ÐºÐ¾Ð´Ð¾Ð¼ ошибки
- 400.
-
- *) Добавление: модуль ngx_http_spdy_module.
- СпаÑибо Automattic за ÑпонÑирование разработки.
-
- *) Добавление: директивы limit_req_status и limit_conn_status.
- СпаÑибо Nick Marden.
-
- *) Добавление: директива image_filter_interlace.
- СпаÑибо Ивану Боброву.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $connections_waiting в модуле
- ngx_http_stub_status_module.
-
- *) Добавление: теперь почтовый прокÑи-Ñервер поддерживает IPv6-бÑкенды.
-
- *) ИÑправление: при повторной отправке запроÑа на бÑкенд тело запроÑа
- могло передаватьÑÑ Ð½ÐµÐ¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð¾; ошибка поÑвилаÑÑŒ в 1.3.9.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: в директиве client_body_in_file_only; ошибка поÑвилаÑÑŒ в
- 1.3.9.
-
- *) ИÑправление: ответы могли завиÑать, еÑли иÑпользовалиÑÑŒ подзапроÑÑ‹ и
- при обработке подзапроÑа проиÑходила DNS-ошибка.
- СпаÑибо Lanshun Zhou.
-
- *) ИÑправление: в процедуре учёта иÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð±Ñкендов.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.14 05.03.2013
-
- *) Добавление: переменные $connections_active, $connections_reading и
- $connections_writing в модуле ngx_http_stub_status_module.
-
- *) Добавление: поддержка WebSocket-Ñоединений в модулÑÑ…
- ngx_http_uwsgi_module и ngx_http_scgi_module.
-
- *) ИÑправление: в обработке виртуальных Ñерверов при иÑпользовании SNI.
-
- *) ИÑправление: при иÑпользовании директивы "ssl_session_cache shared"
- новые ÑеÑÑии могли не ÑохранÑÑ‚ÑŒÑÑ, еÑли заканчивалоÑÑŒ меÑто в
- разделÑемой памÑти.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: неÑколько заголовков X-Forwarded-For обрабатывалиÑÑŒ
- неправильно.
- СпаÑибо Neal Poole за ÑпонÑирование разработки.
-
- *) ИÑправление: в модуле ngx_http_mp4_module.
- СпаÑибо Gernot Vormayr.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.13 19.02.2013
-
- *) Изменение: теперь Ð´Ð»Ñ Ñборки по умолчанию иÑпользуетÑÑ ÐºÐ¾Ð¼Ð¿Ð¸Ð»Ñтор Ñ
- именем "cc".
-
- *) Добавление: поддержка прокÑÐ¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ WebSocket-Ñоединений.
- СпаÑибо Apcera и CloudBees за ÑпонÑирование разработки.
-
- *) Добавление: директива auth_basic_user_file поддерживает шифрование
- паролей методом "{SHA}".
- СпаÑибо Louis Opter.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.12 05.02.2013
-
- *) Добавление: директивы proxy_bind, fastcgi_bind, memcached_bind,
- scgi_bind и uwsgi_bind поддерживают переменные.
-
- *) Добавление: переменные $pipe, $request_length, $time_iso8601 и
- $time_local теперь можно иÑпользовать не только в директиве
- log_format.
- СпаÑибо Kiril Kalchev.
-
- *) Добавление: поддержка IPv6 в модуле ngx_http_geoip_module.
- СпаÑибо Gregor KaliÅ¡nik.
-
- *) ИÑправление: директива proxy_method работала неверно, еÑли была
- указана на уровне http.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалÑÑ resolver и метод poll.
-
- *) ИÑправление: nginx мог нагружать процеÑÑор во Ð²Ñ€ÐµÐ¼Ñ SSL handshake Ñ
- бÑкендом при иÑпользовании методов обработки Ñоединений select, poll
- и /dev/poll.
-
- *) ИÑправление: ошибка "[crit] SSL_write() failed (SSL:)".
-
- *) ИÑправление: в директиве client_body_in_file_only; ошибка поÑвилаÑÑŒ в
- 1.3.9.
-
- *) ИÑправление: в директиве fastcgi_keep_conn.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.11 10.01.2013
-
- *) ИÑправление: при запиÑи в лог мог проиÑходить segmentation fault;
- ошибка поÑвилаÑÑŒ в 1.3.10.
-
- *) ИÑправление: директива proxy_pass не работала Ñ IP-адреÑами без
- Ñвного ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ Ð¿Ð¾Ñ€Ñ‚Ð°; ошибка поÑвилаÑÑŒ в 1.3.10.
-
- *) ИÑправление: на Ñтарте или во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ проиÑходил
- segmentation fault, еÑли директива keepalive была указана неÑколько
- раз в одном блоке upstream.
-
- *) ИÑправление: параметр default директивы geo не определÑл значение по
- умолчанию Ð´Ð»Ñ IPv6-адреÑов.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.10 25.12.2012
-
- *) Изменение: Ð´Ð»Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ñ‹Ñ… в конфигурационном файле доменных имён
- теперь иÑпользуютÑÑ Ð½Ðµ только IPv4, но и IPv6 адреÑа.
-
- *) Изменение: теперь при иÑпользовании директивы include Ñ Ð¼Ð°Ñкой на
- Unix-ÑиÑтемах включаемые файлы ÑортируютÑÑ Ð² алфавитном порÑдке.
-
- *) Изменение: директива add_header добавлÑет Ñтроки в ответы Ñ ÐºÐ¾Ð´Ð¾Ð¼
- 201.
-
- *) Добавление: директива geo теперь поддерживает IPv6 адреÑа в формате
- CIDR.
-
- *) Добавление: параметры flush и gzip в директиве access_log.
-
- *) Добавление: директива auth_basic поддерживает переменные.
-
- *) ИÑправление: nginx в некоторых ÑлучаÑÑ… не ÑобиралÑÑ Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼
- ngx_http_perl_module.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалÑÑ Ð¼Ð¾Ð´ÑƒÐ»ÑŒ ngx_http_xslt_module.
-
- *) ИÑправление: nginx мог не ÑобиратьÑÑ Ð½Ð° MacOSX.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: при иÑпользовании директивы limit_rate Ñ Ð±Ð¾Ð»ÑŒÑˆÐ¸Ð¼Ð¸
- значениÑми ÑкороÑти на 32-битных ÑиÑтемах ответ мог возвращатьÑÑ Ð½Ðµ
- целиком.
- СпаÑибо ÐлекÑею Ðнтропову.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалаÑÑŒ директива if.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: ответ "100 Continue" выдавалÑÑ Ð²Ð¼ÐµÑте Ñ Ð¾Ñ‚Ð²ÐµÑ‚Ð¾Ð¼ "413
- Request Entity Too Large".
-
- *) ИÑправление: директивы image_filter, image_filter_jpeg_quality и
- image_filter_sharpen могли наÑледоватьÑÑ Ð½ÐµÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð¾.
- СпаÑибо Ивану Боброву.
-
- *) ИÑправление: при иÑпользовании директивы auth_basic под Linux могли
- возникать ошибки "crypt_r() failed".
-
- *) ИÑправление: в обработке backup-Ñерверов.
- СпаÑибо Thomas Chen.
-
- *) ИÑправление: при прокÑировании HEAD-запроÑов мог возвращатьÑÑ
- некорректный ответ, еÑли иÑпользовалаÑÑŒ директива gzip.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.9 27.11.2012
-
- *) Добавление: поддержка chunked transfer encoding при получении тела
- запроÑа.
-
- *) Добавление: переменные $request_time и $msec теперь можно
- иÑпользовать не только в директиве log_format.
-
- *) ИÑправление: cache manager и cache loader могли не запуÑкатьÑÑ, еÑли
- иÑпользовалоÑÑŒ более 512 listen-Ñокетов.
-
- *) ИÑправление: в модуле ngx_http_dav_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.8 30.10.2012
-
- *) Добавление: параметр optional_no_ca директивы ssl_verify_client.
- СпаÑибо Михаилу Казанцеву и Eric O'Connor.
-
- *) Добавление: переменные $bytes_sent, $connection и
- $connection_requests теперь можно иÑпользовать не только в директиве
- log_format.
- СпаÑибо Benjamin Grössing.
-
- *) Добавление: параметр auto директивы worker_processes.
-
- *) ИÑправление: ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ "cache file ... has md5 collision".
-
- *) ИÑправление: в модуле ngx_http_gunzip_filter_module.
-
- *) ИÑправление: в директиве ssl_stapling.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.7 02.10.2012
-
- *) Добавление: поддержка OCSP stapling.
- СпаÑибо Comodo, DigiCert и GlobalSign за ÑпонÑирование разработки.
-
- *) Добавление: директива ssl_trusted_certificate.
-
- *) Добавление: теперь resolver Ñлучайным образом менÑет порÑдок
- возвращаемых закÑшированных адреÑов.
- СпаÑибо Ðнтону Жулину.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ OpenSSL 0.9.7.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.6 12.09.2012
-
- *) Добавление: модуль ngx_http_gunzip_filter_module.
-
- *) Добавление: директива memcached_gzip_flag.
-
- *) Добавление: параметр always директивы gzip_static.
-
- *) ИÑправление: в директиве "limit_req"; ошибка поÑвилаÑÑŒ в 1.1.14.
- СпаÑибо Charles Chen.
-
- *) ИÑправление: nginx не ÑобиралÑÑ gcc 4.7 Ñ Ð¾Ð¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸ÐµÐ¹ -O2 еÑли
- иÑпользовалÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€ --with-ipv6.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.5 21.08.2012
-
- *) Изменение: модуль ngx_http_mp4_module больше не отфильтровывает
- дорожки в форматах, отличных от H.264 и AAC.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли в директиве map в качеÑтве значений иÑпользовалиÑÑŒ переменные.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault при
- иÑпользовании директивы geo Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ ranges, но без параметра
- default; ошибка поÑвилаÑÑŒ в 0.8.43.
- СпаÑибо Zhen Chen и Weibin Yao.
-
- *) ИÑправление: в обработке параметра командной Ñтроки -p.
-
- *) ИÑправление: в почтовом прокÑи-Ñервере.
-
- *) ИÑправление: незначительных потенциальных ошибок.
- СпаÑибо Coverity.
-
- *) ИÑправление: nginx/Windows не ÑобиралÑÑ Ñ Visual Studio 2005 Express.
- СпаÑибо HAYASHI Kentaro.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.4 31.07.2012
-
- *) Изменение: теперь на Ñлушающих IPv6-Ñокетах параметр ipv6only включён
- по умолчанию.
-
- *) Добавление: поддержка компилÑтора Clang.
-
- *) ИÑправление: могли ÑоздаватьÑÑ Ð»Ð¸ÑˆÐ½Ð¸Ðµ Ñлушающие Ñокеты.
- СпаÑибо Роману ОдайÑкому.
-
- *) ИÑправление: nginx/Windows мог нагружать процеÑÑор, еÑли при запуÑке
- рабочего процеÑÑа проиÑходила ошибка.
- СпаÑибо Ricardo Villalobos Guevara.
-
- *) ИÑправление: директивы proxy_pass_header, fastcgi_pass_header,
- scgi_pass_header, uwsgi_pass_header, proxy_hide_header,
- fastcgi_hide_header, scgi_hide_header и uwsgi_hide_header могли
- наÑледоватьÑÑ Ð½ÐµÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð¾.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.3 10.07.2012
-
- *) Добавление: поддержка entity tags и директива etag.
-
- *) ИÑправление: при иÑпользовании директивы map Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ hostnames
- не игнорировалаÑÑŒ ÐºÐ¾Ð½ÐµÑ‡Ð½Ð°Ñ Ñ‚Ð¾Ñ‡ÐºÐ° в иÑходном значении.
-
- *) ИÑправление: Ð´Ð»Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ¸ запроÑа мог иÑпользоватьÑÑ Ð½ÐµÐ²ÐµÑ€Ð½Ñ‹Ð¹
- location, еÑли переход в именованный location проиÑходил поÑле
- Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ URI Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы rewrite.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.2 26.06.2012
-
- *) Изменение: параметр single директивы keepalive теперь игнорируетÑÑ.
-
- *) Изменение: Ñжатие SSL теперь отключено в том чиÑле при иÑпользовании
- OpenSSL Ñтарее 1.0.0.
-
- *) Добавление: директиву "ip_hash" теперь можно иÑпользовать длÑ
- баланÑировки IPv6 клиентов.
-
- *) Добавление: переменную $status теперь можно иÑпользовать не только в
- директиве log_format.
-
- *) ИÑправление: при завершении рабочего процеÑÑа мог произойти
- segmentation fault, еÑли иÑпользовалаÑÑŒ директива resolver.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалÑÑ Ð¼Ð¾Ð´ÑƒÐ»ÑŒ ngx_http_mp4_module.
-
- *) ИÑправление: в модуле ngx_http_mp4_module.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалиÑÑŒ конфликтующие имена Ñерверов Ñ Ð¼Ð°Ñками.
-
- *) ИÑправление: на платформе ARM nginx мог аварийно завершатьÑÑ Ð¿Ð¾
- Ñигналу SIGBUS.
-
- *) ИÑправление: во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ на HP-UX в лог запиÑывалÑÑ
- alert "sendmsg() failed (9: Bad file number)".
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.1 05.06.2012
-
- *) БезопаÑноÑÑ‚ÑŒ: теперь nginx/Windows игнорирует точку в конце
- компонента URI и не разрешает URI, Ñодержащие поÑледовательноÑÑ‚ÑŒ
- ":$".
- СпаÑибо Владимиру Кочеткову, Positive Research Center.
-
- *) Добавление: директивы proxy_pass, fastcgi_pass, scgi_pass, uwsgi_pass
- и директива server в блоке upstream теперь поддерживают IPv6-адреÑа.
-
- *) Добавление: в директиве resolver теперь можно указывать порт и
- задавать IPv6-адреÑа DNS-Ñерверов.
-
- *) Добавление: директива least_conn в блоке upstream.
-
- *) Добавление: при иÑпользовании директивы ip_hash теперь можно задавать
- веÑа Ñерверов.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалаÑÑŒ директива image_filter; ошибка поÑвилаÑÑŒ в 1.3.0.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_cpp_test_module; ошибка
- поÑвилаÑÑŒ в 1.1.12.
-
- *) ИÑправление: доÑтуп к переменным из SSI и вÑтроенного перла мог не
- работать поÑле переконфигурации.
- СпаÑибо Yichun Zhang.
-
- *) ИÑправление: в модуле ngx_http_xslt_filter_module.
- СпаÑибо Kuramoto Eiji.
-
- *) ИÑправление: утечки памÑти при иÑпользовании переменной $geoip_org.
- СпаÑибо ДениÑу Латыпову.
-
- *) ИÑправление: в директивах proxy_cookie_domain и proxy_cookie_path.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.3.0 15.05.2012
-
- *) Добавление: директива debug_connection теперь поддерживает
- IPv6-адреÑа и параметр "unix:".
-
- *) Добавление: директива set_real_ip_from и параметр proxy директивы geo
- теперь поддерживают IPv6-адреÑа.
-
- *) Добавление: директивы real_ip_recursive, geoip_proxy и
- geoip_proxy_recursive.
-
- *) Добавление: параметр proxy_recursive директивы geo.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалаÑÑŒ директива resolver.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалиÑÑŒ директивы fastcgi_pass, scgi_pass или uwsgi_pass
- и бÑкенд возвращал некорректный ответ.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалаÑÑŒ директива rewrite и в новых аргументах запроÑа в
- Ñтроке замены иÑпользовалиÑÑŒ переменные.
-
- *) ИÑправление: nginx мог нагружать процеÑÑор, еÑли было доÑтигнуто
- ограничение на количеÑтво открытых файлов.
-
- *) ИÑправление: при иÑпользовании директивы proxy_next_upstream Ñ
- параметром http_404 nginx мог беÑконечно перебирать бÑкенды, еÑли в
- блоке upstream был Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ один Ñервер Ñ Ñ„Ð»Ð°Ð³Ð¾Ð¼ backup.
-
- *) ИÑправление: при иÑпользовании директивы ip_hash уÑтановка параметра
- down директивы server могла приводить к ненужному перераÑпределению
- клиентов между бÑкендами.
-
- *) ИÑправление: утечки Ñокетов.
- СпаÑибо Yichun Zhang.
-
- *) ИÑправление: в модуле ngx_http_fastcgi_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.2.0 23.04.2012
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалаÑÑŒ директива try_files; ошибка поÑвилаÑÑŒ в 1.1.19.
-
- *) ИÑправление: ответ мог быть передан не полноÑтью, еÑли иÑпользовалоÑÑŒ
- больше IOV_MAX буферов.
-
- *) ИÑправление: в работе параметра crop директивы image_filter.
- СпаÑибо Maxim Bublis.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.19 12.04.2012
-
- *) БезопаÑноÑÑ‚ÑŒ: при обработке Ñпециально Ñозданного mp4 файла модулем
- ngx_http_mp4_module могли перезапиÑыватьÑÑ Ð¾Ð±Ð»Ð°Ñти памÑти рабочего
- процеÑÑа, что могло приводить к выполнению произвольного кода
- (CVE-2012-2089).
- СпаÑибо Matthew Daley.
-
- *) ИÑправление: nginx/Windows мог завершатьÑÑ Ð°Ð²Ð°Ñ€Ð¸Ð¹Ð½Ð¾.
- СпаÑибо Vincent Lee.
-
- *) ИÑправление: nginx нагружал процеÑÑор, еÑли вÑе Ñерверы в upstream'е
- были помечены флагом backup.
-
- *) ИÑправление: директивы allow и deny могли наÑледоватьÑÑ Ð½ÐµÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð¾,
- еÑли в них иÑпользовалиÑÑŒ IPv6 адреÑа.
-
- *) ИÑправление: директивы modern_browser и ancient_browser могли
- наÑледоватьÑÑ Ð½ÐµÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð¾.
-
- *) ИÑправление: таймауты могли работать некорректно на Solaris/SPARC.
-
- *) ИÑправление: в модуле ngx_http_mp4_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.18 28.03.2012
-
- *) Изменение: теперь keepalive ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð½Ðµ запрещены Ð´Ð»Ñ Safari по
- умолчанию.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $connection_requests.
-
- *) Добавление: переменные $tcpinfo_rtt, $tcpinfo_rttvar,
- $tcpinfo_snd_cwnd и $tcpinfo_rcv_space.
-
- *) Добавление: директива worker_cpu_affinity теперь работает на FreeBSD.
-
- *) Добавление: директивы xslt_param и xslt_string_param.
- СпаÑибо Samuel Behan.
-
- *) ИÑправление: в configure.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: в модуле ngx_http_xslt_filter_module.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Debian GNU/Hurd.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.17 15.03.2012
-
- *) БезопаÑноÑÑ‚ÑŒ: Ñодержимое ранее оÑвобождённой памÑти могло быть
- отправлено клиенту, еÑли бÑкенд возвращал Ñпециально Ñозданный ответ.
- СпаÑибо Matthew Daley.
-
- *) ИÑправление: при иÑпользовании вÑтроенного перла из SSI.
- СпаÑибо Matthew Daley.
-
- *) ИÑправление: в модуле ngx_http_uwsgi_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.16 29.02.2012
-
- *) Изменение: ограничение на количеÑтво одновременных подзапроÑов
- поднÑто до 200.
-
- *) Добавление: параметр from в директиве disable_symlinks.
-
- *) Добавление: директивы return и error_page теперь могут иÑпользоватьÑÑ
- Ð´Ð»Ñ Ð²Ð¾Ð·Ð²Ñ€Ð°Ñ‚Ð° перенаправлений Ñ ÐºÐ¾Ð´Ð¾Ð¼ 307.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалаÑÑŒ директива resolver и на глобальном уровне не была
- задана директива error_log.
- СпаÑибо Роману ÐрутюнÑну.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалиÑÑŒ директивы "proxy_http_version 1.1" или
- "fastcgi_keep_conn on".
-
- *) ИÑправление: утечек памÑти.
- СпаÑибо Lanshun Zhou.
-
- *) ИÑправление: в директиве disable_symlinks.
-
- *) ИÑправление: при иÑпользовании ZFS размер кÑша на диÑке мог ÑчитатьÑÑ
- некорректно; ошибка поÑвилаÑÑŒ в 1.0.1.
-
- *) ИÑправление: nginx не ÑобиралÑÑ ÐºÐ¾Ð¼Ð¿Ð¸Ð»Ñтором icc 12.1.
-
- *) ИÑправление: nginx не ÑобиралÑÑ gcc на Solaris; ошибка поÑвилаÑÑŒ в
- 1.1.15.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.15 15.02.2012
-
- *) Добавление: директива disable_symlinks.
-
- *) Добавление: директивы proxy_cookie_domain и proxy_cookie_path.
-
- *) ИÑправление: nginx мог некорректно Ñообщать об ошибке "upstream
- prematurely closed connection" вмеÑто "upstream sent too big header".
- СпаÑибо Feibo Li.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_http_perl_module, еÑли
- иÑпользовалÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€ --with-openssl.
-
- *) ИÑправление: количеÑтво внутренних перенаправлений в именованные
- location'Ñ‹ не ограничивалоÑÑŒ.
-
- *) ИÑправление: вызов $r->flush() неÑколько раз подрÑд мог приводить к
- ошибкам в модуле ngx_http_gzip_filter_module.
-
- *) ИÑправление: при иÑпользовании директивы proxy_store Ñ
- SSI-подзапроÑами временные файлы могли не удалÑÑ‚ÑŒÑÑ.
-
- *) ИÑправление: в некоторых ÑлучаÑÑ… некÑшируемые переменные (такие, как
- $args) возвращали Ñтарое пуÑтое закÑшированное значение.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли одновременно ÑоздавалоÑÑŒ Ñлишком много SSI-подзапроÑов; ошибка
- поÑвилаÑÑŒ в 0.7.25.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.14 30.01.2012
-
- *) Добавление: теперь можно указать неÑколько ограничений limit_req
- одновременно.
-
- *) ИÑправление: в обработке ошибок при Ñоединении Ñ Ð±Ñкендом.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: в обработке ошибок при иÑпользовании AIO на FreeBSD.
-
- *) ИÑправление: в инициализации библиотеки OpenSSL.
-
- *) ИÑправление: директивы proxy_redirect могли наÑледоватьÑÑ
- некорректно.
-
- *) ИÑправление: утечки памÑти при переконфигурации, еÑли иÑпользовалаÑÑŒ
- директива pcre_jit.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.13 16.01.2012
-
- *) Добавление: параметры TLSv1.1 и TLSv1.2 в директиве ssl_protocols.
-
- *) ИÑправление: параметры директивы limit_req наÑледовалиÑÑŒ некорректно;
- ошибка поÑвилаÑÑŒ в 1.1.12.
-
- *) ИÑправление: директива proxy_redirect некорректно обрабатывала
- заголовок Refresh при иÑпользовании регулÑрных выражений.
-
- *) ИÑправление: директива proxy_cache_use_stale Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ error не
- возвращала ответ из кÑша, еÑли вÑе бÑкенды были признаны
- неработающими.
-
- *) ИÑправление: директива worker_cpu_affinity могла не работать.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Solaris; ошибка поÑвилаÑÑŒ в
- 1.1.12.
-
- *) ИÑправление: в модуле ngx_http_mp4_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.12 26.12.2011
-
- *) Изменение: поÑле Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы
- error_page директива proxy_pass без URI теперь иÑпользует изменённый
- URI.
- СпаÑибо Lanshun Zhou.
-
- *) Добавление: директивы proxy/fastcgi/scgi/uwsgi_cache_lock,
- proxy/fastcgi/scgi/uwsgi_cache_lock_timeout.
-
- *) Добавление: директива pcre_jit.
-
- *) Добавление: SSI команда if поддерживает Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных
- выражениÑÑ….
-
- *) ИÑправление: SSI команда if не работала внутри команды block.
-
- *) ИÑправление: директивы limit_conn_log_level и limit_req_log_level
- могли не работать.
-
- *) ИÑправление: директива limit_rate не позволÑла передавать на полной
- ÑкороÑти, даже еÑли был указан очень большой лимит.
-
- *) ИÑправление: директива sendfile_max_chunk не работала, еÑли
- иÑпользовалаÑÑŒ директива limit_rate.
-
- *) ИÑправление: еÑли в директиве proxy_pass иÑпользовалиÑÑŒ переменные и
- не был указан URI, вÑегда иÑпользовалÑÑ URI иÑходного запроÑа.
-
- *) ИÑправление: поÑле Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы
- try_files директива proxy_pass без URI могла иÑпользовать URI
- иÑходного запроÑа.
- СпаÑибо Lanshun Zhou.
-
- *) ИÑправление: в модуле ngx_http_scgi_module.
-
- *) ИÑправление: в модуле ngx_http_mp4_module.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Solaris; ошибка поÑвилаÑÑŒ в 1.1.9.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.11 12.12.2011
-
- *) Добавление: параметр so_keepalive в директиве listen.
- СпаÑибо Ð’Ñеволоду Стахову.
-
- *) Добавление: параметр if_not_empty в директивах
- fastcgi/scgi/uwsgi_param.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $https.
-
- *) Добавление: директива proxy_redirect поддерживает переменные в первом
- параметре.
-
- *) Добавление: директива proxy_redirect поддерживает регулÑрные
- выражениÑ.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $sent_http_cache_control могла Ñодержать
- неверное значение при иÑпользовании директивы expires.
- СпаÑибо Yichun Zhang.
-
- *) ИÑправление: директива read_ahead могла не работать при иÑпользовании
- ÑовмеÑтно Ñ try_files и open_file_cache.
-
- *) ИÑправление: еÑли в параметре inactive директивы proxy_cache_path
- было указано малое времÑ, в рабочем процеÑÑе мог произойти
- segmentation fault.
-
- *) ИÑправление: ответы из кÑша могли завиÑать.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.10 30.11.2011
-
- *) ИÑправление: при иÑпользовании AIO на Linux в рабочем процеÑÑе
- проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в 1.1.9.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.9 28.11.2011
-
- *) Изменение: теперь двойные кавычки ÑкранируетÑÑ Ð¿Ñ€Ð¸ выводе
- SSI-командой echo.
- СпаÑибо Зауру ÐбаÑмирзоеву.
-
- *) Добавление: параметр valid в директиве resolver. По умолчанию теперь
- иÑпользуетÑÑ TTL, возвращённый DNS-Ñервером.
- СпаÑибо Кириллу КоринÑкому.
-
- *) ИÑправление: nginx мог переÑтать отвечать, еÑли рабочий процеÑÑ
- завершалÑÑ Ð°Ð²Ð°Ñ€Ð¸Ð¹Ð½Ð¾.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалоÑÑŒ SNI; ошибка поÑвилаÑÑŒ в 1.1.2.
-
- *) ИÑправление: в директиве keepalive_disable; ошибка поÑвилаÑÑŒ в 1.1.8.
- СпаÑибо ÐлекÑандру УÑову.
-
- *) ИÑправление: Ñигнал SIGWINCH переÑтавал работать поÑле первого
- Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸ÑполнÑемого файла; ошибка поÑвилаÑÑŒ в 1.1.1.
-
- *) ИÑправление: теперь ответы бÑкендов, длина которых не ÑоответÑтвует
- заголовку Content-Length, не кÑширутÑÑ.
-
- *) ИÑправление: в директиве scgi_param при иÑпользовании ÑоÑтавных
- параметров.
-
- *) ИÑправление: в методе epoll.
- СпаÑибо Yichun Zhang.
-
- *) ИÑправление: в модуле ngx_http_flv_module.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: в модуле ngx_http_mp4_module.
-
- *) ИÑправление: теперь nginx понимает IPv6-адреÑа в Ñтроке запроÑа и в
- заголовке Host.
-
- *) ИÑправление: директивы add_header и expires не работали Ð´Ð»Ñ Ð¾Ñ‚Ð²ÐµÑ‚Ð¾Ð² Ñ
- кодом 206, еÑли Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¿Ñ€Ð¾ÐºÑировалÑÑ.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° FreeBSD 10.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° AIX.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.8 14.11.2011
-
- *) Изменение: модуль ngx_http_limit_zone_module переименован в
- ngx_http_limit_conn_module.
-
- *) Изменение: директива limit_zone заменена директивой limit_conn_zone Ñ
- новым ÑинтакÑиÑом.
-
- *) Добавление: поддержка Ð¾Ð³Ñ€Ð°Ð½Ð¸Ñ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾ неÑкольким limit_conn на одном
- уровне.
-
- *) Добавление: директива image_filter_sharpen.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли resolver получил большой DNS-ответ.
- СпаÑибо Ben Hawkes.
-
- *) ИÑправление: в вычиÑлении ключа Ð´Ð»Ñ ÐºÑшированиÑ, еÑли иÑпользовалаÑÑŒ
- внутреннÑÑ Ñ€ÐµÐ°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ MD5; ошибка поÑвилаÑÑŒ в 1.0.4.
-
- *) ИÑправление: Ñтроки "If-Modified-Since", "If-Range" и им подобные в
- заголовке запроÑа клиента могли передаватьÑÑ Ð±Ñкенду при кÑшировании;
- или не передаватьÑÑ Ð¿Ñ€Ð¸ выключенном кÑшировании, еÑли кÑширование
- было включено в другой чаÑти конфигурации.
-
- *) ИÑправление: модуль ngx_http_mp4_module выдавал неверную Ñтроку
- "Content-Length" в заголовке ответа, иÑпользовалÑÑ Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚ start.
- СпаÑибо Piotr Sikora.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.7 31.10.2011
-
- *) Добавление: поддержка неÑкольких DNS Ñерверов в директиве "resolver".
- СпаÑибо Кириллу КоринÑкому.
-
- *) ИÑправление: на Ñтарте или во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ проиÑходил
- segmentation fault, еÑли директива ssl иÑпользовалаÑÑŒ на уровне http
- и не был указан ssl_certificate.
-
- *) ИÑправление: уменьшено потребление памÑти при прокÑировании больших
- файлов, еÑли они буферизировалиÑÑŒ на диÑк.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалаÑÑŒ директива "proxy_http_version 1.1".
-
- *) ИÑправление: в директиве "expires @time".
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.6 17.10.2011
-
- *) Изменение во внутреннем API: теперь при внутреннем редиректе в
- именованный location контекÑÑ‚Ñ‹ модулей очищаютÑÑ.
- По запроÑу Yichun Zhang.
-
- *) Изменение: теперь еÑли Ñервер, опиÑанный в блоке upstream, был
- признан неработающим, то поÑле иÑÑ‚ÐµÑ‡ÐµÐ½Ð¸Ñ fail_timeout на него будет
- отправлен только один запроÑ; Ñервер будет ÑчитатьÑÑ Ñ€Ð°Ð±Ð¾Ñ‚Ð°ÑŽÑ‰Ð¸Ð¼, еÑли
- уÑпешно ответит на Ñтот запроÑ.
-
- *) Изменение: теперь Ñимволы 0x7F-0xFF в access_log запиÑываютÑÑ Ð² виде
- \xXX.
-
- *) Добавление: директивы "proxy/fastcgi/scgi/uwsgi_ignore_headers"
- теперь поддерживают Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ X-Accel-Limit-Rate, X-Accel-Buffering и
- X-Accel-Charset.
-
- *) Добавление: уменьшение Ð¿Ð¾Ñ‚Ñ€ÐµÐ±Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð¼Ñти при иÑпользовании SSL.
-
- *) ИÑправление: некоторые UTF-8 Ñимволы обрабатывалиÑÑŒ неправильно.
- СпаÑибо ÐлекÑею Куцу.
-
- *) ИÑправление: директивы Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_rewrite_module, заданные на
- уровне server, применÑлиÑÑŒ повторно, еÑли Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа не находилоÑÑŒ
- ни одного location'а.
-
- *) ИÑправление: при иÑпользовании "aio sendfile" могла проиÑходить
- утечка Ñокетов.
-
- *) ИÑправление: при иÑпользовании файлового AIO ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ð±Ñ‹Ñтрыми
- клиентами могли быть закрыты по иÑтечению send_timeout.
-
- *) ИÑправление: в модуле ngx_http_autoindex_module.
-
- *) ИÑправление: модуль ngx_http_mp4_module не поддерживал перемотку на
- 32-битных платформах.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.5 05.10.2011
-
- *) Добавление: директивы uwsgi_buffering и scgi_buffering.
- СпаÑибо Peter Smit.
-
- *) ИÑправление: при иÑпользовании proxy_cache_bypass могли быть
- закÑшированы некÑшируемые ответы.
- СпаÑибо John Ferlito.
-
- *) ИÑправление: в модуле ngx_http_proxy_module при работе Ñ Ð±Ñкендами по
- HTTP/1.1.
-
- *) ИÑправление: закÑшированные ответы Ñ Ð¿ÑƒÑтым телом возвращалиÑÑŒ
- некорректно; ошибка поÑвилаÑÑŒ в 0.8.31.
-
- *) ИÑправление: ответы Ñ ÐºÐ¾Ð´Ð¾Ð¼ 201 Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_dav_module были
- некорректны; ошибка поÑвилаÑÑŒ в 0.8.32.
-
- *) ИÑправление: в директиве return.
-
- *) ИÑправление: при иÑпользовании директивы "ssl_session_cache builtin"
- проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в 1.1.1.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.4 20.09.2011
-
- *) Добавление: модуль ngx_http_upstream_keepalive.
-
- *) Добавление: директива proxy_http_version.
-
- *) Добавление: директива fastcgi_keep_conn.
-
- *) Добавление: директива worker_aio_requests.
-
- *) ИÑправление: еÑли nginx был Ñобран Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²Ñ‹Ð¼ AIO, он не мог
- запуÑкатьÑÑ Ð½Ð° Linux без поддержки AIO.
-
- *) ИÑправление: в обработке ошибок при работе Ñ Linux AIO.
- СпаÑибо Hagai Avrahami.
-
- *) ИÑправление: уменьшено потребление памÑти Ð´Ð»Ñ Ð´Ð¾Ð»Ð³Ð¾Ð¶Ð¸Ð²ÑƒÑ‰Ð¸Ñ… запроÑов.
-
- *) ИÑправление: модуль ngx_http_mp4_module не поддерживал 64-битный
- MP4-атом co64.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.3 14.09.2011
-
- *) Добавление: модуль ngx_http_mp4_module.
-
- *) ИÑправление: в Linux AIO, иÑпользуемым ÑовмеÑтно Ñ open_file_cache.
-
- *) ИÑправление: open_file_cache не обновлÑл информацию о файле, еÑли
- файл был изменён не атомарно.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° MacOSX 10.7.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.2 05.09.2011
-
- *) Изменение: теперь, еÑли Ñуммарный размер вÑех диапазонов больше
- размера иÑходного ответа, то nginx возвращает только иÑходный ответ,
- не Ð¾Ð±Ñ€Ð°Ð±Ð°Ñ‚Ñ‹Ð²Ð°Ñ Ð´Ð¸Ð°Ð¿Ð°Ð·Ð¾Ð½Ñ‹.
-
- *) Добавление: директива max_ranges.
-
- *) ИÑправление: директивы ssl_verify_client, ssl_verify_depth и
- ssl_prefer_server_cipher могли работать некорректно, еÑли
- иÑпользовалÑÑ SNI.
-
- *) ИÑправление: в директивах proxy/fastcgi/scgi/
- uwsgi_ignore_client_abort.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.1 22.08.2011
-
- *) Изменение: теперь загрузчик кÑша за каждую итерацию либо обрабатывает
- чиÑло файлов, указанное в параметре load_files, либо работает не
- дольше времени, указанного в параметре loader_threshold.
-
- *) Изменение: SIGWINCH Ñигнал теперь работает только в режиме демона.
-
- *) Добавление: теперь разделÑемые зоны и кÑши иÑпользуют Ñемафоры POSIX
- на Solaris.
- СпаÑибо ДениÑу Иванову.
-
- *) Добавление: теперь на NetBSD поддерживаютÑÑ accept фильтры.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Linux 3.0.
-
- *) ИÑправление: в некоторых ÑлучаÑÑ… nginx не иÑпользовал Ñжатие; ошибка
- поÑвилаÑÑŒ в 1.1.0.
-
- *) ИÑправление: обработка тела запроÑа могла быть неверной, еÑли клиент
- иÑпользовал pipelining.
-
- *) ИÑправление: в директиве request_body_in_single_buf.
-
- *) ИÑправление: в директивах proxy_set_body и proxy_pass_request_body
- при иÑпользовании SSL-ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ð±Ñкендом.
-
- *) ИÑправление: nginx нагружал процеÑÑор, еÑли вÑе Ñерверы в upstream'е
- были помечены флагом down.
-
- *) ИÑправление: при переконфигурации мог произойти segmentation fault,
- еÑли в предыдущей конфигурации был определён, но не иÑпользовалÑÑ
- ssl_session_cache.
-
- *) ИÑправление: при иÑпользовании большого количеÑтва backup-Ñерверов в
- рабочем процеÑÑе мог произойти segmentation fault.
-
- *) ИÑправление: при иÑпользовании директив fastcgi/scgi/uwsgi_param Ñо
- значениÑми, начинающимиÑÑ Ñо Ñтроки "HTTP_", в рабочем процеÑÑе мог
- произойти segmentation fault; ошибка поÑвилаÑÑŒ в 0.8.40.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.1.0 01.08.2011
-
- *) Добавление: уменьшение времени работы загрузчика кÑша.
-
- *) Добавление: параметры loader_files, loader_sleep и loader_threshold
- директив proxy/fastcgi/scgi/uwsgi_cache_path.
-
- *) Добавление: уменьшение времени загрузки конфигураций Ñ Ð±Ð¾Ð»ÑŒÑˆÐ¸Ð¼
- количеÑтвом HTTPS Ñерверов.
-
- *) Добавление: теперь nginx поддерживает шифры Ñ Ð¾Ð±Ð¼ÐµÐ½Ð¾Ð¼ ECDHE-ключами.
- СпаÑибо Adrian Kotelba.
-
- *) Добавление: директива lingering_close.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð´Ð»Ñ pipelined-запроÑов.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: nginx не запрещал Ñжатие при получении значениÑ
- "gzip;q=0" в Ñтроке "Accept-Encoding" в заголовке запроÑа клиента.
-
- *) ИÑправление: таймаута при небуферизированном прокÑировании.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: утечки памÑти при иÑпользовании переменных в директиве
- proxy_pass при работе Ñ Ð±Ñкендом по HTTPS.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: в проверке параметра директивы proxy_pass, заданного
- переменными.
- СпаÑибо Lanshun Zhou.
-
- *) ИÑправление: SSL не работал на QNX.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: SSL модули не ÑобиралиÑÑŒ gcc 4.6 без параметра
- --with-debug.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.0.5 19.07.2011
-
- *) Изменение: теперь по умолчанию иÑпользуютÑÑ Ñледующие шифры SSL:
- "HIGH:!aNULL:!MD5".
- СпаÑибо Rob Stradling.
-
- *) Добавление: директивы referer_hash_max_size и
- referer_hash_bucket_size.
- СпаÑибо Witold Filipczyk.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $uid_reset.
-
- *) ИÑправление: при иÑпользовании кÑÑˆÐ¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² рабочем процеÑÑе мог
- произойти segmentation fault.
- СпаÑибо Lanshun Zhou.
-
- *) ИÑправление: при иÑпользовании кÑÑˆÐ¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñ€Ð°Ð±Ð¾Ñ‡Ð¸Ðµ процеÑÑÑ‹ могли
- зациклитьÑÑ Ð²Ð¾ Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸; ошибка поÑвилаÑÑŒ в 0.8.48.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ "stalled cache updating".
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.0.4 01.06.2011
-
- *) Изменение: теперь в регулÑрных выражениÑÑ… в директиве map можно
- задать чувÑтвительноÑÑ‚ÑŒ к региÑтру Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ префикÑов "~" и "~*".
-
- *) Добавление: теперь разделÑемые зоны и кÑши иÑпользуют Ñемафоры POSIX
- на Linux.
- СпаÑибо ДениÑу Латыпову.
-
- *) ИÑправление: ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ "stalled cache updating".
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼
- --without-http_auth_basic_module; ошибка поÑвилаÑÑŒ в 1.0.3.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.0.3 25.05.2011
-
- *) Добавление: директива auth_basic_user_file поддерживает шифрование
- Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð¼ÐµÑ‚Ð¾Ð´Ð°Ð¼Ð¸ "$apr1", "{PLAIN}" и "{SSHA}".
- СпаÑибо МакÑиму Дунину.
-
- *) Добавление: директива geoip_org и Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $geoip_org.
- СпаÑибо ÐлекÑандру УÑкову, Arnaud Granal и ДениÑу Латыпову.
-
- *) Добавление: модули ngx_http_geo_module и ngx_http_geoip_module
- поддерживают адреÑа IPv4, отображённые на IPv6 адреÑа.
-
- *) ИÑправление: при проверке адреÑа IPv4, отображённого на Ð°Ð´Ñ€ÐµÑ IPv6, в
- рабочем процеÑÑе проиÑходил segmentation fault, еÑли директивы access
- или deny были определены только Ð´Ð»Ñ Ð°Ð´Ñ€ÐµÑов IPv6; ошибка поÑвилаÑÑŒ в
- 0.8.22.
-
- *) ИÑправление: закÑшированный ответ мог быть иÑпорчен, еÑли значениÑ
- директив proxy/fastcgi/scgi/uwsgi_cache_bypass и proxy/fastcgi/scgi/
- uwsgi_no_cache были разными; ошибка поÑвилаÑÑŒ в 0.8.46.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.0.2 10.05.2011
-
- *) Добавление: теперь разделÑемые зоны и кÑши иÑпользуют Ñемафоры POSIX.
-
- *) ИÑправление: в работе параметра rotate директивы image_filter.
- СпаÑибо Adam Bocim.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Solaris; ошибка поÑвилаÑÑŒ в 1.0.1.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.0.1 03.05.2011
-
- *) Изменение: теперь директива split_clients иÑпользует алгоритм
- MurmurHash2 из-за лучшего раÑпределениÑ.
- СпаÑибо Олегу Мамонтову.
-
- *) Изменение: теперь длинные Ñтроки, начинающиеÑÑ Ñ Ð½ÑƒÐ»Ñ, не ÑчитаютÑÑ
- ложными значениÑми.
- СпаÑибо МакÑиму Дунину.
-
- *) Изменение: теперь по умолчанию nginx иÑпользует значение 511 длÑ
- listen backlog на Linux.
-
- *) Добавление: переменные $upstream_... можно иÑпользовать в SSI и
- перловом модулÑÑ….
-
- *) ИÑправление: теперь nginx лучше ограничивает размер кÑша на диÑке.
- СпаÑибо Олегу Мамонтову.
-
- *) ИÑправление: при парÑинге неправильного IPv4 адреÑа мог произойти
- segmentation fault; ошибка поÑвилаÑÑŒ в 0.8.22.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: nginx не ÑобиралÑÑ gcc 4.6 без параметра --with-debug.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Solaris 9 и более ранних; ошибка
- поÑвилаÑÑŒ в 0.9.3.
- СпаÑибо Dagobert Michelsen.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $request_time имела неверные значениÑ, еÑли
- иÑпользовалиÑÑŒ подзапроÑÑ‹; ошибка поÑвилаÑÑŒ в 0.8.47.
- СпаÑибо Игорю Ð. Валькову.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 1.0.0 12.04.2011
-
- *) ИÑправление: cache manager мог нагружать процеÑÑор поÑле
- переконфигурации.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: директива "image_filter crop" неправильно работала в
- Ñочетании Ñ "image_filter rotate 180".
-
- *) ИÑправление: директива "satisfy any" запрещала выдачу
- пользовательÑкой Ñтраницы Ð´Ð»Ñ 401 кода.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.9.7 04.04.2011
-
- *) Добавление: теперь ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð² ÑоÑтоÑнии keepalive могут быть
- закрыты преждевременно, еÑли у воркера нет Ñвободных Ñоединений.
- СпаÑибо МакÑиму Дунину.
-
- *) Добавление: параметр rotate директивы image_filter.
- СпаÑибо Adam Bocim.
-
- *) ИÑправление: Ñитуации, когда бÑкенд в директивах fastcgi_pass,
- scgi_pass или uwsgi_pass задан выражением и ÑÑылаетÑÑ Ð½Ð° опиÑанный
- upstream.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.9.6 21.03.2011
-
- *) Добавление: директива map поддерживает регулÑрные Ð²Ñ‹Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð²
- качеÑтве Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿ÐµÑ€Ð²Ð¾Ð³Ð¾ параметра.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $time_iso8601 Ð´Ð»Ñ access_log.
- СпаÑибо Michael Lustfield.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.9.5 21.02.2011
-
- *) Изменение: теперь по умолчанию nginx иÑпользует значение -1 длÑ
- listen backlog на Linux.
- СпаÑибо Ðндрею Ðигматулину.
-
- *) Добавление: параметр utf8 в директивах geoip_country и geoip_city.
- СпаÑибо ДениÑу Латыпову.
-
- *) ИÑправление: иÑправление в умолчательной директиве proxy_redirect,
- еÑли в директиве proxy_pass не был опиÑан URI.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: директива error_page не работала Ñ Ð½ÐµÑтандартными кодами
- ошибок; ошибка поÑвилаÑÑŒ в 0.8.53.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.9.4 21.01.2011
-
- *) Добавление: директива server_name поддерживает переменную $hostname.
-
- *) Добавление: 494 код Ð´Ð»Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ¸ "Request Header Too Large".
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.9.3 13.12.2010
-
- *) ИÑправление: еÑли Ð´Ð»Ñ Ð¿Ð°Ñ€Ñ‹ IPv6-адреÑ:порт опиÑан только один Ñервер,
- то Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных выражениÑÑ… в директиве server_name не
- работали.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð¿Ð¾Ð´ Solaris; ошибка поÑвилаÑÑŒ в
- 0.9.0.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.9.2 06.12.2010
-
- *) Добавление: поддержка Ñтроки "If-Unmodified-Since" в заголовке
- запроÑа клиента.
-
- *) Изменение: иÑпользование accept(), еÑли accept4() не реализован;
- ошибка поÑвилаÑÑŒ в 0.9.0.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð¿Ð¾Ð´ Cygwin; ошибка поÑвилаÑÑŒ в 0.9.0.
-
- *) ИÑправление: уÑзвимоÑти в OpenSSL CVE-2010-4180.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.9.1 30.11.2010
-
- *) ИÑправление: директивы вида "return CODE message" не работали; ошибка
- поÑвилаÑÑŒ в 0.9.0.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.9.0 29.11.2010
-
- *) Добавление: директива keepalive_disable.
-
- *) Добавление: директива map поддерживает переменные в качеÑтве значениÑ
- определÑемой переменной.
-
- *) Добавление: директива map поддерживает пуÑтые Ñтроки в качеÑтве
- Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿ÐµÑ€Ð²Ð¾Ð³Ð¾ параметра.
-
- *) Добавление: директива map поддерживает Ð²Ñ‹Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð² первом параметре.
-
- *) Добавление: Ñтраница руководÑтва nginx(8).
- СпаÑибо Сергею ОÑокину.
-
- *) Добавление: поддержка accept4() в Linux.
- СпаÑибо Simon Liu.
-
- *) Изменение: уÑтранение Ð¿Ñ€ÐµÐ´ÑƒÐ¿Ñ€ÐµÐ¶Ð´ÐµÐ½Ð¸Ñ Ð»Ð¸Ð½ÐºÐµÑ€Ð° о "sys_errlist" и
- "sys_nerr" под Linux; предупреждение поÑвилоÑÑŒ в 0.8.35.
-
- *) ИÑправление: при иÑпользовании директивы auth_basic в рабочем
- процеÑÑе мог произойти segmentation fault.
- СпаÑибо Михаилу Лалетину.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_http_eval_module; ошибка
- поÑвилаÑÑŒ в 0.8.42.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.53 18.10.2010
-
- *) Добавление: теперь директива error_page позволÑет менÑÑ‚ÑŒ код ÑтатуÑа
- у редиректа.
-
- *) Добавление: директива gzip_disable поддерживает Ñпециальную маÑку
- degradation.
-
- *) ИÑправление: при иÑпользовании файлового AIO могла проиÑходить утечка
- Ñокетов.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: еÑли в первом Ñервере не была опиÑана директива listen и
- нигде Ñвно не опиÑан Ñервер по умолчанию, то Ñервером по умолчанию
- ÑтановилÑÑ Ñледующий Ñервер Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¸Ð²Ð¾Ð¹ listen; ошибка поÑвилаÑÑŒ в
- 0.8.21.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.52 28.09.2010
-
- *) ИÑправление: nginx иÑпользовал режим SSL Ð´Ð»Ñ listen Ñокета, еÑли длÑ
- него был уÑтановлен любой listen-параметр; ошибка поÑвилаÑÑŒ в 0.8.51.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.51 27.09.2010
-
- *) Изменение: директива secure_link_expires упразднена.
-
- *) Изменение: уровень Ð»Ð¾Ð³Ð³Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¾ÑˆÐ¸Ð±Ð¾Ðº resolver'а понижен Ñ ÑƒÑ€Ð¾Ð²Ð½Ñ
- alert на error.
-
- *) Добавление: теперь параметр "ssl" listen-Ñокета можно уÑтанавливать
- неÑколько раз.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.50 02.09.2010
-
- *) Добавление: директивы secure_link, secure_link_md5 и
- secure_link_expires Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_secure_link_module.
-
- *) Добавление: ключ -q.
- СпаÑибо Геннадию Махомеду.
-
- *) ИÑправление: при иÑпользовании кÑÑˆÐ¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñ€Ð°Ð±Ð¾Ñ‡Ð¸Ðµ процеÑÑÑ‹ и могли
- зациклитьÑÑ Ð²Ð¾ Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸; ошибка поÑвилаÑÑŒ в 0.8.48.
-
- *) ИÑправление: в директиве gzip_disable.
- СпаÑибо Derrick Petzold.
-
- *) ИÑправление: nginx/Windows не мог поÑылать Ñигналы stop, quit,
- reopen, reload процеÑÑу, запущенному в другой ÑеÑÑии.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.49 09.08.2010
-
- *) Добавление: директива image_filter_jpeg_quality поддерживает
- переменные.
-
- *) ИÑправление: при иÑпользовании переменной $geoip_region_name в
- рабочем процеÑÑе мог произойти segmentation fault; ошибка поÑвилаÑÑŒ в
- 0.8.48.
-
- *) ИÑправление: ошибки, перехваченные error_page, кÑшировалиÑÑŒ только до
- Ñледующего запроÑа; ошибка поÑвилаÑÑŒ в 0.8.48.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.48 03.08.2010
-
- *) Изменение: теперь по умолчанию директива server_name имеет значение
- пуÑтое Ð¸Ð¼Ñ "".
- СпаÑибо Геннадию Махомеду.
-
- *) Изменение: теперь по умолчанию директива server_name_in_redirect
- имеет значение off.
-
- *) Добавление: переменные $geoip_dma_code, $geoip_area_code и
- $geoip_region_name.
- СпаÑибо Christine McGonagle.
-
- *) ИÑправление: директивы proxy_pass, fastcgi_pass, uwsgi_pass и
- scgi_pass не наÑледовалиÑÑŒ в блоки limit_except.
-
- *) ИÑправление: директивы proxy_cache_min_uses, fastcgi_cache_min_uses
- uwsgi_cache_min_uses и scgi_cache_min_uses не работали; ошибка
- поÑвилаÑÑŒ в 0.8.46.
-
- *) ИÑправление: директива fastcgi_split_path_info неверно иÑпользовала
- выделениÑ, еÑли в Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð¿Ð°Ð´Ð°Ð»Ð° только чаÑÑ‚ÑŒ URI.
- СпаÑибо Юрию Тарадаю и Frank Enderle.
-
- *) ИÑправление: директива rewrite не Ñкранировала Ñимвол ";" при
- копировании из URI в аргументы.
- СпаÑибо Daisuke Murase.
-
- *) ИÑправление: модуль ngx_http_image_filter_module закрывал Ñоединение,
- еÑли изображение было больше размера image_filter_buffer.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.47 28.07.2010
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $request_time имела неверные Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð´Ð»Ñ
- подзапроÑов.
-
- *) ИÑправление: ошибки, перехваченные error_page, не кÑшировалиÑÑŒ.
-
- *) ИÑправление: еÑли иÑпользовалÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€ max_size, то cache manager
- мог зациклитьÑÑ; ошибка поÑвилаÑÑŒ в 0.8.46.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.46 19.07.2010
-
- *) Изменение: директивы proxy_no_cache, fastcgi_no_cache, uwsgi_no_cache
- и scgi_no_cache теперь влиÑÑŽÑ‚ только на Ñохранение закÑшированного
- ответа.
-
- *) Добавление: директивы proxy_cache_bypass, fastcgi_cache_bypass,
- uwsgi_cache_bypass и scgi_cache_bypass.
-
- *) ИÑправление: nginx не оÑвобождал памÑÑ‚ÑŒ в keys_zone кÑшей в Ñлучае
- ошибки работы Ñ Ð±Ñкендом: памÑÑ‚ÑŒ оÑвобождалаÑÑŒ только по иÑтечении
- времени неактивноÑти или при недоÑтатке памÑти.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.45 13.07.2010
-
- *) Добавление: ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ Ð² модуле ngx_http_xslt_filter.
- СпаÑибо Laurence Rowe.
-
- *) ИÑправление: ответ SSI Ð¼Ð¾Ð´ÑƒÐ»Ñ Ð¼Ð¾Ð³ передаватьÑÑ Ð½Ðµ полноÑтью поÑле
- команды include Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ wait="yes"; ошибка поÑвилаÑÑŒ в 0.7.25.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: директива listen не поддерживала параметр setfib=0.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.44 05.07.2010
-
- *) Изменение: теперь nginx по умолчанию не кÑширует ответы бÑкендов, в
- заголовке которых еÑÑ‚ÑŒ Ñтрока "Set-Cookie".
-
- *) Добавление: директива listen поддерживает параметр setfib.
- СпаÑибо Ðндрею Филонову.
-
- *) ИÑправление: директива sub_filter могла изменÑÑ‚ÑŒ региÑÑ‚Ñ€ букв при
- чаÑтичном Ñовпадении.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ HP/UX.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ ÐºÐ¾Ð¼Ð¿Ð¸Ð»Ñтором AIX xlC_r.
-
- *) ИÑправление: nginx Ñчитал большие пакеты SSLv2 как обычные текÑтовые
- запроÑÑ‹.
- СпаÑибо Miroslaw Jaworski.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.43 30.06.2010
-
- *) Добавление: уÑкорение загрузки больших баз geo-диапазонов.
-
- *) ИÑправление: перенаправление ошибки в "location /zero {return 204;}"
- без Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÐºÐ¾Ð´Ð° ответа оÑтавлÑло тело ошибки; ошибка поÑвилаÑÑŒ в
- 0.8.42.
-
- *) ИÑправление: nginx мог закрывать IPv6 listen Ñокет во времÑ
- переконфигурации.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: переменную $uid_set можно иÑпользовать на любой Ñтадии
- обработки запроÑа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.42 21.06.2010
-
- *) Изменение: теперь nginx проверÑет location'Ñ‹, заданные регулÑрными
- выражениÑми, еÑли Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¿Ð¾Ð»Ð½Ð¾Ñтью Ñовпал Ñ location'ом, заданным
- Ñтрокой префикÑа. Предыдущее поведение поÑвилоÑÑŒ в 0.7.1.
-
- *) Добавление: модуль ngx_http_scgi_module.
- СпаÑибо Manlio Perillo.
-
- *) Добавление: в директиве return можно добавлÑÑ‚ÑŒ текÑÑ‚ ответа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.41 15.06.2010
-
- *) БезопаÑноÑÑ‚ÑŒ: рабочий процеÑÑ nginx/Windows мог завершатьÑÑ Ð°Ð²Ð°Ñ€Ð¸Ð¹Ð½Ð¾
- при запроÑе файла Ñ Ð½ÐµÐ²ÐµÑ€Ð½Ð¾Ð¹ кодировкой UTF-8.
-
- *) Изменение: теперь nginx разрешает иÑпользовать пробелы в Ñтроке
- запроÑа.
-
- *) ИÑправление: директива proxy_redirect неправильно изменÑла Ñтроку
- "Refresh" в заголовке ответа бÑкенда.
- СпаÑибо Ðндрею Ðндрееву и МакÑиму Согину.
-
- *) ИÑправление: nginx не поддерживал путь без имени хоÑта в Ñтроке
- "Destination" в заголовке запроÑа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.40 07.06.2010
-
- *) БезопаÑноÑÑ‚ÑŒ: теперь nginx/Windows игнорирует Ð¸Ð¼Ñ Ð¿Ð¾Ñ‚Ð¾ÐºÐ° файла по
- умолчанию.
- СпаÑибо Jose Antonio Vazquez Gonzalez.
-
- *) Добавление: модуль ngx_http_uwsgi_module.
- СпаÑибо Roberto De Ioris.
-
- *) Добавление: директива fastcgi_param Ñо значением, начинающимÑÑ Ñо
- Ñтроки "HTTP_", изменÑет Ñтроку заголовка в запроÑе клиента.
-
- *) ИÑправление: Ñтроки "If-Modified-Since", "If-Range" и им подобные в
- заголовке запроÑа клиента передавалиÑÑŒ FastCGI-Ñерверу при
- кÑшировании.
-
- *) ИÑправление: listen unix domain Ñокет Ð½ÐµÐ»ÑŒÐ·Ñ Ð±Ñ‹Ð»Ð¾ изменить во времÑ
- переконфигурации.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.39 31.05.2010
-
- *) ИÑправление: наÑÐ»ÐµÐ´ÑƒÐµÐ¼Ð°Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¸Ð²Ð° alias неправильно работала во
- вложенном location'е.
-
- *) ИÑправление: в комбинации директив alias Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼Ð¸ и try_files;
-
- *) ИÑправление: listen unix domain и IPv6 Ñокеты не наÑледовалиÑÑŒ во
- Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð±ÐµÐ· перерыва.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.38 24.05.2010
-
- *) Добавление: директивы proxy_no_cache и fastcgi_no_cache.
-
- *) Добавление: теперь при иÑпользовании переменной $scheme в директиве
- rewrite автоматичеÑки делаетÑÑ Ñ€ÐµÐ´Ð¸Ñ€ÐµÐºÑ‚.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: теперь задержки в директиве limit_req ÑоответÑтвует
- опиÑанному алгоритму.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: переменную $uid_got Ð½ÐµÐ»ÑŒÐ·Ñ Ð±Ñ‹Ð»Ð¾ иÑпользовать в SSI и
- перловом модулÑÑ….
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.37 17.05.2010
-
- *) Добавление: модуль ngx_http_split_clients_module.
-
- *) Добавление: директива map поддерживает ключи больше 255 Ñимволов.
-
- *) ИÑправление: nginx игнорировал Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ "private" и "no-store" в
- Ñтроке "Cache-Control" в заголовке ответа бÑкенда.
-
- *) ИÑправление: параметр stub в SSI-директиве include не иÑпользовалÑÑ,
- еÑли пуÑтой ответ имел код 200.
-
- *) ИÑправление: еÑли прокÑированный или FastCGI Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð²Ð½ÑƒÑ‚Ñ€ÐµÐ½Ð½Ðµ
- перенаправлÑлÑÑ Ð² другой прокÑированный или FastCGI location, то в
- рабочем процеÑÑе мог произойти segmentation fault; ошибка поÑвилаÑÑŒ в
- 0.8.33.
- СпаÑибо Yichun Zhang.
-
- *) ИÑправление: ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ IMAP к Ñерверу Zimbra могло завиÑнуть до
- таймаута.
- СпаÑибо Alan Batie.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.36 22.04.2010
-
- *) ИÑправление: модуль ngx_http_dav_module неправильно обрабатывал
- методы DELETE, COPY и MOVE Ð´Ð»Ñ Ñимлинков.
-
- *) ИÑправление: модуль SSI в подзапроÑах иÑпользовал закÑшированные в
- оÑновном запроÑе Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ñ… $query_string, $arg_... и им
- подобных.
-
- *) ИÑправление: значение переменной повторно ÑкранировалоÑÑŒ поÑле
- каждого вывода SSI-команды echo; ошибка поÑвилаÑÑŒ в 0.6.14.
-
- *) ИÑправление: рабочий процеÑÑ Ð·Ð°Ð²Ð¸Ñал при запроÑе файла FIFO.
- СпаÑибо Vicente Aguilar и МакÑиму Дунину.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ OpenSSL-1.0.0 на 64-битном Linux.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ --without-http-cache;
- ошибка поÑвилаÑÑŒ в 0.8.35.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.35 01.04.2010
-
- *) Изменение: теперь charset-фильтр работает до SSI-фильтра.
-
- *) Добавление: директива chunked_transfer_encoding.
-
- *) ИÑправление: Ñимвол "&" при копировании в аргументы в правилах
- rewrite не ÑкранировалÑÑ.
-
- *) ИÑправление: nginx мог завершатьÑÑ Ð°Ð²Ð°Ñ€Ð¸Ð¹Ð½Ð¾ во Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ¸
- Ñигнала или при иÑпользовании директивы timer_resolution на
- платформах, не поддерживающих методы kqueue или eventport.
- СпаÑибо George Xie и МакÑиму Дунину.
-
- *) ИÑправление: еÑли временные файлы и поÑтоÑнное меÑто хранениÑ
- раÑполагалиÑÑŒ на разных файловых ÑиÑтемах, то у поÑтоÑнных файлов
- Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð±Ñ‹Ð»Ð¾ неверным.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: модуль ngx_http_memcached_module мог выдавать ошибку
- "memcached sent invalid trailer".
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: nginx не мог Ñобрать библиотеку zlib-1.2.4 из иÑходных
- текÑтов.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: в рабочем процеÑÑе проиÑходил segmentation fault, еÑли
- перед ответом FastCGI-Ñервера было много вывода в stderr; ошибка
- поÑвилаÑÑŒ в 0.8.34.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.34 03.03.2010
-
- *) ИÑправление: nginx не поддерживал вÑе шифры, иÑпользуемые в
- клиентÑких Ñертификатах.
- СпаÑибо Иннокентию Еникееву.
-
- *) ИÑправление: nginx неправильно кÑшировал FastCGI-ответы, еÑли перед
- ответом было много вывода в stderr.
-
- *) ИÑправление: nginx не поддерживал HTTPS-рефереры.
-
- *) ИÑправление: nginx/Windows мог не находить файлы, еÑли путь в
- конфигурации был задан в другом региÑтре; ошибка поÑвилаÑÑŒ в 0.8.33.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $date_local выдавала неверное времÑ, еÑли
- иÑпользовалÑÑ Ñ„Ð¾Ñ€Ð¼Ð°Ñ‚ "%s".
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: еÑли ssl_session_cache не был уÑтановлен или уÑтановлен
- в none, то при проверке клиентÑкого Ñертификаты могла проиÑходить
- ошибка "session id context uninitialized"; ошибка поÑвилаÑÑŒ в 0.7.1.
-
- *) ИÑправление: geo-диапазон возвращал значение по умолчанию, еÑли
- диапазон включал в ÑÐµÐ±Ñ Ð¾Ð´Ð½Ñƒ и более Ñетей размером /16 и не
- начиналÑÑ Ð½Ð° границе Ñети размером /16.
-
- *) ИÑправление: блок, иÑпользуемый в параметре stub в SSI-директиве
- include, выводилÑÑ Ñ MIME-типом "text/plain".
-
- *) ИÑправление: $r->sleep() не работал; ошибка поÑвилаÑÑŒ в 0.8.11.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.33 01.02.2010
-
- *) БезопаÑноÑÑ‚ÑŒ: теперь nginx/Windows игнорирует пробелы в конце URI.
- СпаÑибо Dan Crowley, Core Security Technologies.
-
- *) БезопаÑноÑÑ‚ÑŒ: теперь nginx/Windows игнорирует короткие имена файлов.
- СпаÑибо Dan Crowley, Core Security Technologies.
-
- *) Изменение: теперь keepalive ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¿Ð¾Ñле запроÑов POST не
- запрещаютÑÑ Ð´Ð»Ñ MSIE 7.0+.
- СпаÑибо Adam Lounds.
-
- *) Изменение: теперь keepalive ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€ÐµÑ‰ÐµÐ½Ñ‹ Ð´Ð»Ñ Safari.
- СпаÑибо Joshua Sierles.
-
- *) ИÑправление: еÑли прокÑированный или FastCGI Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð²Ð½ÑƒÑ‚Ñ€ÐµÐ½Ð½Ðµ
- перенаправлÑлÑÑ Ð² другой прокÑированный или FastCGI location, то
- Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $upstream_response_time могла иметь ненормально большое
- значение; ошибка поÑвилаÑÑŒ в 0.8.7.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault при
- отбраÑÑ‹Ð²Ð°Ð½Ð¸Ñ Ñ‚ÐµÐ»Ð° запроÑа; ошибка поÑвилаÑÑŒ в 0.8.11.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.32 11.01.2010
-
- *) ИÑправление: ошибки при иÑпользовании кодировки UTF-8 в
- ngx_http_autoindex_module.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: именованные Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных выражениÑÑ… работали
- только Ð´Ð»Ñ Ð´Ð²ÑƒÑ… переменных.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: теперь в Ñтроке заголовка запроÑа "Host" иÑпользуетÑÑ
- Ð¸Ð¼Ñ "localhost", еÑли в директиве auth_http указан unix domain Ñокет.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: nginx не поддерживал передачу chunk'ами Ð´Ð»Ñ 201-Ñ‹Ñ…
- ответов.
- СпаÑибо Julian Reich.
-
- *) ИÑправление: еÑли директива "expires modified" выÑтавлÑла дату в
- прошлом, то в Ñтроке заголовка ответа "Cache-Control" выдавалоÑÑŒ
- отрицательное чиÑло.
- СпаÑибо ÐлекÑею Капранову.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.31 23.12.2009
-
- *) Добавление: теперь директива error_page может перенаправлÑÑ‚ÑŒ ответы
- Ñо ÑтатуÑом 301 и 302.
-
- *) Добавление: переменные $geoip_city_continent_code, $geoip_latitude и
- $geoip_longitude.
- СпаÑибо Arvind Sundararajan.
-
- *) Добавление: модуль ngx_http_image_filter_module теперь вÑегда удалÑет
- EXIF и другие данные, еÑли они занимают больше 5% в JPEG-файле.
-
- *) ИÑправление: nginx закрывал Ñоединение при запроÑе закÑшированного
- ответа Ñ Ð¿ÑƒÑтым телом.
- СпаÑибо Piotr Sikora.
-
- *) ИÑправление: nginx мог не ÑобиратьÑÑ gcc 4.x при иÑпользовании
- оптимизации -O2 и выше.
- СпаÑибо МакÑиму Дунину и ДениÑу Латыпову.
-
- *) ИÑправление: регулÑрные Ð²Ñ‹Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð² location вÑегда теÑтировалиÑÑŒ Ñ
- учётом региÑтра; ошибка поÑвилаÑÑŒ в 0.8.25.
-
- *) ИÑправление: nginx кÑшировал 304 ответ, еÑли в заголовке
- прокÑируемого запроÑа была Ñтрока "If-None-Match".
- СпаÑибо Tim Dettrick и David Kostal.
-
- *) ИÑправление: nginx/Windows пыталÑÑ Ð´Ð²Ð°Ð¶Ð´Ñ‹ удалить временный файл при
- перезапиÑи уже ÑущеÑтвующего файла.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.30 15.12.2009
-
- *) Изменение: теперь по умолчанию размер буфера директивы
- large_client_header_buffers равен 8K.
- СпаÑибо Andrew Cholakian.
-
- *) Добавление: файл conf/fastcgi.conf Ð´Ð»Ñ Ð¿Ñ€Ð¾ÑÑ‚Ñ‹Ñ… конфигураций FastCGI.
-
- *) ИÑправление: nginx/Windows пыталÑÑ Ð´Ð²Ð°Ð¶Ð´Ñ‹ переименовать временный
- файл при перезапиÑи уже ÑущеÑтвующего файла.
-
- *) ИÑправление: ошибки double free or corruption, возникающей, еÑли имÑ
- хоÑта не было найдено; ошибка поÑвилаÑÑŒ в 0.8.22.
- СпаÑибо КонÑтантину СвиÑту.
-
- *) ИÑправление: в иÑпользовании libatomic на некоторых платформах.
- СпаÑибо W-Mark Kubacki.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.29 30.11.2009
-
- *) Изменение: теперь Ð´Ð»Ñ Ð¿Ñ€Ð¾ÐºÑируемых ответов HTTP/0.9 в лог пишетÑÑ ÐºÐ¾Ð´
- ответа "009".
-
- *) Добавление: директивы addition_types, charset_types, gzip_types,
- ssi_types, sub_filter_types и xslt_types поддерживают параметр "*".
-
- *) Добавление: иÑпользование вÑтроенных атомарных операций GCC 4.1+.
- СпаÑибо W-Mark Kubacki.
-
- *) Добавление: параметр --with-libatomic[=DIR] в configure.
- СпаÑибо W-Mark Kubacki.
-
- *) ИÑправление: listen unix domain Ñокет имели ограниченные права
- доÑтупа.
-
- *) ИÑправление: закÑшированные ответы ответов HTTP/0.9 неправильно
- обрабатывалиÑÑŒ.
-
- *) ИÑправление: именованные Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных выражениÑÑ…, заданные
- как "?P<...>", не работали в директиве server_name.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.28 23.11.2009
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ --without-pcre; ошибка
- поÑвилаÑÑŒ в 0.8.25.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.27 17.11.2009
-
- *) ИÑправление: регулÑрные Ð²Ñ‹Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ð½Ðµ работали в nginx/Windows; ошибка
- поÑвилаÑÑŒ в 0.8.25.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.26 16.11.2009
-
- *) ИÑправление: ошибки при иÑпользовании выделений в директиве rewrite;
- ошибка поÑвилаÑÑŒ в 0.8.25.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð±ÐµÐ· параметра --with-debug; ошибка
- поÑвилаÑÑŒ в 0.8.25.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.25 16.11.2009
-
- *) Изменение: теперь в лог ошибок не пишетÑÑ Ñообщение, еÑли переменнаÑ
- не найдена Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ метода $r->variable().
-
- *) Добавление: модуль ngx_http_degradation_module.
-
- *) Добавление: именованные Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных выражениÑÑ….
-
- *) Добавление: теперь при иÑпользовании переменных в директиве
- proxy_pass не требуетÑÑ Ð·Ð°Ð´Ð°Ð²Ð°Ñ‚ÑŒ URI.
-
- *) Добавление: теперь директива msie_padding работает и Ð´Ð»Ñ Chrome.
-
- *) ИÑправление: в рабочем процеÑÑе проиÑходил segmentation fault при
- недоÑтатке памÑти; ошибка поÑвилаÑÑŒ в 0.8.18.
-
- *) ИÑправление: nginx передавал Ñжатые ответы клиентам, не
- поддерживающим Ñжатие, при наÑтройках gzip_static on и gzip_vary off;
- ошибка поÑвилаÑÑŒ в 0.8.16.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.24 11.11.2009
-
- *) ИÑправление: nginx вÑегда добавлÑл Ñтроку "Content-Encoding: gzip" в
- заголовок 304-Ñ‹Ñ… ответов Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_gzip_static_module.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð±ÐµÐ· параметра --with-debug; ошибка
- поÑвилаÑÑŒ в 0.8.23.
-
- *) ИÑправление: параметр "unix:" в директиве set_real_ip_from
- неправильно наÑледовалÑÑ Ñ Ð¿Ñ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰ÐµÐ³Ð¾ уровнÑ.
-
- *) ИÑправление: в resolver'е при определении пуÑтого имени.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.23 11.11.2009
-
- *) БезопаÑноÑÑ‚ÑŒ: теперь SSL/TLS renegotiation запрещён.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: listen unix domain Ñокет не наÑледовалÑÑ Ð²Ð¾ времÑ
- Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð±ÐµÐ· перерыва.
-
- *) ИÑправление: параметр "unix:" в директиве set_real_ip_from не работал
- без ещё одной директивы Ñ Ð»ÑŽÐ±Ñ‹Ð¼ IP-адреÑом.
-
- *) ИÑправление: segmentation fault и Ð·Ð°Ñ†Ð¸ÐºÐ»Ð¸Ð²Ð°Ð½Ð¸Ñ Ð² resolver'е.
-
- *) ИÑправление: в resolver'е.
- СпаÑибо Ðртёму Бохану.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.22 03.11.2009
-
- *) Добавление: директивы proxy_bind, fastcgi_bind и memcached_bind.
-
- *) Добавление: директивы access и deny поддерживают IPv6.
-
- *) Добавление: директива set_real_ip_from поддерживает IPv6 адреÑа в
- заголовках запроÑа.
-
- *) Добавление: параметр "unix:" в директиве set_real_ip_from.
-
- *) ИÑправление: nginx не удалÑл unix domain Ñокет поÑле теÑтированиÑ
- конфигурации.
-
- *) ИÑправление: nginx удалÑл unix domain Ñокет во Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð±ÐµÐ·
- перерыва.
-
- *) ИÑправление: оператор "!-x" не работал.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault при
- иÑпользовании limit_rate в HTTPS Ñервере.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: при запиÑи в лог переменной $limit_rate в рабочем
- процеÑÑе проиÑходил segmentation fault.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли внутри блока server не было директивы listen; ошибка поÑвилаÑÑŒ в
- 0.8.21.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.21 26.10.2009
-
- *) Добавление: теперь ключ -V показывает ÑÑ‚Ð°Ñ‚ÑƒÑ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ¸ TLS SNI.
-
- *) Добавление: директива listen Ð¼Ð¾Ð´ÑƒÐ»Ñ HTTP поддерживает unix domain
- Ñокеты.
- СпаÑибо Hongli Lai.
-
- *) Добавление: параметр "default_server" в директиве listen.
-
- *) Добавление: теперь параметр "default" не обÑзателен Ð´Ð»Ñ ÑƒÑтановки
- параметров listen-Ñокета.
-
- *) ИÑправление: nginx не поддерживал даты в 2038 году на 32-битных
- платформах;
-
- *) ИÑправление: утечки Ñокетов; ошибка поÑвилаÑÑŒ в 0.8.11.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.20 14.10.2009
-
- *) Изменение: теперь по умолчанию иÑпользуютÑÑ Ñледующие шифры SSL:
- "HIGH:!ADH:!MD5".
-
- *) ИÑправление: модуль ngx_http_autoindex_module не показывал поÑледний
- ÑлÑш Ð´Ð»Ñ Ð»Ð¸Ð½ÐºÐ¾Ð² на каталоги; ошибка поÑвилаÑÑŒ в 0.7.15.
-
- *) ИÑправление: nginx не закрывал лог, заданный параметром конфигурации
- --error-log-path; ошибка поÑвилаÑÑŒ в 0.7.53.
-
- *) ИÑправление: nginx не Ñчитал запÑтую разделителем в Ñтроке
- "Cache-Control" в заголовке ответа бÑкенда.
-
- *) ИÑправление: nginx/Windows мог не Ñоздать временный файл, файл в кÑше
- или файл Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директив proxy/fastcgi_store, еÑли рабочий процеÑÑ
- не имел доÑтаточно прав Ð´Ð»Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ð°Ð¼Ð¸ верхнего уровнÑ.
-
- *) ИÑправление: Ñтроки "Set-Cookie" и "P3P" в заголовке ответа
- FastCGI-Ñервера не ÑкрывалиÑÑŒ при кÑшировании, еÑли не иÑпользовалиÑÑŒ
- директивы fastcgi_hide_header Ñ Ð»ÑŽÐ±Ñ‹Ð¼Ð¸ параметрами.
-
- *) ИÑправление: nginx неверно Ñчитал размер кÑша на диÑке.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.19 06.10.2009
-
- *) Изменение: теперь протокол SSLv2 по умолчанию запрещён.
-
- *) Изменение: теперь по умолчанию иÑпользуютÑÑ Ñледующие шифры SSL:
- "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM".
-
- *) ИÑправление: директива limit_req не работала; ошибка поÑвилаÑÑŒ в
- 0.8.18.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.18 06.10.2009
-
- *) Добавление: директива read_ahead.
-
- *) Добавление: теперь можно иÑпользовать неÑколько директив
- perl_modules.
-
- *) Добавление: директивы limit_req_log_level и limit_conn_log_level.
-
- *) ИÑправление: теперь директива limit_req ÑоответÑтвует алгоритму leaky
- bucket.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: nginx не работал на Linux/sparc.
- СпаÑибо Marcus Ramberg.
-
- *) ИÑправление: nginx Ñлал Ñимвол '\0' в Ñтроке "Location" в заголовке в
- ответе на Ð·Ð°Ð¿Ñ€Ð¾Ñ MKCOL.
- СпаÑибо Xie Zhenye.
-
- *) ИÑправление: вмеÑто кода ответа 499 в лог запиÑывалÑÑ ÐºÐ¾Ð´ 0; ошибка
- поÑвилаÑÑŒ в 0.8.11.
-
- *) ИÑправление: утечки Ñокетов; ошибка поÑвилаÑÑŒ в 0.8.11.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.17 28.09.2009
-
- *) БезопаÑноÑÑ‚ÑŒ: теперь Ñимволы "/../" запрещены в Ñтроке "Destination"
- в заголовке запроÑа.
-
- *) Изменение: теперь значение переменной $host вÑегда в нижнем региÑтре.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ssl_session_id.
-
- *) ИÑправление: утечки Ñокетов; ошибка поÑвилаÑÑŒ в 0.8.11.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.16 22.09.2009
-
- *) Добавление: директива image_filter_transparency.
-
- *) ИÑправление: директива "addition_types" была неверно названа
- "addtion_types".
-
- *) ИÑправление: порчи кÑша resolver'а.
- СпаÑибо Matthew Dempsky.
-
- *) ИÑправление: утечки памÑти в resolver'е.
- СпаÑибо Matthew Dempsky.
-
- *) ИÑправление: Ð½ÐµÐ²ÐµÑ€Ð½Ð°Ñ Ñтрока запроÑа в переменной $request
- запиÑывалаÑÑŒ в access_log только при иÑпользовании error_log на
- уровне info или debug.
-
- *) ИÑправление: в поддержке альфа-канала PNG в модуле
- ngx_http_image_filter_module.
-
- *) ИÑправление: nginx вÑегда добавлÑл Ñтроку "Vary: Accept-Encoding" в
- заголовок ответа, еÑли обе директивы gzip_static и gzip_vary были
- включены.
-
- *) ИÑправление: в поддержке кодировки UTF-8 директивой try_files в
- nginx/Windows.
-
- *) ИÑправление: ошибки при иÑпользовании post_action; ошибка поÑвилаÑÑŒ в
- 0.8.11.
- СпаÑибо Игорю Ðртемьеву.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.15 14.09.2009
-
- *) БезопаÑноÑÑ‚ÑŒ: при обработке Ñпециально Ñозданного запроÑа в рабочем
- процеÑÑе мог произойти segmentation fault.
- СпаÑибо Chris Ries.
-
- *) ИÑправление: еÑли были опиÑаны имена .domain.tld, .sub.domain.tld и
- .domain-some.tld, то Ð¸Ð¼Ñ .sub.domain.tld попадало под маÑку
- .domain.tld.
-
- *) ИÑправление: в поддержке прозрачноÑти в модуле
- ngx_http_image_filter_module.
-
- *) ИÑправление: в файловом AIO.
-
- *) ИÑправление: ошибки при иÑпользовании X-Accel-Redirect; ошибка
- поÑвилаÑÑŒ в 0.8.11.
-
- *) ИÑправление: ошибки при иÑпользовании вÑтроенного перла; ошибка
- поÑвилаÑÑŒ в 0.8.11.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.14 07.09.2009
-
- *) ИÑправление: уÑтаревший закÑшированный Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¼Ð¾Ð³ залипнуть в
- ÑоÑтоÑнии "UPDATING".
-
- *) ИÑправление: при иÑпользовании error_log на уровне info или debug в
- рабочем процеÑÑе мог произойти segmentation fault.
- СпаÑибо Сергею Боченкову.
-
- *) ИÑправление: ошибки при иÑпользовании вÑтроенного перла; ошибка
- поÑвилаÑÑŒ в 0.8.11.
-
- *) ИÑправление: директива error_page не перенаправлÑла ошибку 413;
- ошибка поÑвилаÑÑŒ в 0.6.10.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.13 31.08.2009
-
- *) ИÑправление: в директиве "aio sendfile"; ошибка поÑвилаÑÑŒ в 0.8.12.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð±ÐµÐ· параметра --with-file-aio на
- FreeBSD; ошибка поÑвилаÑÑŒ в 0.8.12.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.12 31.08.2009
-
- *) Добавление: параметр sendfile в директиве aio во FreeBSD.
-
- *) ИÑправление: ошибки при иÑпользовании try_files; ошибка поÑвилаÑÑŒ в
- 0.8.11.
-
- *) ИÑправление: ошибки при иÑпользовании memcached; ошибка поÑвилаÑÑŒ в
- 0.8.11.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.11 28.08.2009
-
- *) Изменение: теперь директива "gzip_disable msie6" не запрещает Ñжатие
- Ð´Ð»Ñ MSIE 6.0 SV1.
-
- *) Добавление: поддержка файлового AIO во FreeBSD и Linux.
-
- *) Добавление: директива directio_alignment.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.10 24.08.2009
-
- *) ИÑправление: утечек памÑти при иÑпользовании базы GeoIP City.
-
- *) ИÑправление: ошибки при копировании временных файлов в поÑтоÑнное
- меÑто хранениÑ; ошибка поÑвилаÑÑŒ в 0.8.9.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.9 17.08.2009
-
- *) Добавление: теперь Ñтартовый загрузчик кÑша работает в отдельном
- процеÑÑ; Ñто должно улучшить обработку больших кÑшей.
-
- *) Добавление: теперь временные файлы и поÑтоÑнное меÑто Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð³ÑƒÑ‚
- раÑполагатьÑÑ Ð½Ð° разных файловых ÑиÑтемах.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.8 10.08.2009
-
- *) ИÑправление: в обработке заголовков ответа, разделённых в
- FastCGI-запиÑÑÑ….
-
- *) ИÑправление: еÑли Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¾Ð±Ñ€Ð°Ð±Ð°Ñ‚Ñ‹Ð²Ð°Ð»ÑÑ Ð² двух прокÑированных или
- FastCGI location'ах и в первом из них иÑпользовалоÑÑŒ кÑширование, то
- в рабочем процеÑÑе проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в
- 0.8.7.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.7 27.07.2009
-
- *) Изменение: Ð¼Ð¸Ð½Ð¸Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶Ð¸Ð²Ð°ÐµÐ¼Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ OpenSSL - 0.9.7.
-
- *) Изменение: параметр ask директивы ssl_verify_client изменён на
- параметр optional и теперь он проверÑет клиентÑкий Ñертификат, еÑли
- он был предложен.
- СпаÑибо Brice Figureau.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ssl_client_verify.
- СпаÑибо Brice Figureau.
-
- *) Добавление: директива ssl_crl.
- СпаÑибо Brice Figureau.
-
- *) Добавление: параметр proxy директивы geo.
-
- *) Добавление: директива image_filter поддерживает переменные длÑ
- Ð·Ð°Ð´Ð°Ð½Ð¸Ñ Ñ€Ð°Ð·Ð¼ÐµÑ€Ð¾Ð².
-
- *) ИÑправление: иÑпользование переменной $ssl_client_cert портило
- памÑÑ‚ÑŒ; ошибка поÑвилаÑÑŒ в 0.7.7.
- СпаÑибо Сергею Журавлёву.
-
- *) ИÑправление: директивы proxy_pass_header и fastcgi_pass_header" не
- передавали клиенту Ñтроки "X-Accel-Redirect", "X-Accel-Limit-Rate",
- "X-Accel-Buffering" и "X-Accel-Charset" из заголовка ответа бÑкенда.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: в обработке Ñтрок "Last-Modified" и "Accept-Ranges" в
- заголовке ответа бÑкенда; ошибка поÑвилаÑÑŒ в 0.7.44.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: ошибки "[alert] zero size buf" при получении пуÑÑ‚Ñ‹Ñ…
- ответы в подзапроÑах; ошибка поÑвилаÑÑŒ в 0.8.5.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.6 20.07.2009
-
- *) Добавление: модуль ngx_http_geoip_module.
-
- *) ИÑправление: XSLT-фильтр мог выдавать ошибку "not well formed XML
- document" Ð´Ð»Ñ Ð¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð¾Ð³Ð¾ документа.
- СпаÑибо Kuramoto Eiji.
-
- *) ИÑправление: в MacOSX, Cygwin и nginx/Windows при проверке
- location'ов, заданных регулÑрным выражением, теперь вÑегда делаетÑÑ
- Ñравнение без учёта региÑтра Ñимволов.
-
- *) ИÑправление: теперь nginx/Windows игнорирует точки в конце URI.
- СпаÑибо Hugo Leisink.
-
- *) ИÑправление: Ð¸Ð¼Ñ Ñ„Ð°Ð¹Ð»Ð° указанного в --conf-path игнорировалоÑÑŒ при
- уÑтановке; ошибка поÑвилаÑÑŒ в 0.6.6.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.5 13.07.2009
-
- *) ИÑправление: теперь nginx разрешает Ð¿Ð¾Ð´Ñ‡Ñ‘Ñ€ÐºÐ¸Ð²Ð°Ð½Ð¸Ñ Ð² методе запроÑа.
-
- *) ИÑправление: при иÑпользовании HTTP Basic-аутентификации на Windows
- Ð´Ð»Ñ Ð½ÐµÐ²ÐµÑ€Ð½Ñ‹Ñ… имени/Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð²Ð¾Ð·Ð²Ñ€Ð°Ñ‰Ð°Ð»Ð°ÑÑŒ 500-Ð°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ°.
-
- *) ИÑправление: ответы Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_perl_module не работали в
- подзапроÑах.
-
- *) ИÑправление: в модуле ngx_http_limit_req_module.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.4 22.06.2009
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ --without-http-cache;
- ошибка поÑвилаÑÑŒ в 0.8.3.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.3 19.06.2009
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $upstream_cache_status.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° MacOSX 10.6.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ --without-http-cache;
- ошибка поÑвилаÑÑŒ в 0.8.2.
-
- *) ИÑправление: еÑли иÑпользовалÑÑ Ð¿ÐµÑ€ÐµÑ…Ð²Ð°Ñ‚ 401 ошибки от бÑкенда и
- бÑкенд не возвращал Ñтроку "WWW-Authenticate" в заголовке ответа, то
- в рабочем процеÑÑе проиÑходил segmentation fault.
- СпаÑибо Евгению Мычло.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.2 15.06.2009
-
- *) ИÑправление: во взаимодейÑтвии open_file_cache и proxy/fastcgi кÑша
- на Ñтарте.
-
- *) ИÑправление: open_file_cache мог кÑшировать открытые файлы очень
- долго; ошибка поÑвилаÑÑŒ в 0.7.4.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.1 08.06.2009
-
- *) Добавление: параметр updating в директивах proxy_cache_use_stale и
- fastcgi_cache_use_stale.
-
- *) ИÑправление: Ñтроки "If-Modified-Since", "If-Range" и им подобные в
- заголовке запроÑа клиента передавалиÑÑŒ бÑкенду при кÑшировании, еÑли
- не иÑпользовалаÑÑŒ директива proxy_set_header Ñ Ð»ÑŽÐ±Ñ‹Ð¼Ð¸ параметрами.
-
- *) ИÑправление: Ñтроки "Set-Cookie" и "P3P" в заголовке ответа бÑкенда
- не ÑкрывалиÑÑŒ при кÑшировании, еÑли не иÑпользовалиÑÑŒ директивы
- proxy_hide_header/fastcgi_hide_header Ñ Ð»ÑŽÐ±Ñ‹Ð¼Ð¸ параметрами.
-
- *) ИÑправление: модуль ngx_http_image_filter_module не понимал формат
- GIF87a.
- СпаÑибо ДениÑу Ильиных.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Solaris 10 и более ранних; ошибка
- поÑвилаÑÑŒ в 0.7.56.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.8.0 02.06.2009
-
- *) Добавление: директива keepalive_requests.
-
- *) Добавление: директива limit_rate_after.
- СпаÑибо Ivan Debnar.
-
- *) ИÑправление: XSLT-фильтр не работал в подзапроÑах.
-
- *) ИÑправление: обработке отноÑительных путей в nginx/Windows.
-
- *) ИÑправление: в proxy_store, fastcgi_store, proxy_cache и
- fastcgi_cache в nginx/Windows.
-
- *) ИÑправление: в обработке ошибок Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¿Ð°Ð¼Ñти.
- СпаÑибо МакÑиму Дунину и Кириллу КоринÑкому.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.59 25.05.2009
-
- *) Добавление: директивы proxy_cache_methods и fastcgi_cache_methods.
-
- *) ИÑправление: утечки Ñокетов; ошибка поÑвилаÑÑŒ в 0.7.25.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: при иÑпользовании переменной $request_body в рабочем
- процеÑÑе проиÑходил segmentation fault, еÑли в запроÑе не было тела;
- ошибка поÑвилаÑÑŒ в 0.7.58.
-
- *) ИÑправление: SSL-модули могли не ÑобиратьÑÑ Ð½Ð° Solaris и Linux;
- ошибка поÑвилаÑÑŒ в 0.7.56.
-
- *) ИÑправление: ответы Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_xslt_filter_module не
- обрабатывалиÑÑŒ SSI-, charset- и gzip-фильтрами.
-
- *) ИÑправление: директива charset не Ñтавила кодировку Ð´Ð»Ñ Ð¾Ñ‚Ð²ÐµÑ‚Ð¾Ð²
- Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_gzip_static_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.58 18.05.2009
-
- *) Добавление: директива listen почтового прокÑи-Ñервера поддерживает
- IPv6.
-
- *) Добавление: директива image_filter_jpeg_quality.
-
- *) Добавление: директива client_body_in_single_buffer.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $request_body.
-
- *) ИÑправление: в модуле ngx_http_autoindex_module в ÑÑылках на имена
- файлов, Ñодержащих Ñимвол ":".
-
- *) ИÑправление: процедура "make upgrade" не работала; ошибка поÑвилаÑÑŒ в
- 0.7.53.
- СпаÑибо ДениÑу Латыпову.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.57 12.05.2009
-
- *) ИÑправление: при перенаправлении ошибок модулÑ
- ngx_http_image_filter_module в именованный location в рабочем
- процеÑÑе проиÑходил floating-point fault; ошибка поÑвилаÑÑŒ в 0.7.56.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.56 11.05.2009
-
- *) Добавление: nginx/Windows поддерживает IPv6 в директиве listen модулÑ
- HTTP.
-
- *) ИÑправление: в модуле ngx_http_image_filter_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.55 06.05.2009
-
- *) ИÑправление: параметры http_XXX в директивах proxy_cache_use_stale и
- fastcgi_cache_use_stale не работали.
-
- *) ИÑправление: fastcgi кÑш не кÑшировал ответы, ÑоÑтоÑщие только из
- заголовка.
-
- *) ИÑправление: ошибки "select() failed (9: Bad file descriptor)" в
- nginx/Unix и "select() failed (10038: ...)" в nginx/Windows.
-
- *) ИÑправление: при иÑпользовании директивы debug_connection в рабочем
- процеÑÑе мог произойти segmentation fault; ошибка поÑвилаÑÑŒ в 0.7.54.
-
- *) ИÑправление: в Ñборке Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_image_filter_module.
-
- *) ИÑправление: файлы больше 2G не передавалиÑÑŒ Ñ Ð¸Ñпользованием
- $r->sendfile.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.54 01.05.2009
-
- *) Добавление: модуль ngx_http_image_filter_module.
-
- *) Добавление: директивы proxy_ignore_headers и fastcgi_ignore_headers.
-
- *) ИÑправление: при иÑпользовании переменных "open_file_cache_errors on"
- в рабочем процеÑÑе мог произойти segmentation fault; ошибка поÑвилаÑÑŒ
- в 0.7.53.
-
- *) ИÑправление: директива "port_in_redirect off" не работала; ошибка
- поÑвилаÑÑŒ в 0.7.39.
-
- *) ИÑправление: улучшение обработки ошибок метода select.
-
- *) ИÑправление: ошибки "select() failed (10022: ...)" в nginx/Windows.
-
- *) ИÑправление: в текÑтовых ÑообщениÑÑ… об ошибках в nginx/Windows;
- ошибка поÑвилаÑÑŒ в 0.7.53.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.53 27.04.2009
-
- *) Изменение: теперь лог, указанный в --error-log-path, ÑоздаётÑÑ Ñ
- Ñамого начала работы.
-
- *) Добавление: теперь ошибки и Ð¿Ñ€ÐµÐ´ÑƒÐ¿Ñ€ÐµÐ¶Ð´ÐµÐ½Ð¸Ñ Ð¿Ñ€Ð¸ Ñтарте запиÑываютÑÑ Ð²
- error_log и выводÑÑ‚ÑÑ Ð½Ð° stderr.
-
- *) Добавление: при Ñборке Ñ Ð¿ÑƒÑтым параметром --prefix= nginx иÑпользует
- как Ð¿Ñ€ÐµÑ„Ð¸ÐºÑ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³, в котором он был запущен.
-
- *) Добавление: ключ -p.
-
- *) Добавление: ключ -s на Unix-платформах.
-
- *) Добавление: ключи -? и -h.
- СпаÑибо Jerome Loyet.
-
- *) Добавление: теперь ключи можно задавать в Ñжатой форме.
-
- *) ИÑправление: nginx/Windows не работал, еÑли файл конфигурации был
- задан ключом -c.
-
- *) ИÑправление: при иÑпользовании директив proxy_store, fastcgi_store,
- proxy_cache или fastcgi_cache временные файлы могли не удалÑÑ‚ÑŒÑÑ.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: в заголовке Auth-Method запроÑа Ñерверу аутентификации
- почтового прокÑи-Ñервера передавалоÑÑŒ неверное значение; ошибка
- поÑвилаÑÑŒ в 0.7.34.
- СпаÑибо Simon Lecaille.
-
- *) ИÑправление: при логгировании на Linux не пиÑалиÑÑŒ текÑтовые опиÑаниÑ
- ÑиÑтемных ошибок; ошибка поÑвилаÑÑŒ в 0.7.45.
-
- *) ИÑправление: директива fastcgi_cache_min_uses не работала.
- СпаÑибо Ðндрею Воробьёву.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.52 20.04.2009
-
- *) Добавление: Ð¿ÐµÑ€Ð²Ð°Ñ Ð±Ð¸Ð½Ð°Ñ€Ð½Ð°Ñ Ð²ÐµÑ€ÑÐ¸Ñ Ð¿Ð¾Ð´ Windows.
-
- *) ИÑправление: ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ° метода HEAD при кÑшировании.
-
- *) ИÑправление: ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ° Ñтрок "If-Modified-Since",
- "If-Range" и им подобных в заголовке запроÑа клиента при кÑшировании.
-
- *) ИÑправление: теперь Ñтроки "Set-Cookie" и "P3P" ÑкрываютÑÑ Ð²
- заголовке ответа Ð´Ð»Ñ Ð·Ð°ÐºÑшированных ответов.
-
- *) ИÑправление: еÑли nginx был Ñобран Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_http_perl_module и
- perl поддерживал потоки, то при выходе оÑновного процеÑÑа могла
- выдаватьÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ° "panic: MUTEX_LOCK".
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ --without-http-cache;
- ошибка поÑвилаÑÑŒ в 0.7.48.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° платформах, отличных от i386,
- amd64, sparc и ppc; ошибка поÑвилаÑÑŒ в 0.7.42.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.51 12.04.2009
-
- *) Добавление: директива try_files поддерживает код ответа в поÑледнем
- параметре.
-
- *) Добавление: теперь в директиве return можно иÑпользовать любой код
- ответа.
-
- *) ИÑправление: директива error_page делала внешний редирект без Ñтроки
- запроÑа; ошибка поÑвилаÑÑŒ в 0.7.44.
-
- *) ИÑправление: еÑли Ñервера Ñлушали на неÑкольких Ñвно опиÑанных
- адреÑах, то виртуальные Ñервера могли не работать; ошибка поÑвилаÑÑŒ в
- 0.7.39.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.50 06.04.2009
-
- *) ИÑправление: переменные $arg_... не работали; ошибка поÑвилаÑÑŒ в
- 0.7.49.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.49 06.04.2009
-
- *) ИÑправление: при иÑпользовании переменных $arg_... в рабочем процеÑÑе
- мог произойти segmentation fault; ошибка поÑвилаÑÑŒ в 0.7.48.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.48 06.04.2009
-
- *) Добавление: директива proxy_cache_key.
-
- *) ИÑправление: теперь nginx учитывает при кÑшировании Ñтроки
- "X-Accel-Expires", "Expires" и "Cache-Control" в заголовке ответа
- бÑкенда.
-
- *) ИÑправление: теперь nginx кÑширует только ответы на запроÑÑ‹ GET.
-
- *) ИÑправление: директива fastcgi_cache_key не наÑледовалаÑÑŒ.
-
- *) ИÑправление: переменные $arg_... не работали Ñ SSI-подзапроÑами.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñ‚ÐµÐºÐ¾Ð¹ uclibc.
- СпаÑибо Timothy Redaelli.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° OpenBSD; ошибка поÑвилаÑÑŒ
- в 0.7.46.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.47 01.04.2009
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° FreeBSD 6 и более ранних верÑиÑÑ…;
- ошибка поÑвилаÑÑŒ в 0.7.46.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° MacOSX; ошибка поÑвилаÑÑŒ в 0.7.46.
-
- *) ИÑправление: еÑли иÑпользовалÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€ max_size, то cache manager
- мог удалить веÑÑŒ кÑш; ошибка поÑвилаÑÑŒ в 0.7.46.
-
- *) Изменение: в рабочем процеÑÑе мог произойти segmentation fault, еÑли
- директивы proxy_cache/fastcgi_cache и proxy_cache_valid/
- fastcgi_cache_valid не были заданы на одном уровне; ошибка поÑвилаÑÑŒ
- в 0.7.46.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault при
- перенаправлении запроÑа прокÑированному или FastCGI-Ñерверу Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ
- error_page или try_files; ошибка поÑвилаÑÑŒ в 0.7.44.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.46 30.03.2009
-
- *) ИÑправление: архив предыдущего релиза был неверным.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.45 30.03.2009
-
- *) Изменение: теперь директивы proxy_cache и proxy_cache_valid можно
- задавать на разных уровнÑÑ….
-
- *) Изменение: параметр clean_time в директиве proxy_cache_path удалён.
-
- *) Добавление: параметр max_size в директиве proxy_cache_path.
-
- *) Добавление: Ð¿Ñ€ÐµÐ´Ð²Ð°Ñ€Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ° кÑÑˆÐ¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² модуле
- ngx_http_fastcgi_module.
-
- *) Добавление: теперь при ошибках Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² разделÑемой памÑти в логе
- указываютÑÑ Ð½Ð°Ð·Ð²Ð°Ð½Ð¸Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¸Ð²Ñ‹ и зоны.
-
- *) ИÑправление: директива "add_header last-modified ''" не удалÑла в
- заголовке ответа Ñтроку "Last-Modified"; ошибка поÑвилаÑÑŒ в 0.7.44.
-
- *) ИÑправление: в директиве auth_basic_user_file не работал
- отноÑительный путь, заданный Ñтрокой без переменных; ошибка поÑвилаÑÑŒ
- в 0.7.44.
- СпаÑибо Jerome Loyet.
-
- *) ИÑправление: в директиве alias, заданной переменными без ÑÑылок на
- Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных выражениÑÑ…; ошибка поÑвилаÑÑŒ в 0.7.42.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.44 23.03.2009
-
- *) Добавление: Ð¿Ñ€ÐµÐ´Ð²Ð°Ñ€Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ° кÑÑˆÐ¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² модуле
- ngx_http_proxy_module.
-
- *) Добавление: параметр --with-pcre в configure.
-
- *) Добавление: теперь директива try_files может быть иÑпользована на
- уровне server.
-
- *) ИÑправление: директива try_files неправильно обрабатывала Ñтроку
- запроÑа в поÑледнем параметре.
-
- *) ИÑправление: директива try_files могла неверно теÑтировать каталоги.
-
- *) ИÑправление: еÑли Ð´Ð»Ñ Ð¿Ð°Ñ€Ñ‹ адреÑ:порт опиÑан только один Ñервер, то
- Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных выражениÑÑ… в директиве server_name не
- работали.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.43 18.03.2009
-
- *) ИÑправление: Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¾Ð±Ñ€Ð°Ð±Ð°Ñ‚Ñ‹Ð²Ð°Ð»ÑÑ Ð½ÐµÐ²ÐµÑ€Ð½Ð¾, еÑли директива root
- иÑпользовала переменные; ошибка поÑвилаÑÑŒ в 0.7.42.
-
- *) ИÑправление: еÑли Ñервер Ñлушал на адреÑах типа "*", то значение
- переменной $server_addr было "0.0.0.0"; ошибка поÑвилаÑÑŒ в 0.7.36.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.42 16.03.2009
-
- *) Изменение: ошибка "Invalid argument", возвращаемаÑ
- setsockopt(TCP_NODELAY) на Solaris, теперь игнорируетÑÑ.
-
- *) Изменение: при отÑутÑтвии файла, указанного в директиве
- auth_basic_user_file, теперь возвращаетÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ° 403 вмеÑто 500.
-
- *) Добавление: директива auth_basic_user_file поддерживает переменные.
- СпаÑибо Кириллу КоринÑкому.
-
- *) Добавление: директива listen поддерживает параметр ipv6only.
- СпаÑибо Zhang Hua.
-
- *) ИÑправление: в директиве alias Ñо ÑÑылками на Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных
- выражениÑÑ…; ошибка поÑвилаÑÑŒ в 0.7.40.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ Tru64 UNIX.
- СпаÑибо Dustin Marquess.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð±ÐµÐ· библиотеки PCRE; ошибка поÑвилаÑÑŒ
- в 0.7.41.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.41 11.03.2009
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли в server_name или location были Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных
- выражениÑÑ…; ошибка поÑвилаÑÑŒ в 0.7.40.
- СпаÑибо Владимиру Сопоту.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.40 09.03.2009
-
- *) Добавление: директива location поддерживает Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных
- выражениÑÑ….
-
- *) Добавление: директиву alias Ñ ÑÑылками на Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных
- выражениÑÑ… можно иÑпользовать внутри location'а, заданного регулÑрным
- выражением Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñми.
-
- *) Добавление: директива server_name поддерживает Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных
- выражениÑÑ….
-
- *) Изменение: модуль ngx_http_autoindex_module не показывал поÑледний
- ÑлÑш Ð´Ð»Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ð¾Ð² на файловой ÑиÑтеме XFS; ошибка поÑвилаÑÑŒ в
- 0.7.15.
- СпаÑибо Дмитрию Кузьменко.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.39 02.03.2009
-
- *) ИÑправление: при включённом Ñжатии большие ответы Ñ Ð¸Ñпользованием
- SSI могли завиÑать; ошибка поÑвилаÑÑŒ в 0.7.28.
- СпаÑибо Ðртёму Бохану.
-
- *) ИÑправление: при иÑпользовании коротких ÑтатичеÑких вариантов в
- директиве try_files в рабочем процеÑÑе мог произойти segmentation
- fault.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.38 23.02.2009
-
- *) Добавление: логгирование ошибок аутентификации.
-
- *) ИÑправление: имÑ/пароль, заданные в auth_basic_user_file,
- игнорировалиÑÑŒ поÑле нечётного чиÑла пуÑÑ‚Ñ‹Ñ… Ñтрок.
- СпаÑибо ÐлекÑандру Загребину.
-
- *) ИÑправление: при иÑпользовании длинного пути в unix domain Ñокете в
- главном процеÑÑе проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в
- 0.7.36.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.37 21.02.2009
-
- *) ИÑправление: директивы, иÑпользующие upstream'Ñ‹, не работали; ошибка
- поÑвилаÑÑŒ в 0.7.36.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.36 21.02.2009
-
- *) Добавление: Ð¿Ñ€ÐµÐ´Ð²Ð°Ñ€Ð¸Ñ‚ÐµÐ»ÑŒÐ½Ð°Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ° IPv6; директива listen модулÑ
- HTTP поддерживает IPv6.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ancient_browser не работала Ð´Ð»Ñ Ð±Ñ€Ð°ÑƒÐ·ÐµÑ€Ð¾Ð²,
- заданных директивами modern_browser.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.35 16.02.2009
-
- *) ИÑправление: директива ssl_engine не иÑпользовала SSL-акÑелератор длÑ
- аÑимметричных шифров.
- СпаÑибо Marcin Gozdalik.
-
- *) ИÑправление: директива try_files выÑтавлÑла MIME-type, иÑÑ…Ð¾Ð´Ñ Ð¸Ð·
- раÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ Ð¿ÐµÑ€Ð²Ð¾Ð½Ð°Ñ‡Ð°Ð»ÑŒÐ½Ð¾Ð³Ð¾ запроÑа.
-
- *) ИÑправление: в директивах server_name, valid_referers и map
- неправильно обрабатывалиÑÑŒ имена вида "*domain.tld", еÑли
- иÑпользовалиÑÑŒ маÑки вида ".domain.tld" и ".subdomain.domain.tld";
- ошибка поÑвилаÑÑŒ в 0.7.9.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.34 10.02.2009
-
- *) Добавление: параметр off в директиве if_modified_since.
-
- *) Добавление: теперь поÑле команды XCLIENT nginx поÑылает команду
- HELO/EHLO.
- СпаÑибо МакÑиму Дунину.
-
- *) Добавление: поддержка Microsoft-Ñпецифичного режима
- "AUTH LOGIN with User Name" в почтовом прокÑи-Ñервере.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: в директиве rewrite, возвращающей редирект, Ñтарые
- аргументы приÑоединÑлиÑÑŒ к новым через Ñимвол "?" вмеÑто "&";
- ошибка поÑвилаÑÑŒ в 0.1.18.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° AIX.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.33 02.02.2009
-
- *) ИÑправление: еÑли на Ð·Ð°Ð¿Ñ€Ð¾Ñ Ñ Ñ‚ÐµÐ»Ð¾Ð¼ возвращалÑÑ Ñ€ÐµÐ´Ð¸Ñ€ÐµÐºÑ‚, то ответ
- мог быть двойным при иÑпользовании методов epoll или rtsig.
- СпаÑибо Eden Li.
-
- *) ИÑправление: Ð´Ð»Ñ Ð½ÐµÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… типов редиректов в переменной
- $sent_http_location было пуÑтое значение.
-
- *) ИÑправление: при иÑпользовании директивы resolver в SMTP
- прокÑи-Ñервере в рабочем процеÑÑе мог произойти segmentation fault.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.32 26.01.2009
-
- *) Добавление: теперь в директиве try_files можно Ñвно указать проверку
- каталога.
-
- *) ИÑправление: fastcgi_store не вÑегда ÑохранÑл файлы.
-
- *) ИÑправление: в гео-диапазонах.
-
- *) ИÑправление: ошибки Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð±Ð¾Ð»ÑŒÑˆÐ¸Ñ… блоков в разделÑемой памÑти,
- еÑли nginx был Ñобран без отладки.
- СпаÑибо Ðндрею КваÑову.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.31 19.01.2009
-
- *) Изменение: теперь директива try_files проверÑет только файлы,
- Ð¸Ð³Ð½Ð¾Ñ€Ð¸Ñ€ÑƒÑ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ð¸.
-
- *) Добавление: директива fastcgi_split_path_info.
-
- *) ИÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² поддержке Ñтроки "Expect" в заголовке запроÑа.
-
- *) ИÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² гео-диапазонах.
-
- *) ИÑправление: при отÑутÑтвии ответа ngx_http_memcached_module
- возвращал в теле ответа Ñтроку "END" вмеÑто 404-ой Ñтраницы по
- умолчанию; ошибка поÑвилаÑÑŒ в 0.7.18.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: при прокÑировании SMTP nginx выдавал Ñообщение
- "250 2.0.0 OK" вмеÑто "235 2.0.0 OK"; ошибка поÑвилаÑÑŒ в 0.7.22.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.30 24.12.2008
-
- *) ИÑправление: в рабочем процеÑÑе проиÑходил segmentation fault, еÑли в
- директивах fastcgi_pass или proxy_pass иÑпользовалиÑÑŒ переменные и
- Ð¸Ð¼Ñ Ñ…Ð¾Ñта должно было резолвитьÑÑ; ошибка поÑвилаÑÑŒ в 0.7.29.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.29 24.12.2008
-
- *) ИÑправление: директивы fastcgi_pass и proxy_pass не поддерживали
- переменные при иÑпользовании unix domain Ñокетов.
-
- *) ИÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² обработке подзапроÑов; ошибки поÑвилиÑÑŒ в 0.7.25.
-
- *) ИÑправление: ответ "100 Continue" выдавалÑÑ Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñов верÑии
- HTTP/1.0;
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: в выделении памÑти в модуле ngx_http_gzip_filter_module
- под Cygwin.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.28 22.12.2008
-
- *) Изменение: в выделении памÑти в модуле ngx_http_gzip_filter_module.
-
- *) Изменение: Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾ умолчанию Ð´Ð»Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¸Ð²Ñ‹ gzip_buffers изменены
- Ñ 4 4k/8k на 32 4k или 16 8k.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.27 15.12.2008
-
- *) Добавление: директива try_files.
-
- *) Добавление: директива fastcgi_pass поддерживает переменные.
-
- *) Добавление: теперь директива geo может брать Ð°Ð´Ñ€ÐµÑ Ð¸Ð· переменной.
- СпаÑибо Ðндрею Ðигматулину.
-
- *) Добавление: теперь модификатор location'а можно указывать без пробела
- перед названием.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $upstream_response_length.
-
- *) ИÑправление: теперь директива add_header не добавлÑет пуÑтое
- значение.
-
- *) ИÑправление: при запроÑе файла нулевой длины nginx закрывал
- Ñоединение, ничего не передав; ошибка поÑвилаÑÑŒ в 0.7.25.
-
- *) ИÑправление: метод MOVE не мог перемещать файл в неÑущеÑтвующий
- каталог.
-
- *) ИÑправление: еÑли в Ñервере не был опиÑан ни один именованный
- location, но такой location иÑпользовалÑÑ Ð² директиве error_page, то
- в рабочем процеÑÑе проиÑходил segmentation fault.
- СпаÑибо Сергею Боченкову.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.26 08.12.2008
-
- *) ИÑправление: в обработке подзапроÑов; ошибка поÑвилаÑÑŒ в 0.7.25.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.25 08.12.2008
-
- *) Изменение: в обработке подзапроÑов.
-
- *) Изменение: теперь разрешаютÑÑ POST'Ñ‹ без Ñтроки "Content-Length" в
- заголовке запроÑа.
-
- *) ИÑправление: теперь директивы limit_req и limit_conn указывают
- причину запрета запроÑа.
-
- *) ИÑправление: в параметре delete директивы geo.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.24 01.12.2008
-
- *) Добавление: директива if_modified_since.
-
- *) ИÑправление: nginx не обрабатывал ответ FastCGI-Ñервера, еÑли перед
- ответом Ñервер передавал много Ñообщений в stderr.
-
- *) ИÑправление: переменные "$cookie_..." не работали в SSI and в
- перловом модуле.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.23 27.11.2008
-
- *) Добавление: параметры delete и ranges в директиве geo.
-
- *) Добавление: уÑкорение загрузки geo-базы Ñ Ð±Ð¾Ð»ÑŒÑˆÐ¸Ð¼ чиÑлом значений.
-
- *) Добавление: уменьшение памÑти, необходимой Ð´Ð»Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸ geo-базы.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.22 20.11.2008
-
- *) Добавление: параметр none в директиве smtp_auth.
- СпаÑибо МакÑиму Дунину.
-
- *) Добавление: переменные "$cookie_...".
-
- *) ИÑправление: директива directio не работала Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð²Ð¾Ð¹ ÑиÑтемой XFS.
-
- *) ИÑправление: resolver не понимал большие DNS-ответы.
- СпаÑибо Zyb.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.21 11.11.2008
-
- *) Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² модуле ngx_http_limit_req_module.
-
- *) Добавление: поддержка EXSLT в модуле ngx_http_xslt_module.
- СпаÑибо ДениÑу Латыпову.
-
- *) Изменение: ÑовмеÑтимоÑÑ‚ÑŒ Ñ glibc 2.3.
- СпаÑибо Eric Benson и МакÑиму Дунину.
-
- *) ИÑправление: nginx не запуÑкалÑÑ Ð½Ð° MacOSX 10.4 и более ранних;
- ошибка поÑвилаÑÑŒ в 0.7.6.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.20 10.11.2008
-
- *) Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² модуле ngx_http_gzip_filter_module.
-
- *) Добавление: модуль ngx_http_limit_req_module.
-
- *) ИÑправление: на платформах sparc и ppc рабочие процеÑÑÑ‹ могли
- выходить по Ñигналу SIGBUS; ошибка поÑвилаÑÑŒ в 0.7.3.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: директивы вида "proxy_pass http://host/some:uri" не
- работали; ошибка поÑвилаÑÑŒ в 0.7.12.
-
- *) ИÑправление: при иÑпользовании HTTPS запроÑÑ‹ могли завершатьÑÑ Ñ
- ошибкой "bad write retry".
-
- *) ИÑправление: модуль ngx_http_secure_link_module не работал внутри
- location'ов Ñ Ð¸Ð¼ÐµÐ½Ð°Ð¼Ð¸ меньше 3 Ñимволов.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $server_addr могла не иметь значениÑ.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.19 13.10.2008
-
- *) ИÑправление: обновление номера верÑии.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.18 13.10.2008
-
- *) Изменение: директива underscores_in_headers; теперь nginx по
- умолчанию не разрешает Ð¿Ð¾Ð´Ñ‡Ñ‘Ñ€ÐºÐ¸Ð²Ð°Ð½Ð¸Ñ Ð² именах Ñтрок в заголовке
- запроÑа клиента.
-
- *) Добавление: модуль ngx_http_secure_link_module.
-
- *) Добавление: директива real_ip_header поддерживает любой заголовок.
-
- *) Добавление: директива log_subrequest.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $realpath_root.
-
- *) Добавление: параметры http_502 и http_504 в директиве
- proxy_next_upstream.
-
- *) ИÑправление: параметр http_503 в директивах proxy_next_upstream или
- fastcgi_next_upstream не работал.
-
- *) ИÑправление: nginx мог выдавать Ñтроку "Transfer-Encoding: chunked"
- Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñов HEAD.
-
- *) ИÑправление: теперь accept-лимит завиÑит от чиÑла worker_connections.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.17 15.09.2008
-
- *) Добавление: директива directio теперь работает на Linux.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $pid.
-
- *) ИÑправление: Ð¾Ð¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸Ñ directio, поÑвившаÑÑÑ Ð² 0.7.15, не работала
- при иÑпользовании open_file_cache.
-
- *) ИÑправление: access_log Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼Ð¸ не работал на Linux; ошибка
- поÑвилаÑÑŒ в 0.7.7.
-
- *) ИÑправление: модуль ngx_http_charset_module не понимал название
- кодировки в кавычках, полученное от бÑкенда.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.16 08.09.2008
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° 64-битных платформах; ошибка
- поÑвилаÑÑŒ в 0.7.15.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.15 08.09.2008
-
- *) Добавление: модуль ngx_http_random_index_module.
-
- *) Добавление: директива directio оптимизирована Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñов файлов,
- начинающихÑÑ Ñ Ð¿Ñ€Ð¾Ð¸Ð·Ð²Ð¾Ð»ÑŒÐ½Ð¾Ð¹ позиции.
-
- *) Добавление: директива directio при необходимоÑти запрещает
- иÑпользование sendfile.
-
- *) Добавление: теперь nginx разрешает Ð¿Ð¾Ð´Ñ‡Ñ‘Ñ€ÐºÐ¸Ð²Ð°Ð½Ð¸Ñ Ð² именах Ñтрок в
- заголовке запроÑа клиента.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.14 01.09.2008
-
- *) Изменение: теперь директивы ssl_certificate и ssl_certificate_key не
- имеют значений по умолчанию.
-
- *) Добавление: директива listen поддерживает параметр ssl.
-
- *) Добавление: теперь при переконфигурации nginx учитывает изменение
- временной зоны на FreeBSD и Linux.
-
- *) ИÑправление: параметры директивы listen, такие как backlog, rcvbuf и
- прочие, не уÑтанавливалиÑÑŒ, еÑли Ñервером по умолчанию был не первый
- Ñервер.
-
- *) ИÑправление: при иÑпользовании в качеÑтве аргументов чаÑти URI,
- выделенного Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы rewrite, Ñти аргументы не
- ÑкранировалиÑÑŒ.
-
- *) ИÑправление: ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ Ñ‚ÐµÑÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¿Ñ€Ð°Ð²Ð¸Ð»ÑŒÐ½Ð¾Ñти конфигурационного
- файла.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.13 26.08.2008
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Linux и Solaris; ошибка поÑвилаÑÑŒ
- в 0.7.12.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.12 26.08.2008
-
- *) Добавление: директива server_name поддерживает пуÑтое Ð¸Ð¼Ñ "".
-
- *) Добавление: директива gzip_disable поддерживает Ñпециальную маÑку
- msie6.
-
- *) ИÑправление: при иÑпользовании параметра max_fails=0 в upstream'е Ñ
- неÑколькими Ñерверами рабочий процеÑÑ Ð²Ñ‹Ñ…Ð¾Ð´Ð¸Ð» по Ñигналу SIGFPE.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: при перенаправлении запроÑа Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы
- error_page терÑлоÑÑŒ тело запроÑа.
-
- *) ИÑправление: при перенаправлении запроÑа Ñ Ð¼ÐµÑ‚Ð¾Ð´Ð¾Ð¼ HEAD Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ
- директивы error_page возвращалÑÑ Ð¿Ð¾Ð»Ð½Ñ‹Ð¹ ответ.
-
- *) ИÑправление: метод $r->header_in() не возвращал Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ñтрок
- "Host", "User-Agent", и "Connection" из заголовка запроÑа; ошибка
- поÑвилаÑÑŒ в 0.7.0.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.11 18.08.2008
-
- *) Изменение: теперь ngx_http_charset_module по умолчанию не работает
- MIME-типом text/css.
-
- *) Добавление: теперь nginx возвращает код 405 Ð´Ð»Ñ Ð¼ÐµÑ‚Ð¾Ð´Ð° POST при
- запроÑе ÑтатичеÑкого файла, только еÑли файл ÑущеÑтвует.
-
- *) Добавление: директива proxy_ssl_session_reuse.
-
- *) ИÑправление: поÑле Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ
- "X-Accel-Redirect" директива proxy_pass без URI могла иÑпользовать
- оригинальный запроÑ.
-
- *) ИÑправление: еÑли у каталога были права доÑтупа только на поиÑк
- файлов и первый индекÑный файл отÑутÑтвовал, то nginx возвращал
- ошибку 500.
-
- *) ИÑправление: ошибок во вложенных location'ах; ошибки поÑвилиÑÑŒ в
- 0.7.1.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.10 13.08.2008
-
- *) ИÑправление: ошибок в директивах addition_types, charset_types,
- gzip_types, ssi_types, sub_filter_types и xslt_types; ошибки
- поÑвилиÑÑŒ в 0.7.9.
-
- *) ИÑправление: рекурÑивной error_page Ð´Ð»Ñ 500 ошибки.
-
- *) ИÑправление: теперь модуль ngx_http_realip_module уÑтанавливает адреÑ
- не Ð´Ð»Ñ Ð²Ñего keepalive ÑоединениÑ, а Ð´Ð»Ñ ÐºÐ°Ð¶Ð´Ð¾Ð³Ð¾ запроÑа по Ñтому
- Ñоединению.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.9 12.08.2008
-
- *) Изменение: теперь ngx_http_charset_module по умолчанию работает Ñо
- Ñледующими MIME-типами: text/html, text/css, text/xml, text/plain,
- text/vnd.wap.wml, application/x-javascript и application/rss+xml.
-
- *) Добавление: директивы charset_types и addition_types.
-
- *) Добавление: теперь директивы gzip_types, ssi_types и sub_filter_types
- иÑпользуют Ñ…Ñш.
-
- *) Добавление: модуль ngx_cpp_test_module.
-
- *) Добавление: директива expires поддерживает Ñуточное времÑ.
-
- *) Добавление: ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ Ð¸ иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² модуле ngx_http_xslt_module.
- СпаÑибо ДениÑу Латыпову и МакÑиму Дунину.
-
- *) ИÑправление: директива log_not_found не работала при поиÑке индекÑных
- файлов.
-
- *) ИÑправление: HTTPS-ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð³Ð»Ð¸ завиÑнуть, еÑли иÑпользовалиÑÑŒ
- методы kqueue, epoll, rtsig или eventport; ошибка поÑвилаÑÑŒ в 0.7.7.
-
- *) ИÑправление: еÑли в директивах server_name, valid_referers и map
- иÑпользовалаÑÑŒ маÑка вида "*.domain.tld" и при Ñтом полное Ð¸Ð¼Ñ Ð²Ð¸Ð´Ð°
- "domain.tld" не было опиÑано, то Ñто Ð¸Ð¼Ñ Ð¿Ð¾Ð¿Ð°Ð´Ð°Ð»Ð¾ под маÑку; ошибка
- поÑвилаÑÑŒ в 0.3.18.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.8 04.08.2008
-
- *) Добавление: модуль ngx_http_xslt_module.
-
- *) Добавление: переменные "$arg_...".
-
- *) Добавление: поддержка directio в Solaris.
- СпаÑибо Ivan Debnar.
-
- *) ИÑправление: теперь, еÑли FastCGI-Ñервер приÑылает Ñтроку "Location"
- в заголовке ответа без Ñтроки ÑтатуÑа, то nginx иÑпользует код
- ÑтатуÑа 302.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.7 30.07.2008
-
- *) Изменение: теперь ошибка EAGAIN при вызове connect() не ÑчитаетÑÑ
- временной.
-
- *) Изменение: значением переменной $ssl_client_cert теперь ÑвлÑетÑÑ
- Ñертификат, перед каждой Ñтрокой которого, кроме первой, вÑтавлÑетÑÑ
- Ñимвол табулÑции; неизменённый Ñертификат доÑтупен через переменную
- $ssl_client_raw_cert.
-
- *) Добавление: параметр ask директивы ssl_verify_client.
-
- *) Добавление: ÑƒÐ»ÑƒÑ‡ÑˆÐµÐ½Ð¸Ñ Ð² обработке byte-range.
- СпаÑибо МакÑиму Дунину.
-
- *) Добавление: директива directio.
- СпаÑибо Jiang Hong.
-
- *) Добавление: поддержка sendfile() в MacOSX 10.5.
-
- *) ИÑправление: в MacOSX и Cygwin при проверке location'ов теперь
- делаетÑÑ Ñравнение без учёта региÑтра Ñимволов; однако, Ñравнение
- ограничено только однобайтными locale'Ñми.
-
- *) ИÑправление: ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¿Ð¾Ñ‡Ñ‚Ð¾Ð²Ð¾Ð³Ð¾ прокÑи-Ñервера завиÑали в режиме
- SSL, еÑли иÑпользовалиÑÑŒ методы select, poll или /dev/poll.
-
- *) ИÑправление: ошибки при иÑпользовании кодировки UTF-8 в
- ngx_http_autoindex_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.6 07.07.2008
-
- *) ИÑправление: теперь при иÑпользовании переменных в директиве
- access_log вÑегда проверÑетÑÑ ÑущеÑтвовании root'а Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа.
-
- *) ИÑправление: модуль ngx_http_flv_module не поддерживал неÑколько
- значений в аргументах запроÑа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.5 01.07.2008
-
- *) ИÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² поддержке переменных в директиве access_log; ошибки
- поÑвилиÑÑŒ в 0.7.4.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼
- --without-http_gzip_module; ошибка поÑвилаÑÑŒ в 0.7.3.
- СпаÑибо Кириллу КоринÑкому.
-
- *) ИÑправление: при ÑовмеÑтном иÑпользовании sub_filter и SSI ответы
- могли передаватьÑÑ Ð½ÐµÐ²ÐµÑ€Ð½Ð¾.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.4 30.06.2008
-
- *) Добавление: директива access_log поддерживает переменные.
-
- *) Добавление: директива open_log_file_cache.
-
- *) Добавление: ключ -g.
-
- *) Добавление: поддержка Ñтроки "Expect" в заголовке запроÑа.
-
- *) ИÑправление: большие Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ð² SSI могли передавалиÑÑŒ не полноÑтью.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.3 23.06.2008
-
- *) Изменение: MIME-тип Ð´Ð»Ñ Ñ€Ð°ÑÑˆÐ¸Ñ€ÐµÐ½Ð¸Ñ rss изменён на
- "application/rss+xml".
-
- *) Изменение: теперь директива "gzip_vary on" выдаёт Ñтроку
- "Vary: Accept-Encoding" в заголовке ответа и Ð´Ð»Ñ Ð½ÐµÑжатых ответов.
-
- *) Добавление: теперь при иÑпользовании протокола "https://" в директиве
- rewrite автоматичеÑки делаетÑÑ Ñ€ÐµÐ´Ð¸Ñ€ÐµÐºÑ‚.
-
- *) ИÑправление: директива proxy_pass не работала Ñ Ð¿Ñ€Ð¾Ñ‚Ð¾ÐºÐ¾Ð»Ð¾Ð¼ HTTPS;
- ошибка поÑвилаÑÑŒ в 0.6.9.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.2 16.06.2008
-
- *) Добавление: теперь nginx поддерживает шифры Ñ Ð¾Ð±Ð¼ÐµÐ½Ð¾Ð¼ EDH-ключами.
-
- *) Добавление: директива ssl_dhparam.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ssl_client_cert.
- СпаÑибо Manlio Perillo.
-
- *) ИÑправление: поÑле Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ URI Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы rewrite nginx не
- иÑкал новый location; ошибка поÑвилаÑÑŒ в 0.7.1.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð±ÐµÐ· библиотеки PCRE; ошибка поÑвилаÑÑŒ
- в 0.7.1.
-
- *) ИÑправление: при редиректе запроÑа к каталогу Ñ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸ÐµÐ¼ ÑлÑша
- nginx не добавлÑл аргументы из оригинального запроÑа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.1 26.05.2008
-
- *) Изменение: теперь поиÑк location'а делаетÑÑ Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ дерева.
-
- *) Изменение: директива optimize_server_names упразднена в ÑвÑзи Ñ
- поÑвлением директивы server_name_in_redirect.
-
- *) Изменение: некоторые давно уÑтаревшие директивы больше не
- поддерживаютÑÑ.
-
- *) Изменение: параметр "none" в директиве ssl_session_cache; теперь Ñтот
- параметр иÑпользуетÑÑ Ð¿Ð¾ умолчанию.
- СпаÑибо Rob Mueller.
-
- *) ИÑправление: рабочие процеÑÑÑ‹ могли не реагировать на Ñигналы
- переконфигурации и ротации логов.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° поÑледних Fedora 9 Linux.
- СпаÑибо Roxis.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.7.0 19.05.2008
-
- *) Изменение: теперь Ñимволы 0x00-0x1F, '"' и '\' в access_log
- запиÑываютÑÑ Ð² виде \xXX.
- СпаÑибо МакÑиму Дунину.
-
- *) Изменение: теперь nginx разрешает неÑколько Ñтрок "Host" в заголовке
- запроÑа.
-
- *) Добавление: директива expires поддерживает флаг modified.
-
- *) Добавление: переменные $uid_got и $uid_set можно иÑпользовать на
- любой Ñтадии обработки запроÑа.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $hostname.
- СпаÑибо Ðндрею Ðигматулину.
-
- *) Добавление: поддержка DESTDIR.
- СпаÑибо Todd A. Fisher и Andras Voroskoi.
-
- *) ИÑправление: при иÑпользовании keepalive на Linux в рабочем процеÑÑе
- мог произойти segmentation fault.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.31 12.05.2008
-
- *) ИÑправление: nginx не обрабатывал ответ FastCGI-Ñервера, еÑли Ñтрока
- заголовка ответа была в конце запиÑи FastCGI; ошибка поÑвилаÑÑŒ в
- 0.6.2.
- СпаÑибо Сергею Серову.
-
- *) ИÑправление: при удалении файла и иÑпользовании директивы
- open_file_cache_errors off в рабочем процеÑÑе мог произойти
- segmentation fault.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.30 29.04.2008
-
- *) Изменение: теперь, еÑли маÑке, заданной в директиве include, не
- ÑоответÑтвует ни один файл, то nginx не выдаёт ошибку.
-
- *) Добавление: теперь Ð²Ñ€ÐµÐ¼Ñ Ð² директивах можно задавать без пробела,
- например, "1h50m".
-
- *) ИÑправление: утечек памÑти, еÑли директива ssl_verify_client имела
- значение on.
- СпаÑибо Chavelle Vincent.
-
- *) ИÑправление: директива sub_filter могла вÑтавлÑÑ‚ÑŒ заменÑемый текÑÑ‚ в
- вывод.
-
- *) ИÑправление: директива error_page не воÑпринимала параметры в
- перенаправлÑемом URI.
-
- *) ИÑправление: теперь при Ñборке Ñ Cygwin nginx вÑегда открывает файлы
- в бинарном режиме.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð¿Ð¾Ð´ OpenBSD; ошибка поÑвилаÑÑŒ в
- 0.6.15.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.29 18.03.2008
-
- *) Добавление: модуль ngx_google_perftools_module.
-
- *) ИÑправление: модуль ngx_http_perl_module не ÑобиралÑÑ Ð½Ð° 64-битных
- платформах; ошибка поÑвилаÑÑŒ в 0.6.27.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.28 13.03.2008
-
- *) ИÑправление: метод rtsig не ÑобиралÑÑ; ошибка поÑвилаÑÑŒ в 0.6.27.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.27 12.03.2008
-
- *) Изменение: теперь на Linux 2.6.18+ по умолчанию не ÑобираетÑÑ Ð¼ÐµÑ‚Ð¾Ð´
- rtsig.
-
- *) Изменение: теперь при перенаправлении запроÑа в именованный location
- Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы error_page метод запроÑа не изменÑетÑÑ.
-
- *) Добавление: директивы resolver и resolver_timeout в SMTP
- прокÑи-Ñервере.
-
- *) Добавление: директива post_action поддерживает именованные
- location'Ñ‹.
-
- *) ИÑправление: при перенаправлении запроÑа из location'а c обработчиком
- proxy, FastCGI или memcached в именованный location Ñо ÑтатичеÑким
- обработчиком в рабочем процеÑÑе проиÑходил segmentation fault.
-
- *) ИÑправление: браузеры не повторÑли SSL handshake, еÑли при первом
- handshake не оказалоÑÑŒ правильного клиентÑкого Ñертификата.
- СпаÑибо ÐлекÑандру Инюхину.
-
- *) ИÑправление: при перенаправлении ошибок 495-497 Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы
- error_page без Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ ÐºÐ¾Ð´Ð° ошибки nginx пыталÑÑ Ð²Ñ‹Ð´ÐµÐ»Ð¸Ñ‚ÑŒ очень
- много памÑти.
-
- *) ИÑправление: утечки памÑти в долгоживущих небуфферизированных
- ÑоединениÑÑ….
-
- *) ИÑправление: утечки памÑти в resolver'е.
-
- *) ИÑправление: при перенаправлении запроÑа из location'а c обработчиком
- proxy в другой location Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚Ñ‡Ð¸ÐºÐ¾Ð¼ proxy в рабочем процеÑÑе
- проиÑходил segmentation fault.
-
- *) ИÑправление: ошибки в кÑшировании переменных $proxy_host и
- $proxy_port.
- СпаÑибо Сергею Боченкову.
-
- *) ИÑправление: директива proxy_pass Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼Ð¸ иÑпользовала порт,
- опиÑанной в другой директиве proxy_pass без переменных, но Ñ Ñ‚Ð°ÐºÐ¸Ð¼ же
- именем хоÑта.
- СпаÑибо Сергею Боченкову.
-
- *) ИÑправление: во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ на некоторых 64-битном
- платформах в лог запиÑывалÑÑ alert "sendmsg() failed (9: Bad file
- descriptor)".
-
- *) ИÑправление: при повторном иÑпользовании в SSI пуÑтого block'а в
- качеÑтве заглушки в рабочем процеÑÑе проиÑходил segmentation fault.
-
- *) ИÑправление: ошибки при копировании чаÑти URI, Ñодержащего
- Ñкранированные Ñимволы, в аргументы.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.26 11.02.2008
-
- *) ИÑправление: директивы proxy_store и fastcgi_store не проверÑли длину
- ответа.
-
- *) ИÑправление: при иÑпользовании большого Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð² директиве expires
- в рабочем процеÑÑе проиÑходил segmentation fault.
- СпаÑибо Joaquin Cuenca Abela.
-
- *) ИÑправление: nginx неверно определÑл длину Ñтроки кÑша на Pentium 4.
- СпаÑибо Геннадию Махомеду.
-
- *) ИÑправление: в прокÑированных подзапроÑах и подзапроÑах к
- FastCGI-Ñерверу вмеÑто метода GET иÑпользовалÑÑ Ð¾Ñ€Ð¸Ð³Ð¸Ð½Ð°Ð»ÑŒÐ½Ñ‹Ð¹ метод
- клиента.
-
- *) ИÑправление: утечки Ñокетов в режиме HTTPS при иÑпользовании
- отложенного accept'а.
- СпаÑибо Ben Maurer.
-
- *) ИÑправление: nginx выдавал ошибочное Ñообщение "SSL_shutdown() failed
- (SSL: )"; ошибка поÑвилаÑÑŒ в 0.6.23.
-
- *) ИÑправление: при иÑпользовании HTTPS запроÑÑ‹ могли завершатьÑÑ Ñ
- ошибкой "bad write retry"; ошибка поÑвилаÑÑŒ в 0.6.23.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.25 08.01.2008
-
- *) Изменение: вмеÑто Ñпециального параметра "*" в директиве server_name
- теперь иÑпользуетÑÑ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¸Ð²Ð° server_name_in_redirect.
-
- *) Изменение: в качеÑтве оÑновного имени в директиве server_name теперь
- можно иÑпользовать имена Ñ Ð¼Ð°Ñками и регулÑрными выражениÑми.
-
- *) Изменение: директива satisfy_any заменена директивой satisfy.
-
- *) Изменение: поÑле переконфигурации Ñтарые рабочие процеÑÑ Ð¼Ð¾Ð³Ð»Ð¸ Ñильно
- нагружать процеÑÑор при запуÑке под Linux OpenVZ.
-
- *) Добавление: директива min_delete_depth.
-
- *) ИÑправление: методы COPY и MOVE не работали Ñ Ð¾Ð´Ð¸Ð½Ð¾Ñ‡Ð½Ñ‹Ð¼Ð¸ файлами.
-
- *) ИÑправление: модуль ngx_http_gzip_static_module не позволÑл работать
- модулю ngx_http_dav_module; ошибка поÑвилаÑÑŒ в 0.6.23.
-
- *) ИÑправление: утечки Ñокетов в режиме HTTPS при иÑпользовании
- отложенного accept'а.
- СпаÑибо Ben Maurer.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð±ÐµÐ· библиотеки PCRE; ошибка поÑвилаÑÑŒ
- в 0.6.23.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.24 27.12.2007
-
- *) ИÑправление: при иÑпользовании HTTPS в рабочем процеÑÑе мог произойти
- segmentation fault; ошибка поÑвилаÑÑŒ в 0.6.23.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.23 27.12.2007
-
- *) Изменение: параметр "off" в директиве ssl_session_cache; теперь Ñтот
- параметр иÑпользуетÑÑ Ð¿Ð¾ умолчанию.
-
- *) Изменение: директива open_file_cache_retest переименована в
- open_file_cache_valid.
-
- *) Добавление: директива open_file_cache_min_uses.
-
- *) Добавление: модуль ngx_http_gzip_static_module.
-
- *) Добавление: директива gzip_disable.
-
- *) Добавление: директиву memcached_pass можно иÑпользовать внутри блока
- if.
-
- *) ИÑправление: еÑли внутри одного location'а иÑпользовалиÑÑŒ директивы
- "memcached_pass" и "if", то в рабочем процеÑÑе проиÑходил
- segmentation fault.
-
- *) ИÑправление: еÑли при иÑпользовании директивы satisfy_any on" были
- заданы директивы не вÑех модулей доÑтупа, то заданные директивы не
- проверÑлиÑÑŒ.
-
- *) ИÑправление: параметры, заданные регулÑрным выражением в директиве
- valid_referers, не наÑледовалаÑÑŒ Ñ Ð¿Ñ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰ÐµÐ³Ð¾ уровнÑ.
-
- *) ИÑправление: директива post_action не работала, еÑли запроÑ
- завершалÑÑ Ñ ÐºÐ¾Ð´Ð¾Ð¼ 499.
-
- *) ИÑправление: Ð¾Ð¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ 16K буфера Ð´Ð»Ñ SSL-ÑоединениÑ.
- СпаÑибо Ben Maurer.
-
- *) ИÑправление: STARTTLS в режиме SMTP не работал.
- СпаÑибо Олегу Мотиенко.
-
- *) ИÑправление: при иÑпользовании HTTPS запроÑÑ‹ могли завершатьÑÑ Ñ
- ошибкой "bad write retry"; ошибка поÑвилаÑÑŒ в 0.5.13.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.22 19.12.2007
-
- *) Изменение: теперь вÑе методы Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_perl_module возвращают
- значениÑ, Ñкопированные в памÑÑ‚ÑŒ, выделенную perl'ом.
-
- *) ИÑправление: еÑли nginx был Ñобран Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_http_perl_module,
- иÑпользовалÑÑ perl до верÑии 5.8.6 и perl поддерживал потоки, то во
- Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ оÑновной процеÑÑ Ð°Ð²Ð°Ñ€Ð¸Ð¹Ð½Ð¾ выходил; ошибка
- поÑвилаÑÑŒ в 0.5.9.
- СпаÑибо БориÑу Жмурову.
-
- *) ИÑправление: в методы Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_perl_module могли передаватьÑÑ
- неверные результаты Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных выражениÑÑ….
-
- *) ИÑправление: еÑли метод $r->has_request_body() вызывалÑÑ Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа,
- у которого небольшое тело запроÑа было уже полноÑтью получено, то в
- рабочем процеÑÑе проиÑходил segmentation fault.
-
- *) ИÑправление: large_client_header_buffers не оÑвобождалиÑÑŒ перед
- переходом в ÑоÑтоÑние keep-alive.
- СпаÑибо ОлекÑандру Штепе.
-
- *) ИÑправление: в переменной $upstream_addr не запиÑывалÑÑ Ð¿Ð¾Ñледний
- адреÑ; ошибка поÑвилаÑÑŒ в 0.6.18.
-
- *) ИÑправление: директива fastcgi_catch_stderr не возвращала ошибку;
- теперь она возвращает ошибку 502, которую можно направить на
- Ñледующий Ñервер Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ "fastcgi_next_upstream invalid_header".
-
- *) ИÑправление: при иÑпользовании директивы fastcgi_catch_stderr в
- оÑновном процеÑÑе проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в
- 0.6.10.
- СпаÑибо Manlio Perillo.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.21 03.12.2007
-
- *) Изменение: еÑли в значениÑÑ… переменных директивы proxy_pass
- иÑпользуютÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ IP-адреÑа, то указывать resolver не нужно.
-
- *) ИÑправление: при иÑпользовании директивы proxy_pass c URI-чаÑтью в
- рабочем процеÑÑе мог произойти segmentation fault; ошибка поÑвилаÑÑŒ в
- 0.6.19.
-
- *) ИÑправление: еÑли resolver иÑпользовалÑÑ Ð½Ð° платформах, не
- поддерживающих метод kqueue, то nginx выдавал alert "name is out of
- response".
- СпаÑибо Ðндрею Ðигматулину.
-
- *) ИÑправление: При иÑпользовании переменной $server_protocol в
- FastCGI-параметрах и запроÑе, длина которого была близка к значению
- директивы client_header_buffer_size, nginx выдавал alert "fastcgi:
- the request record is too big".
-
- *) ИÑправление: при обычном запроÑе верÑии HTTP/0.9 к HTTPS Ñерверу
- nginx возвращал обычный ответ.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.20 28.11.2007
-
- *) ИÑправление: при иÑпользовании директивы proxy_pass c URI-чаÑтью в
- рабочем процеÑÑе мог произойти segmentation fault; ошибка поÑвилаÑÑŒ в
- 0.6.19.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.19 27.11.2007
-
- *) ИÑправление: верÑÐ¸Ñ 0.6.18 не ÑобиралаÑÑŒ.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.18 27.11.2007
-
- *) Изменение: теперь модуль ngx_http_userid_module в поле куки Ñ Ð½Ð¾Ð¼ÐµÑ€Ð¾Ð¼
- процеÑÑа добавлÑет микроÑекунды на Ð²Ñ€ÐµÐ¼Ñ Ñтарта.
-
- *) Изменение: в error_log теперь запиÑываетÑÑ Ð¿Ð¾Ð»Ð½Ð°Ñ Ñтрока запроÑа
- вмеÑто только URI.
-
- *) Добавление: директива proxy_pass поддерживает переменные.
-
- *) Добавление: директивы resolver и resolver_timeout.
-
- *) Добавление: теперь директива "add_header last-modified ''" удалÑет в
- заголовке ответа Ñтроку "Last-Modified".
-
- *) ИÑправление: директива limit_rate не позволÑла передавать на полной
- ÑкороÑти, даже еÑли был указан очень большой лимит.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.17 15.11.2007
-
- *) Добавление: поддержка Ñтроки "If-Range" в заголовке запроÑа.
- СпаÑибо ÐлекÑандру Инюхину.
-
- *) ИÑправление: при иÑпользовании директивы msie_refresh повторно
- ÑкранировалиÑÑŒ уже Ñкранированные Ñимволы; ошибка поÑвилаÑÑŒ в 0.6.4.
-
- *) ИÑправление: директива autoindex не работала при иÑпользовании "alias
- /".
-
- *) ИÑправление: при иÑпользовании подзапроÑов в рабочем процеÑÑе мог
- произойти segmentation fault.
-
- *) ИÑправление: при иÑпользовании SSL и gzip большие ответы могли
- передаватьÑÑ Ð½Ðµ полноÑтью.
-
- *) ИÑправление: еÑли ответ прокÑированного Ñервера был верÑии HTTP/0.9,
- то Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $status была равна 0.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.16 29.10.2007
-
- *) Изменение: теперь на Linux иÑпользуетÑÑ uname(2) вмеÑто procfs.
- СпаÑибо Илье Ðовикову.
-
- *) ИÑправление: еÑли в директиве error_page иÑпользовалÑÑ Ñимвол "?", то
- он ÑкранировалÑÑ Ð¿Ñ€Ð¸ прокÑировании запроÑа; ошибка поÑвилаÑÑŒ в
- 0.6.11.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ mget.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.15 22.10.2007
-
- *) Добавление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ Cygwin.
- СпаÑибо Владимиру Кутакову.
-
- *) Добавление: директива merge_slashes.
-
- *) Добавление: директива gzip_vary.
-
- *) Добавление: директива server_tokens.
-
- *) ИÑправление: nginx не раÑкодировал URI в команде SSI include.
-
- *) ИÑправление: при иÑпользовании переменной в директивах charset или
- source_charset на Ñтарте или во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ проиÑходил
- segmentation fault,
-
- *) ИÑправление: nginx возвращал ошибку 400 на запроÑÑ‹ вида
- "GET http://www.domain.com HTTP/1.0".
- СпаÑибо James Oakley.
-
- *) ИÑправление: поÑле Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа Ñ Ñ‚ÐµÐ»Ð¾Ð¼ запроÑа Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ
- директивы error_page nginx пыталÑÑ Ñнова прочитать тело запроÑа;
- ошибка поÑвилаÑÑŒ в 0.6.7.
-
- *) ИÑправление: в рабочем процеÑÑе проиÑходил segmentation fault, еÑли у
- Ñервера, обрабатывающему запроÑ, не был Ñвно определён server_name;
- ошибка поÑвилаÑÑŒ в 0.6.7.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.14 15.10.2007
-
- *) Изменение: теперь по умолчанию команда SSI echo иÑпользует
- кодирование entity.
-
- *) Добавление: параметр encoding в команде SSI echo.
-
- *) Добавление: директиву access_log можно иÑпользовать внутри блока
- limit_except.
-
- *) ИÑправление: еÑли вÑе Ñервера апÑтрима оказывалиÑÑŒ недоÑтупными, то
- до воÑÑÑ‚Ð°Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ð¾ÑпоÑобноÑти у вÑех Ñерверов Ð²ÐµÑ ÑтановилÑÑ
- равным одному; ошибка поÑвилаÑÑŒ в 0.6.6.
-
- *) ИÑправление: при иÑпользовании переменных $date_local и $date_gmt вне
- Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_ssi_filter_module в рабочем процеÑÑе проиÑходил
- segmentation fault.
-
- *) ИÑправление: при иÑпользовании включённом отладочном логе в рабочем
- процеÑÑе мог произойти segmentation fault.
- СпаÑибо Ðндрею Ðигматулину.
-
- *) ИÑправление: ngx_http_memcached_module не уÑтанавливал
- $upstream_response_time.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: рабочий процеÑÑ Ð¼Ð¾Ð³ зациклитьÑÑ Ð¿Ñ€Ð¸ иÑпользовании
- memcached.
-
- *) ИÑправление: nginx раÑпознавал параметры "close" и "keep-alive" в
- Ñтроке "Connection" в заголовке запроÑа только, еÑли они были в
- нижнем региÑтре; ошибка поÑвилаÑÑŒ в 0.6.11.
-
- *) ИÑправление: sub_filter не работал Ñ Ð¿ÑƒÑтой Ñтрокой замены.
-
- *) ИÑправление: в парÑинге sub_filter.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.13 24.09.2007
-
- *) ИÑправление: nginx не закрывал файл каталога Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа HEAD, еÑли
- иÑпользовалÑÑ autoindex
- СпаÑибо Arkadiusz Patyk.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.12 21.09.2007
-
- *) Изменение: почтовый прокÑи-Ñервер разделён на три модулÑ: pop3, imap
- и smtp.
-
- *) Добавление: параметры конфигурации --without-mail_pop3_module,
- --without-mail_imap_module и --without-mail_smtp_module.
-
- *) Добавление: директивы smtp_greeting_delay и smtp_client_buffer модулÑ
- ngx_mail_smtp_module.
-
- *) ИÑправление: wildcard в конце имени Ñервера не работали; ошибка
- поÑвилаÑÑŒ в 0.6.9.
-
- *) ИÑправление: при иÑпользовании разделÑемой библиотеки PCRE,
- раÑположенной в неÑтандартном меÑте, nginx не запуÑкалÑÑ Ð½Ð° Solaris.
-
- *) ИÑправление: директивы proxy_hide_header и fastcgi_hide_header не
- Ñкрывали Ñтроки заголовка ответа Ñ Ð¸Ð¼ÐµÐ½ÐµÐ¼ больше 32 Ñимволов.
- СпаÑибо Manlio Perillo.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.11 11.09.2007
-
- *) ИÑправление: Ñчётчик активных Ñоединений вÑегда Ñ€Ð¾Ñ Ð¿Ñ€Ð¸ иÑпользовании
- почтового прокÑи-Ñервера.
-
- *) ИÑправление: еÑли бÑкенд возвращал только заголовок ответа при
- небуферизированном прокÑировании, то nginx закрывал Ñоединение Ñ
- бÑкендом по таймауту.
-
- *) ИÑправление: nginx не поддерживал неÑколько Ñтрок "Connection" в
- заголовке запроÑа.
-
- *) ИÑправление: еÑли в Ñервере апÑтрима был задан max_fails, то поÑле
- первой же неудачной попытки Ð²ÐµÑ Ñервера навÑегда ÑтановилÑÑ Ñ€Ð°Ð²Ð½Ñ‹Ð¼
- одному; ошибка поÑвилаÑÑŒ в 0.6.6.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.10 03.09.2007
-
- *) Добавление: директивы open_file_cache, open_file_cache_retest и
- open_file_cache_errors.
-
- *) ИÑправление: утечки Ñокетов; ошибка поÑвилаÑÑŒ в 0.6.7.
-
- *) ИÑправление: Ð’ Ñтроку заголовка ответа "Content-Type", указанную в
- методе $r->send_http_header(), не добавлÑлаÑÑŒ кодировка, ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ð°Ñ Ð²
- директиве charset.
-
- *) ИÑправление: при иÑпользовании метода /dev/poll в рабочем процеÑÑе
- мог произойти segmentation fault.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.9 28.08.2007
-
- *) ИÑправление: рабочий процеÑÑ Ð¼Ð¾Ð³ зациклитьÑÑ Ð¿Ñ€Ð¸ иÑпользовании
- протокола HTTPS; ошибка поÑвилаÑÑŒ в 0.6.7.
-
- *) ИÑправление: еÑли Ñервер Ñлушал на двух адреÑах или портах, то nginx
- не запуÑкалÑÑ Ð¿Ñ€Ð¸ иÑпользовании wildcard в конце имени Ñервера.
-
- *) ИÑправление: директива ip_hash могла неверно помечать Ñервера как
- нерабочие.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° amd64; ошибка поÑвилаÑÑŒ в 0.6.8.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.8 20.08.2007
-
- *) Изменение: теперь nginx пытаетÑÑ ÑƒÑтановить директивы
- worker_priority, worker_rlimit_nofile, worker_rlimit_core,
- worker_rlimit_sigpending без привилегий root'а.
-
- *) Изменение: теперь nginx Ñкранирует Ñимволы пробела и "%" при передаче
- запроÑа Ñерверу аутентификации почтового прокÑи-Ñервера.
-
- *) Изменение: теперь nginx Ñкранирует Ñимвол "%" в переменной
- $memcached_key.
-
- *) ИÑправление: при указании отноÑительного пути к конфигурационному
- файлу в качеÑтве параметра ключа -c nginx определÑл путь отноÑительно
- конфигурационного префикÑа; ошибка поÑвилаÑÑŒ в 0.6.6.
-
- *) ИÑправление: nginx не работал на FreeBSD/sparc64.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.7 15.08.2007
-
- *) Изменение: теперь пути, указанные в директивах include,
- auth_basic_user_file, perl_modules, ssl_certificate,
- ssl_certificate_key и ssl_client_certificate, определÑÑŽÑ‚ÑÑ
- отноÑительно каталога конфигурационного файла nginx.conf, а не
- отноÑительно префикÑа.
-
- *) Изменение: параметр --sysconfdir=PATH в configure упразднён.
-
- *) Изменение: Ð´Ð»Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð½Ð° лету верÑий 0.1.x Ñоздан Ñпециальный
- Ñценарий make upgrade1.
-
- *) Добавление: директивы server_name и valid_referers поддерживают
- регулÑрные выражениÑ.
-
- *) Добавление: директива server в блоке upstream поддерживает параметр
- backup.
-
- *) Добавление: модуль ngx_http_perl_module поддерживает метод
- $r->discard_request_body.
-
- *) Добавление: директива "add_header Last-Modified ..." менÑет Ñтроку
- "Last-Modified" в заголовке ответа.
-
- *) ИÑправление: еÑли на Ð·Ð°Ð¿Ñ€Ð¾Ñ Ñ Ñ‚ÐµÐ»Ð¾Ð¼ возвращалÑÑ Ð¾Ñ‚Ð²ÐµÑ‚ Ñ ÐºÐ¾Ð´Ð¾Ð¼ HTTP
- отличным от 200, и поÑле Ñтого запроÑа Ñоединение переходило в
- ÑоÑтоÑние keep-alive, то на Ñледующий Ð·Ð°Ð¿Ñ€Ð¾Ñ nginx возвращал 400.
-
- *) ИÑправление: еÑли в директиве auth_http был задан неправильный адреÑ,
- то в рабочем процеÑÑе проиÑходил segmentation fault.
-
- *) ИÑправление: теперь по умолчанию nginx иÑпользует значение 511 длÑ
- listen backlog на вÑех платформах, кроме FreeBSD.
- СпаÑибо Jiang Hong.
-
- *) ИÑправление: рабочий процеÑÑ Ð¼Ð¾Ð³ зациклитьÑÑ, еÑли server в блоке
- upstream был помечен как down; ошибка поÑвилаÑÑŒ в 0.6.6.
-
- *) ИÑправление: sendfilev() в Solaris теперь не иÑпользуетÑÑ Ð¿Ñ€Ð¸
- передаче тела запроÑа FastCGI-Ñерверу через unix domain Ñокет.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.6 30.07.2007
-
- *) Добавление: параметр --sysconfdir=PATH в configure.
-
- *) Добавление: именованные location'ы.
-
- *) Добавление: переменную $args можно уÑтанавливать Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ set.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $is_args.
-
- *) ИÑправление: равномерное раÑпределение запроÑов к апÑтримам Ñ
- большими веÑами.
-
- *) ИÑправление: еÑли клиент в почтовом прокÑи-Ñервере закрывал
- Ñоединение, то nginx мог не закрывать Ñоединение Ñ Ð±Ñкендом.
-
- *) ИÑправление: при иÑпользовании одного хоÑта в качеÑтве бÑкендов длÑ
- протоколов HTTP и HTTPS без Ñвного ÑƒÐºÐ°Ð·Ð°Ð½Ð¸Ñ Ð¿Ð¾Ñ€Ñ‚Ð¾Ð², nginx иÑпользовал
- только один порт - 80 или 443.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Solaris/amd64 Sun Studio 11 и
- более ранними верÑиÑми; ошибка поÑвилаÑÑŒ в 0.6.4.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.5 23.07.2007
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $nginx_version.
- СпаÑибо Ðиколаю Гречуху.
-
- *) Добавление: почтовый прокÑи-Ñервер поддерживает AUTHENTICATE в режиме
- IMAP.
- СпаÑибо МакÑиму Дунину.
-
- *) Добавление: почтовый прокÑи-Ñервер поддерживает STARTTLS в режиме
- SMTP.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: теперь nginx Ñкранирует пробел в переменной
- $memcached_key.
-
- *) ИÑправление: nginx неправильно ÑобиралÑÑ Sun Studio на Solaris/amd64.
- СпаÑибо Jiang Hong.
-
- *) ИÑправление: незначительных потенциальных ошибок.
- СпаÑибо Coverity's Scan.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.4 17.07.2007
-
- *) БезопаÑноÑÑ‚ÑŒ: при иÑпользовании директивы msie_refresh был возможен
- XSS.
- СпаÑибо МакÑиму Богуку.
-
- *) Изменение: директивы proxy_store и fastcgi_store изменены.
-
- *) Добавление: директивы proxy_store_access и fastcgi_store_access.
-
- *) ИÑправление: nginx не работал на Solaris/sparc64, еÑли был Ñобран Sun
- Studio.
- СпаÑибо Ðндрею Ðигматулину.
-
- *) Изменение: обход ошибки в Sun Studio 12.
- СпаÑибо Jiang Hong.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.3 12.07.2007
-
- *) Добавление: директивы proxy_store и fastcgi_store.
-
- *) ИÑправление: при иÑпользовании директивы auth_http_header в рабочем
- процеÑÑе мог произойти segmentation fault.
- СпаÑибо МакÑиму Дунину.
-
- *) ИÑправление: еÑли иÑпользовалÑÑ Ð¼ÐµÑ‚Ð¾Ð´ аутентификации CRAM-MD5, но он
- не был разрешён, то в рабочем процеÑÑе проиÑходил segmentation fault.
-
- *) ИÑправление: при иÑпользовании протокола HTTPS в директиве proxy_pass
- в рабочем процеÑÑе мог произойти segmentation fault.
-
- *) ИÑправление: в рабочем процеÑÑе мог произойти segmentation fault,
- еÑли иÑпользовалÑÑ Ð¼ÐµÑ‚Ð¾Ð´ eventport.
-
- *) ИÑправление: директивы proxy_ignore_client_abort и
- fastcgi_ignore_client_abort не работали; ошибка поÑвилаÑÑŒ в 0.5.13.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.2 09.07.2007
-
- *) ИÑправление: еÑли заголовок ответа был разделён в FastCGI-запиÑÑÑ…, то
- nginx передавал клиенту муÑор в таких заголовках.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.1 17.06.2007
-
- *) ИÑправление: в парÑинге SSI.
-
- *) ИÑправление: при иÑпользовании удалённого подзапроÑа в SSI
- поÑледующий Ð¿Ð¾Ð´Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð»Ð¾ÐºÐ°Ð»ÑŒÐ½Ð¾Ð³Ð¾ файла мог отдаватьÑÑ ÐºÐ»Ð¸ÐµÐ½Ñ‚Ñƒ в
- неверном порÑдке.
-
- *) ИÑправление: большие Ð²ÐºÐ»ÑŽÑ‡ÐµÐ½Ð¸Ñ Ð² SSI, Ñохранённые во временные файлы,
- передавалиÑÑŒ не полноÑтью.
-
- *) ИÑправление: значение perl'овой переменной $$ модулÑ
- ngx_http_perl_module было равно номеру главного процеÑÑа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.6.0 14.06.2007
-
- *) Добавление: директивы "server_name", "map", and "valid_referers"
- поддерживают маÑки вида "www.example.*".
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.25 11.06.2007
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼
- --without-http_rewrite_module; ошибка поÑвилаÑÑŒ в 0.5.24.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.24 06.06.2007
-
- *) БезопаÑноÑÑ‚ÑŒ: директива ssl_verify_client не работала, еÑли запроÑ
- выполнÑлÑÑ Ð¿Ð¾ протоколу HTTP/0.9.
-
- *) ИÑправление: при иÑпользовании ÑÐ¶Ð°Ñ‚Ð¸Ñ Ñ‡Ð°ÑÑ‚ÑŒ ответа могла передаватьÑÑ
- неÑжатой; ошибка поÑвилаÑÑŒ в 0.5.23.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.23 04.06.2007
-
- *) Добавление: модуль ngx_http_ssl_module поддерживает раÑширение TLS
- Server Name Indication.
-
- *) Добавление: директива fastcgi_catch_stderr.
- СпаÑибо Ðиколаю Гречуху, проект OWOX.
-
- *) ИÑправление: на ЛинукÑе в оÑновном процеÑÑе проиÑходил segmentation
- fault, еÑли два виртуальных Ñервера должны bind()итÑÑ Ðº
- переÑекающимÑÑ Ð¿Ð¾Ñ€Ñ‚Ð°Ð¼.
-
- *) ИÑправление: еÑли nginx был Ñобран Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_http_perl_module и
- perl поддерживал потоки, то во Ð²Ñ€ÐµÐ¼Ñ Ð²Ñ‚Ð¾Ñ€Ð¾Ð¹ переконфигурации
- выдавалиÑÑŒ ошибки "panic: MUTEX_LOCK" и "perl_parse() failed".
-
- *) ИÑправление: в иÑпользовании протокола HTTPS в директиве proxy_pass.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.22 29.05.2007
-
- *) ИÑправление: большое тело запроÑа могло не передаватьÑÑ Ð±Ñкенду;
- ошибка поÑвилаÑÑŒ в 0.5.21.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.21 28.05.2007
-
- *) ИÑправление: еÑли внутри Ñервера опиÑано больше примерно деÑÑти
- location'ов, то location'Ñ‹, заданные Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ регулÑрного выражениÑ,
- могли выполнÑÑ‚ÑŒÑÑ Ð½Ðµ в том, порÑдке, в каком они опиÑаны.
-
- *) ИÑправление: на 64-битной платформе рабочий процеÑÑ Ð¼Ð¾Ð³ зациклитьÑÑ,
- еÑли 33-тий по Ñчёту или поÑледующий бÑкенд упал.
- СпаÑибо Ðнтону Поварову.
-
- *) ИÑправление: при иÑпользовании библиотеки PCRE на Solaris/sparc64 мог
- произойти bus error.
- СпаÑибо Ðндрею Ðигматулину.
-
- *) ИÑправление: в иÑпользовании протокола HTTPS в директиве proxy_pass.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.20 07.05.2007
-
- *) Добавление: директива sendfile_max_chunk.
-
- *) Добавление: переменные "$http_...", "$sent_http_..." и
- "$upstream_http_..." можно менÑÑ‚ÑŒ директивой set.
-
- *) ИÑправление: при иÑпользовании SSI-команды 'if expr="$var = /"' в
- рабочем процеÑÑе мог произойти segmentation fault.
-
- *) ИÑправление: Ð·Ð°Ð²ÐµÑ€ÑˆÐ°ÑŽÑ‰Ð°Ñ Ñтрока multipart range ответа передавалаÑÑŒ
- неверно.
- СпаÑибо Evan Miller.
-
- *) ИÑправление: nginx не работал на Solaris/sparc64, еÑли был Ñобран Sun
- Studio.
- СпаÑибо Ðндрею Ðигматулину.
-
- *) ИÑправление: модуль ngx_http_perl_module не ÑобиралÑÑ make в Solaris.
- СпаÑибо Ðндрею Ðигматулину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.19 24.04.2007
-
- *) Изменение: значение переменной $request_time теперь запиÑываетÑÑ Ñ
- точноÑтью до миллиÑекунд.
-
- *) Изменение: метод $r->rflush в модуле ngx_http_perl_module
- переименован в $r->flush.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $upstream_addr.
-
- *) Добавление: директивы proxy_headers_hash_max_size и
- proxy_headers_hash_bucket_size.
- СпаÑибо Володымыру КоÑтырко.
-
- *) ИÑправление: при иÑпользовании sendfile и limit_rate на 64-битных
- платформах Ð½ÐµÐ»ÑŒÐ·Ñ Ð±Ñ‹Ð»Ð¾ передавать файлы больше 2G.
-
- *) ИÑправление: при иÑпользовании sendfile на 64-битном Linux нельзÑ
- было передавать файлы больше 2G.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.18 19.04.2007
-
- *) Добавление: модуль ngx_http_sub_filter_module.
-
- *) Добавление: переменные "$upstream_http_...".
-
- *) Добавление: теперь переменные $upstream_status и
- $upstream_response_time Ñодержат данные о вÑех обращениÑÑ… к
- апÑтримам, Ñделанным до X-Accel-Redirect.
-
- *) ИÑправление: еÑли nginx был Ñобран Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_http_perl_module и
- perl не поддерживал multiplicity, то поÑле первой переконфигурации и
- поÑле Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð»ÑŽÐ±Ð¾Ð³Ð¾ Ñигнала в оÑновном процеÑÑе проиÑходил
- segmentation fault; ошибка поÑвилаÑÑŒ в 0.5.9.
-
- *) ИÑправление: еÑли perl не поддерживал multiplicity, то поÑле
- переконфигурации перловый код не работал; ошибка поÑвилаÑÑŒ в 0.3.38.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.17 02.04.2007
-
- *) Изменение: теперь nginx Ð´Ð»Ñ Ð¼ÐµÑ‚Ð¾Ð´Ð° TRACE вÑегда возвращает код 405.
-
- *) Добавление: теперь nginx поддерживает директиву include внутри блока
- types.
-
- *) ИÑправление: иÑпользование переменной $document_root в директиве root
- и alias запрещено: оно вызывало рекурÑивное переполнение Ñтека.
-
- *) ИÑправление: в иÑпользовании протокола HTTPS в директиве proxy_pass.
-
- *) ИÑправление: в некоторых ÑлучаÑÑ… некÑшируемые переменные (такие, как
- $uri) возвращали Ñтарое закÑшированное значение.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.16 26.03.2007
-
- *) ИÑправление: в качеÑтве ключа Ð´Ð»Ñ Ñ…Ñша в директиве ip_hash не
- иÑпользовалаÑÑŒ Ñеть клаÑÑа С.
- СпаÑибо Павлу Ярковому.
-
- *) ИÑправление: еÑли в Ñтроке "Content-Type" в заголовке ответа бÑкенда
- был указан charset и Ñтрока завершалаÑÑŒ Ñимволом ";", то в рабочем
- процеÑÑе мог произойти segmentation fault; ошибка поÑвилаÑÑŒ в 0.3.50.
-
- *) ИÑправление: ошибки "[alert] zero size buf" при работе Ñ
- FastCGI-Ñервером, еÑли тело запроÑа, запиÑанное во временный файл,
- было кратно 32K.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Solaris без параметра
- --with-debug; ошибка поÑвилаÑÑŒ в 0.5.15.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.15 19.03.2007
-
- *) Добавление: почтовый прокÑи-Ñервер поддерживает аутентифицированное
- SMTP-прокÑирование и директивы smtp_auth, smtp_capablities и xclient.
- СпаÑибо Ðнтону Южанинову и МакÑиму Дунину.
-
- *) Добавление: теперь keep-alive ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð·Ð°ÐºÑ€Ñ‹Ð²Ð°ÑŽÑ‚ÑÑ Ñразу же по
- получении Ñигнала переконфигурации.
-
- *) Изменение: директивы imap и auth переименованы ÑоответÑтвенно в mail
- и pop3_auth.
-
- *) ИÑправление: еÑли иÑпользовалÑÑ Ð¼ÐµÑ‚Ð¾Ð´ аутентификации CRAM-MD5 и не
- был разрешён метод APOP, то в рабочем процеÑÑе проиÑходил
- segmentation fault.
-
- *) ИÑправление: при иÑпользовании директивы starttls only в протоколе
- POP3 nginx разрешал аутентификацию без перехода в режим SSL.
-
- *) ИÑправление: рабочие процеÑÑÑ‹ не выходили поÑле переконфигурации и не
- переоткрывали логи, еÑли иÑпользовалÑÑ Ð¼ÐµÑ‚Ð¾Ð´ eventport.
-
- *) ИÑправление: при иÑпользовании директивы ip_hash рабочий процеÑÑ Ð¼Ð¾Ð³
- зациклитьÑÑ.
-
- *) ИÑправление: теперь nginx не пишет в лог некоторые alert'Ñ‹, еÑли
- иÑпользуютÑÑ Ð¼ÐµÑ‚Ð¾Ð´Ñ‹ eventport или /dev/poll.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.14 23.02.2007
-
- *) ИÑправление: nginx игнорировал лишние закрывающие Ñкобки "}" в конце
- конфигурационного файла.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.13 19.02.2007
-
- *) Добавление: методы COPY и MOVE.
-
- *) ИÑправление: модуль ngx_http_realip_module уÑтанавливал муÑор длÑ
- запроÑов, переданных по keep-alive Ñоединению.
-
- *) ИÑправление: nginx не работал на 64-битном big-endian Linux.
- СпаÑибо Ðндрею Ðигматулину.
-
- *) ИÑправление: при получении Ñлишком длинной команды IMAP/POP3-прокÑи
- теперь Ñразу закрывает Ñоединение, а не по таймауту.
-
- *) ИÑправление: еÑли при иÑпользовании метода epoll клиент закрывал
- преждевременно Ñоединение Ñо Ñвоей Ñтороны, то nginx закрывал Ñто
- Ñоединение только по иÑтечении таймаута на передачу.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° платформах, отличных от i386,
- amd64, sparc и ppc; ошибка поÑвилаÑÑŒ в 0.5.8.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.12 12.02.2007
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° платформах, отличных от i386,
- amd64, sparc и ppc; ошибка поÑвилаÑÑŒ в 0.5.8.
-
- *) ИÑправление: при иÑпользовании временных файлов в Ð²Ñ€ÐµÐ¼Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ Ñ
- FastCGI-Ñервером в рабочем процеÑÑе мог произойти segmentation fault;
- ошибка поÑвилаÑÑŒ в 0.5.8.
-
- *) ИÑправление: еÑли Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $fastcgi_script_name запиÑывалаÑÑŒ в лог,
- то в рабочем процеÑÑе мог произойти segmentation fault.
-
- *) ИÑправление: ngx_http_perl_module не ÑобиралÑÑ Ð½Ð° Solaris.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.11 05.02.2007
-
- *) Добавление: теперь configure определÑет библиотеку PCRE в MacPorts.
- СпаÑибо Chris McGrath.
-
- *) ИÑправление: ответ был неверным, еÑли запрашивалоÑÑŒ неÑколько
- диапазонов; ошибка поÑвилаÑÑŒ в 0.5.6.
-
- *) ИÑправление: директива create_full_put_path не могла Ñоздавать
- промежуточные каталоги, еÑли не была уÑтановлена директива
- dav_access.
- СпаÑибо Evan Miller.
-
- *) ИÑправление: вмеÑто кодов ошибок "400" и "408" в access_log мог
- запиÑыватьÑÑ ÐºÐ¾Ð´ "0".
-
- *) ИÑправление: при Ñборке Ñ Ð¾Ð¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸ÐµÐ¹ -O2 в рабочем процеÑÑе мог
- произойти segmentation fault.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.10 26.01.2007
-
- *) ИÑправление: во Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸ÑполнÑемого файла новый процеÑÑ Ð½Ðµ
- наÑледовал Ñлушающие Ñокеты; ошибка поÑвилаÑÑŒ в 0.5.9.
-
- *) ИÑправление: при Ñборке Ñ Ð¾Ð¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸ÐµÐ¹ -O2 в рабочем процеÑÑе мог
- произойти segmentation fault; ошибка поÑвилаÑÑŒ в 0.5.1.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.9 25.01.2007
-
- *) Изменение: модуль ngx_http_memcached_module теперь в качеÑтве ключа
- иÑпользует значение переменной $memcached_key.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $memcached_key.
-
- *) Добавление: параметр clean в директиве client_body_in_file_only.
-
- *) Добавление: директива env.
-
- *) Добавление: директива sendfile работает внутри блока if.
-
- *) Добавление: теперь при ошибке запиÑи в access_log nginx запиÑывает
- Ñообщение в error_log, но не чаще одного раза в минуту.
-
- *) ИÑправление: директива "access_log off" не вÑегда запрещала запиÑÑŒ в
- лог.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.8 19.01.2007
-
- *) ИÑправление: еÑли иÑпользовалаÑÑŒ директива
- "client_body_in_file_only on" и тело запроÑа было небольшое, то мог
- произойти segmentation fault.
-
- *) ИÑправление: проиÑходил segmentation fault, еÑли иÑпользовалиÑÑŒ
- директивы "client_body_in_file_only on" и
- "proxy_pass_request_body off" или "fastcgi_pass_request_body off", и
- делалÑÑ Ð¿ÐµÑ€ÐµÑ…Ð¾Ð´ к Ñледующему бÑкенду.
-
- *) ИÑправление: еÑли при иÑпользовании директивы "proxy_buffering off"
- Ñоединение Ñ ÐºÐ»Ð¸ÐµÐ½Ñ‚Ð¾Ð¼ было неактивно, то оно закрывалоÑÑŒ по таймауту,
- заданному директивой send_timeout; ошибка поÑвилаÑÑŒ в 0.4.7.
-
- *) ИÑправление: еÑли при иÑпользовании метода epoll клиент закрывал
- преждевременно Ñоединение Ñо Ñвоей Ñтороны, то nginx закрывал Ñто
- Ñоединение только по иÑтечении таймаута на передачу.
-
- *) ИÑправление: ошибки "[alert] zero size buf" при работе Ñ
- FastCGI-Ñервером.
-
- *) ИÑправление ошибок в директиве limit_zone.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.7 15.01.2007
-
- *) Добавление: Ð¾Ð¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¿Ð°Ð¼Ñти в ssl_session_cache.
-
- *) ИÑправление ошибок в директивах ssl_session_cache и limit_zone.
-
- *) ИÑправление: на Ñтарте или во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ проиÑходил
- segmentation fault, еÑли директивы ssl_session_cache или limit_zone
- иÑпользовалиÑÑŒ на 64-битных платформах.
-
- *) ИÑправление: при иÑпользовании директив add_before_body или
- add_after_body проиÑходил segmentation fault, еÑли в заголовке ответа
- нет Ñтроки "Content-Type".
-
- *) ИÑправление: библиотека OpenSSL вÑегда ÑобиралаÑÑŒ Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ¾Ð¹
- потоков.
- СпаÑибо Дену Иванову.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ библиотеки PCRE-6.5+ и компилÑтора icc.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.6 09.01.2007
-
- *) Изменение: теперь модуль ngx_http_index_module игнорирует вÑе методы,
- кроме GET, HEAD и POST.
-
- *) Добавление: модуль ngx_http_limit_zone_module.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $binary_remote_addr.
-
- *) Добавление: директивы ssl_session_cache модулей ngx_http_ssl_module и
- ngx_imap_ssl_module.
-
- *) Добавление: метод DELETE поддерживает рекурÑивное удаление.
-
- *) ИÑправление: при иÑпользовании $r->sendfile() byte-ranges
- передавалиÑÑŒ неверно.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.5 24.12.2006
-
- *) Изменение: ключ -v больше не выводит информацию о компилÑторе.
-
- *) Добавление: ключ -V.
-
- *) Добавление: директива worker_rlimit_core поддерживает указание
- размера в K, M и G.
-
- *) ИÑправление: модуль nginx.pm теперь может уÑтанавливатьÑÑ
- непривилегированным пользователем.
-
- *) ИÑправление: при иÑпользовании методов $r->request_body или
- $r->request_body_file мог произойти segmentation fault.
-
- *) ИÑправление: ошибок, Ñпецифичных Ð´Ð»Ñ Ð¿Ð»Ð°Ñ‚Ñ„Ð¾Ñ€Ð¼Ñ‹ ppc.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.4 15.12.2006
-
- *) Добавление: директиву perl можно иÑпользовать внутри блока
- limit_except.
-
- *) ИÑправление: модуль ngx_http_dav_module требовал Ñтроку "Date" в
- заголовке запроÑа Ð´Ð»Ñ Ð¼ÐµÑ‚Ð¾Ð´Ð° DELETE.
-
- *) ИÑправление: при иÑпользовании одного параметра в директиве
- dav_access nginx мог Ñообщить об ошибке в конфигурации.
-
- *) ИÑправление: при иÑпользовании переменной $host мог произойти
- segmentation fault; ошибка поÑвилаÑÑŒ в 0.4.14.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.3 13.12.2006
-
- *) Добавление: модуль ngx_http_perl_module поддерживает методы
- $r->status, $r->log_error и $r->sleep.
-
- *) Добавление: метод $r->variable поддерживает переменные, неопиÑанные в
- конфигурации nginx'а.
-
- *) ИÑправление: метод $r->has_request_body не работал.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.2 11.12.2006
-
- *) ИÑправление: еÑли в директивах proxy_pass иÑпользовалоÑÑŒ имÑ,
- указанное в upstream, то nginx пыталÑÑ Ð½Ð°Ð¹Ñ‚Ð¸ IP-Ð°Ð´Ñ€ÐµÑ Ñтого имени;
- ошибка поÑвилаÑÑŒ в 0.5.1.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.1 11.12.2006
-
- *) ИÑправление: директива post_action могла не работать поÑле неудачного
- Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа.
-
- *) Изменение: обход ошибки в Eudora Ð´Ð»Ñ Mac; ошибка поÑвилаÑÑŒ в 0.4.11.
- СпаÑибо Bron Gondwana.
-
- *) ИÑправление: при указании в директиве fastcgi_pass имени опиÑанного
- upstream'а выдавалоÑÑŒ Ñообщение "no port in upstream"; ошибка
- поÑвилаÑÑŒ в 0.5.0.
-
- *) ИÑправление: еÑли в директивах proxy_pass и fastcgi_pass
- иÑпользовалиÑÑŒ одинаковых имена Ñерверов, но Ñ Ñ€Ð°Ð·Ð½Ñ‹Ð¼Ð¸ портами, то
- Ñти директивы иÑпользовали первый опиÑанный порт; ошибка поÑвилаÑÑŒ в
- 0.5.0.
-
- *) ИÑправление: еÑли в директивах proxy_pass и fastcgi_pass
- иÑпользовалиÑÑŒ unix domain Ñокеты, то Ñти директивы иÑпользовали
- первый опиÑанный Ñокет; ошибка поÑвилаÑÑŒ в 0.5.0.
-
- *) ИÑправление: ngx_http_auth_basic_module игнорировал пользователÑ,
- еÑли он был указан в поÑледней Ñтроке файла паролей и поÑле Ð¿Ð°Ñ€Ð¾Ð»Ñ Ð½Ðµ
- было перевода Ñтроки, возврата каретки или Ñимвола ":".
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $upstream_response_time могла быть равна
- "0.000", Ñ…Ð¾Ñ‚Ñ Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ¸ было больше 1 миллиÑекунды.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.5.0 04.12.2006
-
- *) Изменение: параметры в виде "%name" в директиве log_format больше не
- поддерживаютÑÑ.
-
- *) Изменение: директивы proxy_upstream_max_fails,
- proxy_upstream_fail_timeout, fastcgi_upstream_max_fails, и
- fastcgi_upstream_fail_timeout, memcached_upstream_max_fails и
- memcached_upstream_fail_timeout больше не поддерживаютÑÑ.
-
- *) Добавление: директива server в блоке upstream поддерживает параметры
- max_fails, fail_timeout и down.
-
- *) Добавление: директива ip_hash в блоке upstream.
-
- *) Добавление: ÑÑ‚Ð°Ñ‚ÑƒÑ WAIT в Ñтроке "Auth-Status" в заголовке ответа
- Ñервера аутентификации IMAP/POP3 прокÑи.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° 64-битных платформах; ошибка
- поÑвилаÑÑŒ в 0.4.14.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.14 27.11.2006
-
- *) Добавление: директива proxy_pass_error_message в IMAP/POP3 прокÑи.
-
- *) Добавление: теперь configure определÑет библиотеку PCRE на FreeBSD,
- Linux и NetBSD.
-
- *) ИÑправление: ngx_http_perl_module не работал Ñ Ð¿ÐµÑ€Ð»Ð¾Ð¼, Ñобранным Ñ
- поддержкой потоков; ошибка поÑвилаÑÑŒ в 0.3.38.
-
- *) ИÑправление: ngx_http_perl_module не работал корректно, еÑли перл
- вызывалÑÑ Ñ€ÐµÐºÑƒÑ€Ñивно.
-
- *) ИÑправление: nginx игнорировал Ð¸Ð¼Ñ Ñервера в Ñтроке запроÑа.
-
- *) ИÑправление: еÑли FastCGI Ñервер передавал много в stderr, то рабочий
- процеÑÑ Ð¼Ð¾Ð³ зациклитьÑÑ.
-
- *) ИÑправление: при изменении ÑиÑтемного времени переменнаÑ
- $upstream_response_time могла быть отрицательной.
-
- *) ИÑправление: при иÑпользовании POP3 Ñерверу аутентификации IMAP/POP3
- прокÑи не передавалÑÑ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€ Auth-Login-Attempt.
-
- *) ИÑправление: при ошибке ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ñервером аутентификации
- IMAP/POP3 прокÑи мог произойти segmentation fault.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.13 15.11.2006
-
- *) Добавление: директиву proxy_pass можно иÑпользовать внутри блока
- limit_except.
-
- *) Добавление: директива limit_except поддерживает вÑе WebDAV методы.
-
- *) ИÑправление: при иÑпользовании директивы add_before_body без
- директивы add_after_body ответ передавалÑÑ Ð½Ðµ полноÑтью.
-
- *) ИÑправление: большое тело запроÑа не принималоÑÑŒ, еÑли иÑпользовалиÑÑŒ
- метод epoll и deferred accept().
-
- *) ИÑправление: Ð´Ð»Ñ Ð¾Ñ‚Ð²ÐµÑ‚Ð¾Ð² Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_autoindex_module не
- выÑтавлÑлаÑÑŒ кодировка; ошибка поÑвилаÑÑŒ в 0.3.50.
-
- *) ИÑправление: ошибки "[alert] zero size buf" при работе Ñ
- FastCGI-Ñервером;
-
- *) ИÑправление: параметр конфигурации --group= игнорировалÑÑ.
- СпаÑибо Thomas Moschny.
-
- *) ИÑправление: 50-й Ð¿Ð¾Ð´Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð² SSI ответе не работал; ошибка поÑвилаÑÑŒ
- в 0.3.50.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.12 31.10.2006
-
- *) Добавление: модуль ngx_http_perl_module поддерживает метод
- $r->variable.
-
- *) ИÑправление: при включении в ответ большого ÑтатичеÑкого файла Ñ
- помощью SSI ответ мог передаватьÑÑ Ð½Ðµ полноÑтью.
-
- *) ИÑправление: nginx не убирал "#fragment" в URI.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.11 25.10.2006
-
- *) Добавление: POP3 прокÑи поддерживает AUTH LOIGN PLAIN и CRAM-MD5.
-
- *) Добавление: модуль ngx_http_perl_module поддерживает метод
- $r->allow_ranges.
-
- *) ИÑправление: при включённой поддержке команды APOP в POP3 прокÑи
- могли не работать команды USER/PASS; ошибка поÑвилаÑÑŒ в 0.4.10.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.10 23.10.2006
-
- *) Добавление: POP3 прокÑи поддерживает APOP.
-
- *) ИÑправление: при иÑпользовании методов select, poll и /dev/poll во
- Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð¶Ð¸Ð´Ð°Ð½Ð¸Ñ Ð¾Ñ‚Ð²ÐµÑ‚Ð° от Ñервера аутентификации IMAP/POP3 прокÑи
- нагружал процеÑÑор.
-
- *) ИÑправление: при иÑпользовании переменной $server_addr в директиве
- map мог произойти segmentation fault.
-
- *) ИÑправление: модуль ngx_http_flv_module не поддерживал byte ranges
- Ð´Ð»Ñ Ð¿Ð¾Ð»Ð½Ñ‹Ñ… ответов; ошибка поÑвилаÑÑŒ в 0.4.7.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Debian amd64; ошибка поÑвилаÑÑŒ в
- 0.4.9.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.9 13.10.2006
-
- *) Добавление: параметр set в команде SSI include.
-
- *) Добавление: модуль ngx_http_perl_module теперь проверÑет верÑию
- Ð¼Ð¾Ð´ÑƒÐ»Ñ nginx.pm.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.8 11.10.2006
-
- *) ИÑправление: еÑли до команды SSI include Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ wait
- выполнÑлаÑÑŒ ещё одна команда SSI include, то параметр wait мог не
- работать.
-
- *) ИÑправление: модуль ngx_http_flv_module добавлÑл FLV-заголовок длÑ
- полных ответов.
- СпаÑибо ÐлекÑею Ковырину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.7 10.10.2006
-
- *) Добавление: модуль ngx_http_flv_module.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $request_body_file.
-
- *) Добавление: директивы charset и source_charset поддерживают
- переменные.
-
- *) ИÑправление: еÑли до команды SSI include Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ wait
- выполнÑлаÑÑŒ ещё одна команда SSI include, то параметр wait мог не
- работать.
-
- *) ИÑправление: при иÑпользовании директивы "proxy_buffering off" или
- при работе Ñ memcached ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð³Ð»Ð¸ не закрыватьÑÑ Ð¿Ð¾ таймауту.
-
- *) ИÑправление: nginx не запуÑкалÑÑ Ð½Ð° 64-битных платформах, отличных от
- amd64, sparc64 и ppc64.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.6 06.10.2006
-
- *) ИÑправление: nginx не запуÑкалÑÑ Ð½Ð° 64-битных платформах, отличных от
- amd64, sparc64 и ppc64.
-
- *) ИÑправление: при запроÑе верÑии HTTP/1.1 nginx передавал ответ
- chunk'ами, еÑли длина ответа в методе
- $r->headers_out("Content-Length", ...) была задана текÑтовой Ñтрокой.
-
- *) ИÑправление: поÑле Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ¸ Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы
- error_page Ð»ÑŽÐ±Ð°Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¸Ð²Ð° Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_rewrite_module возвращала
- Ñту ошибку; ошибка поÑвилаÑÑŒ в 0.4.4.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.5 02.10.2006
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Linux и Solaris; ошибка поÑвилаÑÑŒ
- в 0.4.4.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.4 02.10.2006
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $scheme.
-
- *) Добавление: директива expires поддерживает параметр max.
-
- *) Добавление: директива include поддерживает маÑку "*".
- СпаÑибо Jonathan Dance.
-
- *) ИÑправление: директива return вÑегда изменÑла код ответа,
- перенаправленного директивой error_page.
-
- *) ИÑправление: проиÑходил segmentation fault, еÑли в методе PUT
- передавалоÑÑŒ тело нулевой длины.
-
- *) ИÑправление: при иÑпользовании переменных в директиве proxy_redirect
- редирект изменÑлÑÑ Ð½ÐµÐ²ÐµÑ€Ð½Ð¾.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.3 26.09.2006
-
- *) Изменение: ошибку 499 теперь Ð½ÐµÐ»ÑŒÐ·Ñ Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð¸Ñ‚ÑŒ Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы
- error_page.
-
- *) Добавление: поддержка Solaris 10 event ports.
-
- *) Добавление: модуль ngx_http_browser_module.
-
- *) ИÑправление: при перенаправлении ошибки 400 прокÑированному Ñерверу
- помощью директивы error_page мог произойти segmentation fault.
-
- *) ИÑправление: проиÑходил segmentation fault, еÑли в директиве
- proxy_pass иÑпользовалÑÑ unix domain Ñокет; ошибка поÑвилаÑÑŒ в
- 0.3.47.
-
- *) ИÑправление: SSI не работал Ñ Ð¾Ñ‚Ð²ÐµÑ‚Ð°Ð¼Ð¸ memcached и
- небуферизированными прокÑированными ответами.
-
- *) Изменение: обход ошибки PAUSE hardware capability в Sun Studio.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.2 14.09.2006
-
- *) ИÑправление: убрана поддержка флага O_NOATIME на Linux; ошибка
- поÑвилаÑÑŒ в 0.4.1.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.1 14.09.2006
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ DragonFlyBSD.
- СпаÑибо Павлу Ðазарову.
-
- *) Изменение: обход ошибки в sendfile() в 64-битном Linux при передаче
- файлов больше 2G.
-
- *) Добавление: теперь на Linux nginx Ð´Ð»Ñ ÑтатичеÑких запроÑов иÑпользует
- флаг O_NOATIME.
- СпаÑибо Yusuf Goolamabbas.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.4.0 30.08.2006
-
- *) Изменение во внутреннем API: Ð¸Ð½Ð¸Ñ†Ð¸Ð°Ð»Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¹ HTTP перенеÑена из
- фазы init module в фазу HTTP postconfiguration.
-
- *) Изменение: теперь тело запроÑа в модуле ngx_http_perl_module не
- ÑчитываетÑÑ Ð·Ð°Ñ€Ð°Ð½ÐµÐµ: нужно Ñвно инициировать чтение Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ метода
- $r->has_request_body.
-
- *) Добавление: модуль ngx_http_perl_module поддерживает код возврата
- DECLINED.
-
- *) Добавление: модуль ngx_http_dav_module поддерживает входÑщую Ñтроку
- заголовка "Date" Ð´Ð»Ñ Ð¼ÐµÑ‚Ð¾Ð´Ð° PUT.
-
- *) Добавление: директива ssi работает внутри блока if.
-
- *) ИÑправление: проиÑходил segmentation fault, еÑли в директиве index
- иÑпользовалаÑÑŒ переменные и при Ñтом первое Ð¸Ð¼Ñ Ð¸Ð½Ð´ÐµÐºÑного файла было
- без переменных; ошибка поÑвилаÑÑŒ в 0.1.29.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.61 28.08.2006
-
- *) Изменение: директива tcp_nodelay теперь по умолчанию включена.
-
- *) Добавление: директива msie_refresh.
-
- *) Добавление: директива recursive_error_pages.
-
- *) ИÑправление: директива rewrite возвращала неправильный редирект, еÑли
- редирект включал в ÑÐµÐ±Ñ Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð½Ñ‹Ðµ закодированные Ñимволы из
- оригинального URI.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.60 18.08.2006
-
- *) ИÑправление: во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ¸ рабочий процеÑÑ Ð¼Ð¾Ð³
- зациклитьÑÑ; ошибка поÑвилаÑÑŒ в 0.3.59.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.59 16.08.2006
-
- *) Добавление: теперь можно делать неÑколько перенаправлений через
- директиву error_page.
-
- *) ИÑправление: директива dav_access не поддерживала три параметра.
-
- *) ИÑправление: директива error_page не изменÑла Ñтроку "Content-Type"
- поÑле Ð¿ÐµÑ€ÐµÐ½Ð°Ð¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ "X-Accel-Redirect"; ошибка поÑвилаÑÑŒ
- в 0.3.58.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.58 14.08.2006
-
- *) Добавление: директива error_page поддерживает переменные.
-
- *) Изменение: теперь на Linux иÑпользуетÑÑ Ð¸Ð½Ñ‚ÐµÑ€Ñ„ÐµÐ¹Ñ procfs вмеÑто
- sysctl.
-
- *) Изменение: теперь при иÑпользовании "X-Accel-Redirect" Ñтрока
- "Content-Type" наÑледуетÑÑ Ð¸Ð· первоначального ответа.
-
- *) ИÑправление: директива error_page не перенаправлÑла ошибку 413.
-
- *) ИÑправление: завершающий "?" не удалÑл Ñтарые аргументы, еÑли в
- перепиÑанном URI не было новых аргументов.
-
- *) ИÑправление: nginx не запуÑкалÑÑ Ð½Ð° 64-битной FreeBSD 7.0-CURRENT.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.57 09.08.2006
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $ssl_client_serial.
-
- *) ИÑправление: в операторе "!-e" в директиве if.
- СпаÑибо Ðндриану Буданцову.
-
- *) ИÑправление: при проверке клиентÑкого Ñертификата nginx не передавал
- клиенту информацию о требуемых Ñертификатах.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $document_root не поддерживала переменные в
- директиве root.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.56 04.08.2006
-
- *) Добавление: директива dav_access.
-
- *) Добавление: директива if поддерживает операторы "-d", "!-d", "-e",
- "!-e", "-x" и "!-x".
-
- *) ИÑправление: при запиÑи в access_log некоторых передаваемых клиенту
- Ñтрок заголовков проиÑходил segmentation fault, еÑли Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð²Ð¾Ð·Ð²Ñ€Ð°Ñ‰Ð°Ð»
- редирект.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.55 28.07.2006
-
- *) Добавление: параметр stub в команде SSI include.
-
- *) Добавление: команда SSI block.
-
- *) Добавление: Ñкрипт unicode2nginx добавлен в contrib.
-
- *) ИÑправление: еÑли root был задан только переменной, то корень
- задавалÑÑ Ð¾Ñ‚Ð½Ð¾Ñительно префикÑа Ñервера.
-
- *) ИÑправление: еÑли в запроÑе был "//" или "/.", и поÑле Ñтого
- закодированные Ñимволы в виде "%XX", то прокÑируемый запроÑ
- передавалÑÑ Ð½ÐµÐ·Ð°ÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð½Ñ‹Ð¼.
-
- *) ИÑправление: метод $r->header_in("Cookie") модулÑ
- ngx_http_perl_module теперь возвращает вÑе Ñтроки "Cookie" в
- заголовке запроÑа.
-
- *) ИÑправление: проиÑходил segmentation fault, еÑли иÑпользовалÑÑ
- "client_body_in_file_only on" и делалÑÑ Ð¿ÐµÑ€ÐµÑ…Ð¾Ð´ к Ñледующему бÑкенду.
-
- *) ИÑправление: при некоторых уÑловиÑÑ… во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ð¸ коды
- Ñимволов внутри директивы charset_map могли ÑчитатьÑÑ Ð½ÐµÐ²ÐµÑ€Ð½Ñ‹Ð¼Ð¸;
- ошибка поÑвилаÑÑŒ в 0.3.50.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.54 11.07.2006
-
- *) Добавление: nginx теперь запиÑывает в лог информацию о подзапроÑах.
-
- *) Добавление: директивы proxy_next_upstream, fastcgi_next_upstream и
- memcached_next_upstream поддерживают параметр off.
-
- *) Добавление: директива debug_connection поддерживает запиÑÑŒ адреÑов в
- формате CIDR.
-
- *) ИÑправление: при перекодировании ответа прокÑированного Ñервера или
- Ñервера FastCGI в UTF-8 или наоборот ответ мог передаватьÑÑ Ð½Ðµ
- полноÑтью.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $upstream_response_time Ñодержала времÑ
- только первого Ð¾Ð±Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Ðº бÑкенду.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° платформе amd64; ошибка поÑвилаÑÑŒ
- в 0.3.53.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.53 07.07.2006
-
- *) Изменение: директива add_header добавлÑет Ñтроки в ответы Ñ ÐºÐ¾Ð´Ð¾Ð¼
- 204, 301 и 302.
-
- *) Добавление: директива server в блоке upstream поддерживает параметр
- weight.
-
- *) Добавление: директива server_name поддерживает маÑку "*".
-
- *) Добавление: nginx поддерживает тело запроÑа больше 2G.
-
- *) ИÑправление: еÑли при иÑпользовании "satisfy_any on" клиент уÑпешно
- проходил аутентификацию, в лог вÑÑ‘ равно запиÑалоcÑŒ Ñообщение "access
- forbidden by rule".
-
- *) ИÑправление: метод PUT мог ошибочно не Ñоздать файл и вернуть код
- 409.
-
- *) ИÑправление: еÑли во Ð²Ñ€ÐµÐ¼Ñ Ð°ÑƒÑ‚ÐµÐ½Ñ‚Ð¸Ñ„Ð¸ÐºÐ°Ñ†Ð¸Ð¸ IMAP/POP3 бÑкенд возвращал
- ошибку, nginx продолжал прокÑирование.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.52 03.07.2006
-
- *) Изменение: воÑÑтановлено поведение Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_index_module длÑ
- запроÑов "POST /": как в верÑии до 0.3.40, модуль теперь не выдаёт
- ошибку 405.
-
- *) ИÑправление: при иÑпользовании Ð¾Ð³Ñ€Ð°Ð½Ð¸Ñ‡ÐµÐ½Ð¸Ñ ÑкороÑти рабочий процеÑÑ
- мог зациклитьÑÑ; ошибка поÑвилаÑÑŒ в 0.3.37.
-
- *) ИÑправление: модуль ngx_http_charset_module запиÑывал в лог ошибку
- "unknown charset", даже еÑли перекодировка не требовалаÑÑŒ; ошибка
- поÑвилаÑÑŒ в 0.3.50.
-
- *) ИÑправление: еÑли в результате запроÑа PUT возвращалÑÑ ÐºÐ¾Ð´ 409, то
- временный файл не удалÑлÑÑ.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.51 30.06.2006
-
- *) ИÑправление: при некоторых уÑловиÑÑ… в SSI мог пропадать Ñимволы "<";
- ошибка поÑвилаÑÑŒ в 0.3.50.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.50 28.06.2006
-
- *) Изменение: директивы proxy_redirect_errors и fastcgi_redirect_errors
- переименованы ÑоответÑтвенно в proxy_intercept_errors и
- fastcgi_intercept_errors.
-
- *) Добавление: модуль ngx_http_charset_module поддерживает
- перекодирование из однобайтных кодировок в UTF-8 и обратно.
-
- *) Добавление: в режиме прокÑи и FastCGI поддерживаетÑÑ Ñтрока заголовка
- "X-Accel-Charset" в ответе бÑкенда.
-
- *) ИÑправление: Ñимвол "\" в парах "\"" и "\'" в SSI командах убиралÑÑ,
- только еÑли также иÑпользовалÑÑ Ñимвол "$".
-
- *) ИÑправление: при некоторых уÑловиÑÑ… в SSI поÑле вÑтавки могла быть
- добавлена Ñтрока "<!--".
-
- *) ИÑправление: еÑли в заголовке ответа была Ñтрока "Content-Length: 0",
- то при иÑпользовании небуферизированного прокÑировании не закрывалоÑÑŒ
- Ñоединение Ñ ÐºÐ»Ð¸ÐµÐ½Ñ‚Ð¾Ð¼.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.49 31.05.2006
-
- *) ИÑправление: в директиве set.
-
- *) ИÑправление: при включении в ssi двух и более подзапроÑов,
- обрабатываемых через FastCGI, вмеÑто вывода второго и оÑтальных
- подзапроÑов в ответ включалÑÑ Ð²Ñ‹Ð²Ð¾Ð´ первого подзапроÑа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.48 29.05.2006
-
- *) Изменение: теперь модуль ngx_http_charset_module работает длÑ
- подзапроÑов, в ответах которых нет Ñтроки заголовка "Content-Type".
-
- *) ИÑправление: еÑли в директиве proxy_pass не было URI, то директива
- "proxy_redirect default" добавлÑла в перепиÑанный редирект в начало
- лишний ÑлÑш.
-
- *) ИÑправление: внутренний редирект вÑегда превращал любой HTTP-метод в
- GET, теперь Ñто делаетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ Ð´Ð»Ñ Ñ€ÐµÐ´Ð¸Ñ€ÐµÐºÑ‚Ð¾Ð², выполнÑемых Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ
- X-Accel-Redirect, и у которых метод не равен HEAD; ошибка поÑвилаÑÑŒ в
- 0.3.42.
-
- *) ИÑправление: модуль ngx_http_perl_module не ÑобиралÑÑ, еÑли перл был
- Ñ Ð¿Ð¾Ð´Ð´ÐµÑ€Ð¶ÐºÐ¾Ð¹ потоков; ошибка поÑвилаÑÑŒ в 0.3.46.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.47 23.05.2006
-
- *) Добавление: директива upstream.
-
- *) Изменение: Ñимвол "\" в парах "\"" и "\'" в SSI командах теперь
- вÑегда убираетÑÑ.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.46 11.05.2006
-
- *) Добавление: директивы proxy_hide_header, proxy_pass_header,
- fastcgi_hide_header и fastcgi_pass_header.
-
- *) Изменение: директивы proxy_pass_x_powered_by, fastcgi_x_powered_by и
- proxy_pass_server упразднены.
-
- *) Добавление: в режиме прокÑи поддерживаетÑÑ Ñтрока заголовка
- "X-Accel-Buffering" в ответе бÑкенда.
-
- *) ИÑправление: ошибок и утечек памÑти при переконфигурации в модуле
- ngx_http_perl_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.45 06.05.2006
-
- *) Добавление: директивы ssl_verify_client, ssl_verify_depth и
- ssl_client_certificate.
-
- *) Изменение: теперь Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $request_method возвращает метод только
- оÑновного запроÑа.
-
- *) Изменение: в таблице перекодировки koi-win изменены коды Ñимвола
- &deg;.
-
- *) Добавление: в таблицу перекодировки koi-win добавлены Ñимволы евро и
- номера.
-
- *) ИÑправление: еÑли nginx раÑпределÑл запроÑÑ‹ на неÑколько машин, то
- при падении одной из них запроÑÑ‹, предназначенные Ð´Ð»Ñ Ñтой машины,
- перенаправлÑлиÑÑŒ только на одну машину вмеÑто того, чтобы равномерно
- раÑпределÑÑ‚ÑŒÑÑ Ð¼ÐµÐ¶Ð´Ñƒ оÑтальными.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.44 04.05.2006
-
- *) Добавление: параметр wait в команде SSI include.
-
- *) Добавление: в таблицу перекодировки koi-win добавлены украинÑкие и
- белоруÑÑкие Ñимволы.
-
- *) ИÑправление: в SSI.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.43 26.04.2006
-
- *) ИÑправление: в SSI.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.42 26.04.2006
-
- *) Добавление: параметр bind в директиве listen в IMAP/POP3 прокÑи.
-
- *) ИÑправление: ошибки при иÑпользовании в директиве rewrite одного и
- того же Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð±Ð¾Ð»ÐµÐµ одного раза.
-
- *) ИÑправление: в лог не запиÑывалиÑÑŒ переменные
- $sent_http_content_type, $sent_http_content_length,
- $sent_http_last_modified, $sent_http_connection,
- $sent_http_keep_alive и $sent_http_transfer_encoding.
-
- *) ИÑправление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $sent_http_cache_control возвращала
- Ñодержимое только одной Ñтроки "Cache-Control" в заголовке ответа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.41 21.04.2006
-
- *) Добавление: ключ -v.
-
- *) ИÑправление: при включении в SSI удалённых подзапроÑов мог произойти
- segmentation fault.
-
- *) ИÑправление: в обработке FastCGI.
-
- *) ИÑправление: еÑли путь к перловым модулÑм не был указан Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ
- --with-perl_modules_path=PATH или директивы perl_modules, то на
- Ñтарте проиÑходил segmentation fault.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.40 19.04.2006
-
- *) Добавление: модуль ngx_http_dav_module поддерживает метод MKCOL.
-
- *) Добавление: директива create_full_put_path.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $limit_rate.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.39 17.04.2006
-
- *) Добавление: директива uninitialized_variable_warn; уровень
- Ð»Ð¾Ð³Ð³Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ ÑÐ¾Ð¾Ð±Ñ‰ÐµÐ½Ð¸Ñ Ð¾ неинициализированной переменной понижен Ñ
- ÑƒÑ€Ð¾Ð²Ð½Ñ alert на warn.
-
- *) Добавление: директива override_charset.
-
- *) Изменение: при иÑпользовании неизвеÑтной переменной в SSI-командах
- echo и if expr='$name' теперь не запиÑываетÑÑ Ð² лог Ñообщение о
- неизвеÑтной переменной.
-
- *) ИÑправление: Ñчётчик активных Ñоединений Ñ€Ð¾Ñ Ð¿Ñ€Ð¸ превышении лимита
- Ñоединений, заданного директивой worker_connections; ошибка поÑвилаÑÑŒ
- в 0.2.0.
-
- *) ИÑправление: при некоторых уÑÐ»Ð¾Ð²Ð¸Ñ Ð¾Ð³Ñ€Ð°Ð½Ð¸Ñ‡ÐµÐ½Ð¸Ðµ ÑкороÑти ÑоединениÑ
- могло не работать; ошибка поÑвилаÑÑŒ в 0.3.38.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.38 14.04.2006
-
- *) Добавление: модуль ngx_http_dav_module.
-
- *) Изменение: Ð¾Ð¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_perl_module.
- СпаÑибо Сергею Скворцову.
-
- *) Добавление: модуль ngx_http_perl_module поддерживает метод
- $r->request_body_file.
-
- *) Добавление: директива client_body_in_file_only.
-
- *) Изменение: теперь при переполнении диÑка nginx пытаетÑÑ Ð¿Ð¸Ñать
- access_log'и только раз в Ñекунду.
- СпаÑибо Ðнтону Южанинову и МакÑиму Дунину.
-
- *) ИÑправление: теперь директива limit_rate точнее ограничивает ÑкороÑÑ‚ÑŒ
- при значениÑÑ… больше 100 Kbyte/s.
- СпаÑибо ForJest.
-
- *) ИÑправление: IMAP/POP3 прокÑи теперь передаёт Ñерверу авторизации
- Ñимволы "\r" и "\n" в логине и пароле в закодированном виде.
- СпаÑибо МакÑиму Дунину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.37 07.04.2006
-
- *) Добавление: директива limit_except.
-
- *) Добавление: директива if поддерживает операторы "!~", "!~*", "-f" и
- "!-f".
-
- *) Добавление: модуль ngx_http_perl_module поддерживает метод
- $r->request_body.
-
- *) ИÑправление: в модуле ngx_http_addition_filter_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.36 05.04.2006
-
- *) Добавление: модуль ngx_http_addition_filter_module.
-
- *) Добавление: директивы proxy_pass и fastcgi_pass можно иÑпользовать
- внутри блока if.
-
- *) Добавление: директивы proxy_ignore_client_abort и
- fastcgi_ignore_client_abort.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $request_completion.
-
- *) Добавление: модуль ngx_http_perl_module поддерживает методы
- $r->request_method и $r->remote_addr.
-
- *) Добавление: модуль ngx_http_ssi_module поддерживает команду elif.
-
- *) ИÑправление: Ñтрока "\/" в начале Ð²Ñ‹Ñ€Ð°Ð¶ÐµÐ½Ð¸Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ‹ if модулÑ
- ngx_http_ssi_module воÑпринималаÑÑŒ неверно.
-
- *) ИÑправление: в иÑпользовании регулÑрных выражениÑÑ… в команде if
- Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_ssi_module.
-
- *) ИÑправление: при задании отноÑительного пути в директивах
- client_body_temp_path, proxy_temp_path, fastcgi_temp_path и
- perl_modules иÑпользовалÑÑ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³ отноÑительно текущего каталога, а
- не отноÑительно префикÑа Ñервера.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.35 22.03.2006
-
- *) ИÑправление: accept-фильтр и TCP_DEFER_ACCEPT уÑтанавливалиÑÑŒ только
- Ð´Ð»Ñ Ð¿ÐµÑ€Ð²Ð¾Ð¹ директивы listen; ошибка поÑвилаÑÑŒ в 0.3.31.
-
- *) ИÑправление: в директиве proxy_pass без URI при иÑпользовании в
- подзапроÑе.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.34 21.03.2006
-
- *) Добавление: директива add_header поддерживает переменные.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.33 15.03.2006
-
- *) Добавление: параметр http_503 в директивах proxy_next_upstream или
- fastcgi_next_upstream.
-
- *) ИÑправление: ngx_http_perl_module не работал Ñо вÑтроенным в
- конфигурационный файл кодом, еÑли он не начиналÑÑ Ñразу же Ñ "sub".
-
- *) ИÑправление: в директиве post_action.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.32 11.03.2006
-
- *) ИÑправление: удаление отладочного Ð»Ð¾Ð³Ð³Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ð½Ð° Ñтарте и при
- переконфигурации; ошибка поÑвилаÑÑŒ в 0.3.31.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.31 10.03.2006
-
- *) Изменение: теперь nginx передаёт неверные ответы прокÑированного
- бÑкенда.
-
- *) Добавление: директивы listen поддерживают Ð°Ð´Ñ€ÐµÑ Ð² виде "*:порт".
-
- *) Добавление: поддержка EVFILER_TIMER в MacOSX 10.4.
-
- *) Изменение: обход ошибки обработки миллиÑекундных таймаутов kqueue в
- 64-битном Ñдре MacOSX.
- СпаÑибо Ðндрею Ðигматулину.
-
- *) ИÑправление: еÑли внутри одного Ñервера опиÑаны неÑколько директив
- listen, Ñлушающих на разных адреÑах, то имена Ñерверов вида
- "*.domain.tld" работали только Ð´Ð»Ñ Ð¿ÐµÑ€Ð²Ð¾Ð³Ð¾ адреÑа; ошибка поÑвилаÑÑŒ в
- 0.3.18.
-
- *) ИÑправление: при иÑпользовании протокола HTTPS в директиве proxy_pass
- не передавалиÑÑŒ запроÑÑ‹ Ñ Ñ‚ÐµÐ»Ð¾Ð¼, запиÑанным во временный файл.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ perl 5.8.8.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.30 22.02.2006
-
- *) Изменение: уровень запиÑи в лог ошибки ECONNABORTED изменён на error
- Ñ ÑƒÑ€Ð¾Ð²Ð½Ñ crit.
-
- *) ИÑправление: модуль ngx_http_perl_module не ÑобиралÑÑ Ð±ÐµÐ· модулÑ
- ngx_http_ssi_filter_module.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° i386 платформе, еÑли иÑпользовалÑÑ
- PIC; ошибка поÑвилаÑÑŒ в 0.3.27.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.29 20.02.2006
-
- *) Добавление: теперь nginx иÑпользует меньше памÑти, еÑли PHP в режиме
- FastCGI передаёт большое количеÑтво предупреждений перед ответом.
-
- *) ИÑправление: в ответах 204 Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñов верÑии HTTP/1.1 выдавалаÑÑŒ
- Ñтрока заголовка "Transfer-Encoding: chunked".
-
- *) ИÑправление: nginx возвращал 502 код ответа, еÑли FastCGI Ñервер
- передавал полные Ñтроки заголовка ответа в отдельных FastCGI запиÑÑÑ….
-
- *) ИÑправление: еÑли в директиве post_action был указан прокÑируемый
- URI, то он выполнÑлÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ поÑле уÑпешного Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.28 16.02.2006
-
- *) Добавление: директива restrict_host_names упразднена.
-
- *) Добавление: параметр конфигурации --with-cpu-opt=ppc64.
-
- *) ИÑправление: при некоторых уÑловиÑÑ… прокÑированное Ñоединение Ñ
- клиентом завершалоÑÑŒ преждевременно.
- СпаÑибо Владимиру Шутову.
-
- *) ИÑправление: Ñтрока заголовка "X-Accel-Limit-Rate" не учитывалаÑÑŒ длÑ
- запроÑов, перенаправленных Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ Ñтроки "X-Accel-Redirect".
-
- *) ИÑправление: директива post_action работала только поÑле уÑпешного
- Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа.
-
- *) ИÑправление: тело прокÑированного ответа, Ñоздаваемого директивой
- post_action, передавалоÑÑŒ клиенту.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.27 08.02.2006
-
- *) Изменение: директивы variables_hash_max_size и
- variables_hash_bucket_size.
-
- *) Добавление: Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $body_bytes_sent доÑтупна не только в
- директиве log_format.
-
- *) Добавление: переменные $ssl_protocol и $ssl_cipher.
-
- *) Добавление: определение размера Ñтроки кÑша раÑпроÑтранённых
- процеÑÑоров при Ñтарте.
-
- *) Добавление: директива accept_mutex теперь поддерживаетÑÑ Ð¿Ð¾ÑредÑтвом
- fcntl(2) на платформах, отличных от i386, amd64, sparc64 и ppc.
-
- *) Добавление: директива lock_file и параметр автоконфигурации
- --with-lock-path=PATH.
-
- *) ИÑправление: при иÑпользовании протокола HTTPS в директиве proxy_pass
- не передавалиÑÑŒ запроÑÑ‹ Ñ Ñ‚ÐµÐ»Ð¾Ð¼.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.26 03.02.2006
-
- *) Изменение: директива optimize_host_names переименована в
- optimize_server_names.
-
- *) ИÑправление: при прокÑировании подзапроÑа в SSI бÑкенду передавалÑÑ
- URI оÑновного запроÑа, еÑли в директиве proxy_pass отÑутÑтвовал URI.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.25 01.02.2006
-
- *) ИÑправление: при неверной конфигурации на Ñтарте или во времÑ
- переконфигурации проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в
- 0.3.24.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.24 01.02.2006
-
- *) Изменение: обход ошибки в kqueue во FreeBSD.
-
- *) ИÑправление: ответ, Ñоздаваемый директивой post_action, теперь не
- передаётÑÑ ÐºÐ»Ð¸ÐµÐ½Ñ‚Ñƒ.
-
- *) ИÑправление: при иÑпользовании большого количеÑтва лог-файлов
- проиÑходила утечка памÑти.
-
- *) ИÑправление: внутри одного location работала только Ð¿ÐµÑ€Ð²Ð°Ñ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¸Ð²Ð°
- proxy_redirect.
-
- *) ИÑправление: на 64-битных платформах при Ñтарте мог произойти
- segmentation fault, еÑли иÑпользовалоÑÑŒ большое количеÑтво имён в
- директивах server_name; ошибка поÑвилаÑÑŒ в 0.3.18.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.23 24.01.2006
-
- *) Добавление: директива optimize_host_names.
-
- *) ИÑправление: ошибки при иÑпользовании переменных в директивах path и
- alias.
-
- *) ИÑправление: модуль ngx_http_perl_module неправильно ÑобиралÑÑ Ð½Ð°
- Linux и Solaris.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.22 17.01.2006
-
- *) Добавление: модуль ngx_http_perl_module поддерживает методы $r->args
- и $r->unescape.
-
- *) Добавление: метод $r->query_string в модуле ngx_http_perl_module
- упразднён.
-
- *) ИÑправление: еÑли в директиве valid_referers указаны только none или
- blocked, то проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в 0.3.18.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.21 16.01.2006
-
- *) Добавление: модуль ngx_http_perl_module.
-
- *) Изменение: директива valid_referers разрешает иÑпользовать рефереры
- ÑовÑем без URI.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.20 11.01.2006
-
- *) ИÑправление: ошибки в обработке SSI.
-
- *) ИÑправление: модуль ngx_http_memcached_module не поддерживал ключи в
- виде /uri?args.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.19 28.12.2005
-
- *) Добавление: директивы path и alias поддерживают переменные.
-
- *) Изменение: теперь директива valid_referers опÑÑ‚ÑŒ учитывает URI.
-
- *) ИÑправление: ошибки в обработке SSI.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.18 26.12.2005
-
- *) Добавление: директива server_names поддерживает имена вида
- ".domain.tld".
-
- *) Добавление: директива server_names иÑпользует Ñ…Ñш Ð´Ð»Ñ Ð¸Ð¼Ñ‘Ð½ вида
- "*.domain.tld" и более Ñффективный Ñ…Ñш Ð´Ð»Ñ Ð¾Ð±Ñ‹Ñ‡Ð½Ñ‹Ñ… имён.
-
- *) Изменение: директивы server_names_hash_max_size и
- server_names_hash_bucket_size.
-
- *) Изменение: директивы server_names_hash и server_names_hash_threshold
- упразднены.
-
- *) Добавление: директива valid_referers иÑпользует Ñ…Ñш Ð´Ð»Ñ Ð¸Ð¼Ñ‘Ð½ Ñайтов.
-
- *) Изменение: теперь директива valid_referers проверÑет только имена
- Ñайтов без учёта URI.
-
- *) ИÑправление: некоторые имена вида ".domain.tld" неверно
- обрабатывалиÑÑŒ модулем ngx_http_map_module.
-
- *) ИÑправление: еÑли конфигурационного файла не было, то проиÑходил
- segmentation fault; ошибка поÑвилаÑÑŒ в 0.3.12.
-
- *) ИÑправление: на 64-битных платформах при Ñтарте мог произойти
- segmentation fault; ошибка поÑвилаÑÑŒ в 0.3.16.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.17 18.12.2005
-
- *) Изменение: на Linux configure теперь проверÑет наличие epoll и
- sendfile64() в Ñдре.
-
- *) Добавление: директива map поддерживает доменные имена в формате
- ".domain.tld".
-
- *) ИÑправление: во Ð²Ñ€ÐµÐ¼Ñ SSL handshake не иcпользовалиÑÑŒ таймауты;
- ошибка поÑвилаÑÑŒ в 0.2.4.
-
- *) ИÑправление: в иÑпользовании протокола HTTPS в директиве proxy_pass.
-
- *) ИÑправление: при иÑпользовании протокола HTTPS в директиве proxy_pass
- по умолчанию иÑпользовалÑÑ Ð¿Ð¾Ñ€Ñ‚ 80.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.16 16.12.2005
-
- *) Добавление: модуль ngx_http_map_module.
-
- *) Добавление: директивы types_hash_max_size и types_hash_bucket_size.
-
- *) Добавление: директива ssi_value_length.
-
- *) Добавление: директива worker_rlimit_core.
-
- *) Изменение: при Ñборке компилÑторами icc 8.1 и 9.0 Ñ Ð¾Ð¿Ñ‚Ð¸Ð¼Ð¸Ð·Ð°Ñ†Ð¸ÐµÐ¹ длÑ
- Pentium 4 номер ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð² логах вÑегда был равен 1.
-
- *) ИÑправление: команда config timefmt в SSI задавала неверный формат
- времени.
-
- *) ИÑправление: nginx не закрывал ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ IMAP/POP3 бÑкендом при
- иÑпользовании SSL Ñоединений; ошибка поÑвилаÑÑŒ в 0.3.13.
- СпаÑибо Rob Mueller.
-
- *) ИÑправление: segmentation fault мог произойти во Ð²Ñ€ÐµÐ¼Ñ SSL shutdown;
- ошибка поÑвилаÑÑŒ в 0.3.13.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.15 07.12.2005
-
- *) Добавление: новой код 444 в директиве return Ð´Ð»Ñ Ð·Ð°ÐºÑ€Ñ‹Ñ‚Ð¸Ñ ÑоединениÑ.
-
- *) Добавление: директива so_keepalive в IMAP/POP3 прокÑи.
-
- *) ИÑправление: nginx теперь вызывает abort() при обнаружении незакрытых
- Ñоединений только при планом выходе и включённой директиве
- debug_points.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.14 05.12.2005
-
- *) ИÑправление: в ответе 304 передавалоÑÑŒ тело ответа; ошибка поÑвилаÑÑŒ
- в 0.3.13.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.13 05.12.2005
-
- *) Добавление: IMAP/POP3 прокÑи поддерживает STARTTLS и STLS.
-
- *) ИÑправление: IMAP/POP3 прокÑи не работала Ñ Ð¼ÐµÑ‚Ð¾Ð´Ð°Ð¼Ð¸ select, poll и
- /dev/poll.
-
- *) ИÑправление: ошибки в обработке SSI.
-
- *) ИÑправление: sendfilev() в Solaris теперь не иÑпользуетÑÑ Ð¿Ñ€Ð¸
- передаче тела запроÑа FastCGI-Ñерверу через unix domain Ñокет.
-
- *) ИÑправление: директива auth_basic не запрещала аутентификацию; ошибка
- поÑвилаÑÑŒ в 0.3.11.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.12 26.11.2005
-
- *) БезопаÑноÑÑ‚ÑŒ: еÑли nginx был Ñобран Ñ Ð¼Ð¾Ð´ÑƒÐ»ÐµÐ¼ ngx_http_realip_module,
- то при иÑпользовании директивы "satisfy_any on" директивы доÑтупа и
- аутентификации не работали. Модуль ngx_http_realip_module не
- ÑобиралÑÑ Ð¸ не ÑобираетÑÑ Ð¿Ð¾ умолчанию.
-
- *) Изменение: Ð¸Ð¼Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð¾Ð¹ "$time_gmt" изменено на "$time_local".
-
- *) Изменение: директивы proxy_header_buffer_size и
- fastcgi_header_buffer_size переименованы ÑоответÑтвенно в
- proxy_buffer_size и fastcgi_buffer_size.
-
- *) Добавление: модуль ngx_http_memcached_module.
-
- *) Добавление: директива proxy_buffering.
-
- *) ИÑправление: изменение в работе Ñ accept mutex при иÑпользовании
- метода rtsig; ошибка поÑвилаÑÑŒ в 0.3.0.
-
- *) ИÑправление: еÑли клиент передал Ñтроку "Transfer-Encoding: chunked"
- в заголовке запроÑа, то nginx теперь выдаёт ошибку 411.
-
- *) ИÑправление: при наÑледовании директивы auth_basic Ñ ÑƒÑ€Ð¾Ð²Ð½Ñ http в
- Ñтроке "WWW-Authenticate" заголовка ответа выводилÑÑ realm без текÑта
- "Basic realm".
-
- *) ИÑправление: еÑли в директиве access_log был Ñвно указан формат
- combined, то в лог запиÑывалиÑÑŒ пуÑтые Ñтроки; ошибка поÑвилаÑÑŒ в
- 0.3.8.
-
- *) ИÑправление: nginx не работал на платформе sparc под любыми OS, кроме
- Solaris.
-
- *) ИÑправление: в директиве if теперь не нужно разделÑÑ‚ÑŒ пробелом Ñтроку
- в кавычках и закрывающую Ñкобку.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.11 15.11.2005
-
- *) ИÑправление: nginx не передавал при прокÑировании тело запроÑа и
- Ñтроки заголовка клиента; ошибка поÑвилаÑÑŒ в 0.3.10.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.10 15.11.2005
-
- *) Изменение: директива valid_referers и Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ $invalid_referer
- перенеÑены из Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_rewrite_module в новый модуль
- ngx_http_referer_module.
-
- *) Изменение: Ð¸Ð¼Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð¾Ð¹ "$apache_bytes_sent" изменено на
- "$body_bytes_sent".
-
- *) Добавление: переменные "$sent_http_...".
-
- *) Добавление: директива if поддерживает операции "=" и "!=".
-
- *) Добавление: директива proxy_pass поддерживает протокол HTTPS.
-
- *) Добавление: директива proxy_set_body.
-
- *) Добавление: директива post_action.
-
- *) Добавление: модуль ngx_http_empty_gif_module.
-
- *) Добавление: директива worker_cpu_affinity Ð´Ð»Ñ Linux.
-
- *) ИÑправление: директива rewrite не раÑкодировала Ñимволы в редиректах
- в URI, теперь Ñимволы раÑкодируютÑÑ, кроме Ñимволов %00-%25 и
- %7F-%FF.
-
- *) ИÑправление: nginx не ÑобиралÑÑ ÐºÐ¾Ð¼Ð¿Ð¸Ð»Ñтором icc 9.0.
-
- *) ИÑправление: еÑли Ð´Ð»Ñ ÑтатичеÑкого файла нулевого размера был
- разрешён SSI, то ответ передавалÑÑ Ð½ÐµÐ²ÐµÑ€Ð½Ð¾ при кодировании chunk'ами.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.9 10.11.2005
-
- *) ИÑправление: nginx Ñчитал небезопаÑными URI, в которых между двумÑ
- ÑлÑшами находилоÑÑŒ два любых Ñимвола; ошибка поÑвилаÑÑŒ в 0.3.8.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.8 09.11.2005
-
- *) БезопаÑноÑÑ‚ÑŒ: nginx теперь проверÑÑ‚ URI, полученные от бÑкенда в
- Ñтроке "X-Accel-Redirect" в заголовке ответа, или в SSI файле на
- наличие путей "/../" и нулей.
-
- *) Изменение: nginx теперь не воÑпринимает пуÑтое Ð¸Ð¼Ñ ÐºÐ°Ðº правильное в
- Ñтроке "Authorization" в заголовке запроÑа.
-
- *) Добавление: директива ssl_session_timeout модулей ngx_http_ssl_module
- и ngx_imap_ssl_module.
-
- *) Добавление: директива auth_http_header модулÑ
- ngx_imap_auth_http_module.
-
- *) Добавление: директива add_header.
-
- *) Добавление: модуль ngx_http_realip_module.
-
- *) Добавление: новые переменные Ð´Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² директиве
- log_format: $bytes_sent, $apache_bytes_sent, $status, $time_gmt,
- $uri, $request_time, $request_length, $upstream_status,
- $upstream_response_time, $gzip_ratio, $uid_got, $uid_set,
- $connection, $pipe и $msec. Параметры в виде "%name" Ñкоро будут
- упразднены.
-
- *) Изменение: в директиве "if" ложными значениÑми переменных теперь
- ÑвлÑÑŽÑ‚ÑÑ Ð¿ÑƒÑÑ‚Ð°Ñ Ñтрока "" и Ñтроки, начинающиеÑÑ Ð½Ð° "0".
-
- *) ИÑправление: при работает Ñ Ð¿Ñ€Ð¾ÐºÑированными или FastCGI-Ñерверами
- nginx мог оÑтавлÑÑ‚ÑŒ открытыми ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¸ временные файлы Ñ
- запроÑами клиентов.
-
- *) ИÑправление: рабочие процеÑÑÑ‹ не ÑбраÑывали буферизированные логи при
- плавном выходе.
-
- *) ИÑправление: еÑли URI запроÑа изменÑлоÑÑŒ Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ rewrite, а затем
- Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¿Ñ€Ð¾ÐºÑировалÑÑ Ð² location, заданном регулÑрным выражением, то
- бÑкенду передавалÑÑ Ð½ÐµÐ²ÐµÑ€Ð½Ñ‹Ð¹ запроÑ; ошибка поÑвилаÑÑŒ в 0.2.6.
-
- *) ИÑправление: директива expires не удалÑла уже уÑтановленную Ñтроку
- заголовка "Expires".
-
- *) ИÑправление: при иÑпользовании метода rtsig и неÑкольких рабочих
- процеÑÑах nginx мог переÑтать принимать запроÑÑ‹.
-
- *) ИÑправление: в SSI командах неверно обрабатывалиÑÑŒ Ñтроки "\"" и
- "\'".
-
- *) ИÑправление: еÑли ответ заканчивалÑÑ Ñразу же поÑле SSI команды, то
- при иÑпользовании ÑÐ¶Ð°Ñ‚Ð¸Ñ Ð¾Ñ‚Ð²ÐµÑ‚ передавалÑÑ Ð½Ðµ до конца или не
- передавалÑÑ Ð²Ð¾Ð¾Ð±Ñ‰Ðµ.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.7 27.10.2005
-
- *) Добавление: директива access_log поддерживает параметр buffer=.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° платформах, отличных от i386,
- amd64, sparc и ppc; ошибка поÑвилаÑÑŒ в 0.3.2.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.6 24.10.2005
-
- *) Изменение: IMAP/POP3 прокÑи теперь не передаёт Ñерверу авторизации
- пуÑтой логин.
-
- *) Добавление: директива log_format поддерживает переменные в виде
- $name.
-
- *) ИÑправление: еÑли Ñ…Ð¾Ñ‚Ñ Ð±Ñ‹ в одном Ñервере не было опиÑано ни одной
- директивы listen, то nginx не Ñлушал на 80 порту; ошибка поÑвилаÑÑŒ в
- 0.3.3.
-
- *) ИÑправление: еÑли в директиве proxy_pass отÑутÑтвовал URI, то вÑегда
- иÑпользовалÑÑ Ð¿Ð¾Ñ€Ñ‚ 80.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.5 21.10.2005
-
- *) ИÑправление: еÑли логин IMAP/POP3 менÑлÑÑ Ñервером авторизации, то
- мог произойти segmentation fault; ошибка поÑвилаÑÑŒ в 0.2.2.
-
- *) ИÑправление: accept mutex не работал, вÑе ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ð¾Ð±Ñ€Ð°Ð±Ð°Ñ‚Ñ‹Ð²Ð°Ð»Ð¸ÑÑŒ
- одним рабочим процеÑÑом; ошибка поÑвилаÑÑŒ в 0.3.3.
-
- *) ИÑправление: при иÑпользовании метода rtsig и директивы
- timer_resolution не работали таймауты.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.4 19.10.2005
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° Linux 2.4+ и MacOS X; ошибка
- поÑвилаÑÑŒ в 0.3.3.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.3 19.10.2005
-
- *) Изменение: параметры "bl" и "af" директивы listen переименованы в
- "backlog" и "accept_filter".
-
- *) Добавление: параметры "rcvbuf" и "sndbuf" в директиве listen.
-
- *) Изменение: параметр лога $msec теперь не требует дополнительного
- ÑиÑтемного вызова gettimeofday().
-
- *) Добавление: ключ -t теперь проверÑет директивы listen.
-
- *) ИÑправление: еÑли в директиве listen был указан неверный адреÑ, то
- nginx поÑле Ñигнала -HUP оÑтавлÑл открытый Ñокет в ÑоÑтоÑнии CLOSED.
-
- *) ИÑправление: Ð´Ð»Ñ Ð¸Ð½Ð´ÐµÐºÑных файлов, Ñодержащих в имени переменную, мог
- неверно выÑтавлÑÑ‚ÑŒÑÑ Ñ‚Ð¸Ð¿ mime по умолчанию; ошибка поÑвилаÑÑŒ в 0.3.0.
-
- *) Добавление: директива timer_resolution.
-
- *) Добавление: параметр лога $upstream_response_time в миллиÑекундах.
-
- *) ИÑправление: временный файл Ñ Ñ‚ÐµÐ»Ð¾Ð¼ запроÑа клиента теперь удалÑетÑÑ
- Ñразу поÑле того, как клиенту передан заголовок ответа.
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ OpenSSL 0.9.6.
-
- *) ИÑправление: пути к файлам Ñ SSL Ñертификатом и ключом не могли быть
- отноÑительными.
-
- *) ИÑправление: директива ssl_prefer_server_ciphers не работала длÑ
- Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_imap_ssl_module.
-
- *) ИÑправление: директива ssl_protocols позволÑла задать только один
- протокол.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.2 12.10.2005
-
- *) Добавление: поддержка Sun Studio 10 C compiler.
-
- *) Добавление: директивы proxy_upstream_max_fails,
- proxy_upstream_fail_timeout, fastcgi_upstream_max_fails и
- fastcgi_upstream_fail_timeout.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.1 10.10.2005
-
- *) ИÑправление: во Ð²Ñ€ÐµÐ¼Ñ Ð¿ÐµÑ€ÐµÐ¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð¾Ñ‡ÐµÑ€ÐµÐ´Ð¸ Ñигналов при иÑпользовании
- метода rtsig проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в 0.2.0.
-
- *) Изменение: ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ° пар "\\", "\"", "\'" и "\$" в SSI.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.3.0 07.10.2005
-
- *) Изменение: убрано деÑÑтидневное ограничение времени работы рабочего
- процеÑÑа. Ограничение было введено из-за Ð¿ÐµÑ€ÐµÐ¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð¼Ð¸Ð»Ð»Ð¸Ñекундных
- таймеров.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.2.6 05.10.2005
-
- *) Изменение: Ñ 60 до 10 Ñекунд уменьшено Ð²Ñ€ÐµÐ¼Ñ Ð¿Ð¾Ð²Ñ‚Ð¾Ñ€Ð½Ð¾Ð³Ð¾ Ð¾Ð±Ñ€Ð°Ñ‰ÐµÐ½Ð¸Ñ Ðº
- бÑкенду при иÑпользовании раÑÐ¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð¸Ñ Ð½Ð°Ð³Ñ€ÑƒÐ·ÐºÐ¸.
-
- *) Изменение: директива proxy_pass_unparsed_uri упразднена, оригинальный
- Ð·Ð°Ð¿Ñ€Ð¾Ñ Ñ‚ÐµÐ¿ÐµÑ€ÑŒ передаётÑÑ, еÑли в директиве proxy_pass отÑутÑтвует
- URI.
-
- *) Добавление: директива error_page поддерживает редиректы и позволÑет
- более гибко менÑÑ‚ÑŒ код ошибки.
-
- *) Изменение: в прокÑированных подзапроÑах теперь игнорируетÑÑ
- переданный charset.
-
- *) ИÑправление: еÑли поÑле Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ URI в блоке if Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа не
- находилаÑÑŒ Ð½Ð¾Ð²Ð°Ñ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ, то правила модулÑ
- ngx_http_rewrite_module выполнÑлиÑÑŒ Ñнова.
-
- *) ИÑправление: еÑли директива set уÑтанавливала переменную модулÑ
- ngx_http_geo_module в какой-либо чаÑти конфигурации, то Ñта
- Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ Ð½Ðµ была доÑтупна в других чаÑÑ‚ÑÑ… конфигурации и выдавалаÑÑŒ
- ошибка "using uninitialized variable"; ошибка поÑвилаÑÑŒ в 0.2.2.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.2.5 04.10.2005
-
- *) Изменение: дублирующее значение переменной Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_geo_module
- теперь выдаёт предупреждение и изменÑет Ñтарое значение.
-
- *) Добавление: модуль ngx_http_ssi_module поддерживает команду set.
-
- *) Добавление: модуль ngx_http_ssi_module поддерживает параметр file в
- команде include.
-
- *) Добавление: модуль ngx_http_ssi_module поддерживает подÑтановку
- значений переменных в выражениÑÑ… команды if.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.2.4 03.10.2005
-
- *) Добавление: модуль ngx_http_ssi_module поддерживает выражениÑ
- "$var=text", "$var!=text", "$var=/text/" и "$var!=/text/" в команде
- if.
-
- *) ИÑправление: ошибки при прокÑировании location без ÑлÑша в конце;
- ошибка поÑвилаÑÑŒ в 0.1.44.
-
- *) ИÑправление: при иÑпользовании метода rtsig мог произойти
- segmentation fault; ошибка поÑвилаÑÑŒ в 0.2.0.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.2.3 30.09.2005
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð±ÐµÐ· параметра --with-debug; ошибка
- поÑвилаÑÑŒ в 0.2.2.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.2.2 30.09.2005
-
- *) Добавление: команда config errmsg в модуле ngx_http_ssi_module.
-
- *) Изменение: переменные Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_geo_module можно переопределÑÑ‚ÑŒ
- директивой set.
-
- *) Добавление: директивы ssl_protocols и ssl_prefer_server_ciphers
- модулей ngx_http_ssl_module и ngx_imap_ssl_module.
-
- *) ИÑправление: ошибка в модуле ngx_http_autoindex_module при показе
- длинных имён файлов;
-
- *) ИÑправление: модуль ngx_http_autoindex_module теперь не показывает
- файлы, начинающиеÑÑ Ð½Ð° точку.
-
- *) ИÑправление: еÑли SSL handshake завершалÑÑ Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ¾Ð¹, то Ñто могло
- привеÑти также к закрытию другого ÑоединениÑ.
- СпаÑибо Rob Mueller.
-
- *) ИÑправление: ÑкÑпортные верÑии MSIE 5.x не могли ÑоединитьÑÑ Ð¿Ð¾
- HTTPS.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.2.1 23.09.2005
-
- *) ИÑправление: еÑли вÑе бÑкенды, иÑпользуемые Ð´Ð»Ñ Ð±Ð°Ð»Ð°Ð½Ñировки
- нагрузки, оказывалиÑÑŒ в нерабочем ÑоÑтоÑнии поÑле одной ошибки, то
- nginx мог зациклитÑÑ; ошибка поÑвилаÑÑŒ в 0.2.0.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.2.0 23.09.2005
-
- *) ИзменилиÑÑŒ имена pid-файлов, иÑпользуемые во Ð²Ñ€ÐµÐ¼Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ
- иÑполнÑемого файла. Ручное переименование теперь не нужно. Старый
- оÑновной процеÑÑ Ð´Ð¾Ð±Ð°Ð²Ð»Ñет к Ñвоему pid-файл ÑÑƒÑ„Ñ„Ð¸ÐºÑ ".oldbin" и
- запуÑкает новый иÑполнÑемый файл. Ðовый оÑновной процеÑÑ Ñоздаёт
- обычный pid-файл без ÑуффикÑа ".newbin". ЕÑли новый оÑновной процеÑÑ
- выходит, то Ñтарый процеÑÑ Ð¿ÐµÑ€ÐµÐ¸Ð¼ÐµÐ½Ð¾Ð²Ñ‹Ð²Ð°ÐµÑ‚ Ñвой pid-файл c ÑуффикÑом
- ".oldbin" в pid-файл без ÑуффикÑа. При обновлении Ñ Ð²ÐµÑ€Ñии 0.1.Ñ… до
- 0.2.0 нужно учитывать, что оба процеÑÑа - Ñтарый 0.1.x и новый
- 0.2.0 - иÑпользуют pid-файл без ÑуффикÑов.
-
- *) Изменение: директива worker_connections, новое название директивы
- connections; директива теперь задаёт макÑимальное чиÑло Ñоединений, а
- не макÑимально возможный номер деÑкриптора Ð´Ð»Ñ Ñокета.
-
- *) Добавление: SSL поддерживает кÑширование ÑеÑÑий в пределах одного
- рабочего процеÑÑа.
-
- *) Добавление: директива satisfy_any.
-
- *) Изменение: модули ngx_http_access_module и ngx_http_auth_basic_module
- не работают Ð´Ð»Ñ Ð¿Ð¾Ð´Ð·Ð°Ð¿Ñ€Ð¾Ñов.
-
- *) Добавление: директивы worker_rlimit_nofile и
- worker_rlimit_sigpending.
-
- *) ИÑправление: еÑли вÑе бÑкенды, иÑпользуемые Ð´Ð»Ñ Ð±Ð°Ð»Ð°Ð½Ñировки
- нагрузки, оказывалиÑÑŒ в нерабочем ÑоÑтоÑнии поÑле одной ошибки, то
- nginx не обращалÑÑ Ðº ним в течение 60 Ñекунд.
-
- *) ИÑправление: в парÑинге аргументов IMAP/POP3 команд.
- СпаÑибо Rob Mueller.
-
- *) ИÑправление: ошибки при иÑпользовании SSL в IMAP/POP3 прокÑи.
-
- *) ИÑправление: ошибки при иÑпользовании SSI и ÑжатиÑ.
-
- *) ИÑправление: в ответах 304 не добавлÑлиÑÑŒ Ñтроки заголовка ответа
- "Expires" и "Cache-Control".
- СпаÑибо ÐлекÑандру Кукушкину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.45 08.09.2005
-
- *) Изменение: директива ssl_engine упразднена в модуле
- ngx_http_ssl_module и перенеÑена на глобальный уровень.
-
- *) ИÑправление: ответы Ñ Ð¿Ð¾Ð´Ð·Ð°Ð¿Ñ€Ð¾Ñами, включённые Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ SSI, не
- передавалиÑÑŒ через SSL Ñоединение.
-
- *) Разные иÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² IMAP/POP3 прокÑи.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.44 06.09.2005
-
- *) Добавление: IMAP/POP3 прокÑи поддерживает SSL.
-
- *) Добавление: директива proxy_timeout Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_imap_proxy_module.
-
- *) Добавление: директива userid_mark.
-
- *) Добавление: значение переменной $remote_user определÑетÑÑ Ð½ÐµÐ·Ð°Ð²Ð¸Ñимо
- от того, иÑпользуетÑÑ Ð»Ð¸ Ð°Ð²Ñ‚Ð¾Ñ€Ð¸Ð·Ð°Ñ†Ð¸Ñ Ð¸Ð»Ð¸ нет.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.43 30.08.2005
-
- *) Добавление: listen(2) backlog в директиве listen можно менÑÑ‚ÑŒ по
- Ñигналу -HUP.
-
- *) Добавление: Ñкрипт geo2nginx.pl добавлен в contrib.
-
- *) Изменение: параметры FastCGI Ñ Ð¿ÑƒÑтым значениÑми теперь передаютÑÑ
- Ñерверу.
-
- *) ИÑправление: еÑли в ответе прокÑированного Ñервера или FastCGI
- Ñервера была Ñтрока "Cache-Control", то при иÑпользовании директивы
- expires проиÑходил segmentation fault или рабочий процеÑÑ Ð¼Ð¾Ð³
- зациклитÑÑ; в режиме прокÑи ошибка поÑвилаÑÑŒ в 0.1.29.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.42 23.08.2005
-
- *) ИÑправление: еÑли URI запроÑа получалÑÑ Ð½ÑƒÐ»ÐµÐ²Ð¾Ð¹ длины поÑле обработки
- модулем ngx_http_rewrite_module, то в модуле ngx_http_proxy_module
- проиÑходил segmentation fault или bus error.
-
- *) ИÑправление: директива limit_rate не работала внутри блока if; ошибка
- поÑвилаÑÑŒ в 0.1.38.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.41 25.07.2005
-
- *) ИÑправление: еÑли Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ Ð¸ÑпользовалаÑÑŒ в файле конфигурации, то
- она не могла иÑпользоватьÑÑ Ð² SSI.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.40 22.07.2005
-
- *) ИÑправление: еÑли клиент Ñлал очень длинную Ñтроку заголовка, то в
- логе не помещалаÑÑŒ информациÑ, ÑвÑÐ·Ð°Ð½Ð½Ð°Ñ Ñ Ñтим запроÑом.
-
- *) ИÑправление: при иÑпользовании "X-Accel-Redirect" не передавалаÑÑŒ
- Ñтрока "Set-Cookie"; ошибка поÑвилаÑÑŒ в 0.1.39.
-
- *) ИÑправление: при иÑпользовании "X-Accel-Redirect" не передавалаÑÑŒ
- Ñтрока "Content-Disposition".
-
- *) ИÑправление: по Ñигналу SIGQUIT оÑновной процеÑÑ Ð½Ðµ закрывал Ñокеты,
- на которых он Ñлушал.
-
- *) ИÑправление: поÑле Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¸ÑполнÑемого файла на лету на Linux и
- Solaris название процеÑÑа в команде ps ÑтановилоÑÑŒ короче.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.39 14.07.2005
-
- *) Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² модуле ngx_http_charset_module: директива default_charset
- упразднена; директива charset задаёт кодировку ответа; директива
- source_charset задаёт только иÑходную кодировку.
-
- *) ИÑправление: при перенаправлении ошибки 401, полученной от бÑкенда,
- не передавалаÑÑŒ Ñтрока заголовка "WWW-Authenticate".
-
- *) ИÑправление: модули ngx_http_proxy_module и ngx_http_fastcgi_module
- могли закрыть Ñоединение до того, как что-нибудь было передано
- клиенту; ошибка поÑвилаÑÑŒ в 0.1.38.
-
- *) Изменение: обработка ошибки инициализации в crypt_r() в Linux glibc.
-
- *) ИÑправление: модуль ngx_http_ssi_module не поддерживал отноÑительные
- URI в команде include virtual.
-
- *) ИÑправление: еÑли в Ñтроке заголовка ответа бÑкенда была Ñтрока
- "Location", которую nginx не должен был изменÑÑ‚ÑŒ, то в ответе
- передавалоÑÑŒ тело 500 ошибки; ошибка поÑвилаÑÑŒ в 0.1.29.
-
- *) ИÑправление: некоторые директивы модулей ngx_http_proxy_module и
- ngx_http_fastcgi_module не наÑледовалиÑÑŒ Ñ ÑƒÑ€Ð¾Ð²Ð½Ñ server на уровень
- location; ошибка поÑвилаÑÑŒ в 0.1.29.
-
- *) ИÑправление: модуль ngx_http_ssl_module не поддерживал цепочки
- Ñертификатов.
-
- *) ИÑправление: ошибка в модуле ngx_http_autoindex_module при показе
- длинных имён файлов; ошибка поÑвилаÑÑŒ в 0.1.38.
-
- *) ИÑÐ¿Ñ€Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð² IMAP/POP3 прокÑи при взаимодейÑтвии Ñ Ð±Ñкендом на
- Ñтадии login.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.38 08.07.2005
-
- *) Добавление: директива limit_rate поддерживаетÑÑ Ð² режиме прокÑи и
- FastCGI.
-
- *) Добавление: в режиме прокÑи и FastCGI поддерживаетÑÑ Ñтрока заголовка
- "X-Accel-Limit-Rate" в ответе бÑкенда.
-
- *) Добавление: директива break.
-
- *) Добавление: директива log_not_found.
-
- *) ИÑправление: при перенаправлении запроÑа Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ Ñтроки заголовка
- "X-Accel-Redirect" не изменÑлÑÑ ÐºÐ¾Ð´ ответа.
-
- *) ИÑправление: переменные, уÑтановленные директивой set не могли
- иÑпользоватьÑÑ Ð² SSI.
-
- *) ИÑправление: при включении в SSI более одного удалённого подзапроÑа
- мог произойти segmentation fault.
-
- *) ИÑправление: еÑли ÑтатуÑÐ½Ð°Ñ Ñтрока в ответе бÑкенда передавалаÑÑŒ в
- двух пакетах, то nginx Ñчитал ответ неверным; ошибка поÑвилаÑÑŒ в
- 0.1.29.
-
- *) Добавление: директива ssi_types.
-
- *) Добавление: директива autoindex_exact_size.
-
- *) ИÑправление: модуль ngx_http_autoindex_module не поддерживал длинные
- имена файлов в UTF-8.
-
- *) Добавление: IMAP/POP3 прокÑи.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.37 23.06.2005
-
- *) Изменение: в конце файла nginx.pid теперь добавлÑетÑÑ "\n".
-
- *) ИÑправление: при включении большого количеÑтва вÑтавок или неÑкольких
- больших вÑтавок Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ SSI ответ мог передаватьÑÑ Ð½Ðµ полноÑтью.
-
- *) ИÑправление: еÑли вÑе бÑкенды возвращали ответ 404, то при
- иÑпользовании параметра http_404 в директивах proxy_next_upstream или
- fastcgi_next_upstream, nginx начинал запрашивать вÑе бÑкенды Ñнова.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.36 15.06.2005
-
- *) Изменение: еÑли в заголовке запроÑа еÑÑ‚ÑŒ дублирующиеÑÑ Ñтроки "Host",
- "Connection", "Content-Length" и "Authorization", то nginx теперь
- выдаёт ошибку 400.
-
- *) Изменение: директива post_accept_timeout упразднена.
-
- *) Добавление: параметры default, af=, bl=, deferred и bind в директиве
- listen.
-
- *) Добавление: поддержка accept фильтров во FreeBSD.
-
- *) Добавление: поддержка TCP_DEFER_ACCEPT в Linux.
-
- *) ИÑправление: модуль ngx_http_autoindex_module не поддерживал имена
- файлов в UTF-8.
-
- *) ИÑправление: поÑле Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ð¸Ñ Ð½Ð¾Ð²Ñ‹Ð¹ лог-файл Ñ€Ð¾Ñ‚Ð°Ñ†Ð¸Ñ Ñтого лога по
- Ñигналу -USR1 выполнÑлаÑÑŒ, только еÑли переконфигурировать nginx два
- раза по Ñигналу -HUP.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.35 07.06.2005
-
- *) Добавление: директива working_directory.
-
- *) Добавление: директива port_in_redirect.
-
- *) ИÑправление: еÑли заголовок ответа бÑкенда не помещалÑÑ Ð² один пакет,
- то проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в 0.1.29.
-
- *) ИÑправление: еÑли было Ñконфигурировано более 10 Ñерверов или в
- Ñервере не опиÑана директива "listen", то при запуÑке мог произойти
- segmentation fault.
-
- *) ИÑправление: еÑли ответ не помещалÑÑ Ð²Ð¾ временный файл, то мог
- произойти segmentation fault.
-
- *) ИÑправление: nginx возвращал ошибку 400 на запроÑÑ‹ вида
- "GET http://www.domain.com/uri HTTP/1.0"; ошибка поÑвилаÑÑŒ в 0.1.28.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.34 26.05.2005
-
- *) ИÑправление: при включении больших ответов Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ SSI рабочий
- процеÑÑ Ð¼Ð¾Ð³ зациклитьÑÑ.
-
- *) ИÑправление: переменные, уÑтанавливаемые директивой "set", не были
- доÑтупны в SSI.
-
- *) Добавление: директива autoindex_localtime.
-
- *) ИÑправление: пуÑтое значение в директиве proxy_set_header запрещает
- передачу заголовка.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.33 23.05.2005
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ñ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð¾Ð¼ --without-pcre; ошибка
- поÑвилаÑÑŒ в 0.1.29.
-
- *) ИÑправление: 3, 5, 7 и 8 директив proxy_set_header на одном уровне
- вызывали bus fault при запуÑке.
-
- *) ИÑправление: в редиректах внутри HTTPS Ñервера был указан протокол
- HTTP.
-
- *) ИÑправление: еÑли директива rewrite иÑпользовала Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð²Ð½ÑƒÑ‚Ñ€Ð¸
- директивы if, то возвращалаÑÑŒ ошибка 500.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.32 19.05.2005
-
- *) ИÑправление: в редиректах, выдаваемых Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ директивы rewrite, не
- передавалиÑÑŒ аргументы; ошибка поÑвилаÑÑŒ в 0.1.29.
-
- *) Добавление: директива if поддерживает Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð² регулÑрных
- выражениÑÑ….
-
- *) Добавление: директива set поддерживает переменные и Ð²Ñ‹Ð´ÐµÐ»ÐµÐ½Ð¸Ñ Ð¸Ð·
- регулÑрных выражений.
-
- *) Добавление: в режиме прокÑи и FastCGI поддерживаетÑÑ Ñтрока заголовка
- "X-Accel-Redirect" в ответе бÑкенда.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.31 16.05.2005
-
- *) ИÑправление: при иÑпользовании SSL ответ мог передаватьÑÑ Ð½Ðµ до
- конца.
-
- *) ИÑправление: ошибки при обработке SSI в ответе, полученного от
- FastCGI-Ñервера.
-
- *) ИÑправление: ошибки при иÑпользовании SSI и ÑжатиÑ.
-
- *) ИÑправление: редирект Ñ ÐºÐ¾Ð´Ð¾Ð¼ 301 передавалÑÑ Ð±ÐµÐ· тела ответа; ошибка
- поÑвилаÑÑŒ в 0.1.30.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.30 14.05.2005
-
- *) ИÑправление: при иÑпользовании SSI рабочий процеÑÑ Ð¼Ð¾Ð³ зациклитьÑÑ.
-
- *) ИÑправление: при иÑпользовании SSL ответ мог передаватьÑÑ Ð½Ðµ до
- конца.
-
- *) ИÑправление: еÑли длина чаÑти ответа, полученного за один раз от
- прокÑируемого или FastCGI Ñервера была равна 500 байт, то nginx
- возвращал код ответа 500; в режиме прокÑи ошибка поÑвилаÑÑŒ только в
- 0.1.29.
-
- *) ИÑправление: nginx не Ñчитал неверными директивы Ñ 8-ÑŽ или 9-ÑŽ
- параметрами.
-
- *) Добавление: директива return может возвращать код ответа 204.
-
- *) Добавление: директива ignore_invalid_headers.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.29 12.05.2005
-
- *) Добавление: модуль ngx_http_ssi_module поддерживает команду include
- virtual.
-
- *) Добавление: модуль ngx_http_ssi_module поддерживает уÑловную команду
- вида 'if expr="$NAME"' и команды else и endif. ДопуÑкаетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾
- один уровень вложенноÑти.
-
- *) Добавление: модуль ngx_http_ssi_module поддерживает две переменные
- DATE_LOCAL и DATE_GMT и команду config timefmt.
-
- *) Добавление: директива ssi_ignore_recycled_buffers.
-
- *) ИÑправление: еÑли Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ QUERY_STRING не была определена, то в
- команде echo не ÑтавилоÑÑŒ значение по умолчанию.
-
- *) Изменение: модуль ngx_http_proxy_module полноÑтью перепиÑан.
-
- *) Добавление: директивы proxy_redirect, proxy_pass_request_headers,
- proxy_pass_request_body и proxy_method.
-
- *) Добавление: директива proxy_set_header. Директива proxy_x_var
- упразднена и должна быть заменена директивой proxy_set_header.
-
- *) Изменение: директива proxy_preserve_host упразднена и должна быть
- заменена директивами "proxy_set_header Host $host" и "proxy_redirect
- off" или директивой "proxy_set_header Host $host:$proxy_port" и
- ÑоответÑтвующими ей директивами proxy_redirect.
-
- *) Изменение: директива proxy_set_x_real_ip упразднена и должна быть
- заменена директивой "proxy_set_header X-Real-IP $remote_addr".
-
- *) Изменение: директива proxy_add_x_forwarded_for упразднена и должна
- быть заменена директивой
- "proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for".
-
- *) Изменение: директива proxy_set_x_url упразднена и должна быть
- заменена директивой
- "proxy_set_header X-URL http://$host:$server_port$request_uri".
-
- *) Добавление: директива fastcgi_param.
-
- *) Изменение: директивы fastcgi_root, fastcgi_set_var и fastcgi_params
- упразднены и должны быть замены директивами fastcgi_param.
-
- *) Добавление: директива index может иÑпользовать переменные.
-
- *) Добавление: директива index может быть указана на уровне http и
- server.
-
- *) Изменение: только поÑледний параметр в директиве index может быть
- абÑолютным.
-
- *) Добавление: в директиве rewrite могут иÑпользоватьÑÑ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ðµ.
-
- *) Добавление: директива internal.
-
- *) Добавление: переменные CONTENT_LENGTH, CONTENT_TYPE, REMOTE_PORT,
- SERVER_ADDR, SERVER_PORT, SERVER_PROTOCOL, DOCUMENT_ROOT,
- SERVER_NAME, REQUEST_METHOD, REQUEST_URI и REMOTE_USER.
-
- *) Изменение: nginx теперь передаёт неверные Ñтроки в заголовках запроÑа
- клиента и ответа бÑкенда.
-
- *) ИÑправление: еÑли бÑкенд долго не передавал ответ и send_timeout был
- меньше, чем proxy_read_timeout, то клиенту возвращалÑÑ Ð¾Ñ‚Ð²ÐµÑ‚ 408.
-
- *) ИÑправление: еÑли бÑкенд передавал неверную Ñтроку в заголовке
- ответа, то проиÑходил segmentation fault; ошибка поÑвилаÑÑŒ в 0.1.26.
-
- *) ИÑправление: при иÑпользовании отказоуÑтойчивой конфигурации в
- FastCGI мог проиÑходить segmentation fault.
-
- *) ИÑправление: директива expires не удалÑла уже уÑтановленные Ñтроки
- заголовка "Expires" и "Cache-Control".
-
- *) ИÑправление: nginx не учитывал завершающую точку в Ñтроке заголовка
- запроÑа "Host".
-
- *) ИÑправление: модуль ngx_http_auth_module не работал на Linux.
-
- *) ИÑправление: директива rewrite неверно работала, еÑли в запроÑе
- приÑутÑтвовали аргументы.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° MacOS X.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.28 08.04.2005
-
- *) ИÑправление: при прокÑировании больших файлов nginx Ñильно нагружал
- процеÑÑор.
-
- *) ИÑправление: nginx не ÑобиралÑÑ gcc 4.0 на Linux.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.27 28.03.2005
-
- *) Добавление: параметр blocked в директиве valid_referers.
-
- *) Изменение: ошибки обработки заголовка запроÑа теперь запиÑываютÑÑ Ð½Ð°
- уровне info, в лог также запиÑываетÑÑ Ð¸Ð¼Ñ Ñервера и Ñтроки заголовка
- запроÑа "Host" и "Referer".
-
- *) Изменение: при запиÑи ошибок в лог запиÑываетÑÑ Ñ‚Ð°ÐºÐ¶Ðµ Ñтрока
- заголовка запроÑа "Host".
-
- *) Добавление: директива proxy_pass_unparsed_uri. Ð¡Ð¿ÐµÑ†Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ°
- Ñимволов "://" в URI, Ð²Ð²ÐµÐ´Ñ‘Ð½Ð½Ð°Ñ Ð² верÑии 0.1.11, теперь упразднена.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° FreeBSD и Linux, еÑли был указан
- параметр конфигурации --without-ngx_http_auth_basic_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.26 22.03.2005
-
- *) Изменение: неверные Ñтроки заголовка, переданные клиентом, теперь
- игнорируетÑÑ Ð¸ запиÑываютÑÑ Ð² error_log на уровне info.
-
- *) Изменение: при запиÑи ошибок в лог запиÑываетÑÑ Ñ‚Ð°ÐºÐ¶Ðµ Ð¸Ð¼Ñ Ñервера,
- при обращении к которому произошла ошибка.
-
- *) Добавление: модуль ngx_http_auth_basic_module и директивы auth_basic
- и auth_basic_user_file.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.25 19.03.2005
-
- *) ИÑправление: nginx не работал на Linux parisc.
-
- *) Добавление: nginx теперь не запуÑкаетÑÑ Ð¿Ð¾Ð´ FreeBSD, еÑли значение
- sysctl kern.ipc.somaxconn Ñлишком большое.
-
- *) ИÑправление: еÑли модуль ngx_http_index_module делал внутреннее
- перенаправление запроÑа в модули ngx_http_proxy_module или
- ngx_http_fastcgi_module, то файл индекÑа не закрывалÑÑ Ð¿Ð¾Ñле
- обÑÐ»ÑƒÐ¶Ð¸Ð²Ð°Ð½Ð¸Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа.
-
- *) Добавление: директива proxy_pass может иÑпользоватьÑÑ Ð² location,
- заданных регулÑрным выражением.
-
- *) Добавление: модуль ngx_http_rewrite_filter_module поддерживает
- уÑÐ»Ð¾Ð²Ð¸Ñ Ð²Ð¸Ð´Ð° "if ($HTTP_USER_AGENT ~ MSIE)".
-
- *) ИÑправление: nginx очень медленно запуÑкалÑÑ Ð¿Ñ€Ð¸ большом количеÑтве
- адреÑов и иÑпользовании текÑтовых значений в директиве geo.
-
- *) Изменение: Ð¸Ð¼Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð¾Ð¹ в директиве geo нужно указывать, как $name.
- Прежний вариант без "$" пока работает, но вÑкоре будет убран.
-
- *) Добавление: параметр лога "%{VARIABLE}v".
-
- *) Добавление: директива "set $name value".
-
- *) ИÑправление: ÑовмеÑтимоÑÑ‚ÑŒ Ñ gcc 4.0.
-
- *) Добавление: параметр автоконфигурации --with-openssl-opt=OPTIONS.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.24 04.03.2005
-
- *) Добавление: модуль ngx_http_ssi_filter_module поддерживает переменные
- QUERY_STRING и DOCUMENT_URI.
-
- *) ИÑправление: модуль ngx_http_autoindex_module мог выдавать ответ 404
- на ÑущеÑтвующий каталог, еÑли Ñтот каталог был указан как alias.
-
- *) ИÑправление: модуль ngx_http_ssi_filter_module неправильно работал
- при больших ответах.
-
- *) ИÑправление: отÑутÑтвие Ñтроки заголовка "Referer" вÑегда ÑчиталоÑÑŒ
- правильным referrer'ом.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.23 01.03.2005
-
- *) Добавление: модуль ngx_http_ssi_filter_module и директивы ssi,
- ssi_silent_errors и ssi_min_file_chunk. ПоддерживаютÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñ‹ 'echo
- var="HTTP_..." default=""' и 'echo var="REMOTE_ADDR"'.
-
- *) Добавление: параметр лога %request_time.
-
- *) Добавление: еÑли Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¿Ñ€Ð¸ÑˆÑ‘Ð» без Ñтроки заголовка "Host", то
- директива proxy_preserve_host уÑтанавливает в качеÑтве Ñтого
- заголовка первое Ð¸Ð¼Ñ Ñервера из директивы server_name.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð½Ð° платформах, отличных от i386,
- amd64, sparc и ppc; ошибка поÑвилаÑÑŒ в 0.1.22.
-
- *) ИÑправление: модуль ngx_http_autoindex_module теперь показывает
- информацию не о ÑимволичеÑком линке, а о файле или каталоге, на
- который он указывает.
-
- *) ИÑправление: еÑли клиенту ничего не передавалоÑÑŒ, то параметр
- %apache_length запиÑывал в лог отрицательную длину заголовка ответа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.22 22.02.2005
-
- *) ИÑправление: модуль ngx_http_stub_status_module показывал неверную
- ÑтатиÑтику Ð´Ð»Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚Ð°Ð½Ð½Ñ‹Ñ… Ñоединений, еÑли иÑпользовалоÑÑŒ
- прокÑирование или FastCGI-Ñервер.
-
- *) ИÑправление: на Linux и Solaris уÑтановочные пути были неверно
- заключены в кавычки; ошибка поÑвилаÑÑŒ в 0.1.21.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.21 22.02.2005
-
- *) ИÑправление: модуль ngx_http_stub_status_module показывал неверную
- ÑтатиÑтику при иÑпользовании метода rtsig или при иÑпользовании
- неÑкольких рабочих процеÑÑов на SMP машине.
-
- *) ИÑправление: nginx не ÑобиралÑÑ ÐºÐ¾Ð¼Ð¿Ð¸Ð»Ñтором icc под ЛинукÑом или
- еÑли библиотека zlib-1.2.x ÑобиралаÑÑŒ из иÑходных текÑтов.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð¿Ð¾Ð´ NetBSD 2.0.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.20 17.02.2005
-
- *) Добавление: новые параметры script_filename и remote_port в директиве
- fastcgi_params.
-
- *) ИÑправление: неправильно обрабатывалÑÑ Ð¿Ð¾Ñ‚Ð¾Ðº stderr от
- FastCGI-Ñервера.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.19 16.02.2005
-
- *) ИÑправление: еÑли в запроÑе еÑÑ‚ÑŒ нуль, то Ð´Ð»Ñ Ð»Ð¾ÐºÐ°Ð»ÑŒÐ½Ñ‹Ñ… запроÑов
- теперь возвращаетÑÑ Ð¾ÑˆÐ¸Ð±ÐºÐ° 404.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð¿Ð¾Ð´ NetBSD 2.0.
-
- *) ИÑправление: во Ð²Ñ€ÐµÐ¼Ñ Ñ‡Ñ‚ÐµÐ½Ð¸Ñ Ñ‚ÐµÐ»Ð° запроÑа клиента в SSL Ñоединении
- мог произойти таймаут.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.18 09.02.2005
-
- *) Изменение: Ð´Ð»Ñ ÑовмеÑтимоÑти Ñ Solaris 10 в директивах devpoll_events
- и devpoll_changes Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾ умолчанию уменьшены Ñ 512 до 32.
-
- *) ИÑправление: директивы proxy_set_x_var и fastcgi_set_var не
- наÑледовалиÑÑŒ.
-
- *) ИÑправление: в директиве rewrite, возвращающей редирект, аргументы
- приÑоединÑлиÑÑŒ к URI через Ñимвол "&" вмеÑто "?".
-
- *) ИÑправление: Ñтроки Ð´Ð»Ñ Ð¼Ð¾Ð´ÑƒÐ»Ñ ngx_http_geo_module без Ñимвола ";" во
- включённом файле игнорировалиÑÑŒ.
-
- *) Добавление: модуль ngx_http_stub_status_module.
-
- *) ИÑправление: неизвеÑтный формат лог-файла в директиве access_log
- вызывал segmentation fault.
-
- *) Добавление: новый параметр document_root в директиве fastcgi_params.
-
- *) Добавление: директива fastcgi_redirect_errors.
-
- *) Добавление: новый модификатор break в директиве rewrite позволÑет
- прекратить цикл rewrite/location и уÑтанавливает текущую конфигурацию
- Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñа.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.17 03.02.2005
-
- *) Изменение: модуль ngx_http_rewrite_module полноÑтью перепиÑан. Теперь
- можно делать редиректы, возвращать коды ошибок и проверÑÑ‚ÑŒ переменные
- и рефереры. Эти директивы можно иÑпользовать внутри location.
- Директива redirect упразднена.
-
- *) Добавление: модуль ngx_http_geo_module.
-
- *) Добавление: директивы proxy_set_x_var и fastcgi_set_var.
-
- *) ИÑправление: ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ location Ñ Ð¼Ð¾Ð´Ð¸Ñ„Ð¸ÐºÐ°Ñ‚Ð¾Ñ€Ð¾Ð¼ "=" могла
- иÑпользоватьÑÑ Ð² другом location.
-
- *) ИÑправление: правильный тип ответа выÑтавлÑлÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ Ð´Ð»Ñ Ð·Ð°Ð¿Ñ€Ð¾Ñов, у
- которых в раÑширении были только маленькие буквы.
-
- *) ИÑправление: еÑли Ð´Ð»Ñ location уÑтановлен proxy_pass или
- fastcgi_pass, и доÑтуп к нему запрещалÑÑ, а ошибка перенаправлÑлаÑÑŒ
- на ÑтатичеÑкую Ñтраницу, то проиÑходил segmentation fault.
-
- *) ИÑправление: еÑли в прокÑированном ответе в заголовке "Location"
- передавалÑÑ Ð¾Ñ‚Ð½Ð¾Ñительный URL, то к нему добавлÑлоÑÑŒ Ð¸Ð¼Ñ Ñ…Ð¾Ñта и
- ÑлÑш; ошибка поÑвилаÑÑŒ в 0.1.14.
-
- *) ИÑправление: на Linux в лог не запиÑывалÑÑ Ñ‚ÐµÐºÑÑ‚ ÑиÑтемной ошибки.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.16 25.01.2005
-
- *) ИÑправление: еÑли ответ передавалÑÑ chunk'ами, то при запроÑе HEAD
- выдавалÑÑ Ð·Ð°Ð²ÐµÑ€ÑˆÐ°ÑŽÑ‰Ð¸Ð¹ chunk.
-
- *) ИÑправление: заголовок "Connection: keep-alive" выдавалÑÑ, даже еÑли
- директива keepalive_timeout запрещала иÑпользование keep-alive.
-
- *) ИÑправление: ошибки в модуле ngx_http_fastcgi_module вызывали
- segmentation fault.
-
- *) ИÑправление: при иÑпользовании SSL Ñжатый ответ мог передаватьÑÑ Ð½Ðµ
- до конца.
-
- *) ИÑправление: опции TCP_NODELAY, TCP_NOPUSH и TCP_CORK, Ñпецифичные
- Ð´Ð»Ñ TCP Ñокетов, не иÑпользуютÑÑ Ð´Ð»Ñ unix domain Ñокетов.
-
- *) Добавление: директива rewrite поддерживает перезапиÑывание
- аргументов.
-
- *) ИÑправление: на Ð·Ð°Ð¿Ñ€Ð¾Ñ POST Ñ Ð·Ð°Ð³Ð¾Ð»Ð¾Ð²ÐºÐ¾Ð¼ "Content-Length: 0"
- возвращалÑÑ Ð¾Ñ‚Ð²ÐµÑ‚ 400; ошибка поÑвилаÑÑŒ в 0.1.14.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.15 19.01.2005
-
- *) ИÑправление: ошибка ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ FastCGI-Ñервером вызывала
- segmentation fault.
-
- *) ИÑправление: ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¾Ð±Ñ€Ð°Ð±Ð¾Ñ‚ÐºÐ° регулÑрного выражениÑ, в котором
- чиÑло выделенных чаÑтей не Ñовпадает Ñ Ñ‡Ð¸Ñлом подÑтановок.
-
- *) Добавление: location, который передаётÑÑ FastCGI-Ñерверу, может быть
- задан Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ регулÑрного выражениÑ.
-
- *) ИÑправление: параметр FastCGI REQUEST_URI теперь передаётÑÑ Ð²Ð¼ÐµÑте Ñ
- аргументами и в том виде, в котором был получен от клиента.
-
- *) ИÑправление: Ð´Ð»Ñ Ð¸ÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ñ€ÐµÐ³ÑƒÐ»Ñрных выражений в location нужно
- было Ñобирать nginx вмеÑте Ñ ngx_http_rewrite_module.
-
- *) ИÑправление: еÑли бÑкенд Ñлушал на 80-ом порту, то при иÑпользовании
- директивы "proxy_preserve_host on" в заголовке "Host" указывалÑÑ
- также порт 80; ошибка поÑвилаÑÑŒ в 0.1.14.
-
- *) ИÑправление: еÑли задать одинаковые пути в параметрах
- автоконфигурации --http-client-body-temp-path=PATH и
- --http-proxy-temp-path=PATH или --http-client-body-temp-path=PATH и
- --http-fastcgi-temp-path=PATH, то проиÑходил segmentation fault.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.14 18.01.2005
-
- *) Добавление: параметры автоконфигурации
- --http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH и
- --http-fastcgi-temp-path=PATH
-
- *) Изменение: Ð¸Ð¼Ñ ÐºÐ°Ñ‚Ð°Ð»Ð¾Ð³Ð° Ñ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð½Ñ‹Ð¼Ð¸ файлами, Ñодержащие тело запроÑа
- клиента, задаётÑÑ Ð´Ð¸Ñ€ÐµÐºÑ‚Ð¸Ð²Ð¾Ð¹ client_body_temp_path, по умолчанию
- <prefix>/client_body_temp.
-
- *) Добавление: модуль ngx_http_fastcgi_module и директивы fastcgi_pass,
- fastcgi_root, fastcgi_index, fastcgi_params, fastcgi_connect_timeout,
- fastcgi_send_timeout, fastcgi_read_timeout, fastcgi_send_lowat,
- fastcgi_header_buffer_size, fastcgi_buffers,
- fastcgi_busy_buffers_size, fastcgi_temp_path,
- fastcgi_max_temp_file_size, fastcgi_temp_file_write_size,
- fastcgi_next_upstream и fastcgi_x_powered_by.
-
- *) ИÑправление: ошибка "[alert] zero size buf"; ошибка поÑвилаÑÑŒ в
- 0.1.3.
-
- *) Изменение: в директиве proxy_pass нужно обÑзательно указывать URI
- поÑле имени хоÑта.
-
- *) Изменение: еÑли в URI вÑтречалÑÑ Ñимвол %3F, то он ÑчиталÑÑ Ð½Ð°Ñ‡Ð°Ð»Ð¾Ð¼
- Ñтроки аргументов.
-
- *) Добавление: поддержка unix domain Ñокетов в модуле
- ngx_http_proxy_module.
-
- *) Добавление: директивы ssl_engine и ssl_ciphers.
- СпаÑибо Сергею Скворцову за SSL-акÑелератор.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.13 21.12.2004
-
- *) Добавление: директивы server_names_hash и
- server_names_hash_threshold.
-
- *) ИÑправление: имена *.domain.tld в директиве server_name не работали.
-
- *) ИÑправление: параметр лога %request_length запиÑывал неверную длину.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.12 06.12.2004
-
- *) Добавление: параметр лога %request_length.
-
- *) ИÑправление: при иÑпользовании /dev/poll, select и poll на
- платформах, где возможны ложные ÑÑ€Ð°Ð±Ð°Ñ‚Ñ‹Ð²Ð°Ð½Ð¸Ñ ÑƒÐºÐ°Ð·Ð°Ð½Ð½Ñ‹Ñ… методов, могли
- быть длительные задержки при обработке запроÑа по keep-alive
- Ñоединению. ÐаблюдалоÑÑŒ по крайней мере на Solaris Ñ Ð¸Ñпользованием
- /dev/poll.
-
- *) ИÑправление: директива send_lowat игнорируетÑÑ Ð½Ð° Linux, так как
- Linux не поддерживает опцию SO_SNDLOWAT.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.11 02.12.2004
-
- *) Добавление: директива worker_priority.
-
- *) Изменение: под FreeBSD директивы tcp_nopush и tcp_nodelay вмеÑте
- влиÑÑŽÑ‚ на передачу ответа.
-
- *) ИÑправление: nginx не вызывал initgroups().
- СпаÑибо Ðндрею Ситникову и Ðндрею Ðигматулину.
-
- *) Изменение: ngx_http_auto_index_module теперь выдаёт размер файлов в
- байтах.
-
- *) ИÑправление: ngx_http_auto_index_module возвращал ошибку 500, еÑли в
- каталоге еÑÑ‚ÑŒ битый symlink.
-
- *) ИÑправление: файлы больше 4G не передавалиÑÑŒ Ñ Ð¸Ñпользованием
- sendfile.
-
- *) ИÑправление: еÑли бÑкенд резолвилÑÑ Ð² неÑколько адреÑов и при
- ожидании от него ответа проиÑходила ошибка, то процеÑÑ Ð·Ð°Ñ†Ð¸ÐºÐ»Ð¸Ð²Ð°Ð»ÑÑ.
-
- *) ИÑправление: при иÑпользовании метода /dev/poll рабочий процеÑÑ Ð¼Ð¾Ð³
- завершитьÑÑ Ñ Ñообщением "unknown cycle".
-
- *) ИÑправление: ошибки "close() channel failed".
-
- *) ИÑправление: автоматичеÑкое определение групп nobody и nogroup.
-
- *) ИÑправление: директива send_lowat не работала на Linux.
-
- *) ИÑправление: еÑли в конфигурации не было раздела events, то
- проиÑходил segmentation fault.
-
- *) ИÑправление: nginx не ÑобиралÑÑ Ð¿Ð¾Ð´ OpenBSD.
-
- *) ИÑправление: двойные ÑлÑшы в "://" в URI превращалиÑÑŒ в ":/".
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.10 26.11.2004
-
- *) ИÑправление: еÑли в запроÑе без аргументов еÑÑ‚ÑŒ "//", "/./", "/../"
- или "%XX", то терÑлÑÑ Ð¿Ð¾Ñледний Ñимвол в Ñтроке запроÑа; ошибка
- поÑвилаÑÑŒ в 0.1.9.
-
- *) ИÑправление: иÑправление в верÑии 0.1.9 Ð´Ð»Ñ Ñ„Ð°Ð¹Ð»Ð¾Ð² больше 2G на Linux
- не работало.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.9 25.11.2004
-
- *) ИÑправление: еÑли в запроÑе еÑÑ‚ÑŒ "//", "/./", "/../" или "%XX", то
- прокÑируемый Ð·Ð°Ð¿Ñ€Ð¾Ñ Ð¿ÐµÑ€ÐµÐ´Ð°Ð²Ð°Ð»ÑÑ Ð±ÐµÐ· аргументов.
-
- *) ИÑправление: при Ñжатии больших ответов иногда они передавалиÑÑŒ не
- полноÑтью.
-
- *) ИÑправление: не передавалиÑÑŒ файлы больше 2G на Linux,
- неподдерживающем sendfile64().
-
- *) ИÑправление: на Linux при конфигурации Ñборки нужно было обÑзательно
- иÑпользовать параметр --with-poll_module; ошибка поÑвилаÑÑŒ в 0.1.8.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.8 20.11.2004
-
- *) ИÑправление: ошибка в модуле ngx_http_autoindex_module при показе
- длинных имён файлов.
-
- *) Добавление: модификатор "^~" в директиве location.
-
- *) Добавление: директива proxy_max_temp_file_size.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.7 12.11.2004
-
- *) ИÑправление: при иÑпользовании sendfile, еÑли передаваемый файл
- менÑлÑÑ, то мог произойти segmentation fault на FreeBSD; ошибка
- поÑвилаÑÑŒ в 0.1.5.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.6 11.11.2004
-
- *) ИÑправление: при некоторых комбинациÑÑ… директив location c
- регулÑрными выражениÑми иÑпользовалаÑÑŒ ÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð°Ñ†Ð¸Ñ Ð½Ðµ из того
- location.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.5 11.11.2004
-
- *) ИÑправление: на Solaris и Linux могло быть очень много Ñообщений
- "recvmsg() returned not enough data".
-
- *) ИÑправление: в режиме прокÑи без иÑÐ¿Ð¾Ð»ÑŒÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ sendfile на Solaris
- возникала ошибка "writev() failed (22: Invalid argument)". Ðа других
- платформах, не поддерживающих sendfile, процеÑÑ Ð·Ð°Ñ†Ð¸ÐºÐ»Ð¸Ð²Ð°Ð»ÑÑ.
-
- *) ИÑправление: при иÑпользовании sendfile в режиме прокÑи на Solaris
- возникал segmentation fault.
-
- *) ИÑправление: segmentation fault на Solaris.
-
- *) ИÑправление: обновление иÑполнÑемого файла на лету не работало на
- Linux.
-
- *) ИÑправление: в ÑпиÑке файлов, выдаваемом модулем
- ngx_http_autoindex_module, не перекодировалиÑÑŒ пробелы, кавычки и
- знаки процента.
-
- *) Изменение: уменьшение операций копированиÑ.
-
- *) Добавление: директива userid_p3p.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.4 26.10.2004
-
- *) ИÑправление: ошибка в модуле ngx_http_autoindex_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.3 25.10.2004
-
- *) Добавление: модуль ngx_http_autoindex_module и директива autoindex.
-
- *) Добавление: директива proxy_set_x_url.
-
- *) ИÑправление: модуль прокÑировании мог привеÑти к зацикливанию, еÑли
- не иÑпользовалÑÑ sendfile.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.2 21.10.2004
-
- *) Добавление: параметры --user=USER, --group=GROUP и
- --with-ld-opt=OPTIONS в configure.
-
- *) Добавление: директива server_name поддерживает *.domain.tld.
-
- *) ИÑправление: улучшена переноÑимоÑÑ‚ÑŒ на неизвеÑтные платформы.
-
- *) ИÑправление: Ð½ÐµÐ»ÑŒÐ·Ñ Ð¿ÐµÑ€ÐµÐºÐ¾Ð½Ñ„Ð¸Ð³ÑƒÑ€Ð¸Ñ€Ð¾Ð²Ð°Ñ‚ÑŒ nginx, еÑли конфигурационный
- файл указан в командной Ñтроке; ошибка поÑвилаÑÑŒ в 0.1.1.
-
- *) ИÑправление: модуль прокÑировании мог привеÑти к зацикливанию, еÑли
- не иÑпользовалÑÑ sendfile.
-
- *) ИÑправление: при иÑпользовании sendfile текÑÑ‚ ответа не
- перекодировалÑÑ ÑоглаÑно директивам Ð¼Ð¾Ð´ÑƒÐ»Ñ charset; ошибка поÑвилаÑÑŒ
- в 0.1.1.
-
- *) ИÑправление: очень Ñ€ÐµÐ´ÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° при обработке kqueue.
-
- *) ИÑправление: модуль ÑÐ¶Ð°Ñ‚Ð¸Ñ Ñжимал уже Ñжатые ответы, полученные при
- прокÑировании.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.1 11.10.2004
-
- *) Добавление: директива gzip_types.
-
- *) Добавление: директива tcp_nodelay.
-
- *) Добавление: директива send_lowat работает не только на платформах,
- поддерживающих kqueue NOTE_LOWAT, но и на вÑех, поддерживающих
- SO_SNDLOWAT.
-
- *) Добавление: ÑмулÑÑ†Ð¸Ñ setproctitle() Ð´Ð»Ñ Linux и Solaris.
-
- *) ИÑправление: ошибка при перепиÑывании заголовка "Location" при
- прокÑировании.
-
- *) ИÑправление: ошибка в модуле ngx_http_chunked_module, Ð¿Ñ€Ð¸Ð²Ð¾Ð´Ð¸Ð²ÑˆÐ°Ñ Ðº
- зацикливанию.
-
- *) ИÑправление: ошибки в модуле /dev/poll.
-
- *) ИÑправление: при прокÑировании и иÑпользовании временных файлов
- ответы портилиÑÑŒ.
-
- *) ИÑправление: бÑкенду передавалиÑÑŒ запроÑÑ‹ Ñ Ð½ÐµÐ¿ÐµÑ€ÐµÐºÐ¾Ð´Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð½Ñ‹Ð¼Ð¸
- Ñимволами.
-
- *) ИÑправление: на Linux 2.4 при конфигурации Ñборки нужно было
- обÑзательно иÑпользовать параметр --with-poll_module.
-
-
-Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² nginx 0.1.0 04.10.2004
-
- *) ÐŸÐµÑ€Ð²Ð°Ñ Ð¿ÑƒÐ±Ð»Ð¸Ñ‡Ð½Ð¾ доÑÑ‚ÑƒÐ¿Ð½Ð°Ñ Ð²ÐµÑ€ÑиÑ.
-
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/LICENSE b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/LICENSE
deleted file mode 100644
index 4ed7a6fc7c6..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/LICENSE
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2002-2014 Igor Sysoev
- * Copyright (C) 2011-2014 Nginx, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/README b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/README
deleted file mode 100644
index 2f68e14e0d8..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/README
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Documentation is available at http://nginx.org
-
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/acc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/acc
deleted file mode 100644
index 6baee672ad4..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/acc
+++ /dev/null
@@ -1,15 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-# aCC: HP ANSI C++ B3910B A.03.55.02
-
-# C89 mode
-
-CFLAGS="$CFLAGS -Ae"
-CC_TEST_FLAGS="-Ae"
-
-PCRE_OPT="$PCRE_OPT -Ae"
-ZLIB_OPT="$ZLIB_OPT -Ae"
-MD5_OPT="$MD5_OPT -Ae"
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/bcc
deleted file mode 100644
index ec82e60fb13..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/bcc
+++ /dev/null
@@ -1,72 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-# Borland C++ 5.5
-
-# optimizations
-
-# maximize speed
-CFLAGS="$CFLAGS -O2"
-
-case $CPU in
- pentium)
- # optimize for Pentium and Athlon
- CPU_OPT="-5"
- ;;
-
- pentiumpro)
- # optimize for Pentium Pro, Pentium II and Pentium III
- CPU_OPT="-6"
- ;;
-esac
-
-# __stdcall
-#CPU_OPT="$CPU_OPT -ps"
-# __fastcall
-#CPU_OPT="$CPU_OPT -pr"
-
-CFLAGS="$CFLAGS $CPU_OPT"
-
-# multithreaded
-CFLAGS="$CFLAGS -tWM"
-
-# stop on warning
-CFLAGS="$CFLAGS -w!"
-
-# disable logo
-CFLAGS="$CFLAGS -q"
-
-
-# precompiled headers
-CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.csm"
-NGX_PCH="$NGX_OBJS/ngx_config.csm"
-NGX_BUILD_PCH="-H=$NGX_OBJS/ngx_config.csm"
-NGX_USE_PCH="-Hu -H=$NGX_OBJS/ngx_config.csm"
-
-
-# Win32 GUI mode application
-#LINK="\$(CC) -laa"
-
-
-# the resource file
-NGX_RES="$NGX_OBJS/nginx.res"
-NGX_RCC="brcc32 -fo$NGX_OBJS/nginx.res \$(CORE_INCS) $NGX_WIN32_RC"
-# the pragma allows to link the resource file using bcc32 and
-# to avoid the direct ilink32 calling and the c0w32.obj's WinMain/main problem
-NGX_PRAGMA="#pragma resource \"$NGX_OBJS/nginx.res\""
-
-
-ngx_include_opt="-I"
-ngx_objout="-o"
-ngx_binout="-e"
-ngx_objext="obj"
-ngx_binext=".exe"
-
-ngx_long_start='@&&|
- '
-ngx_long_end='|'
-
-ngx_regex_dirsep='\\'
-ngx_dirsep="\\"
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/ccc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/ccc
deleted file mode 100644
index c964045105d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/ccc
+++ /dev/null
@@ -1,46 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-# Compaq C V6.5-207
-
-ngx_include_opt="-I"
-
-# warnings
-
-CFLAGS="$CFLAGS -msg_enable level6 -msg_fatal level6"
-
-CFLAGS="$CFLAGS -msg_disable unknownmacro"
-CFLAGS="$CFLAGS -msg_disable unusedincl"
-CFLAGS="$CFLAGS -msg_disable unnecincl"
-CFLAGS="$CFLAGS -msg_disable nestincl"
-CFLAGS="$CFLAGS -msg_disable strctpadding"
-CFLAGS="$CFLAGS -msg_disable ansialiascast"
-CFLAGS="$CFLAGS -msg_disable inlinestoclsmod"
-CFLAGS="$CFLAGS -msg_disable cxxkeyword"
-CFLAGS="$CFLAGS -msg_disable longlongsufx"
-CFLAGS="$CFLAGS -msg_disable valuepres"
-
-# STUB
-CFLAGS="$CFLAGS -msg_disable truncintcast"
-CFLAGS="$CFLAGS -msg_disable trunclongcast"
-
-CFLAGS="$CFLAGS -msg_disable truncintasn"
-CFLAGS="$CFLAGS -msg_disable trunclongint"
-CFLAGS="$CFLAGS -msg_disable intconcastsgn"
-CFLAGS="$CFLAGS -msg_disable intconstsign"
-CFLAGS="$CFLAGS -msg_disable switchlong"
-CFLAGS="$CFLAGS -msg_disable subscrbounds2"
-
-CFLAGS="$CFLAGS -msg_disable hexoctunsign"
-
-CFLAGS="$CFLAGS -msg_disable ignorecallval"
-CFLAGS="$CFLAGS -msg_disable nonstandcast"
-CFLAGS="$CFLAGS -msg_disable embedcomment"
-CFLAGS="$CFLAGS -msg_disable unreachcode"
-CFLAGS="$CFLAGS -msg_disable questcompare2"
-CFLAGS="$CFLAGS -msg_disable unusedtop"
-CFLAGS="$CFLAGS -msg_disable unrefdecl"
-
-CFLAGS="$CFLAGS -msg_disable bitnotint"
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/clang b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/clang
deleted file mode 100644
index 25707b42db2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/clang
+++ /dev/null
@@ -1,104 +0,0 @@
-
-# Copyright (C) Nginx, Inc.
-
-
-# clang
-
-
-NGX_CLANG_VER=`$CC -v 2>&1 | grep '\(clang\|LLVM\) version' 2>&1 \
- | sed -e 's/^.* version \(.*\)/\1/'`
-
-echo " + clang version: $NGX_CLANG_VER"
-
-have=NGX_COMPILER value="\"clang $NGX_CLANG_VER\"" . auto/define
-
-
-CC_TEST_FLAGS="-pipe"
-
-
-# optimizations
-
-#NGX_CLANG_OPT="-O2"
-#NGX_CLANG_OPT="-Oz"
-NGX_CLANG_OPT="-O"
-
-case $CPU in
- pentium)
- # optimize for Pentium
- CPU_OPT="-march=pentium"
- NGX_CPU_CACHE_LINE=32
- ;;
-
- pentiumpro | pentium3)
- # optimize for Pentium Pro, Pentium II and Pentium III
- CPU_OPT="-march=pentiumpro"
- NGX_CPU_CACHE_LINE=32
- ;;
-
- pentium4)
- # optimize for Pentium 4
- CPU_OPT="-march=pentium4"
- NGX_CPU_CACHE_LINE=128
- ;;
-
- athlon)
- # optimize for Athlon
- CPU_OPT="-march=athlon"
- NGX_CPU_CACHE_LINE=64
- ;;
-
- opteron)
- # optimize for Opteron
- CPU_OPT="-march=opteron"
- NGX_CPU_CACHE_LINE=64
- ;;
-
-esac
-
-CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
-
-
-CFLAGS="$CFLAGS -pipe $CPU_OPT"
-
-if [ ".$PCRE_OPT" = "." ]; then
- PCRE_OPT="-O2 -pipe $CPU_OPT"
-else
- PCRE_OPT="$PCRE_OPT -pipe"
-fi
-
-if [ ".$MD5_OPT" = "." ]; then
- MD5_OPT="-O2 -pipe $CPU_OPT"
-else
- MD5_OPT="$MD5_OPT -pipe"
-fi
-
-if [ ".$ZLIB_OPT" = "." ]; then
- ZLIB_OPT="-O2 -pipe $CPU_OPT"
-else
- ZLIB_OPT="$ZLIB_OPT -pipe"
-fi
-
-
-# warnings
-
-CFLAGS="$CFLAGS $NGX_CLANG_OPT -Wall -Wextra -Wpointer-arith"
-CFLAGS="$CFLAGS -Wconditional-uninitialized"
-#CFLAGS="$CFLAGS -Wmissing-prototypes"
-
-# we have a lot of unused function arguments
-CFLAGS="$CFLAGS -Wno-unused-parameter"
-
-# deprecated system OpenSSL library on OS X
-if [ "$NGX_SYSTEM" = "Darwin" ]; then
- CFLAGS="$CFLAGS -Wno-deprecated-declarations"
-fi
-
-# stop on warning
-CFLAGS="$CFLAGS -Werror"
-
-# debug
-CFLAGS="$CFLAGS -g"
-
-if [ ".$CPP" = "." ]; then
- CPP="$CC -E"
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/conf
deleted file mode 100644
index edc6d74ddfa..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/conf
+++ /dev/null
@@ -1,218 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-LINK="\$(CC)"
-
-ngx_include_opt="-I "
-ngx_compile_opt="-c"
-ngx_objout="-o "
-ngx_binout="-o "
-ngx_objext="o"
-ngx_binext=
-
-ngx_long_start=
-ngx_long_end=
-
-ngx_regex_dirsep="\/"
-ngx_dirsep='/'
-
-ngx_regex_cont=' \\\
- '
-ngx_cont=' \
- '
-ngx_tab=' \
- '
-ngx_spacer=
-
-ngx_long_regex_cont=$ngx_regex_cont
-ngx_long_cont=$ngx_cont
-
-. auto/cc/name
-
-if test -n "$CFLAGS"; then
-
- CC_TEST_FLAGS="$CFLAGS $NGX_CC_OPT"
-
- case $NGX_CC_NAME in
-
- ccc)
- # Compaq C V6.5-207
-
- ngx_include_opt="-I"
- ;;
-
- sunc)
-
- case "$NGX_MACHINE" in
-
- i86pc)
- NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
- ;;
-
- sun4u | sun4v)
- NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
- ;;
-
- esac
-
- case $CPU in
-
- amd64)
- NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
- ;;
-
- esac
- ;;
-
- esac
-
-else
-
- case $NGX_CC_NAME in
- gcc)
- # gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
- # 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
- # 4.0.0, 4.0.1, 4.1.0
-
- . auto/cc/gcc
- ;;
-
- clang)
- # Clang C compiler
-
- . auto/cc/clang
- ;;
-
- icc)
- # Intel C++ compiler 7.1, 8.0, 8.1
-
- . auto/cc/icc
- ;;
-
- sunc)
- # Sun C 5.7 Patch 117837-04 2005/05/11
-
- . auto/cc/sunc
- ;;
-
- ccc)
- # Compaq C V6.5-207
-
- . auto/cc/ccc
- ;;
-
- acc)
- # aCC: HP ANSI C++ B3910B A.03.55.02
-
- . auto/cc/acc
- ;;
-
- msvc*)
- # MSVC++ 6.0 SP2, MSVC++ Toolkit 2003
-
- . auto/cc/msvc
- ;;
-
- owc)
- # Open Watcom C 1.0, 1.2
-
- . auto/cc/owc
- ;;
-
- bcc)
- # Borland C++ 5.5
-
- . auto/cc/bcc
- ;;
-
- esac
-
- CC_TEST_FLAGS="$CC_TEST_FLAGS $NGX_CC_OPT"
-
-fi
-
-CFLAGS="$CFLAGS $NGX_CC_OPT"
-NGX_TEST_LD_OPT="$NGX_LD_OPT"
-
-if [ "$NGX_PLATFORM" != win32 ]; then
-
- if test -n "$NGX_LD_OPT"; then
- ngx_feature=--with-ld-opt=\"$NGX_LD_OPT\"
- ngx_feature_name=
- ngx_feature_run=no
- ngx_feature_incs=
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test=
- . auto/feature
-
- if [ $ngx_found = no ]; then
- echo $0: error: the invalid value in --with-ld-opt=\"$NGX_LD_OPT\"
- echo
- exit 1
- fi
- fi
-
-
- ngx_feature="gcc builtin atomic operations"
- ngx_feature_name=NGX_HAVE_GCC_ATOMIC
- ngx_feature_run=yes
- ngx_feature_incs=
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="long n = 0;
- if (!__sync_bool_compare_and_swap(&n, 0, 1))
- return 1;
- if (__sync_fetch_and_add(&n, 1) != 1)
- return 1;
- if (n != 2)
- return 1;
- __sync_synchronize();"
- . auto/feature
-
-
- if [ "$NGX_CC_NAME" = "ccc" ]; then
- echo "checking for C99 variadic macros ... disabled"
- else
- ngx_feature="C99 variadic macros"
- ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS"
- ngx_feature_run=yes
- ngx_feature_incs="#include <stdio.h>
-#define var(dummy, ...) sprintf(__VA_ARGS__)"
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="char buf[30]; buf[0] = '0';
- var(0, buf, \"%d\", 1);
- if (buf[0] != '1') return 1"
- . auto/feature
- fi
-
-
- ngx_feature="gcc variadic macros"
- ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS"
- ngx_feature_run=yes
- ngx_feature_incs="#include <stdio.h>
-#define var(dummy, args...) sprintf(args)"
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="char buf[30]; buf[0] = '0';
- var(0, buf, \"%d\", 1);
- if (buf[0] != '1') return 1"
- . auto/feature
-
-
-# ngx_feature="inline"
-# ngx_feature_name=
-# ngx_feature_run=no
-# ngx_feature_incs="int inline f(void) { return 1 }"
-# ngx_feature_path=
-# ngx_feature_libs=
-# ngx_feature_test=
-# . auto/feature
-#
-# if [ $ngx_found = yes ]; then
-# fi
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/gcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/gcc
deleted file mode 100644
index 727f11e1dfc..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/gcc
+++ /dev/null
@@ -1,186 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2
-# 3.0.4, 3.1.1, 3.2.3, 3.3.2, 3.3.3, 3.3.4, 3.4.0, 3.4.2
-# 4.0.0, 4.0.1, 4.1.0
-
-
-NGX_GCC_VER=`$CC -v 2>&1 | grep 'gcc version' 2>&1 \
- | sed -e 's/^.* version \(.*\)/\1/'`
-
-echo " + gcc version: $NGX_GCC_VER"
-
-have=NGX_COMPILER value="\"gcc $NGX_GCC_VER\"" . auto/define
-
-
-# Solaris 7's /usr/ccs/bin/as does not support "-pipe"
-
-CC_TEST_FLAGS="-pipe"
-
-ngx_feature="gcc -pipe switch"
-ngx_feature_name=
-ngx_feature_run=no
-ngx_feature_incs=
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test=
-. auto/feature
-
-CC_TEST_FLAGS=
-
-if [ $ngx_found = yes ]; then
- PIPE="-pipe"
-fi
-
-
-case "$NGX_MACHINE" in
-
- sun4u | sun4v | sparc | sparc64 )
- # "-mcpu=v9" enables the "casa" assembler instruction
- CFLAGS="$CFLAGS -mcpu=v9"
- ;;
-
-esac
-
-
-# optimizations
-
-#NGX_GCC_OPT="-O2"
-#NGX_GCC_OPT="-Os"
-NGX_GCC_OPT="-O"
-
-#CFLAGS="$CFLAGS -fomit-frame-pointer"
-
-case $CPU in
- pentium)
- # optimize for Pentium and Athlon
- CPU_OPT="-march=pentium"
- NGX_CPU_CACHE_LINE=32
- ;;
-
- pentiumpro | pentium3)
- # optimize for Pentium Pro, Pentium II and Pentium III
- CPU_OPT="-march=pentiumpro"
- NGX_CPU_CACHE_LINE=32
- ;;
-
- pentium4)
- # optimize for Pentium 4, gcc 3.x
- CPU_OPT="-march=pentium4"
- NGX_CPU_CACHE_LINE=128
- ;;
-
- athlon)
- # optimize for Athlon, gcc 3.x
- CPU_OPT="-march=athlon"
- NGX_CPU_CACHE_LINE=64
- ;;
-
- opteron)
- # optimize for Opteron, gcc 3.x
- CPU_OPT="-march=opteron"
- NGX_CPU_CACHE_LINE=64
- ;;
-
- sparc32)
- # build 32-bit UltraSparc binary
- CPU_OPT="-m32"
- CORE_LINK="$CORE_LINK -m32"
- NGX_CPU_CACHE_LINE=64
- ;;
-
- sparc64)
- # build 64-bit UltraSparc binary
- CPU_OPT="-m64"
- CORE_LINK="$CORE_LINK -m64"
- NGX_CPU_CACHE_LINE=64
- ;;
-
- ppc64)
- # build 64-bit PowerPC binary
- CPU_OPT="-m64"
- CPU_OPT="$CPU_OPT -falign-functions=32 -falign-labels=32"
- CPU_OPT="$CPU_OPT -falign-loops=32 -falign-jumps=32"
- CORE_LINK="$CORE_LINK -m64"
- NGX_CPU_CACHE_LINE=128
- ;;
-
-esac
-
-CC_AUX_FLAGS="$CC_AUX_FLAGS $CPU_OPT"
-
-case "$NGX_GCC_VER" in
- 2.7*)
- # batch build
- CPU_OPT=
- ;;
-esac
-
-
-CFLAGS="$CFLAGS $PIPE $CPU_OPT"
-
-if [ ".$PCRE_OPT" = "." ]; then
- PCRE_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
-else
- PCRE_OPT="$PCRE_OPT $PIPE"
-fi
-
-if [ ".$MD5_OPT" = "." ]; then
- MD5_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
-else
- MD5_OPT="$MD5_OPT $PIPE"
-fi
-
-if [ ".$ZLIB_OPT" = "." ]; then
- ZLIB_OPT="-O2 -fomit-frame-pointer $PIPE $CPU_OPT"
-else
- ZLIB_OPT="$ZLIB_OPT $PIPE"
-fi
-
-
-# warnings
-
-# -W requires at least -O
-CFLAGS="$CFLAGS ${NGX_GCC_OPT:--O} -W"
-
-CFLAGS="$CFLAGS -Wall -Wpointer-arith"
-#CFLAGS="$CFLAGS -Wconversion"
-#CFLAGS="$CFLAGS -Winline"
-#CFLAGS="$CFLAGS -Wmissing-prototypes"
-
-
-case "$NGX_GCC_VER" in
- 3.* | 4.* )
- # we have a lot of the unused function arguments
- CFLAGS="$CFLAGS -Wno-unused-parameter"
- # 4.2.1 shows the warning in wrong places
- #CFLAGS="$CFLAGS -Wunreachable-code"
-
- # deprecated system OpenSSL library on OS X
- if [ "$NGX_SYSTEM" = "Darwin" ]; then
- CFLAGS="$CFLAGS -Wno-deprecated-declarations"
- fi
- ;;
-
- *)
- # we have a lot of the unused function arguments
- CFLAGS="$CFLAGS -Wno-unused"
- ;;
-esac
-
-
-# stop on warning
-CFLAGS="$CFLAGS -Werror"
-
-# debug
-CFLAGS="$CFLAGS -g"
-
-# DragonFly's gcc3 generates DWARF
-#CFLAGS="$CFLAGS -g -gstabs"
-
-if [ ".$CPP" = "." ]; then
- CPP="$CC -E"
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/icc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/icc
deleted file mode 100644
index 1d83ed37a03..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/icc
+++ /dev/null
@@ -1,121 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-# Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1
-
-NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
- | sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
-
-echo " + icc version: $NGX_ICC_VER"
-
-have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
-
-
-# optimizations
-
-CFLAGS="$CFLAGS -O"
-
-CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
-
-
-case $CPU in
- pentium)
- # optimize for Pentium and Athlon
- CPU_OPT="-march=pentium"
- ;;
-
- pentiumpro)
- # optimize for Pentium Pro, Pentium II and Pentium III
- CPU_OPT="-mcpu=pentiumpro -march=pentiumpro"
- ;;
-
- pentium4)
- # optimize for Pentium 4, default
- CPU_OPT="-march=pentium4"
- ;;
-esac
-
-CFLAGS="$CFLAGS $CPU_OPT"
-
-if [ ".$PCRE_OPT" = "." ]; then
- PCRE_OPT="-O $CPU_OPT"
-fi
-
-if [ ".$MD5_OPT" = "." ]; then
- MD5_OPT="-O $CPU_OPT"
-fi
-
-if [ ".$ZLIB_OPT" = "." ]; then
- ZLIB_OPT="-O $CPU_OPT"
-fi
-
-
-# warnings
-
-CFLAGS="$CFLAGS -w2"
-
-# disable some warnings
-
-# invalid type conversion: "int" to "char *"
-CFLAGS="$CFLAGS -wd171"
-# argument is incompatible with corresponding format string conversion
-CFLAGS="$CFLAGS -wd181"
-# zero used for undefined preprocessing identifier
-CFLAGS="$CFLAGS -wd193"
-# the format string ends before this argument
-CFLAGS="$CFLAGS -wd268"
-# invalid format string conversion
-CFLAGS="$CFLAGS -wd269"
-# conversion from "long long" to "size_t" may lose significant bits
-CFLAGS="$CFLAGS -wd810"
-# parameter was never referenced
-CFLAGS="$CFLAGS -wd869"
-# attribute "unused" is only allowed in a function definition, warning on pTHX_
-CFLAGS="$CFLAGS -wd1301"
-
-# STUB
-# enumerated type mixed with another type
-CFLAGS="$CFLAGS -wd188"
-# controlling expression is constant
-CFLAGS="$CFLAGS -wd279"
-# operands are evaluated in unspecified order
-CFLAGS="$CFLAGS -wd981"
-# external definition with no prior declaration
-CFLAGS="$CFLAGS -wd1418"
-# external declaration in primary source file
-CFLAGS="$CFLAGS -wd1419"
-
-case "$NGX_ICC_VER" in
- 9.*)
- # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
- CFLAGS="$CFLAGS -wd1469"
- # explicit conversion of a 64-bit integral type to a smaller
- # integral type
- CFLAGS="$CFLAGS -wd1683"
- # conversion from pointer to same-sized integral type,
- # warning on offsetof()
- CFLAGS="$CFLAGS -wd1684"
- # floating-point equality and inequality comparisons are unreliable,
- # warning on SvTRUE()
- CFLAGS="$CFLAGS -wd1572"
- ;;
-
- 8.*)
- # "cc" clobber ignored, warnings for Liunx's htonl()/htons()
- CFLAGS="$CFLAGS -wd1469"
- # floating-point equality and inequality comparisons are unreliable,
- # warning on SvTRUE()
- CFLAGS="$CFLAGS -wd1572"
- ;;
-
- *)
- ;;
-esac
-
-# stop on warning
-CFLAGS="$CFLAGS -Werror"
-
-# debug
-CFLAGS="$CFLAGS -g"
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/msvc
deleted file mode 100644
index 393ba321499..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/msvc
+++ /dev/null
@@ -1,136 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-# MSVC 6.0 SP2
-# MSVC Toolkit 2003 (7.1)
-# MSVC 2005 Express Edition SP1 (8.0)
-
-# optimizations
-
-# maximize speed, equivalent to -Og -Oi -Ot -Oy -Ob2 -Gs -GF -Gy
-CFLAGS="$CFLAGS -O2"
-
-# enable global optimization
-#CFLAGS="$CFLAGS -Og"
-# enable intrinsic functions
-#CFLAGS="$CFLAGS -Oi"
-
-# disable inline expansion
-#CFLAGS="$CFLAGS -Ob0"
-# explicit inline expansion
-#CFLAGS="$CFLAGS -Ob1"
-# explicit and implicit inline expansion
-#CFLAGS="$CFLAGS -Ob2"
-
-# enable frame pointer omission
-#CFLAGS="$CFLAGS -Oy"
-# disable stack checking calls
-#CFLAGS="$CFLAGS -Gs"
-
-# pools strings as read/write
-#CFLAGS="$CFLAGS -Gf"
-# pools strings as read-only
-#CFLAGS="$CFLAGS -GF"
-
-
-case $CPU in
- pentium)
- # optimize for Pentium and Athlon
- CPU_OPT="-G5"
- ;;
-
- pentiumpro)
- # optimize for Pentium Pro, Pentium II and Pentium III
- CPU_OPT="-G6"
- ;;
-
- pentium4)
- # optimize for Pentium 4, MSVC 7
- CPU_OPT="-G7"
- ;;
-esac
-
-# __cdecl, default, must be used with OpenSSL, md5 asm, and sha1 asm
-#CPU_OPT="$CPU_OPT -Gd"
-# __stdcall
-#CPU_OPT="$CPU_OPT -Gz"
-# __fastcall
-#CPU_OPT="$CPU_OPT -Gr"
-
-
-CFLAGS="$CFLAGS $CPU_OPT"
-
-
-# warnings
-
-CFLAGS="$CFLAGS -W4"
-
-# stop on warning
-CFLAGS="$CFLAGS -WX"
-
-# disable logo
-CFLAGS="$CFLAGS -nologo"
-
-# the link flags
-CORE_LINK="$CORE_LINK -link -verbose:lib"
-
-# link with libcmt.lib, multithreaded
-LIBC="-MT"
-# link with msvcrt.dll
-# however, MSVC Toolkit 2003 has no MSVCRT.LIB
-#LIBC="-MD"
-
-CFLAGS="$CFLAGS $LIBC"
-
-CORE_LIBS="$CORE_LIBS kernel32.lib user32.lib"
-
-# Win32 GUI mode application
-#CORE_LINK="$CORE_LINK -subsystem:windows -entry:mainCRTStartup"
-
-# debug
-# msvc8 under Wine issues
-# Program database manager mismatch; please check your installation
-if [ $NGX_CC_NAME != msvc8 ]; then
- CFLAGS="$CFLAGS -Zi"
- CORE_LINK="$CORE_LINK -debug"
-fi
-
-
-# MSVC 2005 supports C99 variadic macros
-if [ $NGX_CC_NAME = msvc8 ]; then
- have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
-fi
-
-
-# precompiled headers
-CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
-CORE_LINK="$CORE_LINK $NGX_OBJS/ngx_pch.obj"
-NGX_PCH="$NGX_OBJS/ngx_config.pch"
-NGX_BUILD_PCH="-Ycngx_config.h -Fp$NGX_OBJS/ngx_config.pch"
-NGX_USE_PCH="-Yungx_config.h -Fp$NGX_OBJS/ngx_config.pch"
-
-
-# the resource file
-NGX_RES="$NGX_OBJS/nginx.res"
-NGX_RCC="rc -fo$NGX_RES \$(CORE_INCS) $NGX_WIN32_RC"
-CORE_LINK="$NGX_RES $CORE_LINK"
-
-
-ngx_objout="-Fo"
-ngx_binout="-Fe"
-ngx_objext="obj"
-ngx_binext=".exe"
-
-ngx_long_start='@<<
- '
-ngx_long_end='<<'
-ngx_long_regex_cont=' \
- '
-ngx_long_cont='
- '
-
-# MSVC understand / in path
-#ngx_regex_dirsep='\\'
-#ngx_dirsep="\\"
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/name b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/name
deleted file mode 100644
index 51a7ed92e1d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/name
+++ /dev/null
@@ -1,89 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ "$NGX_PLATFORM" != win32 ]; then
-
- ngx_feature="C compiler"
- ngx_feature_name=
- ngx_feature_run=yes
- ngx_feature_incs=
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test=
- . auto/feature
-
- if [ $ngx_found = no ]; then
- echo
- echo $0: error: C compiler $CC is not found
- echo
- exit 1
- fi
-
-fi
-
-
-if [ "$CC" = cl ]; then
- if `$NGX_WINE $CC -v 2>&1 \
- | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16' \
- >/dev/null 2>&1`; then
-
- NGX_CC_NAME=msvc10
- echo " + using Microsoft Visual C++ 10 compiler"
-
- elif `$NGX_WINE $CC -v 2>&1 \
- | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14' \
- >/dev/null 2>&1`; then
-
- NGX_CC_NAME=msvc8
- echo " + using Microsoft Visual C++ 8 compiler"
-
- elif `$NGX_WINE $CC -v 2>&1 \
- | grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13' \
- >/dev/null 2>&1`; then
-
- NGX_CC_NAME=msvc7
- echo " + using Microsoft Visual C++ 7 compiler"
-
- else
- NGX_CC_NAME=msvc
- echo " + using Microsoft Visual C++ compiler"
- fi
-
-elif [ "$CC" = wcl386 ]; then
- NGX_CC_NAME=owc
- echo " + using Open Watcom C compiler"
-
-elif [ "$CC" = bcc32 ]; then
- NGX_CC_NAME=bcc
- echo " + using Borland C++ compiler"
-
-elif `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
- NGX_CC_NAME=icc
- echo " + using Intel C++ compiler"
-
-elif `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
- NGX_CC_NAME=gcc
- echo " + using GNU C compiler"
-
-elif `$CC -v 2>&1 | grep '\(clang\|LLVM\) version' >/dev/null 2>&1`; then
- NGX_CC_NAME=clang
- echo " + using Clang C compiler"
-
-elif `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
- NGX_CC_NAME=sunc
- echo " + using Sun C compiler"
-
-elif `$CC -V 2>&1 | grep '^Compaq C' >/dev/null 2>&1`; then
- NGX_CC_NAME=ccc
- echo " + using Compaq C compiler"
-
-elif `$CC -V 2>&1 | grep '^aCC: ' >/dev/null 2>&1`; then
- NGX_CC_NAME=acc
- echo " + using HP aC++ compiler"
-
-else
- NGX_CC_NAME=unknown
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/owc
deleted file mode 100644
index a063aa34121..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/owc
+++ /dev/null
@@ -1,104 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-# Open Watcom C 1.0, 1.2, 1.3
-
-# optimizations
-
-# maximize speed
-CFLAGS="$CFLAGS -ot"
-# reorder instructions for best pipeline usage
-CFLAGS="$CFLAGS -op"
-# inline intrinsic functions
-CFLAGS="$CFLAGS -oi"
-# inline expansion
-CFLAGS="$CFLAGS -oe"
-# disable stack checking calls
-CFLAGS="$CFLAGS -s"
-
-case $CPU in
- pentium)
- # optimize for Pentium and Athlon
- # register-based arguments passing conventions
- CPU_OPT="-5r"
- # stack-based arguments passing conventions
- #CPU_OPT="-5s"
- ;;
-
- pentiumpro)
- # optimize for Pentium Pro, Pentium II and Pentium III
- # register-based arguments passing conventions
- CPU_OPT="-6r"
- # stack-based arguments passing conventions
- #CPU_OPT="-6s"
- ;;
-esac
-
-CFLAGS="$CFLAGS $CPU_OPT"
-
-
-# warnings
-
-# maximum level
-CFLAGS="$CFLAGS -wx"
-#CFLAGS="$CFLAGS -w3"
-
-# stop on warning
-CFLAGS="$CFLAGS -we"
-
-# built target is NT
-CFLAGS="$CFLAGS -bt=nt"
-
-# multithreaded
-CFLAGS="$CFLAGS -bm"
-
-# debug
-CFLAGS="$CFLAGS -d2"
-
-# quiet
-CFLAGS="$CFLAGS -zq"
-
-# Open Watcom C 1.2
-have=NGX_HAVE_C99_VARIADIC_MACROS . auto/have
-
-
-# the precompiled headers
-#CORE_DEPS="$CORE_DEPS $NGX_OBJS/ngx_config.pch"
-#NGX_PCH="$NGX_OBJS/ngx_config.pch"
-#NGX_BUILD_PCH="-fhq=$NGX_OBJS/ngx_config.pch"
-#NGX_USE_PCH="-fh=$NGX_OBJS/ngx_config.pch"
-
-
-# the link flags, built target is NT GUI mode application
-#CORE_LINK="$CORE_LINK -l=nt_win"
-
-
-# the resource file
-NGX_RCC="wrc \$(CORE_INCS) -fo=$NGX_OBJS/nginx.res "
-NGX_RCC="$NGX_RCC $NGX_WIN32_RC $NGX_OBJS/nginx.exe"
-
-
-ngx_include_opt="-i="
-ngx_objout="-fo"
-ngx_binout="-fe="
-ngx_objext="obj"
-ngx_binext=".exe"
-
-ngx_regex_dirsep='\\'
-ngx_dirsep="\\"
-
-ngx_long_start=' '
-ngx_long_end=' '
-ngx_long_regex_cont=' \&\
- '
-ngx_long_cont=' &
- '
-
-ngx_regex_cont=' \&\
- '
-ngx_cont=' &
- '
-ngx_tab=' &
- '
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/sunc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/sunc
deleted file mode 100644
index 8f12d7cd7fe..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/cc/sunc
+++ /dev/null
@@ -1,158 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-# Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10
-# Sun C 5.8 2005/10/13 Sun Studio 11
-# Sun C 5.9 SunOS_i386 2007/05/03 Sun Studio 12
-# Sun C 5.9 SunOS_sparc 2007/05/03
-# Sun C 5.10 SunOS_i386 2009/06/03 Sun Studio 12.1
-# Sun C 5.11 SunOS_i386 2010/08/13 Sun Studio 12.2
-
-NGX_SUNC_VER=`$CC -V 2>&1 | grep 'Sun C' 2>&1 \
- | sed -e 's/^.* Sun C \(.*\)/\1/'`
-
-echo " + Sun C version: $NGX_SUNC_VER"
-
-have=NGX_COMPILER value="\"Sun C $NGX_SUNC_VER\"" . auto/define
-
-
-cat << END > $NGX_AUTOTEST.c
-
-int main() { printf("%d", __SUNPRO_C); }
-
-END
-
-eval "$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c >> $NGX_ERR 2>&1"
-
-if [ -x $NGX_AUTOTEST ]; then
- ngx_sunc_ver=`$NGX_AUTOTEST`
-fi
-
-rm -rf $NGX_AUTOTEST*
-
-# 1424 == 0x590, Sun Studio 12
-
-if [ "$ngx_sunc_ver" -ge 1424 ]; then
- ngx_sparc32="-m32"
- ngx_sparc64="-m64"
- ngx_amd64="-m64"
-
-else
- ngx_sparc32="-xarch=v8plus"
- ngx_sparc64="-xarch=v9"
- ngx_amd64="-xarch=amd64"
-fi
-
-case "$NGX_MACHINE" in
-
- i86pc)
- NGX_AUX=" src/os/unix/ngx_sunpro_x86.il"
- ;;
-
- sun4u | sun4v)
- NGX_AUX=" src/os/unix/ngx_sunpro_sparc64.il"
- ;;
-
-esac
-
-
-# optimizations
-
-# 20736 == 0x5100, Sun Studio 12.1
-
-if [ "$ngx_sunc_ver" -ge 20736 ]; then
- ngx_fast="-fast"
-
-else
- # older versions had problems with bit-fields
- ngx_fast="-fast -xalias_level=any"
-fi
-
-IPO=-xipo
-CFLAGS="$CFLAGS $ngx_fast $IPO"
-CORE_LINK="$CORE_LINK $ngx_fast $IPO"
-
-
-case $CPU in
- pentium)
- # optimize for Pentium and Athlon
- CPU_OPT="-xchip=pentium"
- ;;
-
- pentiumpro)
- # optimize for Pentium Pro, Pentium II
- CPU_OPT="-xchip=pentium_pro"
- ;;
-
- pentium3)
- # optimize for Pentium III
- CPU_OPT="-xchip=pentium3"
- #CPU_OPT="$CPU_OPT -xarch=sse"
- CPU_OPT="$CPU_OPT -xcache=16/32/4:256/32/4"
- ;;
-
- pentium4)
- # optimize for Pentium 4
- CPU_OPT="-xchip=pentium4"
- #CPU_OPT="$CPU_OPT -xarch=sse2"
- CPU_OPT="$CPU_OPT -xcache=8/64/4:256/128/8"
- ;;
-
- opteron)
- # optimize for Opteron
- CPU_OPT="-xchip=opteron"
- #CPU_OPT="$CPU_OPT -xarch=sse2"
- CPU_OPT="$CPU_OPT -xcache=64/64/2:1024/64/16"
- ;;
-
- sparc32)
- # build 32-bit UltraSparc binary
- CPU_OPT="$ngx_sparc32"
- CORE_LINK="$CORE_LINK $ngx_sparc32"
- CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc32"
- NGX_CPU_CACHE_LINE=64
- ;;
-
- sparc64)
- # build 64-bit UltraSparc binary
- CPU_OPT="$ngx_sparc64"
- CORE_LINK="$CORE_LINK $ngx_sparc64"
- CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_sparc64"
- NGX_CPU_CACHE_LINE=64
- ;;
-
- amd64)
- # build 64-bit amd64 binary
- CPU_OPT="$ngx_amd64"
- CORE_LINK="$CORE_LINK $ngx_amd64"
- CC_AUX_FLAGS="$CC_AUX_FLAGS $ngx_amd64"
- NGX_AUX=" src/os/unix/ngx_sunpro_amd64.il"
- NGX_CPU_CACHE_LINE=64
- ;;
-
-esac
-
-
-CFLAGS="$CFLAGS $CPU_OPT"
-
-
-if [ ".$PCRE_OPT" = "." ]; then
- PCRE_OPT="$ngx_fast $IPO $CPU_OPT"
-fi
-
-if [ ".$MD5_OPT" = "." ]; then
- MD5_OPT="$ngx_fast $IPO $CPU_OPT"
-fi
-
-if [ ".$ZLIB_OPT" = "." ]; then
- ZLIB_OPT="$ngx_fast $IPO $CPU_OPT"
-fi
-
-
-# stop on warning
-CFLAGS="$CFLAGS -errwarn=%all"
-
-# debug
-CFLAGS="$CFLAGS -g"
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/define b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/define
deleted file mode 100644
index b5a7622590d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/define
+++ /dev/null
@@ -1,12 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-cat << END >> $NGX_AUTO_CONFIG_H
-
-#ifndef $have
-#define $have $value
-#endif
-
-END
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/endianness b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/endianness
deleted file mode 100644
index 93da2f80d99..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/endianness
+++ /dev/null
@@ -1,45 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo $ngx_n "checking for system byte ordering ...$ngx_c"
-echo >> $NGX_ERR
-echo "checking for system byte ordering" >> $NGX_ERR
-
-
-cat << END > $NGX_AUTOTEST.c
-
-int main() {
- int i = 0x11223344;
- char *p;
-
- p = (char *) &i;
- if (*p == 0x44) return 0;
- return 1;
-}
-
-END
-
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
-
-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
-if [ -x $NGX_AUTOTEST ]; then
- if $NGX_AUTOTEST >/dev/null 2>&1; then
- echo " little endian"
- have=NGX_HAVE_LITTLE_ENDIAN . auto/have
- else
- echo " big endian"
- fi
-
- rm -rf $NGX_AUTOTEST*
-
-else
- rm -rf $NGX_AUTOTEST*
-
- echo
- echo "$0: error: cannot detect system byte ordering"
- exit 1
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/feature b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/feature
deleted file mode 100644
index 1145f28684b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/feature
+++ /dev/null
@@ -1,123 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo $ngx_n "checking for $ngx_feature ...$ngx_c"
-
-cat << END >> $NGX_AUTOCONF_ERR
-
-----------------------------------------
-checking for $ngx_feature
-
-END
-
-ngx_found=no
-
-if test -n "$ngx_feature_name"; then
- ngx_have_feature=`echo $ngx_feature_name \
- | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
-fi
-
-if test -n "$ngx_feature_path"; then
- for ngx_temp in $ngx_feature_path; do
- ngx_feature_inc_path="$ngx_feature_inc_path -I $ngx_temp"
- done
-fi
-
-cat << END > $NGX_AUTOTEST.c
-
-#include <sys/types.h>
-$NGX_INCLUDE_UNISTD_H
-$ngx_feature_incs
-
-int main() {
- $ngx_feature_test;
- return 0;
-}
-
-END
-
-
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS $ngx_feature_inc_path \
- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_TEST_LD_OPT $ngx_feature_libs"
-
-ngx_feature_inc_path=
-
-eval "/bin/sh -c \"$ngx_test\" >> $NGX_AUTOCONF_ERR 2>&1"
-
-
-if [ -x $NGX_AUTOTEST ]; then
-
- case "$ngx_feature_run" in
-
- yes)
- # /bin/sh is used to intercept "Killed" or "Abort trap" messages
- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
- echo " found"
- ngx_found=yes
-
- if test -n "$ngx_feature_name"; then
- have=$ngx_have_feature . auto/have
- fi
-
- else
- echo " found but is not working"
- fi
- ;;
-
- value)
- # /bin/sh is used to intercept "Killed" or "Abort trap" messages
- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
- echo " found"
- ngx_found=yes
-
- cat << END >> $NGX_AUTO_CONFIG_H
-
-#ifndef $ngx_feature_name
-#define $ngx_feature_name `$NGX_AUTOTEST`
-#endif
-
-END
- else
- echo " found but is not working"
- fi
- ;;
-
- bug)
- # /bin/sh is used to intercept "Killed" or "Abort trap" messages
- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then
- echo " not found"
-
- else
- echo " found"
- ngx_found=yes
-
- if test -n "$ngx_feature_name"; then
- have=$ngx_have_feature . auto/have
- fi
- fi
- ;;
-
- *)
- echo " found"
- ngx_found=yes
-
- if test -n "$ngx_feature_name"; then
- have=$ngx_have_feature . auto/have
- fi
- ;;
-
- esac
-
-else
- echo " not found"
-
- echo "----------" >> $NGX_AUTOCONF_ERR
- cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
- echo "----------" >> $NGX_AUTOCONF_ERR
- echo $ngx_test >> $NGX_AUTOCONF_ERR
- echo "----------" >> $NGX_AUTOCONF_ERR
-fi
-
-rm -rf $NGX_AUTOTEST*
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have
deleted file mode 100644
index f8e3751c5f0..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have
+++ /dev/null
@@ -1,12 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-cat << END >> $NGX_AUTO_CONFIG_H
-
-#ifndef $have
-#define $have 1
-#endif
-
-END
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have_headers b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have_headers
deleted file mode 100644
index a3a75430aa4..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/have_headers
+++ /dev/null
@@ -1,12 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-cat << END >> $NGX_AUTO_HEADERS_H
-
-#ifndef $have
-#define $have 1
-#endif
-
-END
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/headers b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/headers
deleted file mode 100644
index 5a2e6b9023f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/headers
+++ /dev/null
@@ -1,13 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-ngx_include="unistd.h"; . auto/include
-ngx_include="inttypes.h"; . auto/include
-ngx_include="limits.h"; . auto/include
-ngx_include="sys/filio.h"; . auto/include
-ngx_include="sys/param.h"; . auto/include
-ngx_include="sys/mount.h"; . auto/include
-ngx_include="sys/statvfs.h"; . auto/include
-ngx_include="crypt.h"; . auto/include
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/include b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/include
deleted file mode 100644
index e34dabdae1d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/include
+++ /dev/null
@@ -1,61 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo $ngx_n "checking for $ngx_include ...$ngx_c"
-
-cat << END >> $NGX_AUTOCONF_ERR
-
-----------------------------------------
-checking for $ngx_include
-
-END
-
-
-ngx_found=no
-
-cat << END > $NGX_AUTOTEST.c
-
-$NGX_INCLUDE_SYS_PARAM_H
-#include <$ngx_include>
-
-int main() {
- return 0;
-}
-
-END
-
-
-ngx_test="$CC -o $NGX_AUTOTEST $NGX_AUTOTEST.c"
-
-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
-if [ -x $NGX_AUTOTEST ]; then
-
- ngx_found=yes
-
- echo " found"
-
- ngx_name=`echo $ngx_include \
- | tr abcdefghijklmnopqrstuvwxyz/. ABCDEFGHIJKLMNOPQRSTUVWXYZ__`
-
-
- have=NGX_HAVE_$ngx_name . auto/have_headers
-
- eval "NGX_INCLUDE_$ngx_name='#include <$ngx_include>'"
-
- #STUB
- eval "NGX_$ngx_name='#include <$ngx_include>'"
-
-else
- echo " not found"
-
- echo "----------" >> $NGX_AUTOCONF_ERR
- cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
- echo "----------" >> $NGX_AUTOCONF_ERR
- echo $ngx_test >> $NGX_AUTOCONF_ERR
- echo "----------" >> $NGX_AUTOCONF_ERR
-fi
-
-rm -rf $NGX_AUTOTEST*
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/init b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/init
deleted file mode 100644
index 910f5294b66..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/init
+++ /dev/null
@@ -1,51 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-NGX_MAKEFILE=$NGX_OBJS/Makefile
-NGX_MODULES_C=$NGX_OBJS/ngx_modules.c
-
-NGX_AUTO_HEADERS_H=$NGX_OBJS/ngx_auto_headers.h
-NGX_AUTO_CONFIG_H=$NGX_OBJS/ngx_auto_config.h
-
-NGX_AUTOTEST=$NGX_OBJS/autotest
-NGX_AUTOCONF_ERR=$NGX_OBJS/autoconf.err
-
-# STUBs
-NGX_ERR=$NGX_OBJS/autoconf.err
-MAKEFILE=$NGX_OBJS/Makefile
-
-
-NGX_PCH=
-NGX_USE_PCH=
-
-
-# check the echo's "-n" option and "\c" capability
-
-if echo "test\c" | grep c >/dev/null; then
-
- if echo -n test | grep n >/dev/null; then
- ngx_n=
- ngx_c=
-
- else
- ngx_n=-n
- ngx_c=
- fi
-
-else
- ngx_n=
- ngx_c='\c'
-fi
-
-
-# create Makefile
-
-cat << END > Makefile
-
-default: build
-
-clean:
- rm -rf Makefile $NGX_OBJS
-END
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/conf
deleted file mode 100644
index e1e447557e9..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/conf
+++ /dev/null
@@ -1,83 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ $USE_PCRE = YES -o $PCRE != NONE ]; then
- . auto/lib/pcre/conf
-
-else
- if [ $USE_PCRE = DISABLED -a $HTTP_REWRITE = YES ]; then
-
-cat << END
-
-$0: error: the HTTP rewrite module requires the PCRE library.
-You can either disable the module by using --without-http_rewrite_module
-option or you have to enable the PCRE support.
-
-END
- exit 1
- fi
-fi
-
-
-if [ $USE_OPENSSL = YES ]; then
- . auto/lib/openssl/conf
-fi
-
-if [ $USE_MD5 = YES ]; then
-
- if [ $USE_OPENSSL = YES ]; then
- have=NGX_HAVE_OPENSSL_MD5_H . auto/have
- have=NGX_OPENSSL_MD5 . auto/have
- have=NGX_HAVE_MD5 . auto/have
- MD5=YES
- MD5_LIB=OpenSSL
-
- else
- . auto/lib/md5/conf
- fi
-
-fi
-
-if [ $USE_SHA1 = YES ]; then
-
- if [ $USE_OPENSSL = YES ]; then
- have=NGX_HAVE_OPENSSL_SHA1_H . auto/have
- have=NGX_HAVE_SHA1 . auto/have
- SHA1=YES
- SHA1_LIB=OpenSSL
-
- else
- . auto/lib/sha1/conf
- fi
-
-fi
-
-if [ $USE_ZLIB = YES ]; then
- . auto/lib/zlib/conf
-fi
-
-if [ $USE_LIBXSLT = YES ]; then
- . auto/lib/libxslt/conf
-fi
-
-if [ $USE_LIBGD = YES ]; then
- . auto/lib/libgd/conf
-fi
-
-if [ $USE_PERL = YES ]; then
- . auto/lib/perl/conf
-fi
-
-if [ $HTTP_GEOIP = YES ]; then
- . auto/lib/geoip/conf
-fi
-
-if [ $NGX_GOOGLE_PERFTOOLS = YES ]; then
- . auto/lib/google-perftools/conf
-fi
-
-if [ $NGX_LIBATOMIC != NO ]; then
- . auto/lib/libatomic/conf
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/geoip/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/geoip/conf
deleted file mode 100644
index 53c274d54dc..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/geoip/conf
+++ /dev/null
@@ -1,94 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
- ngx_feature="GeoIP library"
- ngx_feature_name=
- ngx_feature_run=no
- ngx_feature_incs="#include <GeoIP.h>"
- ngx_feature_path=
- ngx_feature_libs="-lGeoIP"
- ngx_feature_test="GeoIP_open(NULL, 0)"
- . auto/feature
-
-
-if [ $ngx_found = no ]; then
-
- # FreeBSD port
-
- ngx_feature="GeoIP library in /usr/local/"
- ngx_feature_path="/usr/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lGeoIP"
- else
- ngx_feature_libs="-L/usr/local/lib -lGeoIP"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # NetBSD port
-
- ngx_feature="GeoIP library in /usr/pkg/"
- ngx_feature_path="/usr/pkg/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lGeoIP"
- else
- ngx_feature_libs="-L/usr/pkg/lib -lGeoIP"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # MacPorts
-
- ngx_feature="GeoIP library in /opt/local/"
- ngx_feature_path="/opt/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lGeoIP"
- else
- ngx_feature_libs="-L/opt/local/lib -lGeoIP"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = yes ]; then
-
- CORE_INCS="$CORE_INCS $ngx_feature_path"
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
-
- if [ $NGX_IPV6 = YES ]; then
- ngx_feature="GeoIP IPv6 support"
- ngx_feature_name="NGX_HAVE_GEOIP_V6"
- ngx_feature_run=no
- ngx_feature_incs="#include <stdio.h>
- #include <GeoIP.h>"
- #ngx_feature_path=
- #ngx_feature_libs=
- ngx_feature_test="printf(\"%d\", GEOIP_CITY_EDITION_REV0_V6);"
- . auto/feature
- fi
-
-else
-
-cat << END
-
-$0: error: the GeoIP module requires the GeoIP library.
-You can either do not enable the module or install the library.
-
-END
-
- exit 1
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/google-perftools/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/google-perftools/conf
deleted file mode 100644
index 5d5ddaef60d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/google-perftools/conf
+++ /dev/null
@@ -1,61 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
- ngx_feature="Google perftools"
- ngx_feature_name=
- ngx_feature_run=no
- ngx_feature_incs=
- ngx_feature_path=
- ngx_feature_libs="-lprofiler"
- ngx_feature_test="ProfilerStop()"
- . auto/feature
-
-
-if [ $ngx_found = no ]; then
-
- # FreeBSD port
-
- ngx_feature="Google perftools in /usr/local/"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lprofiler"
- else
- ngx_feature_libs="-L/usr/local/lib -lprofiler"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # MacPorts
-
- ngx_feature="Google perftools in /opt/local/"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lprofiler"
- else
- ngx_feature_libs="-L/opt/local/lib -lprofiler"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = yes ]; then
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
-
-else
-
-cat << END
-
-$0: error: the Google perftools module requires the Google perftools
-library. You can either do not enable the module or install the library.
-
-END
-
- exit 1
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/conf
deleted file mode 100644
index d1e484ab32e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/conf
+++ /dev/null
@@ -1,43 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ $NGX_LIBATOMIC != YES ]; then
-
- have=NGX_HAVE_LIBATOMIC . auto/have
- CORE_INCS="$CORE_INCS $NGX_LIBATOMIC/src"
- LINK_DEPS="$LINK_DEPS $NGX_LIBATOMIC/src/libatomic_ops.a"
- CORE_LIBS="$CORE_LIBS $NGX_LIBATOMIC/src/libatomic_ops.a"
-
-else
-
- ngx_feature="atomic_ops library"
- ngx_feature_name=NGX_HAVE_LIBATOMIC
- ngx_feature_run=yes
- ngx_feature_incs="#define AO_REQUIRE_CAS
- #include <atomic_ops.h>"
- ngx_feature_path=
- ngx_feature_libs="-latomic_ops"
- ngx_feature_test="long n = 0;
- if (!AO_compare_and_swap(&n, 0, 1))
- return 1;
- if (AO_fetch_and_add(&n, 1) != 1)
- return 1;
- if (n != 2)
- return 1;
- AO_nop();"
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
- else
-
-cat << END
-
-$0: error: libatomic_ops library was not found.
-
-END
- exit 1
- fi
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/make
deleted file mode 100644
index c90318ea122..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libatomic/make
+++ /dev/null
@@ -1,16 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
- cat << END >> $NGX_MAKEFILE
-
-$NGX_LIBATOMIC/src/libatomic_ops.a: $NGX_LIBATOMIC/Makefile
- cd $NGX_LIBATOMIC && \$(MAKE)
-
-$NGX_LIBATOMIC/Makefile: $NGX_MAKEFILE
- cd $NGX_LIBATOMIC \\
- && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
- && ./configure
-
-END
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libgd/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libgd/conf
deleted file mode 100644
index ff99054db68..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libgd/conf
+++ /dev/null
@@ -1,83 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
- ngx_feature="GD library"
- ngx_feature_name=
- ngx_feature_run=no
- ngx_feature_incs="#include <gd.h>"
- ngx_feature_path=
- ngx_feature_libs="-lgd"
- ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);"
- . auto/feature
-
-
-if [ $ngx_found = no ]; then
-
- # FreeBSD port
-
- ngx_feature="GD library in /usr/local/"
- ngx_feature_path="/usr/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lgd"
- else
- ngx_feature_libs="-L/usr/local/lib -lgd"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # NetBSD port
-
- ngx_feature="GD library in /usr/pkg/"
- ngx_feature_path="/usr/pkg/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lgd"
- else
- ngx_feature_libs="-L/usr/pkg/lib -lgd"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # MacPorts
-
- ngx_feature="GD library in /opt/local/"
- ngx_feature_path="/opt/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lgd"
- else
- ngx_feature_libs="-L/opt/local/lib -lgd"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = yes ]; then
-
- CORE_INCS="$CORE_INCS $ngx_feature_path"
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
-
-else
-
-cat << END
-
-$0: error: the HTTP image filter module requires the GD library.
-You can either do not enable the module or install the libraries.
-
-END
-
- exit 1
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libxslt/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libxslt/conf
deleted file mode 100644
index bc19d83ddce..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/libxslt/conf
+++ /dev/null
@@ -1,156 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
- ngx_feature="libxslt"
- ngx_feature_name=
- ngx_feature_run=no
- ngx_feature_incs="#include <libxml/parser.h>
- #include <libxml/tree.h>
- #include <libxslt/xslt.h>
- #include <libxslt/xsltInternals.h>
- #include <libxslt/transform.h>
- #include <libxslt/xsltutils.h>"
- ngx_feature_path="/usr/include/libxml2"
- ngx_feature_libs="-lxml2 -lxslt"
- ngx_feature_test="xmlParserCtxtPtr ctxt = NULL;
- xsltStylesheetPtr sheet = NULL;
- xmlDocPtr doc;
- doc = xmlParseChunk(ctxt, NULL, 0, 0);
- xsltApplyStylesheet(sheet, doc, NULL);"
- . auto/feature
-
-
-if [ $ngx_found = no ]; then
-
- # FreeBSD port
-
- ngx_feature="libxslt in /usr/local/"
- ngx_feature_path="/usr/local/include/libxml2 /usr/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lxml2 -lxslt"
- else
- ngx_feature_libs="-L/usr/local/lib -lxml2 -lxslt"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # NetBSD port
-
- ngx_feature="libxslt in /usr/pkg/"
- ngx_feature_path="/usr/pkg/include/libxml2 /usr/pkg/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lxml2 -lxslt"
- else
- ngx_feature_libs="-L/usr/pkg/lib -lxml2 -lxslt"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # MacPorts
-
- ngx_feature="libxslt in /opt/local/"
- ngx_feature_path="/opt/local/include/libxml2 /opt/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lxml2 -lxslt"
- else
- ngx_feature_libs="-L/opt/local/lib -lxml2 -lxslt"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = yes ]; then
-
- CORE_INCS="$CORE_INCS $ngx_feature_path"
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
-
-else
-
-cat << END
-
-$0: error: the HTTP XSLT module requires the libxml2/libxslt
-libraries. You can either do not enable the module or install the libraries.
-
-END
-
- exit 1
-fi
-
-
- ngx_feature="libexslt"
- ngx_feature_name=NGX_HAVE_EXSLT
- ngx_feature_run=no
- ngx_feature_incs="#include <libexslt/exslt.h>"
- ngx_feature_path="/usr/include/libxml2"
- ngx_feature_libs="-lexslt"
- ngx_feature_test="exsltRegisterAll();"
- . auto/feature
-
-if [ $ngx_found = no ]; then
-
- # FreeBSD port
-
- ngx_feature="libexslt in /usr/local/"
- ngx_feature_path="/usr/local/include/libxml2 /usr/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lexslt"
- else
- ngx_feature_libs="-L/usr/local/lib -lexslt"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # NetBSD port
-
- ngx_feature="libexslt in /usr/pkg/"
- ngx_feature_path="/usr/pkg/include/libxml2 /usr/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lexslt"
- else
- ngx_feature_libs="-L/usr/pkg/lib -lexslt"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # MacPorts
-
- ngx_feature="libexslt in /opt/local/"
- ngx_feature_path="/opt/local/include/libxml2 /opt/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lexslt"
- else
- ngx_feature_libs="-L/opt/local/lib -lexslt"
- fi
-
- . auto/feature
-fi
-
-
-if [ $ngx_found = yes ]; then
- CORE_LIBS="$CORE_LIBS -lexslt"
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/make
deleted file mode 100644
index 58a84a34cac..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/make
+++ /dev/null
@@ -1,32 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ $PCRE != NONE -a $PCRE != NO -a $PCRE != YES ]; then
- . auto/lib/pcre/make
-fi
-
-if [ $MD5 != NONE -a $MD5 != NO -a $MD5 != YES ]; then
- . auto/lib/md5/make
-fi
-
-if [ $SHA1 != NONE -a $SHA1 != NO -a $SHA1 != YES ]; then
- . auto/lib/sha1/make
-fi
-
-if [ $OPENSSL != NONE -a $OPENSSL != NO -a $OPENSSL != YES ]; then
- . auto/lib/openssl/make
-fi
-
-if [ $ZLIB != NONE -a $ZLIB != NO -a $ZLIB != YES ]; then
- . auto/lib/zlib/make
-fi
-
-if [ $NGX_LIBATOMIC != NO -a $NGX_LIBATOMIC != YES ]; then
- . auto/lib/libatomic/make
-fi
-
-if [ $USE_PERL = YES ]; then
- . auto/lib/perl/make
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/conf
deleted file mode 100644
index eb5dfd1f236..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/conf
+++ /dev/null
@@ -1,103 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ $MD5 != NONE ]; then
-
- if grep MD5_Init $MD5/md5.h 2>&1 >/dev/null; then
- # OpenSSL md5
- OPENSSL_MD5=YES
- have=NGX_HAVE_OPENSSL_MD5 . auto/have
- have=NGX_OPENSSL_MD5 . auto/have
- else
- # rsaref md5
- OPENSSL_MD5=NO
- fi
-
- have=NGX_HAVE_MD5 . auto/have
- CORE_INCS="$CORE_INCS $MD5"
-
- case "$NGX_CC_NAME" in
-
- msvc* | owc* | bcc)
- LINK_DEPS="$LINK_DEPS $MD5/md5.lib"
- CORE_LIBS="$CORE_LIBS $MD5/md5.lib"
- ;;
-
- icc*)
- LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
-
- # to allow -ipo optimization we link with the *.o but not library
- CORE_LIBS="$CORE_LIBS $MD5/md5_dgst.o"
-
- if [ $MD5_ASM = YES ]; then
- CORE_LIBS="$CORE_LIBS $MD5/asm/mx86-elf.o"
- fi
- ;;
-
- *)
- LINK_DEPS="$LINK_DEPS $MD5/libmd5.a"
- CORE_LIBS="$CORE_LIBS $MD5/libmd5.a"
- #CORE_LIBS="$CORE_LIBS -L $MD5 -lmd5"
- ;;
-
- esac
-
-else
-
- if [ "$NGX_PLATFORM" != win32 ]; then
-
- MD5=NO
-
- # FreeBSD, Solaris 10
-
- ngx_feature="md5 in system md library"
- ngx_feature_name=NGX_HAVE_MD5
- ngx_feature_run=no
- ngx_feature_incs="#include <md5.h>"
- ngx_feature_path=
- ngx_feature_libs="-lmd"
- ngx_feature_test="MD5_CTX md5; MD5Init(&md5)"
- . auto/feature
-
- ngx_md5_lib="system md"
-
- if [ $ngx_found = no ]; then
-
- # Solaris 8/9
-
- ngx_feature="md5 in system md5 library"
- ngx_feature_libs="-lmd5"
- . auto/feature
-
- ngx_md5_lib="system md5"
- fi
-
- if [ $ngx_found = no ]; then
-
- # OpenSSL crypto library
-
- ngx_feature="md5 in system OpenSSL crypto library"
- ngx_feature_name="NGX_OPENSSL_MD5"
- ngx_feature_incs="#include <openssl/md5.h>"
- ngx_feature_libs="-lcrypto"
- ngx_feature_test="MD5_CTX md5; MD5_Init(&md5)"
- . auto/feature
-
- ngx_md5_lib="system crypto"
-
- if [ $ngx_found = yes ]; then
- have=NGX_HAVE_OPENSSL_MD5_H . auto/have
- have=NGX_HAVE_MD5 . auto/have
- fi
- fi
-
- if [ $ngx_found = yes ]; then
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
- MD5=YES
- MD5_LIB=$ngx_md5_lib
- fi
- fi
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/make
deleted file mode 100644
index 81f138ab671..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/make
+++ /dev/null
@@ -1,96 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-case "$NGX_CC_NAME" in
-
- msvc*)
- ngx_makefile=makefile.msvc
- ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC MD5_ASM=$MD5_ASM"
- ngx_md5="MD5=\"$MD5\""
- ;;
-
- owc*)
- ngx_makefile=makefile.owc
- ngx_opt="CPU_OPT=\"$CPU_OPT\""
- ngx_md5=`echo MD5=\"$MD5\" | sed -e "s/\//$ngx_regex_dirsep/g"`
- ;;
-
- bcc)
- ngx_makefile=makefile.bcc
- ngx_opt="-DCPU_OPT=\"$CPU_OPT\" -DMD5_ASM=$MD5_ASM"
- ngx_md5=`echo \-DMD5=\"$MD5\" | sed -e "s/\//$ngx_regex_dirsep/g"`
- ;;
-
-esac
-
-
-done=NO
-
-
-case "$NGX_PLATFORM" in
-
- win32)
- cat << END >> $NGX_MAKEFILE
-
-`echo "$MD5/md5.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
- \$(MAKE) -f auto/lib/md5/$ngx_makefile $ngx_opt $ngx_md5
-
-END
-
- done=YES
- ;;
-
- SunOS:*:i86pc)
- if [ $MD5_ASM = YES ]; then
-
- cat << END >> $NGX_MAKEFILE
-
-$MD5/libmd5.a: $NGX_MAKEFILE
- cd $MD5 \\
- && \$(MAKE) CFLAGS="$MD5_OPT -DSOL -DMD5_ASM -DL_ENDIAN" \\
- CC="\$(CC)" CPP="\$(CPP)" \\
- MD5_ASM_OBJ=asm/mx86-sol.o clean libmd5.a
-
-END
-
- done=YES
- fi
- ;;
-
- # FreeBSD: i386
- # Linux: i686
-
- *:i386 | *:i686)
- if [ $MD5_ASM = YES ]; then
-
- cat << END >> $NGX_MAKEFILE
-
-$MD5/libmd5.a: $NGX_MAKEFILE
- cd $MD5 \\
- && \$(MAKE) CFLAGS="$MD5_OPT -DELF -DMD5_ASM -DL_ENDIAN" \\
- CC="\$(CC)" CPP="\$(CPP)" \\
- MD5_ASM_OBJ=asm/mx86-elf.o clean libmd5.a
-
-END
-
- done=YES
- fi
- ;;
-
-esac
-
-
-if [ $done = NO ]; then
-
- cat << END >> $NGX_MAKEFILE
-
-$MD5/libmd5.a: $NGX_MAKEFILE
- cd $MD5 \\
- && \$(MAKE) CFLAGS="$MD5_OPT" \\
- CC="\$(CC)" MD5_ASM_OBJ= clean libmd5.a
-
-END
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.bcc
deleted file mode 100644
index eb6fb624178..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.bcc
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN
-
-!if "$(MD5_ASM)" == "YES"
-
-md5.lib:
- cd $(MD5)
- bcc32 -c $(CFLAGS) -DMD5_ASM md5_dgst.c
- tlib md5.lib +md5_dgst.obj +"asm\m-win32.obj"
-
-!else
-
-md5.lib:
- cd $(MD5)
- bcc32 -c $(CFLAGS) md5_dgst.c
- tlib md5.lib +md5_dgst.obj
-
-!endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.msvc
deleted file mode 100644
index 90d62fac7f0..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.msvc
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
-
-!IF "$(MD5_ASM)" == "YES"
-
-md5.lib:
- cd $(MD5)
- cl -c $(CFLAGS) -D MD5_ASM md5_dgst.c
- link -lib -out:md5.lib md5_dgst.obj asm/m-win32.obj
-
-!ELSE
-
-md5.lib:
- cd $(MD5)
- cl -c $(CFLAGS) md5_dgst.c
- link -lib -out:md5.lib md5_dgst.obj
-
-!ENDIF
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.owc
deleted file mode 100644
index 78c1e61dde7..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/md5/makefile.owc
+++ /dev/null
@@ -1,11 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)
-
-md5.lib:
- cd $(MD5)
- wcl386 -c $(CFLAGS) -dL_ENDIAN md5_dgst.c
- wlib -n md5.lib md5_dgst.obj
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/conf
deleted file mode 100644
index a65815f6364..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/conf
+++ /dev/null
@@ -1,78 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ $OPENSSL != NONE ]; then
-
- case "$CC" in
-
- cl | bcc32)
- have=NGX_OPENSSL . auto/have
- have=NGX_SSL . auto/have
-
- CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
-
- CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
- CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
-
- # libeay32.lib requires gdi32.lib
- CORE_LIBS="$CORE_LIBS gdi32.lib"
- # OpenSSL 1.0.0 requires crypt32.lib
- CORE_LIBS="$CORE_LIBS crypt32.lib"
- ;;
-
- *)
- have=NGX_OPENSSL . auto/have
- have=NGX_SSL . auto/have
-
- CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
- CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
- CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
-
- if [ "$NGX_PLATFORM" = win32 ]; then
- CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
- fi
- ;;
- esac
-
-else
-
- if [ "$NGX_PLATFORM" != win32 ]; then
-
- OPENSSL=NO
-
- ngx_feature="OpenSSL library"
- ngx_feature_name="NGX_OPENSSL"
- ngx_feature_run=no
- ngx_feature_incs="#include <openssl/ssl.h>"
- ngx_feature_path=
- ngx_feature_libs="-lssl -lcrypto"
- ngx_feature_test="SSL_library_init()"
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- have=NGX_SSL . auto/have
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs $NGX_LIBDL"
- OPENSSL=YES
- fi
- fi
-
- if [ $OPENSSL != YES ]; then
-
-cat << END
-
-$0: error: SSL modules require the OpenSSL library.
-You can either do not enable the modules, or install the OpenSSL library
-into the system, or build the OpenSSL library statically from the source
-with nginx by using --with-openssl=<path> option.
-
-END
- exit 1
- fi
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/make
deleted file mode 100644
index e64acd973ec..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/make
+++ /dev/null
@@ -1,67 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-case "$CC" in
-
- cl)
-
- cat << END >> $NGX_MAKEFILE
-
-$OPENSSL/openssl/include/openssl/ssl.h: $NGX_MAKEFILE
- \$(MAKE) -f auto/lib/openssl/makefile.msvc \
- OPENSSL="$OPENSSL" OPENSSL_OPT="$OPENSSL_OPT"
-
-END
-
- ;;
-
- bcc32)
-
- ngx_opt=`echo "-DOPENSSL=\"$OPENSSL\" -DOPENSSL_OPT=\"$OPENSSL_OPT\"" \
- | sed -e "s/\//$ngx_regex_dirsep/g"`
-
- cat << END >> $NGX_MAKEFILE
-
-`echo "$OPENSSL\\openssl\\lib\\libeay32.lib: \
- $OPENSSL\\openssl\\include\\openssl\\ssl.h" \
- | sed -e "s/\//$ngx_regex_dirsep/g"`
-
-`echo "$OPENSSL\\openssl\\lib\\ssleay32.lib: \
- $OPENSSL\\openssl\\include\\openssl\\ssl.h" \
- | sed -e "s/\//$ngx_regex_dirsep/g"`
-
-`echo "$OPENSSL\\openssl\\include\\openssl\\ssl.h: $NGX_MAKEFILE" \
- | sed -e "s/\//$ngx_regex_dirsep/g"`
- \$(MAKE) -f auto/lib/openssl/makefile.bcc $ngx_opt
-
-END
-
- ;;
-
- *)
- case $USE_THREADS in
- NO) OPENSSL_OPT="$OPENSSL_OPT no-threads" ;;
- *) OPENSSL_OPT="$OPENSSL_OPT threads" ;;
- esac
-
- case $OPENSSL in
- /*) ngx_prefix="$OPENSSL/.openssl" ;;
- *) ngx_prefix="$PWD/$OPENSSL/.openssl" ;;
- esac
-
- cat << END >> $NGX_MAKEFILE
-
-$OPENSSL/.openssl/include/openssl/ssl.h: $NGX_MAKEFILE
- cd $OPENSSL \\
- && if [ -f Makefile ]; then \$(MAKE) clean; fi \\
- && ./config --prefix=$ngx_prefix no-shared $OPENSSL_OPT \\
- && \$(MAKE) \\
- && \$(MAKE) install LIBDIR=lib
-
-END
-
- ;;
-
-esac
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.bcc
deleted file mode 100644
index 6a94ff74982..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.bcc
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-all:
- cd $(OPENSSL)
-
- perl Configure BC-32 no-shared --prefix=openssl $(OPENSSL_OPT)
-
- ms\do_nasm
-
- $(MAKE) -f ms\bcb.mak
- $(MAKE) -f ms\bcb.mak install
-
- # Borland's make does not expand "[ch]" in
- # copy "inc32\openssl\*.[ch]" "openssl\include\openssl"
- copy inc32\openssl\*.h openssl\include\openssl
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.msvc
deleted file mode 100644
index fc9e57864ae..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/openssl/makefile.msvc
+++ /dev/null
@@ -1,14 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-all:
- cd $(OPENSSL)
-
- perl Configure VC-WIN32 no-shared --prefix=openssl $(OPENSSL_OPT)
-
- ms\do_ms
-
- $(MAKE) -f ms\nt.mak
- $(MAKE) -f ms\nt.mak install
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/conf
deleted file mode 100644
index 939f01b77a4..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/conf
+++ /dev/null
@@ -1,203 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ $PCRE != NONE ]; then
- CORE_INCS="$CORE_INCS $PCRE"
-
- case "$NGX_CC_NAME" in
-
- msvc* | owc* | bcc)
- have=NGX_PCRE . auto/have
- have=PCRE_STATIC . auto/have
- CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
- LINK_DEPS="$LINK_DEPS $PCRE/pcre.lib"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre.lib"
- ;;
-
- icc* )
- have=NGX_PCRE . auto/have
- CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
-
- LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
-
- echo $ngx_n "checking for PCRE library ...$ngx_c"
-
- if [ -f $PCRE/pcre.h ]; then
- ngx_pcre_ver=`grep PCRE_MAJOR $PCRE/pcre.h \
- | sed -e 's/^.*PCRE_MAJOR.* \(.*\)$/\1/'`
-
- else if [ -f $PCRE/configure.in ]; then
- ngx_pcre_ver=`grep PCRE_MAJOR= $PCRE/configure.in \
- | sed -e 's/^.*=\(.*\)$/\1/'`
-
- else
- ngx_pcre_ver=`grep pcre_major, $PCRE/configure.ac \
- | sed -e 's/^.*pcre_major,.*\[\(.*\)\].*$/\1/'`
- fi
- fi
-
- echo " $ngx_pcre_ver major version found"
-
- # to allow -ipo optimization we link with the *.o but not library
-
- case "$ngx_pcre_ver" in
- 4|5)
- CORE_LIBS="$CORE_LIBS $PCRE/pcre.o"
- ;;
-
- 6)
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
- ;;
-
- *)
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_chartables.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_compile.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_exec.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_fullinfo.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_globals.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_tables.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_try_flipped.o"
- CORE_LIBS="$CORE_LIBS $PCRE/pcre_newline.o"
- ;;
-
- esac
- ;;
-
- *)
- have=NGX_PCRE . auto/have
-
- if [ "$NGX_PLATFORM" = win32 ]; then
- have=PCRE_STATIC . auto/have
- fi
-
- CORE_DEPS="$CORE_DEPS $PCRE/pcre.h"
- LINK_DEPS="$LINK_DEPS $PCRE/.libs/libpcre.a"
- CORE_LIBS="$CORE_LIBS $PCRE/.libs/libpcre.a"
- ;;
-
- esac
-
-
- if [ $PCRE_JIT = YES ]; then
- have=NGX_HAVE_PCRE_JIT . auto/have
- PCRE_CONF_OPT="$PCRE_CONF_OPT --enable-jit"
- fi
-
-else
-
- if [ "$NGX_PLATFORM" != win32 ]; then
-
- PCRE=NO
-
- ngx_feature="PCRE library"
- ngx_feature_name="NGX_PCRE"
- ngx_feature_run=no
- ngx_feature_incs="#include <pcre.h>"
- ngx_feature_path=
- ngx_feature_libs="-lpcre"
- ngx_feature_test="pcre *re;
- re = pcre_compile(NULL, 0, NULL, 0, NULL);
- if (re == NULL) return 1"
- . auto/feature
-
- if [ $ngx_found = no ]; then
-
- # FreeBSD port
-
- ngx_feature="PCRE library in /usr/local/"
- ngx_feature_path="/usr/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lpcre"
- else
- ngx_feature_libs="-L/usr/local/lib -lpcre"
- fi
-
- . auto/feature
- fi
-
- if [ $ngx_found = no ]; then
-
- # RedHat RPM, Solaris package
-
- ngx_feature="PCRE library in /usr/include/pcre/"
- ngx_feature_path="/usr/include/pcre"
- ngx_feature_libs="-lpcre"
-
- . auto/feature
- fi
-
- if [ $ngx_found = no ]; then
-
- # NetBSD port
-
- ngx_feature="PCRE library in /usr/pkg/"
- ngx_feature_path="/usr/pkg/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lpcre"
- else
- ngx_feature_libs="-L/usr/pkg/lib -lpcre"
- fi
-
- . auto/feature
- fi
-
- if [ $ngx_found = no ]; then
-
- # MacPorts
-
- ngx_feature="PCRE library in /opt/local/"
- ngx_feature_path="/opt/local/include"
-
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lpcre"
- else
- ngx_feature_libs="-L/opt/local/lib -lpcre"
- fi
-
- . auto/feature
- fi
-
- if [ $ngx_found = yes ]; then
- CORE_INCS="$CORE_INCS $ngx_feature_path"
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
- PCRE=YES
- fi
-
- if [ $PCRE = YES ]; then
- ngx_feature="PCRE JIT support"
- ngx_feature_name="NGX_HAVE_PCRE_JIT"
- ngx_feature_test="int jit = 0;
- pcre_free_study(NULL);
- pcre_config(PCRE_CONFIG_JIT, &jit);
- if (jit != 1) return 1;"
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- PCRE_JIT=YES
- fi
- fi
- fi
-
- if [ $PCRE != YES ]; then
-cat << END
-
-$0: error: the HTTP rewrite module requires the PCRE library.
-You can either disable the module by using --without-http_rewrite_module
-option, or install the PCRE library into the system, or build the PCRE library
-statically from the source with nginx by using --with-pcre=<path> option.
-
-END
- exit 1
- fi
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/make
deleted file mode 100644
index 0a27a112c11..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/make
+++ /dev/null
@@ -1,64 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-case "$NGX_CC_NAME" in
-
- msvc*)
- ngx_makefile=makefile.msvc
- ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
- ngx_pcre="PCRE=\"$PCRE\""
- ;;
-
- owc*)
- ngx_makefile=makefile.owc
- ngx_opt="CPU_OPT=\"$CPU_OPT\""
- ngx_pcre=`echo PCRE=\"$PCRE\" | sed -e "s/\//$ngx_regex_dirsep/g"`
- ;;
-
- bcc)
- ngx_makefile=makefile.bcc
- ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
- ngx_pcre=`echo \-DPCRE=\"$PCRE\" | sed -e "s/\//$ngx_regex_dirsep/g"`
- ;;
-
- *)
- ngx_makefile=
- ;;
-
-esac
-
-
-if [ -n "$ngx_makefile" ]; then
-
- cat << END >> $NGX_MAKEFILE
-
-`echo "$PCRE/pcre.lib: $PCRE/pcre.h $NGX_MAKEFILE" \
- | sed -e "s/\//$ngx_regex_dirsep/g"`
- \$(MAKE) -f auto/lib/pcre/$ngx_makefile $ngx_pcre $ngx_opt
-
-`echo "$PCRE/pcre.h:" | sed -e "s/\//$ngx_regex_dirsep/g"`
- \$(MAKE) -f auto/lib/pcre/$ngx_makefile $ngx_pcre pcre.h
-
-END
-
-else
-
- cat << END >> $NGX_MAKEFILE
-
-$PCRE/pcre.h: $PCRE/Makefile
-
-$PCRE/Makefile: $NGX_MAKEFILE
- cd $PCRE \\
- && if [ -f Makefile ]; then \$(MAKE) distclean; fi \\
- && CC="\$(CC)" CFLAGS="$PCRE_OPT" \\
- ./configure --disable-shared $PCRE_CONF_OPT
-
-$PCRE/.libs/libpcre.a: $PCRE/Makefile
- cd $PCRE \\
- && \$(MAKE) libpcre.la
-
-END
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.bcc
deleted file mode 100644
index 7a0f2beafc6..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.bcc
+++ /dev/null
@@ -1,27 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -q -O2 -tWM -w-8004 $(CPU_OPT)
-PCREFLAGS = -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 \
- -DSUPPORT_PCRE8 -DHAVE_MEMMOVE
-
-
-pcre.lib:
- cd $(PCRE)
-
- bcc32 -c $(CFLAGS) -I. $(PCREFLAGS) pcre_*.c
-
- copy /y nul pcre.lst
- for %n in (*.obj) do @echo +%n ^^& >> pcre.lst
- echo + >> pcre.lst
-
- tlib pcre.lib @pcre.lst
-
-pcre.h:
- cd $(PCRE)
-
- copy /y pcre.h.generic pcre.h
- copy /y config.h.generic config.h
- copy /y pcre_chartables.c.dist pcre_chartables.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.msvc
deleted file mode 100644
index 07fd9a2853a..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.msvc
+++ /dev/null
@@ -1,23 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT)
-PCREFLAGS = -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 \
- -DSUPPORT_PCRE8 -DHAVE_MEMMOVE
-
-
-pcre.lib:
- cd $(PCRE)
-
- cl -nologo -c $(CFLAGS) -I . $(PCREFLAGS) pcre_*.c
-
- link -lib -out:pcre.lib -verbose:lib pcre_*.obj
-
-pcre.h:
- cd $(PCRE)
-
- copy /y pcre.h.generic pcre.h
- copy /y config.h.generic config.h
- copy /y pcre_chartables.c.dist pcre_chartables.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.owc
deleted file mode 100644
index 122fd5b27f2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/pcre/makefile.owc
+++ /dev/null
@@ -1,25 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -c -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
-PCREFLAGS = -DHAVE_CONFIG_H -DPCRE_STATIC -DPOSIX_MALLOC_THRESHOLD=10 &
- -DSUPPORT_PCRE8 -DHAVE_MEMMOVE
-
-
-pcre.lib:
- cd $(PCRE)
-
- wcl386 $(CFLAGS) -i=. $(PCREFLAGS) pcre_*.c
-
- dir /b *.obj > pcre.lst
-
- wlib -n pcre.lib @pcre.lst
-
-pcre.h:
- cd $(PCRE)
-
- copy /y pcre.h.generic pcre.h
- copy /y config.h.generic config.h
- copy /y pcre_chartables.c.dist pcre_chartables.c
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/conf
deleted file mode 100644
index 2a1a3fe3cf2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/conf
+++ /dev/null
@@ -1,78 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo "checking for perl"
-
-
-NGX_PERL_VER=`$NGX_PERL -v 2>&1 | grep '^This is perl' 2>&1 \
- | sed -e 's/^This is perl, \(.*\)/\1/'`
-
-if test -n "$NGX_PERL_VER"; then
- echo " + perl version: $NGX_PERL_VER"
-
- if [ "`$NGX_PERL -e 'use 5.006001; print "OK"'`" != "OK" ]; then
- echo
- echo "$0: error: perl 5.6.1 or higher is required"
- echo
-
- exit 1;
- fi
-
- if [ "`$NGX_PERL -MExtUtils::Embed -e 'print "OK"'`" != "OK" ]; then
- echo
- echo "$0: error: perl module ExtUtils::Embed is required"
- echo
-
- exit 1;
- fi
-
- NGX_PERL_CFLAGS="$CFLAGS `$NGX_PERL -MExtUtils::Embed -e ccopts`"
- NGX_PM_CFLAGS=`$NGX_PERL -MExtUtils::Embed -e ccopts`
-
- # gcc 4.1/4.2 warn about unused values in pTHX_
- NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
- | sed -e 's/-Wunused-value/-Wno-unused-value/'`
- # icc8 warns 'declaration hides parameter "my_perl"' in ENTER and LEAVE
- NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
- | sed -e 's/-wd171/-wd171 -wd1599/'`
-
- ngx_perl_ldopts=`$NGX_PERL -MExtUtils::Embed -e ldopts`
-
- ngx_perl_dlext=`$NGX_PERL -MConfig -e 'print $Config{dlext}'`
- ngx_perl_libdir="src/http/modules/perl/blib/arch/auto"
- ngx_perl_module="$ngx_perl_libdir/nginx/nginx.$ngx_perl_dlext"
-
- if $NGX_PERL -V:usemultiplicity | grep define > /dev/null; then
- have=NGX_HAVE_PERL_MULTIPLICITY . auto/have
- echo " + perl interpreter multiplicity found"
- fi
-
- if $NGX_PERL -V:useithreads | grep undef > /dev/null; then
- # FreeBSD port wants to link with -pthread non-threaded perl
- ngx_perl_ldopts=`echo $ngx_perl_ldopts | sed 's/ -pthread//'`
- fi
-
- if [ "$NGX_SYSTEM" = "Darwin" ]; then
- # OS X system perl wants to link universal binaries
- ngx_perl_ldopts=`echo $ngx_perl_ldopts \
- | sed -e 's/-arch x86_64 -arch i386//'`
- fi
-
- CORE_LINK="$CORE_LINK $ngx_perl_ldopts"
- LINK_DEPS="$LINK_DEPS $NGX_OBJS/$ngx_perl_module"
-
- if test -n "$NGX_PERL_MODULES"; then
- have=NGX_PERL_MODULES value="(u_char *) \"$NGX_PERL_MODULES\""
- . auto/define
- NGX_PERL_MODULES_MAN=$NGX_PERL_MODULES/man3
- fi
-
-else
- echo
- echo "$0: error: perl 5.6.1 or higher is required"
- echo
-
- exit 1;
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/make
deleted file mode 100644
index d1c1b9e48c1..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/perl/make
+++ /dev/null
@@ -1,41 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-v=`grep 'define NGINX_VERSION' src/core/nginx.h | sed -e 's/^.*"\(.*\)".*/\1/'`
-
-
-cat << END >> $NGX_MAKEFILE
-
-$NGX_OBJS/src/http/modules/perl/blib/arch/auto/nginx/nginx.$ngx_perl_dlext: \\
- \$(CORE_DEPS) \$(HTTP_DEPS) \\
- src/http/modules/perl/ngx_http_perl_module.h \\
- $NGX_OBJS/src/http/modules/perl/Makefile
- cd $NGX_OBJS/src/http/modules/perl && \$(MAKE)
-
- rm -rf $NGX_OBJS/install_perl
-
-
-$NGX_OBJS/src/http/modules/perl/Makefile: \\
- $NGX_AUTO_CONFIG_H \\
- src/core/nginx.h \\
- src/http/modules/perl/Makefile.PL \\
- src/http/modules/perl/nginx.pm \\
- src/http/modules/perl/nginx.xs \\
- src/http/modules/perl/typemap
- sed "s/%%VERSION%%/$v/" src/http/modules/perl/nginx.pm > \\
- $NGX_OBJS/src/http/modules/perl/nginx.pm
- cp -p src/http/modules/perl/nginx.xs $NGX_OBJS/src/http/modules/perl/
- cp -p src/http/modules/perl/typemap $NGX_OBJS/src/http/modules/perl/
- cp -p src/http/modules/perl/Makefile.PL $NGX_OBJS/src/http/modules/perl/
-
- cd $NGX_OBJS/src/http/modules/perl \\
- && NGX_PM_CFLAGS="\$(NGX_PM_CFLAGS) -g $NGX_CC_OPT" \\
- NGX_INCS="$CORE_INCS $NGX_OBJS $HTTP_INCS" \\
- NGX_DEPS="\$(CORE_DEPS) \$(HTTP_DEPS)" \\
- $NGX_PERL Makefile.PL \\
- LIB=$NGX_PERL_MODULES \\
- INSTALLSITEMAN3DIR=$NGX_PERL_MODULES_MAN
-
-END
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/conf
deleted file mode 100644
index fd69afda22b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/conf
+++ /dev/null
@@ -1,79 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ $SHA1 != NONE ]; then
-
- have=NGX_HAVE_SHA1 . auto/have
- CORE_INCS="$CORE_INCS $SHA1"
-
- case "$NGX_CC_NAME" in
-
- msvc* | owc* | bcc)
- LINK_DEPS="$LINK_DEPS $SHA1/sha1.lib"
- CORE_LIBS="$CORE_LIBS $SHA1/sha1.lib"
- ;;
-
- icc*)
- LINK_DEPS="$LINK_DEPS $SHA1/libsha.a"
-
- # to allow -ipo optimization we link with the *.o but not library
- CORE_LIBS="$CORE_LIBS $SHA1/sha1_dgst.o"
-
- if [ $SHA1_ASM = YES ]; then
- CORE_LIBS="$CORE_LIBS $SHA1/asm/sx86-elf.o"
- fi
- ;;
-
- *)
- LINK_DEPS="$LINK_DEPS $SHA1/libsha.a"
- CORE_LIBS="$CORE_LIBS $SHA1/libsha.a"
- #CORE_LIBS="$CORE_LIBS -L $SHA1 -lsha"
- ;;
-
- esac
-
-else
-
- if [ "$NGX_PLATFORM" != win32 ]; then
-
- SHA1=NO
-
- # FreeBSD
-
- ngx_feature="sha1 in system md library"
- ngx_feature_name=NGX_HAVE_SHA1
- ngx_feature_run=no
- ngx_feature_incs="#include <sha.h>"
- ngx_feature_path=
- ngx_feature_libs="-lmd"
- ngx_feature_test="SHA_CTX sha1; SHA1_Init(&sha1)"
- . auto/feature
-
- ngx_sha1_lib="system md"
-
- if [ $ngx_found = no ]; then
-
- # OpenSSL crypto library
-
- ngx_feature="sha1 in system OpenSSL crypto library"
- ngx_feature_incs="#include <openssl/sha.h>"
- ngx_feature_libs="-lcrypto"
- . auto/feature
-
- ngx_sha1_lib="system crypto"
-
- if [ $ngx_found = yes ]; then
- have=NGX_HAVE_OPENSSL_SHA1_H . auto/have
- fi
- fi
-
- if [ $ngx_found = yes ]; then
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
- SHA1=YES
- SHA1_LIB=$ngx_sha1_lib
- fi
- fi
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/make
deleted file mode 100644
index fc10aaef38b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/make
+++ /dev/null
@@ -1,96 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-case "$NGX_CC_NAME" in
-
- msvc*)
- ngx_makefile=makefile.msvc
- ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC SHA1_ASM=$SHA1_ASM"
- ngx_sha1="SHA1=\"$SHA1\""
- ;;
-
- owc*)
- ngx_makefile=makefile.owc
- ngx_opt="CPU_OPT=\"$CPU_OPT\""
- ngx_sha1=`echo SHA1=\"$SHA1\" | sed -e "s/\//$ngx_regex_dirsep/g"`
- ;;
-
- bcc)
- ngx_makefile=makefile.bcc
- ngx_opt="-DCPU_OPT=\"$CPU_OPT\" -DSHA1_ASM=$SHA1_ASM"
- ngx_sha1=`echo \-DSHA1=\"$SHA1\" | sed -e "s/\//$ngx_regex_dirsep/g"`
- ;;
-
-esac
-
-
-done=NO
-
-
-case "$NGX_PLATFORM" in
-
- win32)
- cat << END >> $NGX_MAKEFILE
-
-`echo "$SHA1/sha1.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
- \$(MAKE) -f auto/lib/sha1/$ngx_makefile $ngx_opt $ngx_sha1
-
-END
-
- done=YES
- ;;
-
- SunOS:*:i86pc)
- if [ $SHA1_ASM = YES ]; then
-
- cat << END >> $NGX_MAKEFILE
-
-$SHA1/libsha.a: $NGX_MAKEFILE
- cd $SHA1 \\
- && \$(MAKE) CFLAGS="$SHA1_OPT -DSOL -DSHA1_ASM -DL_ENDIAN" \\
- CC="\$(CC)" CPP="\$(CPP)" \\
- SHA_ASM_OBJ=asm/sx86-sol.o clean libsha.a
-
-END
-
- done=YES
- fi
- ;;
-
- # FreeBSD: i386
- # Linux: i686
-
- *:i386 | *:i686)
- if [ $SHA1_ASM = YES ]; then
-
- cat << END >> $NGX_MAKEFILE
-
-$SHA1/libsha.a: $NGX_MAKEFILE
- cd $SHA1 \\
- && \$(MAKE) CFLAGS="$SHA1_OPT -DELF -DSHA1_ASM -DL_ENDIAN" \\
- CC="\$(CC)" CPP="\$(CPP)" \\
- SHA_ASM_OBJ=asm/sx86-elf.o clean libsha.a
-
-END
-
- done=YES
- fi
- ;;
-
-esac
-
-
-if [ $done = NO ]; then
-
- cat << END >> $NGX_MAKEFILE
-
-$SHA1/libsha.a: $NGX_MAKEFILE
- cd $SHA1 \\
- && \$(MAKE) CFLAGS="$SHA1_OPT" \\
- CC="\$(CC)" SHA_ASM_OBJ= clean libsha.a
-
-END
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.bcc
deleted file mode 100644
index b0685fa4512..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.bcc
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN
-
-!if "$(SHA1_ASM)" == "YES"
-
-sha1.lib:
- cd $(SHA1)
- bcc32 -c $(CFLAGS) -DSHA1_ASM sha1dgst.c
- tlib sha1.lib +sha1dgst.obj +"asm\s-win32.obj"
-
-!else
-
-sha1.lib:
- cd $(SHA1)
- bcc32 -c $(CFLAGS) sha1dgst.c
- tlib sha1.lib +sha1dgst.obj
-
-!endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.msvc
deleted file mode 100644
index 3cbd21b3dbd..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.msvc
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
-
-!IF "$(SHA1_ASM)" == "YES"
-
-sha1.lib:
- cd $(SHA1)
- cl -c $(CFLAGS) -D SHA1_ASM sha1dgst.c
- link -lib -out:sha1.lib sha1dgst.obj asm/s-win32.obj
-
-!ELSE
-
-sha1.lib:
- cd $(SHA1)
- cl -c $(CFLAGS) sha1dgst.c
- link -lib -out:sha1.lib sha1dgst.obj
-
-!ENDIF
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.owc
deleted file mode 100644
index fc095cc980a..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/sha1/makefile.owc
+++ /dev/null
@@ -1,11 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)
-
-sha1.lib:
- cd $(SHA1)
- wcl386 -c $(CFLAGS) -dL_ENDIAN sha1dgst.c
- wlib -n sha1.lib sha1dgst.obj
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/test b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/test
deleted file mode 100644
index ba943a29d40..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/test
+++ /dev/null
@@ -1,40 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo $ngx_n "checking for $ngx_lib ...$ngx_c"
-
-cat << END >> $NGX_AUTOCONF_ERR
-
-----------------------------------------
-checking for $ngx_lib
-
-END
-
-ngx_found=no
-
-cat << END > $NGX_AUTOTEST.c
-
-$ngx_lib_incs
-
-int main() {
- $ngx_lib_test;
- return 0;
-}
-
-
-eval "$CC $cc_test_flags $ngx_lib_cflags \
- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $ngx_libs \
- >> $NGX_ERR 2>&1"
-
-if [ -x $NGX_AUTOTEST ]; then
- echo " found"
-
- ngx_found=yes
-
-else
- echo " not found"
-fi
-
-rm -rf $NGX_AUTOTEST*
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/conf
deleted file mode 100644
index 26db642ac90..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/conf
+++ /dev/null
@@ -1,79 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ $ZLIB != NONE ]; then
- CORE_INCS="$CORE_INCS $ZLIB"
-
- case "$NGX_CC_NAME" in
-
- msvc* | owc* | bcc)
- have=NGX_ZLIB . auto/have
- LINK_DEPS="$LINK_DEPS $ZLIB/zlib.lib"
- CORE_LIBS="$CORE_LIBS $ZLIB/zlib.lib"
- ;;
-
- icc*)
- have=NGX_ZLIB . auto/have
- LINK_DEPS="$LINK_DEPS $ZLIB/libz.a"
-
- # to allow -ipo optimization we link with the *.o but not library
- CORE_LIBS="$CORE_LIBS $ZLIB/adler32.o"
- CORE_LIBS="$CORE_LIBS $ZLIB/crc32.o"
- CORE_LIBS="$CORE_LIBS $ZLIB/deflate.o"
- CORE_LIBS="$CORE_LIBS $ZLIB/trees.o"
- CORE_LIBS="$CORE_LIBS $ZLIB/zutil.o"
- CORE_LIBS="$CORE_LIBS $ZLIB/compress.o"
-
- if [ $ZLIB_ASM != NO ]; then
- CORE_LIBS="$CORE_LIBS $ZLIB/match.o"
- fi
- ;;
-
- *)
- have=NGX_ZLIB . auto/have
- LINK_DEPS="$LINK_DEPS $ZLIB/libz.a"
- CORE_LIBS="$CORE_LIBS $ZLIB/libz.a"
- #CORE_LIBS="$CORE_LIBS -L $ZLIB -lz"
- ;;
-
- esac
-
-else
-
- if [ "$NGX_PLATFORM" != win32 ]; then
- ZLIB=NO
-
- # FreeBSD, Solaris, Linux
-
- ngx_feature="zlib library"
- ngx_feature_name="NGX_ZLIB"
- ngx_feature_run=no
- ngx_feature_incs="#include <zlib.h>"
- ngx_feature_path=
- ngx_feature_libs="-lz"
- ngx_feature_test="z_stream z; deflate(&z, Z_NO_FLUSH)"
- . auto/feature
-
-
- if [ $ngx_found = yes ]; then
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
- ZLIB=YES
- ngx_found=no
- fi
- fi
-
- if [ $ZLIB != YES ]; then
-cat << END
-
-$0: error: the HTTP gzip module requires the zlib library.
-You can either disable the module by using --without-http_gzip_module
-option, or install the zlib library into the system, or build the zlib library
-statically from the source with nginx by using --with-zlib=<path> option.
-
-END
- exit 1
- fi
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/make
deleted file mode 100644
index 7875ef67fe0..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/make
+++ /dev/null
@@ -1,135 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-case "$NGX_CC_NAME" in
-
- msvc*)
- ngx_makefile=makefile.msvc
- ngx_opt="CPU_OPT=\"$CPU_OPT\" LIBC=$LIBC"
- ngx_zlib="ZLIB=\"$ZLIB\""
-
- ;;
-
- owc*)
- ngx_makefile=makefile.owc
- ngx_opt="CPU_OPT=\"$CPU_OPT\""
- ngx_zlib=`echo ZLIB=\"$ZLIB\" | sed -e "s/\//$ngx_regex_dirsep/g"`
- ;;
-
- bcc)
- ngx_makefile=makefile.bcc
- ngx_opt="-DCPU_OPT=\"$CPU_OPT\""
- ngx_zlib=`echo \-DZLIB=\"$ZLIB\" | sed -e "s/\//$ngx_regex_dirsep/g"`
- ;;
-
- *)
- ngx_makefile=
- ;;
-
-esac
-
-
-done=NO
-
-
-case "$NGX_PLATFORM" in
-
- win32)
-
- if [ -n "$ngx_makefile" ]; then
- cat << END >> $NGX_MAKEFILE
-
-`echo "$ZLIB/zlib.lib: $NGX_MAKEFILE" | sed -e "s/\//$ngx_regex_dirsep/g"`
- \$(MAKE) -f auto/lib/zlib/$ngx_makefile $ngx_opt $ngx_zlib
-
-END
-
- else
-
- cat << END >> $NGX_MAKEFILE
-
-$ZLIB/libz.a: $NGX_MAKEFILE
- cd $ZLIB \\
- && \$(MAKE) distclean \\
- && \$(MAKE) -f win32/Makefile.gcc \\
- CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
- libz.a
-
-END
-
- fi
-
- done=YES
- ;;
-
- # FreeBSD: i386
- # Linux: i686
-
- *:i386 | *:i686)
- case $ZLIB_ASM in
- pentium)
-
- cat << END >> $NGX_MAKEFILE
-
-$ZLIB/libz.a: $NGX_MAKEFILE
- cd $ZLIB \\
- && \$(MAKE) distclean \\
- && cp contrib/asm586/match.S . \\
- && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
- ./configure \\
- && \$(MAKE) OBJA=match.o libz.a
-
-END
-
- done=YES
- ;;
-
- pentiumpro)
-
- cat << END >> $NGX_MAKEFILE
-
-$ZLIB/libz.a: $NGX_MAKEFILE
- cd $ZLIB \\
- && \$(MAKE) distclean \\
- && cp contrib/asm686/match.S . \\
- && CFLAGS="$ZLIB_OPT -DASMV" CC="\$(CC)" \\
- ./configure \\
- && \$(MAKE) OBJA=match.o libz.a
-
-END
-
- done=YES
- ;;
-
- NO)
- ;;
-
- *)
- echo "$0: error: invalid --with-zlib-asm=$ZLIB_ASM option."
- echo "The valid values are \"pentium\" and \"pentiumpro\" only".
- echo
-
- exit 1;
- ;;
- esac
- ;;
-
-esac
-
-
-if [ $done = NO ]; then
-
- cat << END >> $NGX_MAKEFILE
-
-$ZLIB/libz.a: $NGX_MAKEFILE
- cd $ZLIB \\
- && \$(MAKE) distclean \\
- && CFLAGS="$ZLIB_OPT" CC="\$(CC)" \\
- ./configure \\
- && \$(MAKE) libz.a
-
-END
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.bcc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.bcc
deleted file mode 100644
index 97a30ea3951..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.bcc
+++ /dev/null
@@ -1,17 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -q -O2 -tWM -w-8004 -w-8012 $(CPU_OPT)
-
-zlib.lib:
- cd $(ZLIB)
-
- bcc32 -c $(CFLAGS) adler32.c crc32.c deflate.c \
- trees.c zutil.c compress.c \
- inflate.c inffast.c inftrees.c
-
- tlib zlib.lib +adler32.obj +crc32.obj +deflate.obj \
- +trees.obj +zutil.obj +compress.obj \
- +inflate.obj +inffast.obj +inftrees.obj
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.msvc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.msvc
deleted file mode 100644
index 6fbd6918c2f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.msvc
+++ /dev/null
@@ -1,17 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT)
-
-zlib.lib:
- cd $(ZLIB)
-
- cl -c $(CFLAGS) adler32.c crc32.c deflate.c \
- trees.c zutil.c compress.c \
- inflate.c inffast.c inftrees.c
-
- link -lib -out:zlib.lib adler32.obj crc32.obj deflate.obj \
- trees.obj zutil.obj compress.obj \
- inflate.obj inffast.obj inftrees.obj
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.owc b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.owc
deleted file mode 100644
index 9e123be83e9..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/lib/zlib/makefile.owc
+++ /dev/null
@@ -1,14 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CFLAGS = -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)
-
-zlib.lib:
- cd $(ZLIB)
-
- wcl386 -c $(CFLAGS) adler32.c crc32.c deflate.c trees.c zutil.c &
- compress.c inflate.c inffast.c inftrees.c
- wlib -n zlib.lib adler32.obj crc32.obj deflate.obj trees.obj &
- zutil.obj compress.obj inflate.obj inffast.obj inftrees.obj
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/make b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/make
deleted file mode 100644
index 05b74543c53..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/make
+++ /dev/null
@@ -1,417 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo "creating $NGX_MAKEFILE"
-
-mkdir -p $NGX_OBJS/src/core $NGX_OBJS/src/event $NGX_OBJS/src/event/modules \
- $NGX_OBJS/src/os/unix $NGX_OBJS/src/os/win32 \
- $NGX_OBJS/src/http $NGX_OBJS/src/http/modules \
- $NGX_OBJS/src/http/modules/perl \
- $NGX_OBJS/src/mail \
- $NGX_OBJS/src/misc
-
-
-ngx_objs_dir=$NGX_OBJS$ngx_regex_dirsep
-ngx_use_pch=`echo $NGX_USE_PCH | sed -e "s/\//$ngx_regex_dirsep/g"`
-
-
-cat << END > $NGX_MAKEFILE
-
-CC = $CC
-CFLAGS = $CFLAGS
-CPP = $CPP
-LINK = $LINK
-
-END
-
-
-if test -n "$NGX_PERL_CFLAGS"; then
- echo NGX_PERL_CFLAGS = $NGX_PERL_CFLAGS >> $NGX_MAKEFILE
- echo NGX_PM_CFLAGS = $NGX_PM_CFLAGS >> $NGX_MAKEFILE
-fi
-
-
-# ALL_INCS, required by the addons and by OpenWatcom C precompiled headers
-
-ngx_incs=`echo $CORE_INCS $NGX_OBJS $HTTP_INCS $MAIL_INCS\
- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
- -e "s/\//$ngx_regex_dirsep/g"`
-
-cat << END >> $NGX_MAKEFILE
-
-ALL_INCS = $ngx_include_opt$ngx_incs
-
-END
-
-
-ngx_all_srcs="$CORE_SRCS"
-
-
-# the core dependences and include paths
-
-ngx_deps=`echo $CORE_DEPS $NGX_AUTO_CONFIG_H $NGX_PCH \
- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
- -e "s/\//$ngx_regex_dirsep/g"`
-
-ngx_incs=`echo $CORE_INCS $NGX_OBJS \
- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
- -e "s/\//$ngx_regex_dirsep/g"`
-
-cat << END >> $NGX_MAKEFILE
-
-CORE_DEPS = $ngx_deps
-
-
-CORE_INCS = $ngx_include_opt$ngx_incs
-
-END
-
-
-# the http dependences and include paths
-
-if [ $HTTP = YES ]; then
-
- ngx_all_srcs="$ngx_all_srcs $HTTP_SRCS"
-
- ngx_deps=`echo $HTTP_DEPS \
- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
- -e "s/\//$ngx_regex_dirsep/g"`
-
- ngx_incs=`echo $HTTP_INCS \
- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
- -e "s/\//$ngx_regex_dirsep/g"`
-
- cat << END >> $NGX_MAKEFILE
-
-HTTP_DEPS = $ngx_deps
-
-
-HTTP_INCS = $ngx_include_opt$ngx_incs
-
-END
-
-fi
-
-
-# the mail dependences and include paths
-
-if [ $MAIL = YES ]; then
-
- ngx_all_srcs="$ngx_all_srcs $MAIL_SRCS"
-
- ngx_deps=`echo $MAIL_DEPS \
- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
- -e "s/\//$ngx_regex_dirsep/g"`
-
- ngx_incs=`echo $MAIL_INCS \
- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont$ngx_include_opt\1/g" \
- -e "s/\//$ngx_regex_dirsep/g"`
-
- cat << END >> $NGX_MAKEFILE
-
-MAIL_DEPS = $ngx_deps
-
-
-MAIL_INCS = $ngx_include_opt$ngx_incs
-
-END
-
-fi
-
-
-ngx_all_srcs="$ngx_all_srcs $NGX_MISC_SRCS"
-
-
-if test -n "$NGX_ADDON_SRCS"; then
-
-cat << END >> $NGX_MAKEFILE
-
-ADDON_DEPS = \$(CORE_DEPS) $NGX_ADDON_DEPS
-
-END
-
-fi
-
-
-# nginx
-
-ngx_all_srcs=`echo $ngx_all_srcs | sed -e "s/\//$ngx_regex_dirsep/g"`
-
-for ngx_src in $NGX_ADDON_SRCS
-do
- ngx_obj="addon/`basename \`dirname $ngx_src\``"
-
- test -d $NGX_OBJS/$ngx_obj || mkdir -p $NGX_OBJS/$ngx_obj
-
- ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \
- | sed -e "s/\//$ngx_regex_dirsep/g"`
-
- ngx_all_srcs="$ngx_all_srcs $ngx_obj"
-done
-
-ngx_all_objs=`echo $ngx_all_srcs \
- | sed -e "s#\([^ ]*\.\)cpp#$NGX_OBJS\/\1$ngx_objext#g" \
- -e "s#\([^ ]*\.\)cc#$NGX_OBJS\/\1$ngx_objext#g" \
- -e "s#\([^ ]*\.\)c#$NGX_OBJS\/\1$ngx_objext#g" \
- -e "s#\([^ ]*\.\)S#$NGX_OBJS\/\1$ngx_objext#g"`
-
-ngx_modules_c=`echo $NGX_MODULES_C | sed -e "s/\//$ngx_regex_dirsep/g"`
-
-ngx_modules_obj=`echo $ngx_modules_c | sed -e "s/\(.*\.\)c/\1$ngx_objext/"`
-
-
-if test -n "$NGX_RES"; then
- ngx_res=$NGX_RES
-else
- ngx_res="$NGX_RC $NGX_ICONS"
- ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"`
-fi
-
-ngx_deps=`echo $ngx_all_objs $ngx_modules_obj $ngx_res $LINK_DEPS \
- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_regex_cont\1/g" \
- -e "s/\//$ngx_regex_dirsep/g"`
-
-ngx_objs=`echo $ngx_all_objs $ngx_modules_obj \
- | sed -e "s/ *\([^ ][^ ]*\)/$ngx_long_regex_cont\1/g" \
- -e "s/\//$ngx_regex_dirsep/g"`
-
-if test -n "$NGX_LD_OPT$CORE_LIBS"; then
- ngx_libs=`echo $NGX_LD_OPT $CORE_LIBS \
- | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`
-fi
-
-ngx_link=${CORE_LINK:+`echo $CORE_LINK \
- | sed -e "s/\//$ngx_regex_dirsep/g" -e "s/^/$ngx_long_regex_cont/"`}
-
-
-cat << END >> $NGX_MAKEFILE
-
-$NGX_OBJS${ngx_dirsep}nginx${ngx_binext}: $ngx_deps$ngx_spacer
- \$(LINK) ${ngx_long_start}${ngx_binout}$NGX_OBJS${ngx_dirsep}nginx$ngx_long_cont$ngx_objs$ngx_libs$ngx_link
- $ngx_rcc
-${ngx_long_end}
-END
-
-
-# ngx_modules.c
-
-if test -n "$NGX_PCH"; then
- ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
-else
- ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS)"
-fi
-
-cat << END >> $NGX_MAKEFILE
-
-$ngx_modules_obj: \$(CORE_DEPS)$ngx_cont$ngx_modules_c
- $ngx_cc$ngx_tab$ngx_objout$ngx_modules_obj$ngx_tab$ngx_modules_c$NGX_AUX
-
-END
-
-
-# the core sources
-
-for ngx_src in $CORE_SRCS
-do
- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
- ngx_obj=`echo $ngx_src \
- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
-
- cat << END >> $NGX_MAKEFILE
-
-$ngx_obj: \$(CORE_DEPS)$ngx_cont$ngx_src
- $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
-
-END
-
-done
-
-
-# the http sources
-
-if [ $HTTP = YES ]; then
-
- if test -n "$NGX_PCH"; then
- ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
- else
- ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(HTTP_INCS)"
- ngx_perl_cc="\$(CC) $ngx_compile_opt \$(NGX_PERL_CFLAGS) "
- ngx_perl_cc="$ngx_perl_cc \$(CORE_INCS) \$(HTTP_INCS)"
- fi
-
- for ngx_source in $HTTP_SRCS
- do
- ngx_src=`echo $ngx_source | sed -e "s/\//$ngx_regex_dirsep/g"`
- ngx_obj=`echo $ngx_src \
- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
-
- if [ $ngx_source = src/http/modules/perl/ngx_http_perl_module.c ]; then
-
- cat << END >> $NGX_MAKEFILE
-
-$ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
- $ngx_perl_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
-
-END
- else
-
- cat << END >> $NGX_MAKEFILE
-
-$ngx_obj: \$(CORE_DEPS) \$(HTTP_DEPS)$ngx_cont$ngx_src
- $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
-
-END
-
- fi
- done
-
-fi
-
-
-# the mail sources
-
-if [ $MAIL = YES ]; then
-
- if test -n "$NGX_PCH"; then
- ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
- else
- ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) \$(CORE_INCS) \$(MAIL_INCS)"
- fi
-
- for ngx_src in $MAIL_SRCS
- do
- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
- ngx_obj=`echo $ngx_src \
- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
-
- cat << END >> $NGX_MAKEFILE
-
-$ngx_obj: \$(CORE_DEPS) \$(MAIL_DEPS)$ngx_cont$ngx_src
- $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
-
-END
- done
-
-fi
-
-
-# the misc sources
-
-if test -n "$NGX_MISC_SRCS"; then
-
- ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
-
- for ngx_src in $NGX_MISC_SRCS
- do
- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
- ngx_obj=`echo $ngx_src \
- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
-
- cat << END >> $NGX_MAKEFILE
-
-$ngx_obj: \$(CORE_DEPS) $ngx_cont$ngx_src
- $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
-
-END
- done
-
-fi
-
-
-# the addons sources
-
-if test -n "$NGX_ADDON_SRCS"; then
-
- ngx_cc="\$(CC) $ngx_compile_opt \$(CFLAGS) $ngx_use_pch \$(ALL_INCS)"
-
- for ngx_src in $NGX_ADDON_SRCS
- do
- ngx_obj="addon/`basename \`dirname $ngx_src\``"
-
- ngx_obj=`echo $ngx_obj/\`basename $ngx_src\` \
- | sed -e "s/\//$ngx_regex_dirsep/g"`
-
- ngx_obj=`echo $ngx_obj \
- | sed -e "s#^\(.*\.\)cpp\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)cc\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)c\\$#$ngx_objs_dir\1$ngx_objext#g" \
- -e "s#^\(.*\.\)S\\$#$ngx_objs_dir\1$ngx_objext#g"`
-
- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
-
- cat << END >> $NGX_MAKEFILE
-
-$ngx_obj: \$(ADDON_DEPS)$ngx_cont$ngx_src
- $ngx_cc$ngx_tab$ngx_objout$ngx_obj$ngx_tab$ngx_src$NGX_AUX
-
-END
- done
-
-fi
-
-
-# the addons config.make
-
-if test -n "$NGX_ADDONS"; then
-
- for ngx_addon_dir in $NGX_ADDONS
- do
- if test -f $ngx_addon_dir/config.make; then
- . $ngx_addon_dir/config.make
- fi
- done
-fi
-
-
-# Win32 resource file
-
-if test -n "$NGX_RES"; then
-
- ngx_res=`echo "$NGX_RES: $NGX_RC $NGX_ICONS" \
- | sed -e "s/\//$ngx_regex_dirsep/g"`
- ngx_rcc=`echo $NGX_RCC | sed -e "s/\//$ngx_regex_dirsep/g"`
-
- cat << END >> $NGX_MAKEFILE
-
-$ngx_res
- $ngx_rcc
-
-END
-
-fi
-
-
-# the precompiled headers
-
-if test -n "$NGX_PCH"; then
- echo "#include <ngx_config.h>" > $NGX_OBJS/ngx_pch.c
-
- ngx_pch="src/core/ngx_config.h $OS_CONFIG $NGX_OBJS/ngx_auto_config.h"
- ngx_pch=`echo "$NGX_PCH: $ngx_pch" | sed -e "s/\//$ngx_regex_dirsep/g"`
-
- ngx_src="\$(CC) \$(CFLAGS) $NGX_BUILD_PCH $ngx_compile_opt \$(ALL_INCS)"
- ngx_src="$ngx_src $ngx_objout$NGX_OBJS/ngx_pch.obj $NGX_OBJS/ngx_pch.c"
- ngx_src=`echo $ngx_src | sed -e "s/\//$ngx_regex_dirsep/g"`
-
- cat << END >> $NGX_MAKEFILE
-
-$ngx_pch
- $ngx_src
-
-END
-
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/modules b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/modules
deleted file mode 100644
index 78859676357..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/modules
+++ /dev/null
@@ -1,534 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-if [ $EVENT_SELECT = NO -a $EVENT_FOUND = NO ]; then
- EVENT_SELECT=YES
-fi
-
-if [ $EVENT_SELECT = YES ]; then
- have=NGX_HAVE_SELECT . auto/have
- CORE_SRCS="$CORE_SRCS $SELECT_SRCS"
- EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE"
-fi
-
-
-if [ $EVENT_POLL = NO -a $EVENT_FOUND = NO ]; then
- EVENT_POLL=YES
-fi
-
-if [ $EVENT_POLL = YES ]; then
- have=NGX_HAVE_POLL . auto/have
- CORE_SRCS="$CORE_SRCS $POLL_SRCS"
- EVENT_MODULES="$EVENT_MODULES $POLL_MODULE"
-fi
-
-
-if [ $NGX_TEST_BUILD_DEVPOLL = YES ]; then
- have=NGX_HAVE_DEVPOLL . auto/have
- have=NGX_TEST_BUILD_DEVPOLL . auto/have
- EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
- CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
-fi
-
-
-if [ $NGX_TEST_BUILD_EVENTPORT = YES ]; then
- have=NGX_HAVE_EVENTPORT . auto/have
- have=NGX_TEST_BUILD_EVENTPORT . auto/have
- EVENT_MODULES="$EVENT_MODULES $EVENTPORT_MODULE"
- CORE_SRCS="$CORE_SRCS $EVENTPORT_SRCS"
-fi
-
-if [ $NGX_TEST_BUILD_EPOLL = YES ]; then
- have=NGX_HAVE_EPOLL . auto/have
- have=NGX_HAVE_EPOLLRDHUP . auto/have
- have=NGX_HAVE_EVENTFD . auto/have
- have=NGX_TEST_BUILD_EPOLL . auto/have
- EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
- CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
-fi
-
-if [ $NGX_TEST_BUILD_RTSIG = YES ]; then
- have=NGX_HAVE_RTSIG . auto/have
- have=NGX_TEST_BUILD_RTSIG . auto/have
- EVENT_MODULES="$EVENT_MODULES $RTSIG_MODULE"
- CORE_SRCS="$CORE_SRCS $RTSIG_SRCS"
-fi
-
-if [ $NGX_TEST_BUILD_SOLARIS_SENDFILEV = YES ]; then
- have=NGX_TEST_BUILD_SOLARIS_SENDFILEV . auto/have
- CORE_SRCS="$CORE_SRCS $SOLARIS_SENDFILEV_SRCS"
-fi
-
-
-if [ $HTTP != YES ]; then
- have=NGX_CRYPT . auto/nohave
- CRYPT_LIB=
-fi
-
-
-if [ $HTTP_CACHE = YES ]; then
- USE_MD5=YES
- have=NGX_HTTP_CACHE . auto/have
- HTTP_SRCS="$HTTP_SRCS $HTTP_FILE_CACHE_SRCS"
-fi
-
-
-if [ $HTTP_SSI = YES ]; then
- HTTP_POSTPONE=YES
-fi
-
-
-if [ $HTTP_ADDITION = YES ]; then
- HTTP_POSTPONE=YES
-fi
-
-
-# the module order is important
-# ngx_http_static_module
-# ngx_http_gzip_static_module
-# ngx_http_dav_module
-# ngx_http_autoindex_module
-# ngx_http_index_module
-# ngx_http_random_index_module
-#
-# ngx_http_access_module
-# ngx_http_realip_module
-#
-#
-# the filter order is important
-# ngx_http_write_filter
-# ngx_http_header_filter
-# ngx_http_chunked_filter
-# ngx_http_spdy_filter
-# ngx_http_range_header_filter
-# ngx_http_gzip_filter
-# ngx_http_postpone_filter
-# ngx_http_ssi_filter
-# ngx_http_charset_filter
-# ngx_http_xslt_filter
-# ngx_http_image_filter
-# ngx_http_sub_filter
-# ngx_http_addition_filter
-# ngx_http_gunzip_filter
-# ngx_http_userid_filter
-# ngx_http_headers_filter
-# ngx_http_copy_filter
-# ngx_http_range_body_filter
-# ngx_http_not_modified_filter
-
-HTTP_FILTER_MODULES="$HTTP_WRITE_FILTER_MODULE \
- $HTTP_HEADER_FILTER_MODULE \
- $HTTP_CHUNKED_FILTER_MODULE"
-
-if [ $HTTP_SPDY = YES ]; then
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SPDY_FILTER_MODULE"
-fi
-
-HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_RANGE_HEADER_FILTER_MODULE"
-
-if [ $HTTP_GZIP = YES ]; then
- have=NGX_HTTP_GZIP . auto/have
- USE_ZLIB=YES
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_GZIP_FILTER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_GZIP_SRCS"
-fi
-
-if [ $HTTP_POSTPONE = YES ]; then
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_POSTPONE_FILTER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_POSTPONE_FILTER_SRCS"
-fi
-
-if [ $HTTP_SSI = YES ]; then
- have=NGX_HTTP_SSI . auto/have
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SSI_FILTER_MODULE"
- HTTP_DEPS="$HTTP_DEPS $HTTP_SSI_DEPS"
- HTTP_SRCS="$HTTP_SRCS $HTTP_SSI_SRCS"
-fi
-
-if [ $HTTP_CHARSET = YES ]; then
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_CHARSET_FILTER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_CHARSET_SRCS"
-fi
-
-if [ $HTTP_XSLT = YES ]; then
- USE_LIBXSLT=YES
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_XSLT_FILTER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_XSLT_SRCS"
-fi
-
-if [ $HTTP_IMAGE_FILTER = YES ]; then
- USE_LIBGD=YES
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_IMAGE_FILTER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_IMAGE_SRCS"
-fi
-
-if [ $HTTP_SUB = YES ]; then
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_SUB_FILTER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_SUB_SRCS"
-fi
-
-if [ $HTTP_ADDITION = YES ]; then
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_ADDITION_FILTER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_ADDITION_SRCS"
-fi
-
-if [ $HTTP_GUNZIP = YES ]; then
- have=NGX_HTTP_GZIP . auto/have
- USE_ZLIB=YES
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_GUNZIP_FILTER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_GUNZIP_SRCS"
-fi
-
-if [ $HTTP_USERID = YES ]; then
- HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES $HTTP_USERID_FILTER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_USERID_SRCS"
-fi
-
-
-if [ $HTTP_SPDY = YES ]; then
- have=NGX_HTTP_SPDY . auto/have
- USE_ZLIB=YES
- HTTP_MODULES="$HTTP_MODULES $HTTP_SPDY_MODULE"
- HTTP_DEPS="$HTTP_DEPS $HTTP_SPDY_DEPS"
- HTTP_SRCS="$HTTP_SRCS $HTTP_SPDY_SRCS"
-fi
-
-HTTP_MODULES="$HTTP_MODULES $HTTP_STATIC_MODULE"
-
-if [ $HTTP_GZIP_STATIC = YES ]; then
- have=NGX_HTTP_GZIP . auto/have
- HTTP_MODULES="$HTTP_MODULES $HTTP_GZIP_STATIC_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_GZIP_STATIC_SRCS"
-fi
-
-if [ $HTTP_DAV = YES ]; then
- have=NGX_HTTP_DAV . auto/have
- HTTP_MODULES="$HTTP_MODULES $HTTP_DAV_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_DAV_SRCS"
-fi
-
-if [ $HTTP_AUTOINDEX = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_AUTOINDEX_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_AUTOINDEX_SRCS"
-fi
-
-HTTP_MODULES="$HTTP_MODULES $HTTP_INDEX_MODULE"
-
-if [ $HTTP_RANDOM_INDEX = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_RANDOM_INDEX_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_RANDOM_INDEX_SRCS"
-fi
-
-if [ $HTTP_AUTH_REQUEST = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_AUTH_REQUEST_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_AUTH_REQUEST_SRCS"
-fi
-
-if [ $HTTP_AUTH_BASIC = YES ]; then
- USE_MD5=YES
- USE_SHA1=YES
- have=NGX_CRYPT . auto/have
- HTTP_MODULES="$HTTP_MODULES $HTTP_AUTH_BASIC_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_AUTH_BASIC_SRCS"
- CORE_LIBS="$CORE_LIBS $CRYPT_LIB"
-fi
-
-if [ $HTTP_ACCESS = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_ACCESS_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_ACCESS_SRCS"
-fi
-
-if [ $HTTP_LIMIT_CONN = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_LIMIT_CONN_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_LIMIT_CONN_SRCS"
-fi
-
-if [ $HTTP_LIMIT_REQ = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_LIMIT_REQ_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_LIMIT_REQ_SRCS"
-fi
-
-if [ $HTTP_REALIP = YES ]; then
- have=NGX_HTTP_REALIP . auto/have
- have=NGX_HTTP_X_FORWARDED_FOR . auto/have
- HTTP_MODULES="$HTTP_MODULES $HTTP_REALIP_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_REALIP_SRCS"
-fi
-
-if [ $HTTP_STATUS = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_STATUS_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_STATUS_SRCS"
-fi
-
-if [ $HTTP_GEO = YES ]; then
- have=NGX_HTTP_X_FORWARDED_FOR . auto/have
- HTTP_MODULES="$HTTP_MODULES $HTTP_GEO_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_GEO_SRCS"
-fi
-
-if [ $HTTP_GEOIP = YES ]; then
- have=NGX_HTTP_X_FORWARDED_FOR . auto/have
- HTTP_MODULES="$HTTP_MODULES $HTTP_GEOIP_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_GEOIP_SRCS"
-fi
-
-if [ $HTTP_MAP = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_MAP_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_MAP_SRCS"
-fi
-
-if [ $HTTP_SPLIT_CLIENTS = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_SPLIT_CLIENTS_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_SPLIT_CLIENTS_SRCS"
-fi
-
-if [ $HTTP_REFERER = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_REFERER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_REFERER_SRCS"
-fi
-
-if [ $HTTP_REWRITE = YES -a $USE_PCRE != DISABLED ]; then
- USE_PCRE=YES
- HTTP_MODULES="$HTTP_MODULES $HTTP_REWRITE_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_REWRITE_SRCS"
-fi
-
-if [ $HTTP_SSL = YES ]; then
- USE_OPENSSL=YES
- have=NGX_HTTP_SSL . auto/have
- HTTP_MODULES="$HTTP_MODULES $HTTP_SSL_MODULE"
- HTTP_DEPS="$HTTP_DEPS $HTTP_SSL_DEPS"
- HTTP_SRCS="$HTTP_SRCS $HTTP_SSL_SRCS"
-fi
-
-if [ $HTTP_PROXY = YES ]; then
- have=NGX_HTTP_X_FORWARDED_FOR . auto/have
- #USE_MD5=YES
- HTTP_MODULES="$HTTP_MODULES $HTTP_PROXY_MODULE"
- HTTP_DEPS="$HTTP_DEPS $HTTP_PROXY_DEPS"
- HTTP_SRCS="$HTTP_SRCS $HTTP_PROXY_SRCS"
-fi
-
-if [ $HTTP_FASTCGI = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_FASTCGI_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_FASTCGI_SRCS"
-fi
-
-if [ $HTTP_UWSGI = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_UWSGI_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_UWSGI_SRCS"
-fi
-
-if [ $HTTP_SCGI = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_SCGI_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_SCGI_SRCS"
-fi
-
-if [ $HTTP_PERL = YES ]; then
- USE_PERL=YES
- HTTP_MODULES="$HTTP_MODULES $HTTP_PERL_MODULE"
- HTTP_INCS="$HTTP_INCS $HTTP_PERL_INCS"
- HTTP_DEPS="$HTTP_DEPS $HTTP_PERL_DEPS"
- HTTP_SRCS="$HTTP_SRCS $HTTP_PERL_SRCS"
-fi
-
-if [ $HTTP_MEMCACHED = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_MEMCACHED_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_MEMCACHED_SRCS"
-fi
-
-if [ $HTTP_EMPTY_GIF = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_EMPTY_GIF_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_EMPTY_GIF_SRCS"
-fi
-
-if [ $HTTP_BROWSER = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_BROWSER_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_BROWSER_SRCS"
-fi
-
-if [ $HTTP_SECURE_LINK = YES ]; then
- USE_MD5=YES
- HTTP_MODULES="$HTTP_MODULES $HTTP_SECURE_LINK_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_SECURE_LINK_SRCS"
-fi
-
-if [ $HTTP_DEGRADATION = YES ]; then
- have=NGX_HTTP_DEGRADATION . auto/have
- HTTP_MODULES="$HTTP_MODULES $HTTP_DEGRADATION_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_DEGRADATION_SRCS"
-fi
-
-if [ $HTTP_FLV = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_FLV_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_FLV_SRCS"
-fi
-
-if [ $HTTP_MP4 = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_MP4_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_MP4_SRCS"
-fi
-
-if [ $HTTP_UPSTREAM_HASH = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_HASH_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_HASH_SRCS"
-fi
-
-if [ $HTTP_UPSTREAM_IP_HASH = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_IP_HASH_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_IP_HASH_SRCS"
-fi
-
-if [ $HTTP_UPSTREAM_LEAST_CONN = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_LEAST_CONN_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_LEAST_CONN_SRCS"
-fi
-
-if [ $HTTP_UPSTREAM_KEEPALIVE = YES ]; then
- HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_KEEPALIVE_MODULE"
- HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_KEEPALIVE_SRCS"
-fi
-
-if [ $HTTP_STUB_STATUS = YES ]; then
- have=NGX_STAT_STUB . auto/have
- HTTP_MODULES="$HTTP_MODULES ngx_http_stub_status_module"
- HTTP_SRCS="$HTTP_SRCS src/http/modules/ngx_http_stub_status_module.c"
-fi
-
-#if [ -r $NGX_OBJS/auto ]; then
-# . $NGX_OBJS/auto
-#fi
-
-
-if test -n "$NGX_ADDONS"; then
-
- echo configuring additional modules
-
- for ngx_addon_dir in $NGX_ADDONS
- do
- echo "adding module in $ngx_addon_dir"
-
- if test -f $ngx_addon_dir/config; then
- . $ngx_addon_dir/config
-
- echo " + $ngx_addon_name was configured"
-
- else
- echo "$0: error: no $ngx_addon_dir/config was found"
- exit 1
- fi
- done
-fi
-
-
-if [ $MAIL_SSL = YES ]; then
- have=NGX_MAIL_SSL . auto/have
- USE_OPENSSL=YES
-fi
-
-
-modules="$CORE_MODULES $EVENT_MODULES"
-
-
-if [ $USE_OPENSSL = YES ]; then
- modules="$modules $OPENSSL_MODULE"
- CORE_DEPS="$CORE_DEPS $OPENSSL_DEPS"
- CORE_SRCS="$CORE_SRCS $OPENSSL_SRCS"
-fi
-
-if [ $USE_PCRE = YES ]; then
- modules="$modules $REGEX_MODULE"
- CORE_DEPS="$CORE_DEPS $REGEX_DEPS"
- CORE_SRCS="$CORE_SRCS $REGEX_SRCS"
-fi
-
-if [ $HTTP = YES ]; then
- modules="$modules $HTTP_MODULES $HTTP_FILTER_MODULES \
- $HTTP_HEADERS_FILTER_MODULE \
- $HTTP_AUX_FILTER_MODULES \
- $HTTP_COPY_FILTER_MODULE \
- $HTTP_RANGE_BODY_FILTER_MODULE \
- $HTTP_NOT_MODIFIED_FILTER_MODULE"
-
- NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(HTTP_DEPS)"
-fi
-
-
-if [ $MAIL = YES ]; then
- modules="$modules $MAIL_MODULES"
-
- if [ $MAIL_SSL = YES ]; then
- modules="$modules $MAIL_SSL_MODULE"
- MAIL_DEPS="$MAIL_DEPS $MAIL_SSL_DEPS"
- MAIL_SRCS="$MAIL_SRCS $MAIL_SSL_SRCS"
- fi
-
- if [ $MAIL_POP3 = YES ]; then
- modules="$modules $MAIL_POP3_MODULE"
- MAIL_DEPS="$MAIL_DEPS $MAIL_POP3_DEPS"
- MAIL_SRCS="$MAIL_SRCS $MAIL_POP3_SRCS"
- fi
-
- if [ $MAIL_IMAP = YES ]; then
- modules="$modules $MAIL_IMAP_MODULE"
- MAIL_DEPS="$MAIL_DEPS $MAIL_IMAP_DEPS"
- MAIL_SRCS="$MAIL_SRCS $MAIL_IMAP_SRCS"
- fi
-
- if [ $MAIL_SMTP = YES ]; then
- modules="$modules $MAIL_SMTP_MODULE"
- MAIL_DEPS="$MAIL_DEPS $MAIL_SMTP_DEPS"
- MAIL_SRCS="$MAIL_SRCS $MAIL_SMTP_SRCS"
- fi
-
- modules="$modules $MAIL_AUTH_HTTP_MODULE"
- MAIL_SRCS="$MAIL_SRCS $MAIL_AUTH_HTTP_SRCS"
-
- modules="$modules $MAIL_PROXY_MODULE"
- MAIL_SRCS="$MAIL_SRCS $MAIL_PROXY_SRCS"
-
- NGX_ADDON_DEPS="$NGX_ADDON_DEPS \$(MAIL_DEPS)"
-fi
-
-
-if [ $NGX_GOOGLE_PERFTOOLS = YES ]; then
- modules="$modules $NGX_GOOGLE_PERFTOOLS_MODULE"
- NGX_MISC_SRCS="$NGX_MISC_SRCS $NGX_GOOGLE_PERFTOOLS_SRCS"
-fi
-
-
-if [ $NGX_CPP_TEST = YES ]; then
- NGX_MISC_SRCS="$NGX_MISC_SRCS $NGX_CPP_TEST_SRCS"
- CORE_LIBS="$CORE_LIBS -lstdc++"
-fi
-
-
-cat << END > $NGX_MODULES_C
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-$NGX_PRAGMA
-
-END
-
-for mod in $modules
-do
- echo "extern ngx_module_t $mod;" >> $NGX_MODULES_C
-done
-
-echo >> $NGX_MODULES_C
-echo 'ngx_module_t *ngx_modules[] = {' >> $NGX_MODULES_C
-
-for mod in $modules
-do
- echo " &$mod," >> $NGX_MODULES_C
-done
-
-cat << END >> $NGX_MODULES_C
- NULL
-};
-
-END
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/nohave b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/nohave
deleted file mode 100644
index dfb171837c5..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/nohave
+++ /dev/null
@@ -1,12 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-cat << END >> $NGX_AUTO_CONFIG_H
-
-#ifndef $have
-#define $have 0
-#endif
-
-END
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/options b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/options
deleted file mode 100644
index 0d296ac6027..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/options
+++ /dev/null
@@ -1,527 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-help=no
-
-NGX_PREFIX=
-NGX_SBIN_PATH=
-NGX_CONF_PREFIX=
-NGX_CONF_PATH=
-NGX_ERROR_LOG_PATH=
-NGX_PID_PATH=
-NGX_LOCK_PATH=
-NGX_USER=
-NGX_GROUP=
-NGX_BUILD=
-
-CC=${CC:-cc}
-CPP=
-NGX_OBJS=objs
-
-NGX_DEBUG=NO
-NGX_CC_OPT=
-NGX_LD_OPT=
-CPU=NO
-
-NGX_RPATH=NO
-
-NGX_TEST_BUILD_DEVPOLL=NO
-NGX_TEST_BUILD_EVENTPORT=NO
-NGX_TEST_BUILD_EPOLL=NO
-NGX_TEST_BUILD_RTSIG=NO
-NGX_TEST_BUILD_SOLARIS_SENDFILEV=NO
-
-NGX_PLATFORM=
-NGX_WINE=
-
-EVENT_FOUND=NO
-
-EVENT_RTSIG=NO
-EVENT_SELECT=NO
-EVENT_POLL=NO
-EVENT_AIO=NO
-
-USE_THREADS=NO
-
-NGX_FILE_AIO=NO
-NGX_IPV6=NO
-
-HTTP=YES
-
-NGX_HTTP_LOG_PATH=
-NGX_HTTP_CLIENT_TEMP_PATH=
-NGX_HTTP_PROXY_TEMP_PATH=
-NGX_HTTP_FASTCGI_TEMP_PATH=
-NGX_HTTP_UWSGI_TEMP_PATH=
-NGX_HTTP_SCGI_TEMP_PATH=
-
-HTTP_CACHE=YES
-HTTP_CHARSET=YES
-HTTP_GZIP=YES
-HTTP_SSL=NO
-HTTP_SPDY=NO
-HTTP_SSI=YES
-HTTP_POSTPONE=NO
-HTTP_REALIP=NO
-HTTP_XSLT=NO
-HTTP_IMAGE_FILTER=NO
-HTTP_SUB=NO
-HTTP_ADDITION=NO
-HTTP_DAV=NO
-HTTP_ACCESS=YES
-HTTP_AUTH_BASIC=YES
-HTTP_AUTH_REQUEST=NO
-HTTP_USERID=YES
-HTTP_AUTOINDEX=YES
-HTTP_RANDOM_INDEX=NO
-HTTP_STATUS=NO
-HTTP_GEO=YES
-HTTP_GEOIP=NO
-HTTP_MAP=YES
-HTTP_SPLIT_CLIENTS=YES
-HTTP_REFERER=YES
-HTTP_REWRITE=YES
-HTTP_PROXY=YES
-HTTP_FASTCGI=YES
-HTTP_UWSGI=YES
-HTTP_SCGI=YES
-HTTP_PERL=NO
-HTTP_MEMCACHED=YES
-HTTP_LIMIT_CONN=YES
-HTTP_LIMIT_REQ=YES
-HTTP_EMPTY_GIF=YES
-HTTP_BROWSER=YES
-HTTP_SECURE_LINK=NO
-HTTP_DEGRADATION=NO
-HTTP_FLV=NO
-HTTP_MP4=NO
-HTTP_GUNZIP=NO
-HTTP_GZIP_STATIC=NO
-HTTP_UPSTREAM_HASH=YES
-HTTP_UPSTREAM_IP_HASH=YES
-HTTP_UPSTREAM_LEAST_CONN=YES
-HTTP_UPSTREAM_KEEPALIVE=YES
-
-# STUB
-HTTP_STUB_STATUS=NO
-
-MAIL=NO
-MAIL_SSL=NO
-MAIL_POP3=YES
-MAIL_IMAP=YES
-MAIL_SMTP=YES
-
-NGX_ADDONS=
-
-USE_PCRE=NO
-PCRE=NONE
-PCRE_OPT=
-PCRE_CONF_OPT=
-PCRE_JIT=NO
-
-USE_OPENSSL=NO
-OPENSSL=NONE
-
-USE_MD5=NO
-MD5=NONE
-MD5_OPT=
-MD5_ASM=NO
-
-USE_SHA1=NO
-SHA1=NONE
-SHA1_OPT=
-SHA1_ASM=NO
-
-USE_ZLIB=NO
-ZLIB=NONE
-ZLIB_OPT=
-ZLIB_ASM=NO
-
-USE_PERL=NO
-NGX_PERL=perl
-
-USE_LIBXSLT=NO
-USE_LIBGD=NO
-
-NGX_GOOGLE_PERFTOOLS=NO
-NGX_CPP_TEST=NO
-
-NGX_LIBATOMIC=NO
-
-NGX_CPU_CACHE_LINE=
-
-NGX_POST_CONF_MSG=
-
-opt=
-
-for option
-do
- opt="$opt `echo $option | sed -e \"s/\(--[^=]*=\)\(.* .*\)/\1'\2'/\"`"
-
- case "$option" in
- -*=*) value=`echo "$option" | sed -e 's/[-_a-zA-Z0-9]*=//'` ;;
- *) value="" ;;
- esac
-
- case "$option" in
- --help) help=yes ;;
-
- --prefix=) NGX_PREFIX="!" ;;
- --prefix=*) NGX_PREFIX="$value" ;;
- --sbin-path=*) NGX_SBIN_PATH="$value" ;;
- --conf-path=*) NGX_CONF_PATH="$value" ;;
- --error-log-path=*) NGX_ERROR_LOG_PATH="$value";;
- --pid-path=*) NGX_PID_PATH="$value" ;;
- --lock-path=*) NGX_LOCK_PATH="$value" ;;
- --user=*) NGX_USER="$value" ;;
- --group=*) NGX_GROUP="$value" ;;
-
- --crossbuild=*) NGX_PLATFORM="$value" ;;
-
- --build=*) NGX_BUILD="$value" ;;
- --builddir=*) NGX_OBJS="$value" ;;
-
- --with-rtsig_module) EVENT_RTSIG=YES ;;
- --with-select_module) EVENT_SELECT=YES ;;
- --without-select_module) EVENT_SELECT=NONE ;;
- --with-poll_module) EVENT_POLL=YES ;;
- --without-poll_module) EVENT_POLL=NONE ;;
- --with-aio_module) EVENT_AIO=YES ;;
-
- #--with-threads=*) USE_THREADS="$value" ;;
- #--with-threads) USE_THREADS="pthreads" ;;
-
- --with-file-aio) NGX_FILE_AIO=YES ;;
- --with-ipv6) NGX_IPV6=YES ;;
-
- --without-http) HTTP=NO ;;
- --without-http-cache) HTTP_CACHE=NO ;;
-
- --http-log-path=*) NGX_HTTP_LOG_PATH="$value" ;;
- --http-client-body-temp-path=*) NGX_HTTP_CLIENT_TEMP_PATH="$value" ;;
- --http-proxy-temp-path=*) NGX_HTTP_PROXY_TEMP_PATH="$value" ;;
- --http-fastcgi-temp-path=*) NGX_HTTP_FASTCGI_TEMP_PATH="$value" ;;
- --http-uwsgi-temp-path=*) NGX_HTTP_UWSGI_TEMP_PATH="$value" ;;
- --http-scgi-temp-path=*) NGX_HTTP_SCGI_TEMP_PATH="$value" ;;
-
- --with-http_ssl_module) HTTP_SSL=YES ;;
- --with-http_spdy_module) HTTP_SPDY=YES ;;
- --with-http_realip_module) HTTP_REALIP=YES ;;
- --with-http_addition_module) HTTP_ADDITION=YES ;;
- --with-http_xslt_module) HTTP_XSLT=YES ;;
- --with-http_image_filter_module) HTTP_IMAGE_FILTER=YES ;;
- --with-http_geoip_module) HTTP_GEOIP=YES ;;
- --with-http_sub_module) HTTP_SUB=YES ;;
- --with-http_dav_module) HTTP_DAV=YES ;;
- --with-http_flv_module) HTTP_FLV=YES ;;
- --with-http_mp4_module) HTTP_MP4=YES ;;
- --with-http_gunzip_module) HTTP_GUNZIP=YES ;;
- --with-http_gzip_static_module) HTTP_GZIP_STATIC=YES ;;
- --with-http_auth_request_module) HTTP_AUTH_REQUEST=YES ;;
- --with-http_random_index_module) HTTP_RANDOM_INDEX=YES ;;
- --with-http_secure_link_module) HTTP_SECURE_LINK=YES ;;
- --with-http_degradation_module) HTTP_DEGRADATION=YES ;;
-
- --without-http_charset_module) HTTP_CHARSET=NO ;;
- --without-http_gzip_module) HTTP_GZIP=NO ;;
- --without-http_ssi_module) HTTP_SSI=NO ;;
- --without-http_userid_module) HTTP_USERID=NO ;;
- --without-http_access_module) HTTP_ACCESS=NO ;;
- --without-http_auth_basic_module) HTTP_AUTH_BASIC=NO ;;
- --without-http_autoindex_module) HTTP_AUTOINDEX=NO ;;
- --without-http_status_module) HTTP_STATUS=NO ;;
- --without-http_geo_module) HTTP_GEO=NO ;;
- --without-http_map_module) HTTP_MAP=NO ;;
- --without-http_split_clients_module) HTTP_SPLIT_CLIENTS=NO ;;
- --without-http_referer_module) HTTP_REFERER=NO ;;
- --without-http_rewrite_module) HTTP_REWRITE=NO ;;
- --without-http_proxy_module) HTTP_PROXY=NO ;;
- --without-http_fastcgi_module) HTTP_FASTCGI=NO ;;
- --without-http_uwsgi_module) HTTP_UWSGI=NO ;;
- --without-http_scgi_module) HTTP_SCGI=NO ;;
- --without-http_memcached_module) HTTP_MEMCACHED=NO ;;
- --without-http_limit_zone_module)
- HTTP_LIMIT_CONN=NO
- NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
-$0: warning: the \"--without-http_limit_zone_module\" option is deprecated, \
-use the \"--without-http_limit_conn_module\" option instead"
- ;;
- --without-http_limit_conn_module) HTTP_LIMIT_CONN=NO ;;
- --without-http_limit_req_module) HTTP_LIMIT_REQ=NO ;;
- --without-http_empty_gif_module) HTTP_EMPTY_GIF=NO ;;
- --without-http_browser_module) HTTP_BROWSER=NO ;;
- --without-http_upstream_hash_module) HTTP_UPSTREAM_HASH=NO ;;
- --without-http_upstream_ip_hash_module) HTTP_UPSTREAM_IP_HASH=NO ;;
- --without-http_upstream_least_conn_module)
- HTTP_UPSTREAM_LEAST_CONN=NO ;;
- --without-http_upstream_keepalive_module) HTTP_UPSTREAM_KEEPALIVE=NO ;;
-
- --with-http_perl_module) HTTP_PERL=YES ;;
- --with-perl_modules_path=*) NGX_PERL_MODULES="$value" ;;
- --with-perl=*) NGX_PERL="$value" ;;
-
- # STUB
- --with-http_stub_status_module) HTTP_STUB_STATUS=YES ;;
-
- --with-mail) MAIL=YES ;;
- --with-mail_ssl_module) MAIL_SSL=YES ;;
- # STUB
- --with-imap) MAIL=YES ;;
- --with-imap_ssl_module) MAIL_SSL=YES ;;
- --without-mail_pop3_module) MAIL_POP3=NO ;;
- --without-mail_imap_module) MAIL_IMAP=NO ;;
- --without-mail_smtp_module) MAIL_SMTP=NO ;;
-
- --with-google_perftools_module) NGX_GOOGLE_PERFTOOLS=YES ;;
- --with-cpp_test_module) NGX_CPP_TEST=YES ;;
-
- --add-module=*) NGX_ADDONS="$NGX_ADDONS $value" ;;
-
- --with-cc=*) CC="$value" ;;
- --with-cpp=*) CPP="$value" ;;
- --with-cc-opt=*) NGX_CC_OPT="$value" ;;
- --with-ld-opt=*) NGX_LD_OPT="$value" ;;
- --with-cpu-opt=*) CPU="$value" ;;
- --with-debug) NGX_DEBUG=YES ;;
-
- --without-pcre) USE_PCRE=DISABLED ;;
- --with-pcre) USE_PCRE=YES ;;
- --with-pcre=*) PCRE="$value" ;;
- --with-pcre-opt=*) PCRE_OPT="$value" ;;
- --with-pcre-jit) PCRE_JIT=YES ;;
-
- --with-openssl=*) OPENSSL="$value" ;;
- --with-openssl-opt=*) OPENSSL_OPT="$value" ;;
-
- --with-md5=*) MD5="$value" ;;
- --with-md5-opt=*) MD5_OPT="$value" ;;
- --with-md5-asm) MD5_ASM=YES ;;
-
- --with-sha1=*) SHA1="$value" ;;
- --with-sha1-opt=*) SHA1_OPT="$value" ;;
- --with-sha1-asm) SHA1_ASM=YES ;;
-
- --with-zlib=*) ZLIB="$value" ;;
- --with-zlib-opt=*) ZLIB_OPT="$value" ;;
- --with-zlib-asm=*) ZLIB_ASM="$value" ;;
-
- --with-libatomic) NGX_LIBATOMIC=YES ;;
- --with-libatomic=*) NGX_LIBATOMIC="$value" ;;
-
- --test-build-devpoll) NGX_TEST_BUILD_DEVPOLL=YES ;;
- --test-build-eventport) NGX_TEST_BUILD_EVENTPORT=YES ;;
- --test-build-epoll) NGX_TEST_BUILD_EPOLL=YES ;;
- --test-build-rtsig) NGX_TEST_BUILD_RTSIG=YES ;;
- --test-build-solaris-sendfilev) NGX_TEST_BUILD_SOLARIS_SENDFILEV=YES ;;
-
- *)
- echo "$0: error: invalid option \"$option\""
- exit 1
- ;;
- esac
-done
-
-
-NGX_CONFIGURE="$opt"
-
-
-if [ $help = yes ]; then
-
-cat << END
-
- --help print this message
-
- --prefix=PATH set installation prefix
- --sbin-path=PATH set nginx binary pathname
- --conf-path=PATH set nginx.conf pathname
- --error-log-path=PATH set error log pathname
- --pid-path=PATH set nginx.pid pathname
- --lock-path=PATH set nginx.lock pathname
-
- --user=USER set non-privileged user for
- worker processes
- --group=GROUP set non-privileged group for
- worker processes
-
- --build=NAME set build name
- --builddir=DIR set build directory
-
- --with-rtsig_module enable rtsig module
- --with-select_module enable select module
- --without-select_module disable select module
- --with-poll_module enable poll module
- --without-poll_module disable poll module
-
- --with-file-aio enable file AIO support
- --with-ipv6 enable IPv6 support
-
- --with-http_ssl_module enable ngx_http_ssl_module
- --with-http_spdy_module enable ngx_http_spdy_module
- --with-http_realip_module enable ngx_http_realip_module
- --with-http_addition_module enable ngx_http_addition_module
- --with-http_xslt_module enable ngx_http_xslt_module
- --with-http_image_filter_module enable ngx_http_image_filter_module
- --with-http_geoip_module enable ngx_http_geoip_module
- --with-http_sub_module enable ngx_http_sub_module
- --with-http_dav_module enable ngx_http_dav_module
- --with-http_flv_module enable ngx_http_flv_module
- --with-http_mp4_module enable ngx_http_mp4_module
- --with-http_gunzip_module enable ngx_http_gunzip_module
- --with-http_gzip_static_module enable ngx_http_gzip_static_module
- --with-http_auth_request_module enable ngx_http_auth_request_module
- --with-http_random_index_module enable ngx_http_random_index_module
- --with-http_secure_link_module enable ngx_http_secure_link_module
- --with-http_degradation_module enable ngx_http_degradation_module
- --with-http_stub_status_module enable ngx_http_stub_status_module
-
- --without-http_charset_module disable ngx_http_charset_module
- --without-http_gzip_module disable ngx_http_gzip_module
- --without-http_ssi_module disable ngx_http_ssi_module
- --without-http_userid_module disable ngx_http_userid_module
- --without-http_access_module disable ngx_http_access_module
- --without-http_auth_basic_module disable ngx_http_auth_basic_module
- --without-http_autoindex_module disable ngx_http_autoindex_module
- --without-http_geo_module disable ngx_http_geo_module
- --without-http_map_module disable ngx_http_map_module
- --without-http_split_clients_module disable ngx_http_split_clients_module
- --without-http_referer_module disable ngx_http_referer_module
- --without-http_rewrite_module disable ngx_http_rewrite_module
- --without-http_proxy_module disable ngx_http_proxy_module
- --without-http_fastcgi_module disable ngx_http_fastcgi_module
- --without-http_uwsgi_module disable ngx_http_uwsgi_module
- --without-http_scgi_module disable ngx_http_scgi_module
- --without-http_memcached_module disable ngx_http_memcached_module
- --without-http_limit_conn_module disable ngx_http_limit_conn_module
- --without-http_limit_req_module disable ngx_http_limit_req_module
- --without-http_empty_gif_module disable ngx_http_empty_gif_module
- --without-http_browser_module disable ngx_http_browser_module
- --without-http_upstream_hash_module
- disable ngx_http_upstream_hash_module
- --without-http_upstream_ip_hash_module
- disable ngx_http_upstream_ip_hash_module
- --without-http_upstream_least_conn_module
- disable ngx_http_upstream_least_conn_module
- --without-http_upstream_keepalive_module
- disable ngx_http_upstream_keepalive_module
-
- --with-http_perl_module enable ngx_http_perl_module
- --with-perl_modules_path=PATH set Perl modules path
- --with-perl=PATH set perl binary pathname
-
- --http-log-path=PATH set http access log pathname
- --http-client-body-temp-path=PATH set path to store
- http client request body temporary files
- --http-proxy-temp-path=PATH set path to store
- http proxy temporary files
- --http-fastcgi-temp-path=PATH set path to store
- http fastcgi temporary files
- --http-uwsgi-temp-path=PATH set path to store
- http uwsgi temporary files
- --http-scgi-temp-path=PATH set path to store
- http scgi temporary files
-
- --without-http disable HTTP server
- --without-http-cache disable HTTP cache
-
- --with-mail enable POP3/IMAP4/SMTP proxy module
- --with-mail_ssl_module enable ngx_mail_ssl_module
- --without-mail_pop3_module disable ngx_mail_pop3_module
- --without-mail_imap_module disable ngx_mail_imap_module
- --without-mail_smtp_module disable ngx_mail_smtp_module
-
- --with-google_perftools_module enable ngx_google_perftools_module
- --with-cpp_test_module enable ngx_cpp_test_module
-
- --add-module=PATH enable an external module
-
- --with-cc=PATH set C compiler pathname
- --with-cpp=PATH set C preprocessor pathname
- --with-cc-opt=OPTIONS set additional C compiler options
- --with-ld-opt=OPTIONS set additional linker options
- --with-cpu-opt=CPU build for the specified CPU, valid values:
- pentium, pentiumpro, pentium3, pentium4,
- athlon, opteron, sparc32, sparc64, ppc64
-
- --without-pcre disable PCRE library usage
- --with-pcre force PCRE library usage
- --with-pcre=DIR set path to PCRE library sources
- --with-pcre-opt=OPTIONS set additional build options for PCRE
- --with-pcre-jit build PCRE with JIT compilation support
-
- --with-md5=DIR set path to md5 library sources
- --with-md5-opt=OPTIONS set additional build options for md5
- --with-md5-asm use md5 assembler sources
-
- --with-sha1=DIR set path to sha1 library sources
- --with-sha1-opt=OPTIONS set additional build options for sha1
- --with-sha1-asm use sha1 assembler sources
-
- --with-zlib=DIR set path to zlib library sources
- --with-zlib-opt=OPTIONS set additional build options for zlib
- --with-zlib-asm=CPU use zlib assembler sources optimized
- for the specified CPU, valid values:
- pentium, pentiumpro
-
- --with-libatomic force libatomic_ops library usage
- --with-libatomic=DIR set path to libatomic_ops library sources
-
- --with-openssl=DIR set path to OpenSSL library sources
- --with-openssl-opt=OPTIONS set additional build options for OpenSSL
-
- --with-debug enable debug logging
-
-END
-
- exit 1
-fi
-
-
-if [ $HTTP = NO ]; then
- HTTP_CHARSET=NO
- HTTP_GZIP=NO
- HTTP_SSI=NO
- HTTP_USERID=NO
- HTTP_ACCESS=NO
- HTTP_STATUS=NO
- HTTP_REWRITE=NO
- HTTP_PROXY=NO
- HTTP_FASTCGI=NO
-fi
-
-
-if [ ".$NGX_PLATFORM" = ".win32" ]; then
- NGX_WINE=$WINE
-fi
-
-
-NGX_CONF_PATH=${NGX_CONF_PATH:-conf/nginx.conf}
-NGX_CONF_PREFIX=`dirname $NGX_CONF_PATH`
-NGX_PID_PATH=${NGX_PID_PATH:-logs/nginx.pid}
-NGX_LOCK_PATH=${NGX_LOCK_PATH:-logs/nginx.lock}
-
-if [ ".$NGX_ERROR_LOG_PATH" = ".stderr" ]; then
- NGX_ERROR_LOG_PATH=
-else
- NGX_ERROR_LOG_PATH=${NGX_ERROR_LOG_PATH:-logs/error.log}
-fi
-
-NGX_HTTP_LOG_PATH=${NGX_HTTP_LOG_PATH:-logs/access.log}
-NGX_HTTP_CLIENT_TEMP_PATH=${NGX_HTTP_CLIENT_TEMP_PATH:-client_body_temp}
-NGX_HTTP_PROXY_TEMP_PATH=${NGX_HTTP_PROXY_TEMP_PATH:-proxy_temp}
-NGX_HTTP_FASTCGI_TEMP_PATH=${NGX_HTTP_FASTCGI_TEMP_PATH:-fastcgi_temp}
-NGX_HTTP_UWSGI_TEMP_PATH=${NGX_HTTP_UWSGI_TEMP_PATH:-uwsgi_temp}
-NGX_HTTP_SCGI_TEMP_PATH=${NGX_HTTP_SCGI_TEMP_PATH:-scgi_temp}
-
-case ".$NGX_PERL_MODULES" in
- ./*)
- ;;
-
- .)
- ;;
-
- *)
- NGX_PERL_MODULES=$NGX_PREFIX/$NGX_PERL_MODULES
- ;;
-esac
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/conf
deleted file mode 100644
index fe720160ada..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/conf
+++ /dev/null
@@ -1,107 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo "checking for $NGX_SYSTEM specific features"
-
-case "$NGX_PLATFORM" in
-
- FreeBSD:*)
- . auto/os/freebsd
- ;;
-
- Linux:*)
- . auto/os/linux
- ;;
-
- SunOS:*)
- . auto/os/solaris
- ;;
-
- Darwin:*)
- . auto/os/darwin
- ;;
-
- win32)
- . auto/os/win32
- ;;
-
- DragonFly:*)
- have=NGX_FREEBSD . auto/have_headers
- CORE_INCS="$UNIX_INCS"
- CORE_DEPS="$UNIX_DEPS $FREEBSD_DEPS"
- CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS"
-
- echo " + sendfile() found"
- have=NGX_HAVE_SENDFILE . auto/have
- CORE_SRCS="$CORE_SRCS $FREEBSD_SENDFILE_SRCS"
-
- ngx_spacer='
-'
- ;;
-
- HP-UX:*)
- # HP/UX
- have=NGX_HPUX . auto/have_headers
- CORE_INCS="$UNIX_INCS"
- CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
- CORE_SRCS="$UNIX_SRCS"
- CC_AUX_FLAGS="$CC_AUX_FLAGS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
- CC_AUX_FLAGS="$CC_AUX_FLAGS -D_HPUX_ALT_XOPEN_SOCKET_API"
- ;;
-
- OSF1:*)
- # Tru64 UNIX
- have=NGX_TRU64 . auto/have_headers
- have=NGX_HAVE_STRERROR_R . auto/nohave
- CORE_INCS="$UNIX_INCS"
- CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
- CORE_SRCS="$UNIX_SRCS"
- ;;
-
- *)
- CORE_INCS="$UNIX_INCS"
- CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
- CORE_SRCS="$UNIX_SRCS"
- ;;
-
-esac
-
-
-case "$NGX_MACHINE" in
-
- i386 | i686 | i86pc)
- have=NGX_HAVE_NONALIGNED . auto/have
- NGX_MACH_CACHE_LINE=32
- ;;
-
- amd64 | x86_64)
- have=NGX_HAVE_NONALIGNED . auto/have
- NGX_MACH_CACHE_LINE=64
- ;;
-
- sun4u | sun4v | sparc | sparc64)
- have=NGX_ALIGNMENT value=16 . auto/define
- # TODO
- NGX_MACH_CACHE_LINE=64
- ;;
-
- ia64 )
- have=NGX_ALIGNMENT value=16 . auto/define
- # TODO
- NGX_MACH_CACHE_LINE=64
- ;;
-
- *)
- have=NGX_ALIGNMENT value=16 . auto/define
- NGX_MACH_CACHE_LINE=32
- ;;
-
-esac
-
-if test -z "$NGX_CPU_CACHE_LINE"; then
- NGX_CPU_CACHE_LINE=$NGX_MACH_CACHE_LINE
-fi
-
-have=NGX_CPU_CACHE_LINE value=$NGX_CPU_CACHE_LINE . auto/define
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/darwin b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/darwin
deleted file mode 100644
index b97518a6ea0..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/darwin
+++ /dev/null
@@ -1,116 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-have=NGX_DARWIN . auto/have_headers
-
-CORE_INCS="$UNIX_INCS"
-CORE_DEPS="$UNIX_DEPS $DARWIN_DEPS"
-CORE_SRCS="$UNIX_SRCS $DARWIN_SRCS"
-
-
-
-ngx_spacer='
-'
-
-# kqueue
-
-echo " + kqueue found"
-have=NGX_HAVE_KQUEUE . auto/have
-have=NGX_HAVE_CLEAR_EVENT . auto/have
-EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
-CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
-EVENT_FOUND=YES
-NGX_KQUEUE_CHECKED=YES
-
-ngx_feature="kqueue's EVFILT_TIMER"
-ngx_feature_name="NGX_HAVE_TIMER_EVENT"
-ngx_feature_run=yes
-ngx_feature_incs="#include <sys/event.h>
- #include <sys/time.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int kq;
- struct kevent kev;
- struct timespec ts;
-
- if ((kq = kqueue()) == -1) return 1;
-
- kev.ident = 0;
- kev.filter = EVFILT_TIMER;
- kev.flags = EV_ADD|EV_ENABLE;
- kev.fflags = 0;
- kev.data = 1000;
- kev.udata = 0;
-
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
-
- if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
-
- if (kev.flags & EV_ERROR) return 1;"
-
-. auto/feature
-
-
-ngx_feature="Darwin 64-bit kqueue millisecond timeout bug"
-ngx_feature_name=NGX_DARWIN_KEVENT_BUG
-ngx_feature_run=bug
-ngx_feature_incs="#include <sys/event.h>
- #include <sys/time.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int kq;
- struct kevent kev;
- struct timespec ts;
- struct timeval tv, tv0;
-
- kq = kqueue();
-
- ts.tv_sec = 0;
- ts.tv_nsec = 999000000;
-
- gettimeofday(&tv, 0);
- kevent(kq, NULL, 0, &kev, 1, &ts);
- gettimeofday(&tv0, 0);
- timersub(&tv0, &tv, &tv);
-
- if (tv.tv_sec * 1000000 + tv.tv_usec < 900000) return 1;"
-
-. auto/feature
-
-
-# sendfile()
-
-CC_AUX_FLAGS="$CC_AUX_FLAGS"
-ngx_feature="sendfile()"
-ngx_feature_name="NGX_HAVE_SENDFILE"
-ngx_feature_run=yes
-ngx_feature_incs="#include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/uio.h>
- #include <sys/errno.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int s = 0, fd = 1;
- off_t n; off_t off = 0;
- n = sendfile(s, fd, off, &n, NULL, 0);
- if (n == -1 && errno == ENOSYS) return 1"
-. auto/feature
-
-if [ $ngx_found = yes ]; then
- have=NGX_HAVE_SENDFILE . auto/have
- CORE_SRCS="$CORE_SRCS $DARWIN_SENDFILE_SRCS"
-fi
-
-
-ngx_feature="atomic(3)"
-ngx_feature_name=NGX_DARWIN_ATOMIC
-ngx_feature_run=no
-ngx_feature_incs="#include <libkern/OSAtomic.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int32_t lock, n;
- n = OSAtomicCompareAndSwap32Barrier(0, 1, &lock)"
-. auto/feature
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/freebsd b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/freebsd
deleted file mode 100644
index 6aa823f9250..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/freebsd
+++ /dev/null
@@ -1,144 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-have=NGX_FREEBSD . auto/have_headers
-
-CORE_INCS="$UNIX_INCS"
-CORE_DEPS="$UNIX_DEPS $FREEBSD_DEPS"
-CORE_SRCS="$UNIX_SRCS $FREEBSD_SRCS"
-
-ngx_spacer='
-'
-
-
-# __FreeBSD_version and sysctl kern.osreldate are the best ways
-# to determine whether some capability exists and is safe to use.
-# __FreeBSD_version is used for the testing of the build environment.
-# sysctl kern.osreldate is used for the testing of the kernel capabilities.
-
-version=`grep "#define __FreeBSD_version" /usr/include/osreldate.h \
- | sed -e 's/^.* \(.*\)$/\1/'`
-
-osreldate=`/sbin/sysctl -n kern.osreldate`
-
-
-# setproctitle() in libutil
-
-if [ \( $version -ge 500000 -a $version -lt 500012 \) \
- -o $version -lt 410002 ]
-then
- echo " + setproctitle() in libutil"
-
- CORE_LIBS="$CORE_LIBS -lutil"
- NGX_SETPROCTITLE_LIB="-lutil"
-fi
-
-# sendfile
-
-if [ $osreldate -gt 300007 ]; then
- echo " + sendfile() found"
-
- have=NGX_HAVE_SENDFILE . auto/have
- CORE_SRCS="$CORE_SRCS $FREEBSD_SENDFILE_SRCS"
-fi
-
-if [ $osreldate -gt 502103 ]; then
- echo " + sendfile()'s SF_NODISKIO found"
-
- have=NGX_HAVE_AIO_SENDFILE . auto/have
-fi
-
-# POSIX semaphores
-# http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/127545
-
-if [ $osreldate -ge 701106 ]; then
- echo " + POSIX semaphores should work"
-else
- have=NGX_HAVE_POSIX_SEM . auto/nohave
-fi
-
-
-# kqueue
-
-if [ \( $osreldate -lt 500000 -a $osreldate -ge 410000 \) \
- -o $osreldate -ge 500011 ]
-then
- echo " + kqueue found"
-
- have=NGX_HAVE_KQUEUE . auto/have
- have=NGX_HAVE_CLEAR_EVENT . auto/have
- EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
- CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
- EVENT_FOUND=YES
-fi
-
-
-NGX_KQUEUE_CHECKED=YES
-
-
-# kqueue's NOTE_LAWAT
-
-if [ \( $version -lt 500000 -a $version -ge 430000 \) \
- -o $version -ge 500018 ]
-then
- echo " + kqueue's NOTE_LOWAT found"
- have=NGX_HAVE_LOWAT_EVENT . auto/have
-fi
-
-# kqueue's EVFILT_TIMER
-
-if [ \( $version -lt 500000 -a $version -ge 440001 \) \
- -o $version -ge 500023 ]
-then
- echo " + kqueue's EVFILT_TIMER found"
- have=NGX_HAVE_TIMER_EVENT . auto/have
-fi
-
-
-if [ $USE_THREADS = "rfork" ]; then
-
- echo " + using rfork()"
-
-# # kqueue's EVFILT_SIGNAL is safe
-#
-# if [ $version -gt 460101 ]; then
-# echo " + kqueue's EVFILT_SIGNAL is safe"
-# have=NGX_HAVE_SAFE_EVFILT_SIGNAL . auto/have
-# else
-# echo "$0: error: the kqueue's EVFILT_SIGNAL is unsafe on this"
-# echo "FreeBSD version, so --with-threads=rfork could not be used"
-# echo
-#
-# exit 1
-# fi
-fi
-
-
-if [ $EVENT_AIO = YES ]; then
- if [ \( $version -lt 500000 -a $version -ge 430000 \) \
- -o $version -ge 500014 ]
- then
- have=NGX_HAVE_AIO . auto/have
- EVENT_MODULES="$EVENT_MODULES $AIO_MODULE"
- CORE_SRCS="$CORE_SRCS $AIO_SRCS"
- else
-
-cat << END
-
-$0: error: the kqueue does not support AIO on this FreeBSD version
-
-END
-
- exit 1
- fi
-fi
-
-
-# cpuset_setaffinity()
-
-if [ $version -ge 701000 ]; then
- echo " + cpuset_setaffinity() found"
- have=NGX_HAVE_CPUSET_SETAFFINITY . auto/have
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/linux b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/linux
deleted file mode 100644
index 19bf832ce3e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/linux
+++ /dev/null
@@ -1,185 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-have=NGX_LINUX . auto/have_headers
-
-CORE_INCS="$UNIX_INCS"
-CORE_DEPS="$UNIX_DEPS $LINUX_DEPS"
-CORE_SRCS="$UNIX_SRCS $LINUX_SRCS"
-
-ngx_spacer='
-'
-
-cc_aux_flags="$CC_AUX_FLAGS"
-CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
-
-
-# Linux kernel version
-
-version=$((`uname -r \
- | sed -n -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/ \
- \1*256*256+\2*256+\3/p' \
- -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1*256*256+\2*256/p'`))
-
-version=${version:-0}
-
-
-# enable the rt signals on Linux between 2.2.19 and 2.6.17
-
-if [ \( $version -ge 131603 -a $version -lt 132626 \) -o $EVENT_RTSIG = YES ]
-then
- echo " + rt signals found"
- have=NGX_HAVE_RTSIG . auto/have
- EVENT_MODULES="$EVENT_MODULES $RTSIG_MODULE"
- CORE_SRCS="$CORE_SRCS $RTSIG_SRCS"
- EVENT_FOUND=YES
-fi
-
-
-# posix_fadvise64() had been implemented in 2.5.60
-
-if [ $version -lt 132412 ]; then
- have=NGX_HAVE_POSIX_FADVISE . auto/nohave
-fi
-
-# epoll, EPOLLET version
-
-ngx_feature="epoll"
-ngx_feature_name="NGX_HAVE_EPOLL"
-ngx_feature_run=yes
-ngx_feature_incs="#include <sys/epoll.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int efd = 0;
- struct epoll_event ee;
- ee.events = EPOLLIN|EPOLLOUT|EPOLLET;
- ee.data.ptr = NULL;
- efd = epoll_create(100);
- if (efd == -1) return 1;"
-. auto/feature
-
-if [ $ngx_found = yes ]; then
- have=NGX_HAVE_CLEAR_EVENT . auto/have
- CORE_SRCS="$CORE_SRCS $EPOLL_SRCS"
- EVENT_MODULES="$EVENT_MODULES $EPOLL_MODULE"
- EVENT_FOUND=YES
-
-
- # EPOLLRDHUP appeared in Linux 2.6.17, glibc 2.8
-
- ngx_feature="EPOLLRDHUP"
- ngx_feature_name="NGX_HAVE_EPOLLRDHUP"
- ngx_feature_run=no
- ngx_feature_incs="#include <sys/epoll.h>"
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="int efd = 0, fd = 0;
- struct epoll_event ee;
- ee.events = EPOLLIN|EPOLLRDHUP|EPOLLET;
- ee.data.ptr = NULL;
- epoll_ctl(efd, EPOLL_CTL_ADD, fd, &ee)"
- . auto/feature
-fi
-
-
-# O_PATH and AT_EMPTY_PATH were introduced in 2.6.39, glibc 2.14
-
-ngx_feature="O_PATH"
-ngx_feature_name="NGX_HAVE_O_PATH"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int fd; struct stat sb;
- fd = openat(AT_FDCWD, \".\", O_PATH|O_DIRECTORY|O_NOFOLLOW);
- if (fstatat(fd, \"\", &sb, AT_EMPTY_PATH) != 0) return 1"
-. auto/feature
-
-
-# sendfile()
-
-CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE"
-ngx_feature="sendfile()"
-ngx_feature_name="NGX_HAVE_SENDFILE"
-ngx_feature_run=yes
-ngx_feature_incs="#include <sys/sendfile.h>
- #include <errno.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int s = 0, fd = 1;
- ssize_t n; off_t off = 0;
- n = sendfile(s, fd, &off, 1);
- if (n == -1 && errno == ENOSYS) return 1"
-. auto/feature
-
-if [ $ngx_found = yes ]; then
- CORE_SRCS="$CORE_SRCS $LINUX_SENDFILE_SRCS"
-fi
-
-
-# sendfile64()
-
-CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
-ngx_feature="sendfile64()"
-ngx_feature_name="NGX_HAVE_SENDFILE64"
-ngx_feature_run=yes
-ngx_feature_incs="#include <sys/sendfile.h>
- #include <errno.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int s = 0, fd = 1;
- ssize_t n; off_t off = 0;
- n = sendfile(s, fd, &off, 1);
- if (n == -1 && errno == ENOSYS) return 1"
-. auto/feature
-
-
-ngx_include="sys/prctl.h"; . auto/include
-
-# prctl(PR_SET_DUMPABLE)
-
-ngx_feature="prctl(PR_SET_DUMPABLE)"
-ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE"
-ngx_feature_run=yes
-ngx_feature_incs="#include <sys/prctl.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) return 1"
-. auto/feature
-
-
-# sched_setaffinity()
-
-ngx_feature="sched_setaffinity()"
-ngx_feature_name="NGX_HAVE_SCHED_SETAFFINITY"
-ngx_feature_run=no
-ngx_feature_incs="#include <sched.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="cpu_set_t mask;
- CPU_ZERO(&mask);
- sched_setaffinity(0, sizeof(cpu_set_t), &mask)"
-. auto/feature
-
-
-# crypt_r()
-
-ngx_feature="crypt_r()"
-ngx_feature_name="NGX_HAVE_GNU_CRYPT_R"
-ngx_feature_run=no
-ngx_feature_incs="#include <crypt.h>"
-ngx_feature_path=
-ngx_feature_libs=-lcrypt
-ngx_feature_test="struct crypt_data cd;
- crypt_r(\"key\", \"salt\", &cd);"
-. auto/feature
-
-
-ngx_include="sys/vfs.h"; . auto/include
-
-
-CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/solaris b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/solaris
deleted file mode 100644
index d39df0bf713..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/solaris
+++ /dev/null
@@ -1,61 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-have=NGX_SOLARIS . auto/have_headers
-
-CORE_INCS="$UNIX_INCS"
-CORE_DEPS="$UNIX_DEPS $SOLARIS_DEPS"
-CORE_SRCS="$UNIX_SRCS $SOLARIS_SRCS "
-CORE_LIBS="$CORE_LIBS -lsocket -lnsl"
-
-NGX_RPATH=YES
-
-# Solaris's make does not support a blank line between target and rules
-ngx_spacer=
-
-CC_AUX_FLAGS="$CC_AUX_FLAGS -D_FILE_OFFSET_BITS=64 -lsocket -lnsl"
-
-
-if [ $ZLIB_ASM != NO ]; then
- echo "$0: error: the --with-zlib-asm=CPU option is not supported"
- echo "on that platform"
- echo
-
- exit 1
-fi
-
-
-ngx_feature="sendfilev()"
-ngx_feature_name="NGX_HAVE_SENDFILE"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/sendfile.h>"
-ngx_feature_path=
-ngx_feature_libs="-lsendfile"
-ngx_feature_test="int fd = 1; sendfilevec_t vec[1];
- size_t sent; ssize_t n;
- n = sendfilev(fd, vec, 1, &sent);
- if (n == -1) return 1"
-. auto/feature
-
-
-if [ $ngx_found = yes ]; then
- CORE_SRCS="$CORE_SRCS $SOLARIS_SENDFILEV_SRCS"
- CORE_LIBS="$CORE_LIBS -lsendfile"
-fi
-
-
-ngx_feature="event ports"
-ngx_feature_name="NGX_HAVE_EVENTPORT"
-ngx_feature_run=no
-ngx_feature_incs="#include <port.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int n = port_create()"
-. auto/feature
-
-if [ $ngx_found = yes ]; then
- CORE_SRCS="$CORE_SRCS $EVENTPORT_SRCS"
- EVENT_MODULES="$EVENT_MODULES $EVENTPORT_MODULE"
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/win32 b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/win32
deleted file mode 100644
index 0b9b461875f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/os/win32
+++ /dev/null
@@ -1,40 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-have=NGX_WIN32 . auto/have_headers
-
-CORE_INCS="$WIN32_INCS"
-CORE_DEPS="$WIN32_DEPS"
-CORE_SRCS="$WIN32_SRCS $IOCP_SRCS"
-OS_CONFIG="$WIN32_CONFIG"
-NGX_ICONS="$NGX_WIN32_ICONS"
-SELECT_SRCS=$WIN32_SELECT_SRCS
-
-case "$NGX_CC_NAME" in
-
- gcc)
- CORE_LIBS="$CORE_LIBS -ladvapi32 -lws2_32"
- ;;
-
- *)
- CORE_LIBS="$CORE_LIBS advapi32.lib ws2_32.lib"
- ;;
-
-esac
-
-EVENT_MODULES="$EVENT_MODULES $IOCP_MODULE"
-EVENT_FOUND=YES
-
-if [ $EVENT_SELECT = NO ]; then
- CORE_SRCS="$CORE_SRCS $SELECT_SRCS"
- EVENT_MODULES="$EVENT_MODULES $SELECT_MODULE"
-fi
-
-if [ $NGX_IPV6 = YES ]; then
- have=NGX_HAVE_INET6 . auto/have
-fi
-
-have=NGX_HAVE_AIO . auto/have
-have=NGX_HAVE_IOCP . auto/have
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/sources b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/sources
deleted file mode 100644
index 1287782ead8..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/sources
+++ /dev/null
@@ -1,557 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-CORE_MODULES="ngx_core_module ngx_errlog_module ngx_conf_module"
-
-CORE_INCS="src/core"
-
-CORE_DEPS="src/core/nginx.h \
- src/core/ngx_config.h \
- src/core/ngx_core.h \
- src/core/ngx_log.h \
- src/core/ngx_palloc.h \
- src/core/ngx_array.h \
- src/core/ngx_list.h \
- src/core/ngx_hash.h \
- src/core/ngx_buf.h \
- src/core/ngx_queue.h \
- src/core/ngx_string.h \
- src/core/ngx_parse.h \
- src/core/ngx_inet.h \
- src/core/ngx_file.h \
- src/core/ngx_crc.h \
- src/core/ngx_crc32.h \
- src/core/ngx_murmurhash.h \
- src/core/ngx_md5.h \
- src/core/ngx_sha1.h \
- src/core/ngx_rbtree.h \
- src/core/ngx_radix_tree.h \
- src/core/ngx_slab.h \
- src/core/ngx_times.h \
- src/core/ngx_shmtx.h \
- src/core/ngx_connection.h \
- src/core/ngx_cycle.h \
- src/core/ngx_conf_file.h \
- src/core/ngx_resolver.h \
- src/core/ngx_open_file_cache.h \
- src/core/ngx_crypt.h \
- src/core/ngx_proxy_protocol.h \
- src/core/ngx_syslog.h"
-
-
-CORE_SRCS="src/core/nginx.c \
- src/core/ngx_log.c \
- src/core/ngx_palloc.c \
- src/core/ngx_array.c \
- src/core/ngx_list.c \
- src/core/ngx_hash.c \
- src/core/ngx_buf.c \
- src/core/ngx_queue.c \
- src/core/ngx_output_chain.c \
- src/core/ngx_string.c \
- src/core/ngx_parse.c \
- src/core/ngx_inet.c \
- src/core/ngx_file.c \
- src/core/ngx_crc32.c \
- src/core/ngx_murmurhash.c \
- src/core/ngx_md5.c \
- src/core/ngx_rbtree.c \
- src/core/ngx_radix_tree.c \
- src/core/ngx_slab.c \
- src/core/ngx_times.c \
- src/core/ngx_shmtx.c \
- src/core/ngx_connection.c \
- src/core/ngx_cycle.c \
- src/core/ngx_spinlock.c \
- src/core/ngx_cpuinfo.c \
- src/core/ngx_conf_file.c \
- src/core/ngx_resolver.c \
- src/core/ngx_open_file_cache.c \
- src/core/ngx_crypt.c \
- src/core/ngx_proxy_protocol.c \
- src/core/ngx_syslog.c"
-
-
-REGEX_MODULE=ngx_regex_module
-REGEX_DEPS=src/core/ngx_regex.h
-REGEX_SRCS=src/core/ngx_regex.c
-
-
-OPENSSL_MODULE=ngx_openssl_module
-OPENSSL_DEPS=src/event/ngx_event_openssl.h
-OPENSSL_SRCS="src/event/ngx_event_openssl.c \
- src/event/ngx_event_openssl_stapling.c"
-
-
-EVENT_MODULES="ngx_events_module ngx_event_core_module"
-
-EVENT_INCS="src/event src/event/modules"
-
-EVENT_DEPS="src/event/ngx_event.h \
- src/event/ngx_event_timer.h \
- src/event/ngx_event_posted.h \
- src/event/ngx_event_busy_lock.h \
- src/event/ngx_event_connect.h \
- src/event/ngx_event_pipe.h"
-
-EVENT_SRCS="src/event/ngx_event.c \
- src/event/ngx_event_timer.c \
- src/event/ngx_event_posted.c \
- src/event/ngx_event_busy_lock.c \
- src/event/ngx_event_accept.c \
- src/event/ngx_event_connect.c \
- src/event/ngx_event_pipe.c"
-
-
-SELECT_MODULE=ngx_select_module
-SELECT_SRCS=src/event/modules/ngx_select_module.c
-WIN32_SELECT_SRCS=src/event/modules/ngx_win32_select_module.c
-
-POLL_MODULE=ngx_poll_module
-POLL_SRCS=src/event/modules/ngx_poll_module.c
-
-KQUEUE_MODULE=ngx_kqueue_module
-KQUEUE_SRCS=src/event/modules/ngx_kqueue_module.c
-
-DEVPOLL_MODULE=ngx_devpoll_module
-DEVPOLL_SRCS=src/event/modules/ngx_devpoll_module.c
-
-EVENTPORT_MODULE=ngx_eventport_module
-EVENTPORT_SRCS=src/event/modules/ngx_eventport_module.c
-
-EPOLL_MODULE=ngx_epoll_module
-EPOLL_SRCS=src/event/modules/ngx_epoll_module.c
-
-RTSIG_MODULE=ngx_rtsig_module
-RTSIG_SRCS=src/event/modules/ngx_rtsig_module.c
-
-IOCP_MODULE=ngx_iocp_module
-IOCP_SRCS=src/event/modules/ngx_iocp_module.c
-
-AIO_MODULE=ngx_aio_module
-AIO_SRCS="src/event/modules/ngx_aio_module.c \
- src/os/unix/ngx_aio_read.c \
- src/os/unix/ngx_aio_write.c \
- src/os/unix/ngx_aio_read_chain.c \
- src/os/unix/ngx_aio_write_chain.c"
-
-FILE_AIO_SRCS="src/os/unix/ngx_file_aio_read.c"
-LINUX_AIO_SRCS="src/os/unix/ngx_linux_aio_read.c"
-
-UNIX_INCS="$CORE_INCS $EVENT_INCS src/os/unix"
-
-UNIX_DEPS="$CORE_DEPS $EVENT_DEPS \
- src/os/unix/ngx_time.h \
- src/os/unix/ngx_errno.h \
- src/os/unix/ngx_alloc.h \
- src/os/unix/ngx_files.h \
- src/os/unix/ngx_channel.h \
- src/os/unix/ngx_shmem.h \
- src/os/unix/ngx_process.h \
- src/os/unix/ngx_setaffinity.h \
- src/os/unix/ngx_setproctitle.h \
- src/os/unix/ngx_atomic.h \
- src/os/unix/ngx_gcc_atomic_x86.h \
- src/os/unix/ngx_thread.h \
- src/os/unix/ngx_socket.h \
- src/os/unix/ngx_os.h \
- src/os/unix/ngx_user.h \
- src/os/unix/ngx_process_cycle.h"
-
-# add to UNIX_DEPS
-# src/os/unix/ngx_gcc_atomic_amd64.h \
-# src/os/unix/ngx_gcc_atomic_sparc64.h \
-# src/os/unix/ngx_gcc_atomic_ppc.h \
-# src/os/unix/ngx_sunpro_atomic_sparc64.h \
-# src/os/unix/ngx_sunpro_x86.il \
-# src/os/unix/ngx_sunpro_amd64.il \
-# src/os/unix/ngx_sunpro_sparc64.il \
-
-
-UNIX_SRCS="$CORE_SRCS $EVENT_SRCS \
- src/os/unix/ngx_time.c \
- src/os/unix/ngx_errno.c \
- src/os/unix/ngx_alloc.c \
- src/os/unix/ngx_files.c \
- src/os/unix/ngx_socket.c \
- src/os/unix/ngx_recv.c \
- src/os/unix/ngx_readv_chain.c \
- src/os/unix/ngx_udp_recv.c \
- src/os/unix/ngx_send.c \
- src/os/unix/ngx_writev_chain.c \
- src/os/unix/ngx_channel.c \
- src/os/unix/ngx_shmem.c \
- src/os/unix/ngx_process.c \
- src/os/unix/ngx_daemon.c \
- src/os/unix/ngx_setaffinity.c \
- src/os/unix/ngx_setproctitle.c \
- src/os/unix/ngx_posix_init.c \
- src/os/unix/ngx_user.c \
- src/os/unix/ngx_process_cycle.c"
-
-POSIX_DEPS=src/os/unix/ngx_posix_config.h
-
-FREEBSD_DEPS="src/os/unix/ngx_freebsd_config.h src/os/unix/ngx_freebsd.h"
-FREEBSD_SRCS=src/os/unix/ngx_freebsd_init.c
-FREEBSD_SENDFILE_SRCS=src/os/unix/ngx_freebsd_sendfile_chain.c
-FREEBSD_RFORK_DEPS="src/os/unix/ngx_freebsd_rfork_thread.h"
-FREEBSD_RFORK_SRCS="src/os/unix/ngx_freebsd_rfork_thread.c"
-FREEBSD_RFORK_THREAD_SRCS="src/os/unix/rfork_thread.S"
-
-PTHREAD_SRCS="src/os/unix/ngx_pthread_thread.c"
-
-LINUX_DEPS="src/os/unix/ngx_linux_config.h src/os/unix/ngx_linux.h"
-LINUX_SRCS=src/os/unix/ngx_linux_init.c
-LINUX_SENDFILE_SRCS=src/os/unix/ngx_linux_sendfile_chain.c
-
-
-SOLARIS_DEPS="src/os/unix/ngx_solaris_config.h src/os/unix/ngx_solaris.h"
-SOLARIS_SRCS=src/os/unix/ngx_solaris_init.c
-SOLARIS_SENDFILEV_SRCS=src/os/unix/ngx_solaris_sendfilev_chain.c
-
-
-DARWIN_DEPS="src/os/unix/ngx_darwin_config.h src/os/unix/ngx_darwin.h"
-DARWIN_SRCS=src/os/unix/ngx_darwin_init.c
-DARWIN_SENDFILE_SRCS=src/os/unix/ngx_darwin_sendfile_chain.c
-
-
-WIN32_INCS="$CORE_INCS $EVENT_INCS src/os/win32"
-
-WIN32_DEPS="$CORE_DEPS $EVENT_DEPS \
- src/os/win32/ngx_win32_config.h \
- src/os/win32/ngx_time.h \
- src/os/win32/ngx_errno.h \
- src/os/win32/ngx_alloc.h \
- src/os/win32/ngx_files.h \
- src/os/win32/ngx_shmem.h \
- src/os/win32/ngx_process.h \
- src/os/win32/ngx_atomic.h \
- src/os/win32/ngx_thread.h \
- src/os/win32/ngx_socket.h \
- src/os/win32/ngx_os.h \
- src/os/win32/ngx_user.h \
- src/os/win32/ngx_process_cycle.h"
-
-WIN32_CONFIG=src/os/win32/ngx_win32_config.h
-
-WIN32_SRCS="$CORE_SRCS $EVENT_SRCS \
- src/os/win32/ngx_errno.c \
- src/os/win32/ngx_alloc.c \
- src/os/win32/ngx_files.c \
- src/os/win32/ngx_shmem.c \
- src/os/win32/ngx_time.c \
- src/os/win32/ngx_process.c \
- src/os/win32/ngx_thread.c \
- src/os/win32/ngx_socket.c \
- src/os/win32/ngx_wsarecv.c \
- src/os/win32/ngx_wsarecv_chain.c \
- src/os/win32/ngx_udp_wsarecv.c \
- src/os/win32/ngx_wsasend.c \
- src/os/win32/ngx_wsasend_chain.c \
- src/os/win32/ngx_win32_init.c \
- src/os/win32/ngx_user.c \
- src/os/win32/ngx_event_log.c \
- src/os/win32/ngx_process_cycle.c \
- src/event/ngx_event_acceptex.c"
-
-NGX_WIN32_ICONS="src/os/win32/nginx.ico"
-NGX_WIN32_RC="src/os/win32/nginx.rc"
-
-
-# the http modules that have their logging formats
-# must be after ngx_http_log_module
-
-HTTP_MODULES="ngx_http_module \
- ngx_http_core_module \
- ngx_http_log_module \
- ngx_http_upstream_module"
-
-HTTP_WRITE_FILTER_MODULE="ngx_http_write_filter_module"
-HTTP_HEADER_FILTER_MODULE="ngx_http_header_filter_module"
-
-HTTP_POSTPONE_FILTER_MODULE=ngx_http_postpone_filter_module
-HTTP_COPY_FILTER_MODULE=ngx_http_copy_filter_module
-
-HTTP_CHUNKED_FILTER_MODULE=ngx_http_chunked_filter_module
-HTTP_HEADERS_FILTER_MODULE=ngx_http_headers_filter_module
-
-HTTP_RANGE_HEADER_FILTER_MODULE=ngx_http_range_header_filter_module
-HTTP_RANGE_BODY_FILTER_MODULE=ngx_http_range_body_filter_module
-
-HTTP_NOT_MODIFIED_FILTER_MODULE=ngx_http_not_modified_filter_module
-
-HTTP_STATIC_MODULE=ngx_http_static_module
-HTTP_INDEX_MODULE=ngx_http_index_module
-
-HTTP_INCS="src/http src/http/modules"
-
-HTTP_DEPS="src/http/ngx_http.h \
- src/http/ngx_http_request.h \
- src/http/ngx_http_config.h \
- src/http/ngx_http_core_module.h \
- src/http/ngx_http_cache.h \
- src/http/ngx_http_variables.h \
- src/http/ngx_http_script.h \
- src/http/ngx_http_upstream.h \
- src/http/ngx_http_upstream_round_robin.h \
- src/http/ngx_http_busy_lock.h"
-
-HTTP_SRCS="src/http/ngx_http.c \
- src/http/ngx_http_core_module.c \
- src/http/ngx_http_special_response.c \
- src/http/ngx_http_request.c \
- src/http/ngx_http_parse.c \
- src/http/ngx_http_header_filter_module.c \
- src/http/ngx_http_write_filter_module.c \
- src/http/ngx_http_copy_filter_module.c \
- src/http/modules/ngx_http_log_module.c \
- src/http/ngx_http_request_body.c \
- src/http/ngx_http_variables.c \
- src/http/ngx_http_script.c \
- src/http/ngx_http_upstream.c \
- src/http/ngx_http_upstream_round_robin.c \
- src/http/ngx_http_parse_time.c \
- src/http/modules/ngx_http_static_module.c \
- src/http/modules/ngx_http_index_module.c \
- src/http/modules/ngx_http_chunked_filter_module.c \
- src/http/modules/ngx_http_range_filter_module.c \
- src/http/modules/ngx_http_headers_filter_module.c \
- src/http/modules/ngx_http_not_modified_filter_module.c"
-
-# STUB
-HTTP_SRCS="$HTTP_SRCS src/http/ngx_http_busy_lock.c"
-
-HTTP_POSTPONE_FILTER_SRCS=src/http/ngx_http_postpone_filter_module.c
-
-HTTP_FILE_CACHE_SRCS=src/http/ngx_http_file_cache.c
-
-
-HTTP_SPDY_MODULE=ngx_http_spdy_module
-HTTP_SPDY_FILTER_MODULE=ngx_http_spdy_filter_module
-HTTP_SPDY_DEPS="src/http/ngx_http_spdy.h \
- src/http/ngx_http_spdy_module.h"
-HTTP_SPDY_SRCS="src/http/ngx_http_spdy.c \
- src/http/ngx_http_spdy_module.c \
- src/http/ngx_http_spdy_filter_module.c"
-
-
-HTTP_CHARSET_FILTER_MODULE=ngx_http_charset_filter_module
-HTTP_CHARSET_SRCS=src/http/modules/ngx_http_charset_filter_module.c
-
-
-HTTP_GZIP_FILTER_MODULE=ngx_http_gzip_filter_module
-HTTP_GZIP_SRCS=src/http/modules/ngx_http_gzip_filter_module.c
-
-
-HTTP_GUNZIP_FILTER_MODULE=ngx_http_gunzip_filter_module
-HTTP_GUNZIP_SRCS=src/http/modules/ngx_http_gunzip_filter_module.c
-
-
-HTTP_SSI_FILTER_MODULE=ngx_http_ssi_filter_module
-HTTP_SSI_DEPS=src/http/modules/ngx_http_ssi_filter_module.h
-HTTP_SSI_SRCS=src/http/modules/ngx_http_ssi_filter_module.c
-
-
-HTTP_XSLT_FILTER_MODULE=ngx_http_xslt_filter_module
-HTTP_XSLT_SRCS=src/http/modules/ngx_http_xslt_filter_module.c
-
-
-HTTP_IMAGE_FILTER_MODULE=ngx_http_image_filter_module
-HTTP_IMAGE_SRCS=src/http/modules/ngx_http_image_filter_module.c
-
-
-HTTP_SUB_FILTER_MODULE=ngx_http_sub_filter_module
-HTTP_SUB_SRCS=src/http/modules/ngx_http_sub_filter_module.c
-
-
-HTTP_USERID_FILTER_MODULE=ngx_http_userid_filter_module
-HTTP_USERID_SRCS=src/http/modules/ngx_http_userid_filter_module.c
-
-
-HTTP_REALIP_MODULE=ngx_http_realip_module
-HTTP_REALIP_SRCS=src/http/modules/ngx_http_realip_module.c
-
-
-HTTP_ADDITION_FILTER_MODULE=ngx_http_addition_filter_module
-HTTP_ADDITION_SRCS=src/http/modules/ngx_http_addition_filter_module.c
-
-
-HTTP_DAV_MODULE=ngx_http_dav_module
-HTTP_DAV_SRCS=src/http/modules/ngx_http_dav_module.c
-
-
-HTTP_ACCESS_MODULE=ngx_http_access_module
-HTTP_ACCESS_SRCS=src/http/modules/ngx_http_access_module.c
-
-
-HTTP_AUTH_BASIC_MODULE=ngx_http_auth_basic_module
-HTTP_AUTH_BASIC_SRCS=src/http/modules/ngx_http_auth_basic_module.c
-
-
-HTTP_AUTH_REQUEST_MODULE=ngx_http_auth_request_module
-HTTP_AUTH_REQUEST_SRCS=src/http/modules/ngx_http_auth_request_module.c
-
-
-HTTP_AUTOINDEX_MODULE=ngx_http_autoindex_module
-HTTP_AUTOINDEX_SRCS=src/http/modules/ngx_http_autoindex_module.c
-
-
-HTTP_RANDOM_INDEX_MODULE=ngx_http_random_index_module
-HTTP_RANDOM_INDEX_SRCS=src/http/modules/ngx_http_random_index_module.c
-
-
-HTTP_STATUS_MODULE=ngx_http_status_module
-HTTP_STATUS_SRCS=src/http/modules/ngx_http_status_module.c
-
-
-HTTP_GEO_MODULE=ngx_http_geo_module
-HTTP_GEO_SRCS=src/http/modules/ngx_http_geo_module.c
-
-
-HTTP_GEOIP_MODULE=ngx_http_geoip_module
-HTTP_GEOIP_SRCS=src/http/modules/ngx_http_geoip_module.c
-
-
-HTTP_MAP_MODULE=ngx_http_map_module
-HTTP_MAP_SRCS=src/http/modules/ngx_http_map_module.c
-
-
-HTTP_SPLIT_CLIENTS_MODULE=ngx_http_split_clients_module
-HTTP_SPLIT_CLIENTS_SRCS=src/http/modules/ngx_http_split_clients_module.c
-
-
-HTTP_REFERER_MODULE=ngx_http_referer_module
-HTTP_REFERER_SRCS=src/http/modules/ngx_http_referer_module.c
-
-
-HTTP_REWRITE_MODULE=ngx_http_rewrite_module
-HTTP_REWRITE_SRCS=src/http/modules/ngx_http_rewrite_module.c
-
-
-HTTP_SSL_MODULE=ngx_http_ssl_module
-HTTP_SSL_DEPS=src/http/modules/ngx_http_ssl_module.h
-HTTP_SSL_SRCS=src/http/modules/ngx_http_ssl_module.c
-
-
-HTTP_PROXY_MODULE=ngx_http_proxy_module
-HTTP_PROXY_SRCS=src/http/modules/ngx_http_proxy_module.c
-
-
-HTTP_FASTCGI_MODULE=ngx_http_fastcgi_module
-HTTP_FASTCGI_SRCS=src/http/modules/ngx_http_fastcgi_module.c
-
-
-HTTP_UWSGI_MODULE=ngx_http_uwsgi_module
-HTTP_UWSGI_SRCS=src/http/modules/ngx_http_uwsgi_module.c
-
-
-HTTP_SCGI_MODULE=ngx_http_scgi_module
-HTTP_SCGI_SRCS=src/http/modules/ngx_http_scgi_module.c
-
-
-HTTP_PERL_MODULE=ngx_http_perl_module
-HTTP_PERL_INCS=src/http/modules/perl
-HTTP_PERL_DEPS=src/http/modules/perl/ngx_http_perl_module.h
-HTTP_PERL_SRCS=src/http/modules/perl/ngx_http_perl_module.c
-
-
-HTTP_MEMCACHED_MODULE=ngx_http_memcached_module
-HTTP_MEMCACHED_SRCS=src/http/modules/ngx_http_memcached_module.c
-
-
-HTTP_LIMIT_CONN_MODULE=ngx_http_limit_conn_module
-HTTP_LIMIT_CONN_SRCS=src/http/modules/ngx_http_limit_conn_module.c
-
-
-HTTP_LIMIT_REQ_MODULE=ngx_http_limit_req_module
-HTTP_LIMIT_REQ_SRCS=src/http/modules/ngx_http_limit_req_module.c
-
-
-HTTP_EMPTY_GIF_MODULE=ngx_http_empty_gif_module
-HTTP_EMPTY_GIF_SRCS=src/http/modules/ngx_http_empty_gif_module.c
-
-
-HTTP_BROWSER_MODULE=ngx_http_browser_module
-HTTP_BROWSER_SRCS=src/http/modules/ngx_http_browser_module.c
-
-
-HTTP_SECURE_LINK_MODULE=ngx_http_secure_link_module
-HTTP_SECURE_LINK_SRCS=src/http/modules/ngx_http_secure_link_module.c
-
-
-HTTP_DEGRADATION_MODULE=ngx_http_degradation_module
-HTTP_DEGRADATION_SRCS=src/http/modules/ngx_http_degradation_module.c
-
-
-HTTP_FLV_MODULE=ngx_http_flv_module
-HTTP_FLV_SRCS=src/http/modules/ngx_http_flv_module.c
-
-
-HTTP_MP4_MODULE=ngx_http_mp4_module
-HTTP_MP4_SRCS=src/http/modules/ngx_http_mp4_module.c
-
-
-HTTP_GZIP_STATIC_MODULE=ngx_http_gzip_static_module
-HTTP_GZIP_STATIC_SRCS=src/http/modules/ngx_http_gzip_static_module.c
-
-
-HTTP_UPSTREAM_HASH_MODULE=ngx_http_upstream_hash_module
-HTTP_UPSTREAM_HASH_SRCS=src/http/modules/ngx_http_upstream_hash_module.c
-
-
-HTTP_UPSTREAM_IP_HASH_MODULE=ngx_http_upstream_ip_hash_module
-HTTP_UPSTREAM_IP_HASH_SRCS=src/http/modules/ngx_http_upstream_ip_hash_module.c
-
-
-HTTP_UPSTREAM_LEAST_CONN_MODULE=ngx_http_upstream_least_conn_module
-HTTP_UPSTREAM_LEAST_CONN_SRCS=" \
- src/http/modules/ngx_http_upstream_least_conn_module.c"
-
-
-HTTP_UPSTREAM_KEEPALIVE_MODULE=ngx_http_upstream_keepalive_module
-HTTP_UPSTREAM_KEEPALIVE_SRCS=" \
- src/http/modules/ngx_http_upstream_keepalive_module.c"
-
-
-MAIL_INCS="src/mail"
-
-MAIL_DEPS="src/mail/ngx_mail.h"
-
-MAIL_MODULES="ngx_mail_module ngx_mail_core_module"
-
-MAIL_SRCS="src/mail/ngx_mail.c \
- src/mail/ngx_mail_core_module.c \
- src/mail/ngx_mail_handler.c \
- src/mail/ngx_mail_parse.c"
-
-MAIL_POP3_MODULE="ngx_mail_pop3_module"
-MAIL_POP3_DEPS="src/mail/ngx_mail_pop3_module.h"
-MAIL_POP3_SRCS="src/mail/ngx_mail_pop3_module.c \
- src/mail/ngx_mail_pop3_handler.c"
-
-MAIL_IMAP_MODULE="ngx_mail_imap_module"
-MAIL_IMAP_DEPS="src/mail/ngx_mail_imap_module.h"
-MAIL_IMAP_SRCS="src/mail/ngx_mail_imap_module.c \
- src/mail/ngx_mail_imap_handler.c"
-
-MAIL_SMTP_MODULE="ngx_mail_smtp_module"
-MAIL_SMTP_DEPS="src/mail/ngx_mail_smtp_module.h"
-MAIL_SMTP_SRCS="src/mail/ngx_mail_smtp_module.c \
- src/mail/ngx_mail_smtp_handler.c"
-
-MAIL_SSL_MODULE="ngx_mail_ssl_module"
-MAIL_SSL_DEPS="src/mail/ngx_mail_ssl_module.h"
-MAIL_SSL_SRCS="src/mail/ngx_mail_ssl_module.c"
-
-MAIL_AUTH_HTTP_MODULE="ngx_mail_auth_http_module"
-MAIL_AUTH_HTTP_SRCS="src/mail/ngx_mail_auth_http_module.c"
-
-MAIL_PROXY_MODULE="ngx_mail_proxy_module"
-MAIL_PROXY_SRCS="src/mail/ngx_mail_proxy_module.c"
-
-NGX_GOOGLE_PERFTOOLS_MODULE=ngx_google_perftools_module
-NGX_GOOGLE_PERFTOOLS_SRCS=src/misc/ngx_google_perftools_module.c
-
-NGX_CPP_TEST_SRCS=src/misc/ngx_cpp_test_module.cpp
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/stubs b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/stubs
deleted file mode 100644
index d8bc1f0e02a..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/stubs
+++ /dev/null
@@ -1,8 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-have=NGX_SUPPRESS_WARN . auto/have
-
-have=NGX_SMP . auto/have
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/summary b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/summary
deleted file mode 100644
index dcebec9f0fe..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/summary
+++ /dev/null
@@ -1,116 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-### STUB
-
-if [ $USE_THREADS != NO ]; then
-
-cat << END
-
-$0: error: the threads support is broken now.
-
-END
- exit 1
- fi
-
-###
-
-
-echo
-echo "Configuration summary"
-
-
-#case $USE_THREADS in
-# rfork) echo " + using rfork()ed threads" ;;
-# pthreads) echo " + using libpthread threads library" ;;
-# libthr) echo " + using FreeBSD libthr threads library" ;;
-# libc_r) echo " + using FreeBSD libc_r threads library" ;;
-# linuxthreads) echo " + using FreeBSD LinuxThreads port library" ;;
-# NO) echo " + threads are not used" ;;
-# *) echo " + using lib$USE_THREADS threads library" ;;
-#esac
-
-if [ $USE_PCRE = DISABLED ]; then
- echo " + PCRE library is disabled"
-
-else
- case $PCRE in
- YES) echo " + using system PCRE library" ;;
- NONE) echo " + PCRE library is not used" ;;
- *) echo " + using PCRE library: $PCRE" ;;
- esac
-fi
-
-case $OPENSSL in
- YES) echo " + using system OpenSSL library" ;;
- NONE) echo " + OpenSSL library is not used" ;;
- *) echo " + using OpenSSL library: $OPENSSL" ;;
-esac
-
-case $MD5 in
- YES) echo " + md5: using $MD5_LIB library" ;;
- NONE) echo " + md5 library is not used" ;;
- NO) echo " + using builtin md5 code" ;;
- *) echo " + using md5 library: $MD5" ;;
-esac
-
-case $SHA1 in
- YES) echo " + sha1: using $SHA1_LIB library" ;;
- NONE) echo " + sha1 library is not used" ;;
- NO) echo " + sha1 library is not found" ;;
- *) echo " + using sha1 library: $SHA1" ;;
-esac
-
-case $ZLIB in
- YES) echo " + using system zlib library" ;;
- NONE) echo " + zlib library is not used" ;;
- *) echo " + using zlib library: $ZLIB" ;;
-esac
-
-case $NGX_LIBATOMIC in
- YES) echo " + using system libatomic_ops library" ;;
- NO) ;; # not used
- *) echo " + using libatomic_ops library: $NGX_LIBATOMIC" ;;
-esac
-
-echo
-
-
-cat << END
- nginx path prefix: "$NGX_PREFIX"
- nginx binary file: "$NGX_SBIN_PATH"
- nginx configuration prefix: "$NGX_CONF_PREFIX"
- nginx configuration file: "$NGX_CONF_PATH"
- nginx pid file: "$NGX_PID_PATH"
-END
-
-if test -n "$NGX_ERROR_LOG_PATH"; then
- echo " nginx error log file: \"$NGX_ERROR_LOG_PATH\""
-else
- echo " nginx logs errors to stderr"
-fi
-
-cat << END
- nginx http access log file: "$NGX_HTTP_LOG_PATH"
- nginx http client request body temporary files: "$NGX_HTTP_CLIENT_TEMP_PATH"
-END
-
-if [ $HTTP_PROXY = YES ]; then
- echo " nginx http proxy temporary files: \"$NGX_HTTP_PROXY_TEMP_PATH\""
-fi
-
-if [ $HTTP_FASTCGI = YES ]; then
- echo " nginx http fastcgi temporary files: \"$NGX_HTTP_FASTCGI_TEMP_PATH\""
-fi
-
-if [ $HTTP_UWSGI = YES ]; then
- echo " nginx http uwsgi temporary files: \"$NGX_HTTP_UWSGI_TEMP_PATH\""
-fi
-
-if [ $HTTP_SCGI = YES ]; then
- echo " nginx http scgi temporary files: \"$NGX_HTTP_SCGI_TEMP_PATH\""
-fi
-
-echo "$NGX_POST_CONF_MSG"
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/sizeof b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/sizeof
deleted file mode 100644
index 9215a545fc4..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/sizeof
+++ /dev/null
@@ -1,84 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo $ngx_n "checking for $ngx_type size ...$ngx_c"
-
-cat << END >> $NGX_AUTOCONF_ERR
-
-----------------------------------------
-checking for $ngx_type size
-
-END
-
-ngx_size=
-
-cat << END > $NGX_AUTOTEST.c
-
-#include <sys/types.h>
-#include <sys/time.h>
-$NGX_INCLUDE_UNISTD_H
-#include <signal.h>
-#include <stdio.h>
-#include <sys/resource.h>
-$NGX_INCLUDE_INTTYPES_H
-$NGX_INCLUDE_AUTO_CONFIG_H
-
-int main() {
- printf("%d", (int) sizeof($ngx_type));
- return 0;
-}
-
-END
-
-
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
-
-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
-
-if [ -x $NGX_AUTOTEST ]; then
- ngx_size=`$NGX_AUTOTEST`
- echo " $ngx_size bytes"
-fi
-
-
-rm -rf $NGX_AUTOTEST*
-
-
-case $ngx_size in
- 4)
- if [ "$ngx_type"="long" ]; then
- ngx_max_value=2147483647L
- else
- ngx_max_value=2147483647
- fi
-
- ngx_max_len='(sizeof("-2147483648") - 1)'
- ;;
-
- 8)
- if [ "$ngx_type"="long long" ]; then
- ngx_max_value=9223372036854775807LL
- else
- ngx_max_value=9223372036854775807L
- fi
-
- ngx_max_len='(sizeof("-9223372036854775808") - 1)'
- ;;
-
- *)
- echo
- echo "$0: error: can not detect $ngx_type size"
-
- echo "----------" >> $NGX_AUTOCONF_ERR
- cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
- echo "----------" >> $NGX_AUTOCONF_ERR
- echo $ngx_test >> $NGX_AUTOCONF_ERR
- echo "----------" >> $NGX_AUTOCONF_ERR
-
- exit 1
-esac
-
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/typedef b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/typedef
deleted file mode 100644
index 8b5c3689ced..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/typedef
+++ /dev/null
@@ -1,77 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo $ngx_n "checking for $ngx_type ...$ngx_c"
-
-cat << END >> $NGX_AUTOCONF_ERR
-
-----------------------------------------
-checking for $ngx_type
-
-END
-
-ngx_found=no
-
-for ngx_try in $ngx_type $ngx_types
-do
-
- cat << END > $NGX_AUTOTEST.c
-
-#include <sys/types.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <netinet/in.h>
-$NGX_INCLUDE_INTTYPES_H
-
-int main() {
- $ngx_try i = 0;
- return (int) i;
-}
-
-END
-
- ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
-
- eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
- if [ -x $NGX_AUTOTEST ]; then
- if [ $ngx_try = $ngx_type ]; then
- echo " found"
- ngx_found=yes
- else
- echo ", $ngx_try used"
- ngx_found=$ngx_try
- fi
- fi
-
- rm -rf $NGX_AUTOTEST*
-
- if [ $ngx_found = no ]; then
- echo $ngx_n " $ngx_try not found$ngx_c"
-
- echo "----------" >> $NGX_AUTOCONF_ERR
- cat $NGX_AUTOTEST.c >> $NGX_AUTOCONF_ERR
- echo "----------" >> $NGX_AUTOCONF_ERR
- echo $ngx_test >> $NGX_AUTOCONF_ERR
- echo "----------" >> $NGX_AUTOCONF_ERR
-
- else
- break
- fi
-done
-
-if [ $ngx_found = no ]; then
- echo
- echo "$0: error: can not define $ngx_type"
-
- exit 1
-fi
-
-if [ $ngx_found != yes ]; then
- echo "typedef $ngx_found $ngx_type;" >> $NGX_AUTO_CONFIG_H
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/uintptr_t b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/uintptr_t
deleted file mode 100644
index f3cdccb2274..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/uintptr_t
+++ /dev/null
@@ -1,45 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-echo $ngx_n "checking for uintptr_t ...$ngx_c"
-echo >> $NGX_AUTOCONF_ERR
-echo "checking for uintptr_t" >> $NGX_AUTOCONF_ERR
-
-found=no
-
-cat << END > $NGX_AUTOTEST.c
-
-#include <sys/types.h>
-$NGX_INTTYPES_H
-
-int main() {
- uintptr_t i = 0;
- return (int) i;
-}
-
-END
-
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT"
-
-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
-if [ -x $NGX_AUTOTEST ]; then
- echo " uintptr_t found"
- found=yes
-else
- echo $ngx_n " uintptr_t not found" $ngx_c
-fi
-
-rm -rf $NGX_AUTOTEST*
-
-
-if [ $found = no ]; then
- found="uint`expr 8 \* $ngx_ptr_size`_t"
- echo ", $found used"
-
- echo "typedef $found uintptr_t;" >> $NGX_AUTO_CONFIG_H
- echo "typedef $found intptr_t;" | sed -e 's/u//g' >> $NGX_AUTO_CONFIG_H
-fi
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/value b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/value
deleted file mode 100644
index ac88a3919ef..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/types/value
+++ /dev/null
@@ -1,12 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-cat << END >> $NGX_AUTO_CONFIG_H
-
-#ifndef $ngx_param
-#define $ngx_param $ngx_value
-#endif
-
-END
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/unix b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/unix
deleted file mode 100755
index 9b4764c6d24..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/auto/unix
+++ /dev/null
@@ -1,827 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-
-NGX_USER=${NGX_USER:-nobody}
-
-if [ -z "$NGX_GROUP" ]; then
- if [ $NGX_USER = nobody ]; then
- if grep nobody /etc/group 2>&1 >/dev/null; then
- echo "checking for nobody group ... found"
- NGX_GROUP=nobody
- else
- echo "checking for nobody group ... not found"
-
- if grep nogroup /etc/group 2>&1 >/dev/null; then
- echo "checking for nogroup group ... found"
- NGX_GROUP=nogroup
- else
- echo "checking for nogroup group ... not found"
- NGX_GROUP=nobody
- fi
- fi
- else
- NGX_GROUP=$NGX_USER
- fi
-fi
-
-
-ngx_feature="poll()"
-ngx_feature_name=
-ngx_feature_run=no
-ngx_feature_incs="#include <poll.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int n; struct pollfd pl;
- pl.fd = 0;
- pl.events = 0;
- pl.revents = 0;
- n = poll(&pl, 1, 0);
- if (n == -1) return 1"
-. auto/feature
-
-if [ $ngx_found = no ]; then
- EVENT_POLL=NONE
-fi
-
-
-ngx_feature="/dev/poll"
-ngx_feature_name="NGX_HAVE_DEVPOLL"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/devpoll.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int n, dp; struct dvpoll dvp;
- dp = 0;
- dvp.dp_fds = NULL;
- dvp.dp_nfds = 0;
- dvp.dp_timeout = 0;
- n = ioctl(dp, DP_POLL, &dvp);
- if (n == -1) return 1"
-. auto/feature
-
-if [ $ngx_found = yes ]; then
- CORE_SRCS="$CORE_SRCS $DEVPOLL_SRCS"
- EVENT_MODULES="$EVENT_MODULES $DEVPOLL_MODULE"
- EVENT_FOUND=YES
-fi
-
-
-if test -z "$NGX_KQUEUE_CHECKED"; then
- ngx_feature="kqueue"
- ngx_feature_name="NGX_HAVE_KQUEUE"
- ngx_feature_run=no
- ngx_feature_incs="#include <sys/event.h>"
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="int kq; kq = kqueue()"
- . auto/feature
-
- if [ $ngx_found = yes ]; then
-
- have=NGX_HAVE_CLEAR_EVENT . auto/have
- EVENT_MODULES="$EVENT_MODULES $KQUEUE_MODULE"
- CORE_SRCS="$CORE_SRCS $KQUEUE_SRCS"
- EVENT_FOUND=YES
-
- ngx_feature="kqueue's NOTE_LOWAT"
- ngx_feature_name="NGX_HAVE_LOWAT_EVENT"
- ngx_feature_run=no
- ngx_feature_incs="#include <sys/event.h>"
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="struct kevent kev;
- kev.fflags = NOTE_LOWAT;"
- . auto/feature
-
-
- ngx_feature="kqueue's EVFILT_TIMER"
- ngx_feature_name="NGX_HAVE_TIMER_EVENT"
- ngx_feature_run=yes
- ngx_feature_incs="#include <sys/event.h>
- #include <sys/time.h>"
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="int kq;
- struct kevent kev;
- struct timespec ts;
-
- if ((kq = kqueue()) == -1) return 1;
-
- kev.ident = 0;
- kev.filter = EVFILT_TIMER;
- kev.flags = EV_ADD|EV_ENABLE;
- kev.fflags = 0;
- kev.data = 1000;
- kev.udata = 0;
-
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
-
- if (kevent(kq, &kev, 1, &kev, 1, &ts) == -1) return 1;
-
- if (kev.flags & EV_ERROR) return 1;"
-
- . auto/feature
- fi
-fi
-
-
-if [ "$NGX_SYSTEM" = "NetBSD" ]; then
-
- # NetBSD 2.0 incompatibly defines kevent.udata as "intptr_t"
-
- cat << END >> $NGX_AUTO_CONFIG_H
-
-#define NGX_KQUEUE_UDATA_T
-
-END
-
-else
- cat << END >> $NGX_AUTO_CONFIG_H
-
-#define NGX_KQUEUE_UDATA_T (void *)
-
-END
-
-fi
-
-
-ngx_feature="crypt()"
-ngx_feature_name=
-ngx_feature_run=no
-ngx_feature_incs=
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="crypt(\"test\", \"salt\");"
-. auto/feature
-
-
-if [ $ngx_found = no ]; then
-
- ngx_feature="crypt() in libcrypt"
- ngx_feature_name=
- ngx_feature_run=no
- ngx_feature_incs=
- ngx_feature_path=
- ngx_feature_libs=-lcrypt
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- CRYPT_LIB="-lcrypt"
- fi
-fi
-
-
-ngx_feature="F_READAHEAD"
-ngx_feature_name="NGX_HAVE_F_READAHEAD"
-ngx_feature_run=no
-ngx_feature_incs="#include <fcntl.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="fcntl(0, F_READAHEAD, 1);"
-. auto/feature
-
-
-ngx_feature="posix_fadvise()"
-ngx_feature_name="NGX_HAVE_POSIX_FADVISE"
-ngx_feature_run=no
-ngx_feature_incs="#include <fcntl.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="posix_fadvise(0, 0, 0, POSIX_FADV_SEQUENTIAL);"
-. auto/feature
-
-
-ngx_feature="O_DIRECT"
-ngx_feature_name="NGX_HAVE_O_DIRECT"
-ngx_feature_run=no
-ngx_feature_incs="#include <fcntl.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="fcntl(0, F_SETFL, O_DIRECT);"
-. auto/feature
-
-
-if [ $ngx_found = yes -a "$NGX_SYSTEM" = "Linux" ]; then
- have=NGX_HAVE_ALIGNED_DIRECTIO . auto/have
-fi
-
-ngx_feature="F_NOCACHE"
-ngx_feature_name="NGX_HAVE_F_NOCACHE"
-ngx_feature_run=no
-ngx_feature_incs="#include <fcntl.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="fcntl(0, F_NOCACHE, 1);"
-. auto/feature
-
-
-ngx_feature="directio()"
-ngx_feature_name="NGX_HAVE_DIRECTIO"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/types.h>
- #include <sys/fcntl.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="directio(0, DIRECTIO_ON);"
-. auto/feature
-
-
-ngx_feature="statfs()"
-ngx_feature_name="NGX_HAVE_STATFS"
-ngx_feature_run=no
-ngx_feature_incs="$NGX_INCLUDE_SYS_PARAM_H
- $NGX_INCLUDE_SYS_MOUNT_H
- $NGX_INCLUDE_SYS_VFS_H"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="struct statfs fs;
- statfs(\".\", &fs);"
-. auto/feature
-
-
-ngx_feature="statvfs()"
-ngx_feature_name="NGX_HAVE_STATVFS"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/types.h>
- #include <sys/statvfs.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="struct statvfs fs;
- statvfs(\".\", &fs);"
-. auto/feature
-
-
-ngx_feature="dlopen()"
-ngx_feature_name=
-ngx_feature_run=no
-ngx_feature_incs="#include <dlfcn.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="dlopen(NULL, 0)"
-. auto/feature
-
-
-if [ $ngx_found != yes ]; then
-
- ngx_feature="dlopen() in libdl"
- ngx_feature_libs="-ldl"
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- NGX_LIBDL="-ldl"
- fi
-fi
-
-
-ngx_feature="sched_yield()"
-ngx_feature_name="NGX_HAVE_SCHED_YIELD"
-ngx_feature_run=no
-ngx_feature_incs="#include <sched.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="sched_yield()"
-. auto/feature
-
-
-if [ $ngx_found != yes ]; then
-
- ngx_feature="sched_yield() in librt"
- ngx_feature_libs="-lrt"
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- CORE_LIBS="$CORE_LIBS -lrt"
- fi
-fi
-
-
-ngx_feature="SO_SETFIB"
-ngx_feature_name="NGX_HAVE_SETFIB"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/socket.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4)"
-. auto/feature
-
-
-ngx_feature="SO_ACCEPTFILTER"
-ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/socket.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)"
-. auto/feature
-
-
-ngx_feature="TCP_DEFER_ACCEPT"
-ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/socket.h>
- #include <netinet/in.h>
- #include <netinet/tcp.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
-. auto/feature
-
-
-ngx_feature="TCP_KEEPIDLE"
-ngx_feature_name="NGX_HAVE_KEEPALIVE_TUNABLE"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/socket.h>
- #include <netinet/in.h>
- #include <netinet/tcp.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_KEEPIDLE, NULL, 0);
- setsockopt(0, IPPROTO_TCP, TCP_KEEPINTVL, NULL, 0);
- setsockopt(0, IPPROTO_TCP, TCP_KEEPCNT, NULL, 0)"
-. auto/feature
-
-
-ngx_feature="TCP_FASTOPEN"
-ngx_feature_name="NGX_HAVE_TCP_FASTOPEN"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/socket.h>
- #include <netinet/in.h>
- #include <netinet/tcp.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_FASTOPEN, NULL, 0)"
-. auto/feature
-
-
-ngx_feature="TCP_INFO"
-ngx_feature_name="NGX_HAVE_TCP_INFO"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/socket.h>
- #include <netinet/in.h>
- #include <netinet/tcp.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="socklen_t optlen = sizeof(struct tcp_info);
- struct tcp_info ti;
- ti.tcpi_rtt = 0;
- ti.tcpi_rttvar = 0;
- ti.tcpi_snd_cwnd = 0;
- ti.tcpi_rcv_space = 0;
- getsockopt(0, IPPROTO_TCP, TCP_INFO, &ti, &optlen)"
-. auto/feature
-
-
-ngx_feature="accept4()"
-ngx_feature_name="NGX_HAVE_ACCEPT4"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/socket.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="accept4(0, NULL, NULL, SOCK_NONBLOCK)"
-. auto/feature
-
-if [ $NGX_FILE_AIO = YES ]; then
-
- ngx_feature="kqueue AIO support"
- ngx_feature_name="NGX_HAVE_FILE_AIO"
- ngx_feature_run=no
- ngx_feature_incs="#include <aio.h>"
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="int n; struct aiocb iocb;
- iocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
- n = aio_read(&iocb)"
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- CORE_SRCS="$CORE_SRCS $FILE_AIO_SRCS"
- fi
-
- if [ $ngx_found = no ]; then
-
- ngx_feature="Linux AIO support"
- ngx_feature_name="NGX_HAVE_FILE_AIO"
- ngx_feature_run=no
- ngx_feature_incs="#include <linux/aio_abi.h>
- #include <sys/eventfd.h>"
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="struct iocb iocb;
- iocb.aio_lio_opcode = IOCB_CMD_PREAD;
- iocb.aio_flags = IOCB_FLAG_RESFD;
- iocb.aio_resfd = -1;
- (void) eventfd(0, 0)"
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- have=NGX_HAVE_EVENTFD . auto/have
- have=NGX_HAVE_SYS_EVENTFD_H . auto/have
- CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
- fi
- fi
-
- if [ $ngx_found = no ]; then
-
- ngx_feature="Linux AIO support (SYS_eventfd)"
- ngx_feature_incs="#include <linux/aio_abi.h>
- #include <sys/syscall.h>"
- ngx_feature_test="int n = SYS_eventfd;
- struct iocb iocb;
- iocb.aio_lio_opcode = IOCB_CMD_PREAD;
- iocb.aio_flags = IOCB_FLAG_RESFD;
- iocb.aio_resfd = -1;"
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- have=NGX_HAVE_EVENTFD . auto/have
- CORE_SRCS="$CORE_SRCS $LINUX_AIO_SRCS"
- fi
- fi
-
- if [ $ngx_found = no ]; then
- cat << END
-
-$0: no supported file AIO was found
-Currently file AIO is supported on FreeBSD 4.3+ and Linux 2.6.22+ only
-
-END
- exit 1
- fi
-fi
-
-
-have=NGX_HAVE_UNIX_DOMAIN . auto/have
-
-ngx_feature_libs=
-
-
-# C types
-
-ngx_type="int"; . auto/types/sizeof
-
-ngx_type="long"; . auto/types/sizeof
-
-ngx_type="long long"; . auto/types/sizeof
-
-ngx_type="void *"; . auto/types/sizeof; ngx_ptr_size=$ngx_size
-ngx_param=NGX_PTR_SIZE; ngx_value=$ngx_size; . auto/types/value
-
-
-# POSIX types
-
-case "$NGX_AUTO_CONFIG_H" in
- /*)
- NGX_INCLUDE_AUTO_CONFIG_H="#include \"$NGX_AUTO_CONFIG_H\""
- ;;
- *)
- NGX_INCLUDE_AUTO_CONFIG_H="#include \"../$NGX_AUTO_CONFIG_H\""
- ;;
-esac
-
-ngx_type="uint64_t"; ngx_types="u_int64_t"; . auto/types/typedef
-
-ngx_type="sig_atomic_t"; ngx_types="int"; . auto/types/typedef
-. auto/types/sizeof
-ngx_param=NGX_SIG_ATOMIC_T_SIZE; ngx_value=$ngx_size; . auto/types/value
-
-ngx_type="socklen_t"; ngx_types="int"; . auto/types/typedef
-
-ngx_type="in_addr_t"; ngx_types="uint32_t"; . auto/types/typedef
-
-ngx_type="in_port_t"; ngx_types="u_short"; . auto/types/typedef
-
-ngx_type="rlim_t"; ngx_types="int"; . auto/types/typedef
-
-. auto/types/uintptr_t
-
-. auto/endianness
-
-ngx_type="size_t"; . auto/types/sizeof
-ngx_param=NGX_MAX_SIZE_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
-ngx_param=NGX_SIZE_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
-
-ngx_type="off_t"; . auto/types/sizeof
-ngx_param=NGX_MAX_OFF_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value
-ngx_param=NGX_OFF_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
-
-ngx_type="time_t"; . auto/types/sizeof
-ngx_param=NGX_TIME_T_SIZE; ngx_value=$ngx_size; . auto/types/value
-ngx_param=NGX_TIME_T_LEN; ngx_value=$ngx_max_len; . auto/types/value
-
-
-# syscalls, libc calls and some features
-
-
-if [ $NGX_IPV6 = YES ]; then
- ngx_feature="AF_INET6"
- ngx_feature_name="NGX_HAVE_INET6"
- ngx_feature_run=no
- ngx_feature_incs="#include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>"
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test="struct sockaddr_in6 sin6;
- sin6.sin6_family = AF_INET6;"
- . auto/feature
-fi
-
-
-ngx_feature="setproctitle()"
-ngx_feature_name="NGX_HAVE_SETPROCTITLE"
-ngx_feature_run=no
-ngx_feature_incs="#include <stdlib.h>"
-ngx_feature_path=
-ngx_feature_libs=$NGX_SETPROCTITLE_LIB
-ngx_feature_test="setproctitle(\"test\");"
-. auto/feature
-
-
-ngx_feature="pread()"
-ngx_feature_name="NGX_HAVE_PREAD"
-ngx_feature_run=no
-ngx_feature_incs=
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="char buf[1]; ssize_t n; n = pread(0, buf, 1, 0);
- if (n == -1) return 1"
-. auto/feature
-
-
-ngx_feature="pwrite()"
-ngx_feature_name="NGX_HAVE_PWRITE"
-ngx_feature_run=no
-ngx_feature_incs=
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0);
- if (n == -1) return 1"
-. auto/feature
-
-
-ngx_feature="sys_nerr"
-ngx_feature_name="NGX_SYS_NERR"
-ngx_feature_run=value
-ngx_feature_incs='#include <errno.h>
- #include <stdio.h>'
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test='printf("%d", sys_nerr);'
-. auto/feature
-
-
-if [ $ngx_found = no ]; then
-
- # Cygiwn defines _sys_nerr
- ngx_feature="_sys_nerr"
- ngx_feature_name="NGX_SYS_NERR"
- ngx_feature_run=value
- ngx_feature_incs='#include <errno.h>
- #include <stdio.h>'
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test='printf("%d", _sys_nerr);'
- . auto/feature
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # Solaris has no sys_nerr
- ngx_feature='maximum errno'
- ngx_feature_name=NGX_SYS_NERR
- ngx_feature_run=value
- ngx_feature_incs='#include <errno.h>
- #include <string.h>
- #include <stdio.h>'
- ngx_feature_path=
- ngx_feature_libs=
- ngx_feature_test='int n;
- char *p;
- for (n = 1; n < 1000; n++) {
- errno = 0;
- p = strerror(n);
- if (errno == EINVAL
- || p == NULL
- || strncmp(p, "Unknown error", 13) == 0)
- {
- break;
- }
- }
- printf("%d", n);'
- . auto/feature
-fi
-
-
-ngx_feature="localtime_r()"
-ngx_feature_name="NGX_HAVE_LOCALTIME_R"
-ngx_feature_run=no
-ngx_feature_incs="#include <time.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="struct tm t; time_t c=0; localtime_r(&c, &t)"
-. auto/feature
-
-
-ngx_feature="posix_memalign()"
-ngx_feature_name="NGX_HAVE_POSIX_MEMALIGN"
-ngx_feature_run=no
-ngx_feature_incs="#include <stdlib.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="void *p; int n; n = posix_memalign(&p, 4096, 4096);
- if (n != 0) return 1"
-. auto/feature
-
-
-ngx_feature="memalign()"
-ngx_feature_name="NGX_HAVE_MEMALIGN"
-ngx_feature_run=no
-ngx_feature_incs="#include <stdlib.h>
- #include <malloc.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="void *p; p = memalign(4096, 4096);
- if (p == NULL) return 1"
-. auto/feature
-
-
-ngx_feature="mmap(MAP_ANON|MAP_SHARED)"
-ngx_feature_name="NGX_HAVE_MAP_ANON"
-ngx_feature_run=yes
-ngx_feature_incs="#include <sys/mman.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="void *p;
- p = mmap(NULL, 4096, PROT_READ|PROT_WRITE,
- MAP_ANON|MAP_SHARED, -1, 0);
- if (p == MAP_FAILED) return 1;"
-. auto/feature
-
-
-ngx_feature='mmap("/dev/zero", MAP_SHARED)'
-ngx_feature_name="NGX_HAVE_MAP_DEVZERO"
-ngx_feature_run=yes
-ngx_feature_incs="#include <sys/mman.h>
- #include <sys/stat.h>
- #include <fcntl.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test='void *p; int fd;
- fd = open("/dev/zero", O_RDWR);
- p = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
- if (p == MAP_FAILED) return 1;'
-. auto/feature
-
-
-ngx_feature="System V shared memory"
-ngx_feature_name="NGX_HAVE_SYSVSHM"
-ngx_feature_run=yes
-ngx_feature_incs="#include <sys/ipc.h>
- #include <sys/shm.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int id;
- id = shmget(IPC_PRIVATE, 4096, (SHM_R|SHM_W|IPC_CREAT));
- if (id == -1) return 1;
- shmctl(id, IPC_RMID, NULL);"
-. auto/feature
-
-
-ngx_feature="POSIX semaphores"
-ngx_feature_name="NGX_HAVE_POSIX_SEM"
-ngx_feature_run=yes
-ngx_feature_incs="#include <semaphore.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="sem_t sem;
- if (sem_init(&sem, 1, 0) == -1) return 1;
- sem_destroy(&sem);"
-. auto/feature
-
-
-if [ $ngx_found = no ]; then
-
- # Linux has POSIX semaphores in libpthread
- ngx_feature="POSIX semaphores in libpthread"
- ngx_feature_libs=-lpthread
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- CORE_LIBS="$CORE_LIBS -lpthread"
- fi
-fi
-
-
-if [ $ngx_found = no ]; then
-
- # Solaris has POSIX semaphores in librt
- ngx_feature="POSIX semaphores in librt"
- ngx_feature_libs=-lrt
- . auto/feature
-
- if [ $ngx_found = yes ]; then
- CORE_LIBS="$CORE_LIBS -lrt"
- fi
-fi
-
-
-ngx_feature="struct msghdr.msg_control"
-ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/socket.h>
- #include <stdio.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="struct msghdr msg;
- printf(\"%d\", (int) sizeof(msg.msg_control))"
-. auto/feature
-
-
-ngx_feature="ioctl(FIONBIO)"
-ngx_feature_name="NGX_HAVE_FIONBIO"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/ioctl.h>
- #include <stdio.h>
- $NGX_INCLUDE_SYS_FILIO_H"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="int i = FIONBIO; printf(\"%d\", i)"
-. auto/feature
-
-
-ngx_feature="struct tm.tm_gmtoff"
-ngx_feature_name="NGX_HAVE_GMTOFF"
-ngx_feature_run=no
-ngx_feature_incs="#include <time.h>
- #include <stdio.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="struct tm tm; tm.tm_gmtoff = 0;
- printf(\"%d\", (int) tm.tm_gmtoff)"
-. auto/feature
-
-
-ngx_feature="struct dirent.d_namlen"
-ngx_feature_name="NGX_HAVE_D_NAMLEN"
-ngx_feature_run=no
-ngx_feature_incs="#include <dirent.h>
- #include <stdio.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="struct dirent dir; dir.d_namlen = 0;
- printf(\"%d\", (int) dir.d_namlen)"
-. auto/feature
-
-
-ngx_feature="struct dirent.d_type"
-ngx_feature_name="NGX_HAVE_D_TYPE"
-ngx_feature_run=no
-ngx_feature_incs="#include <dirent.h>
- #include <stdio.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="struct dirent dir; dir.d_type = DT_REG;
- printf(\"%d\", (int) dir.d_type)"
-. auto/feature
-
-
-ngx_feature="sysconf(_SC_NPROCESSORS_ONLN)"
-ngx_feature_name="NGX_HAVE_SC_NPROCESSORS_ONLN"
-ngx_feature_run=no
-ngx_feature_incs=
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
-. auto/feature
-
-
-ngx_feature="openat(), fstatat()"
-ngx_feature_name="NGX_HAVE_OPENAT"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test="struct stat sb;
- openat(AT_FDCWD, \".\", O_RDONLY|O_NOFOLLOW);
- fstatat(AT_FDCWD, \".\", &sb, AT_SYMLINK_NOFOLLOW);"
-. auto/feature
-
-
-ngx_feature="getaddrinfo()"
-ngx_feature_name="NGX_HAVE_GETADDRINFO"
-ngx_feature_run=no
-ngx_feature_incs="#include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>"
-ngx_feature_path=
-ngx_feature_libs=
-ngx_feature_test='struct addrinfo *res;
- if (getaddrinfo("localhost", NULL, NULL, &res) != 0) return 1;
- freeaddrinfo(res)'
-. auto/feature
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi.conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi.conf
deleted file mode 100644
index ac9ff92049f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi.conf
+++ /dev/null
@@ -1,25 +0,0 @@
-
-fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-fastcgi_param QUERY_STRING $query_string;
-fastcgi_param REQUEST_METHOD $request_method;
-fastcgi_param CONTENT_TYPE $content_type;
-fastcgi_param CONTENT_LENGTH $content_length;
-
-fastcgi_param SCRIPT_NAME $fastcgi_script_name;
-fastcgi_param REQUEST_URI $request_uri;
-fastcgi_param DOCUMENT_URI $document_uri;
-fastcgi_param DOCUMENT_ROOT $document_root;
-fastcgi_param SERVER_PROTOCOL $server_protocol;
-fastcgi_param HTTPS $https if_not_empty;
-
-fastcgi_param GATEWAY_INTERFACE CGI/1.1;
-fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
-
-fastcgi_param REMOTE_ADDR $remote_addr;
-fastcgi_param REMOTE_PORT $remote_port;
-fastcgi_param SERVER_ADDR $server_addr;
-fastcgi_param SERVER_PORT $server_port;
-fastcgi_param SERVER_NAME $server_name;
-
-# PHP only, required if PHP was built with --enable-force-cgi-redirect
-fastcgi_param REDIRECT_STATUS 200;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi_params b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi_params
deleted file mode 100644
index 71e2c2e3bed..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/fastcgi_params
+++ /dev/null
@@ -1,24 +0,0 @@
-
-fastcgi_param QUERY_STRING $query_string;
-fastcgi_param REQUEST_METHOD $request_method;
-fastcgi_param CONTENT_TYPE $content_type;
-fastcgi_param CONTENT_LENGTH $content_length;
-
-fastcgi_param SCRIPT_NAME $fastcgi_script_name;
-fastcgi_param REQUEST_URI $request_uri;
-fastcgi_param DOCUMENT_URI $document_uri;
-fastcgi_param DOCUMENT_ROOT $document_root;
-fastcgi_param SERVER_PROTOCOL $server_protocol;
-fastcgi_param HTTPS $https if_not_empty;
-
-fastcgi_param GATEWAY_INTERFACE CGI/1.1;
-fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
-
-fastcgi_param REMOTE_ADDR $remote_addr;
-fastcgi_param REMOTE_PORT $remote_port;
-fastcgi_param SERVER_ADDR $server_addr;
-fastcgi_param SERVER_PORT $server_port;
-fastcgi_param SERVER_NAME $server_name;
-
-# PHP only, required if PHP was built with --enable-force-cgi-redirect
-fastcgi_param REDIRECT_STATUS 200;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-utf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-utf
deleted file mode 100644
index e7974ff6ad9..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-utf
+++ /dev/null
@@ -1,109 +0,0 @@
-
-# This map is not a full koi8-r <> utf8 map: it does not contain
-# box-drawing and some other characters. Besides this map contains
-# several koi8-u and Byelorussian letters which are not in koi8-r.
-# If you need a full and standard map, use contrib/unicode2nginx/koi-utf
-# map instead.
-
-charset_map koi8-r utf-8 {
-
- 80 E282AC ; # euro
-
- 95 E280A2 ; # bullet
-
- 9A C2A0 ; # &nbsp;
-
- 9E C2B7 ; # &middot;
-
- A3 D191 ; # small yo
- A4 D194 ; # small Ukrainian ye
-
- A6 D196 ; # small Ukrainian i
- A7 D197 ; # small Ukrainian yi
-
- AD D291 ; # small Ukrainian soft g
- AE D19E ; # small Byelorussian short u
-
- B0 C2B0 ; # &deg;
-
- B3 D081 ; # capital YO
- B4 D084 ; # capital Ukrainian YE
-
- B6 D086 ; # capital Ukrainian I
- B7 D087 ; # capital Ukrainian YI
-
- B9 E28496 ; # numero sign
-
- BD D290 ; # capital Ukrainian soft G
- BE D18E ; # capital Byelorussian short U
-
- BF C2A9 ; # (C)
-
- C0 D18E ; # small yu
- C1 D0B0 ; # small a
- C2 D0B1 ; # small b
- C3 D186 ; # small ts
- C4 D0B4 ; # small d
- C5 D0B5 ; # small ye
- C6 D184 ; # small f
- C7 D0B3 ; # small g
- C8 D185 ; # small kh
- C9 D0B8 ; # small i
- CA D0B9 ; # small j
- CB D0BA ; # small k
- CC D0BB ; # small l
- CD D0BC ; # small m
- CE D0BD ; # small n
- CF D0BE ; # small o
-
- D0 D0BF ; # small p
- D1 D18F ; # small ya
- D2 D180 ; # small r
- D3 D181 ; # small s
- D4 D182 ; # small t
- D5 D183 ; # small u
- D6 D0B6 ; # small zh
- D7 D0B2 ; # small v
- D8 D18C ; # small soft sign
- D9 D18B ; # small y
- DA D0B7 ; # small z
- DB D188 ; # small sh
- DC D18D ; # small e
- DD D189 ; # small shch
- DE D187 ; # small ch
- DF D18A ; # small hard sign
-
- E0 D0AE ; # capital YU
- E1 D090 ; # capital A
- E2 D091 ; # capital B
- E3 D0A6 ; # capital TS
- E4 D094 ; # capital D
- E5 D095 ; # capital YE
- E6 D0A4 ; # capital F
- E7 D093 ; # capital G
- E8 D0A5 ; # capital KH
- E9 D098 ; # capital I
- EA D099 ; # capital J
- EB D09A ; # capital K
- EC D09B ; # capital L
- ED D09C ; # capital M
- EE D09D ; # capital N
- EF D09E ; # capital O
-
- F0 D09F ; # capital P
- F1 D0AF ; # capital YA
- F2 D0A0 ; # capital R
- F3 D0A1 ; # capital S
- F4 D0A2 ; # capital T
- F5 D0A3 ; # capital U
- F6 D096 ; # capital ZH
- F7 D092 ; # capital V
- F8 D0AC ; # capital soft sign
- F9 D0AB ; # capital Y
- FA D097 ; # capital Z
- FB D0A8 ; # capital SH
- FC D0AD ; # capital E
- FD D0A9 ; # capital SHCH
- FE D0A7 ; # capital CH
- FF D0AA ; # capital hard sign
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-win b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-win
deleted file mode 100644
index 72afabe89b8..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/koi-win
+++ /dev/null
@@ -1,103 +0,0 @@
-
-charset_map koi8-r windows-1251 {
-
- 80 88 ; # euro
-
- 95 95 ; # bullet
-
- 9A A0 ; # &nbsp;
-
- 9E B7 ; # &middot;
-
- A3 B8 ; # small yo
- A4 BA ; # small Ukrainian ye
-
- A6 B3 ; # small Ukrainian i
- A7 BF ; # small Ukrainian yi
-
- AD B4 ; # small Ukrainian soft g
- AE A2 ; # small Byelorussian short u
-
- B0 B0 ; # &deg;
-
- B3 A8 ; # capital YO
- B4 AA ; # capital Ukrainian YE
-
- B6 B2 ; # capital Ukrainian I
- B7 AF ; # capital Ukrainian YI
-
- B9 B9 ; # numero sign
-
- BD A5 ; # capital Ukrainian soft G
- BE A1 ; # capital Byelorussian short U
-
- BF A9 ; # (C)
-
- C0 FE ; # small yu
- C1 E0 ; # small a
- C2 E1 ; # small b
- C3 F6 ; # small ts
- C4 E4 ; # small d
- C5 E5 ; # small ye
- C6 F4 ; # small f
- C7 E3 ; # small g
- C8 F5 ; # small kh
- C9 E8 ; # small i
- CA E9 ; # small j
- CB EA ; # small k
- CC EB ; # small l
- CD EC ; # small m
- CE ED ; # small n
- CF EE ; # small o
-
- D0 EF ; # small p
- D1 FF ; # small ya
- D2 F0 ; # small r
- D3 F1 ; # small s
- D4 F2 ; # small t
- D5 F3 ; # small u
- D6 E6 ; # small zh
- D7 E2 ; # small v
- D8 FC ; # small soft sign
- D9 FB ; # small y
- DA E7 ; # small z
- DB F8 ; # small sh
- DC FD ; # small e
- DD F9 ; # small shch
- DE F7 ; # small ch
- DF FA ; # small hard sign
-
- E0 DE ; # capital YU
- E1 C0 ; # capital A
- E2 C1 ; # capital B
- E3 D6 ; # capital TS
- E4 C4 ; # capital D
- E5 C5 ; # capital YE
- E6 D4 ; # capital F
- E7 C3 ; # capital G
- E8 D5 ; # capital KH
- E9 C8 ; # capital I
- EA C9 ; # capital J
- EB CA ; # capital K
- EC CB ; # capital L
- ED CC ; # capital M
- EE CD ; # capital N
- EF CE ; # capital O
-
- F0 CF ; # capital P
- F1 DF ; # capital YA
- F2 D0 ; # capital R
- F3 D1 ; # capital S
- F4 D2 ; # capital T
- F5 D3 ; # capital U
- F6 C6 ; # capital ZH
- F7 C2 ; # capital V
- F8 DC ; # capital soft sign
- F9 DB ; # capital Y
- FA C7 ; # capital Z
- FB D8 ; # capital SH
- FC DD ; # capital E
- FD D9 ; # capital SHCH
- FE D7 ; # capital CH
- FF DA ; # capital hard sign
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/mime.types b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/mime.types
deleted file mode 100644
index 89be9a4cd63..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/mime.types
+++ /dev/null
@@ -1,89 +0,0 @@
-
-types {
- text/html html htm shtml;
- text/css css;
- text/xml xml;
- image/gif gif;
- image/jpeg jpeg jpg;
- application/javascript js;
- application/atom+xml atom;
- application/rss+xml rss;
-
- text/mathml mml;
- text/plain txt;
- text/vnd.sun.j2me.app-descriptor jad;
- text/vnd.wap.wml wml;
- text/x-component htc;
-
- image/png png;
- image/tiff tif tiff;
- image/vnd.wap.wbmp wbmp;
- image/x-icon ico;
- image/x-jng jng;
- image/x-ms-bmp bmp;
- image/svg+xml svg svgz;
- image/webp webp;
-
- application/font-woff woff;
- application/java-archive jar war ear;
- application/json json;
- application/mac-binhex40 hqx;
- application/msword doc;
- application/pdf pdf;
- application/postscript ps eps ai;
- application/rtf rtf;
- application/vnd.apple.mpegurl m3u8;
- application/vnd.ms-excel xls;
- application/vnd.ms-fontobject eot;
- application/vnd.ms-powerpoint ppt;
- application/vnd.wap.wmlc wmlc;
- application/vnd.google-earth.kml+xml kml;
- application/vnd.google-earth.kmz kmz;
- application/x-7z-compressed 7z;
- application/x-cocoa cco;
- application/x-java-archive-diff jardiff;
- application/x-java-jnlp-file jnlp;
- application/x-makeself run;
- application/x-perl pl pm;
- application/x-pilot prc pdb;
- application/x-rar-compressed rar;
- application/x-redhat-package-manager rpm;
- application/x-sea sea;
- application/x-shockwave-flash swf;
- application/x-stuffit sit;
- application/x-tcl tcl tk;
- application/x-x509-ca-cert der pem crt;
- application/x-xpinstall xpi;
- application/xhtml+xml xhtml;
- application/xspf+xml xspf;
- application/zip zip;
-
- application/octet-stream bin exe dll;
- application/octet-stream deb;
- application/octet-stream dmg;
- application/octet-stream iso img;
- application/octet-stream msi msp msm;
-
- application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
- application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
-
- audio/midi mid midi kar;
- audio/mpeg mp3;
- audio/ogg ogg;
- audio/x-m4a m4a;
- audio/x-realaudio ra;
-
- video/3gpp 3gpp 3gp;
- video/mp2t ts;
- video/mp4 mp4;
- video/mpeg mpeg mpg;
- video/quicktime mov;
- video/webm webm;
- video/x-flv flv;
- video/x-m4v m4v;
- video/x-mng mng;
- video/x-ms-asf asx asf;
- video/x-ms-wmv wmv;
- video/x-msvideo avi;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/nginx.conf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/nginx.conf
deleted file mode 100644
index 29bc085f28c..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/nginx.conf
+++ /dev/null
@@ -1,117 +0,0 @@
-
-#user nobody;
-worker_processes 1;
-
-#error_log logs/error.log;
-#error_log logs/error.log notice;
-#error_log logs/error.log info;
-
-#pid logs/nginx.pid;
-
-
-events {
- worker_connections 1024;
-}
-
-
-http {
- include mime.types;
- default_type application/octet-stream;
-
- #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- # '$status $body_bytes_sent "$http_referer" '
- # '"$http_user_agent" "$http_x_forwarded_for"';
-
- #access_log logs/access.log main;
-
- sendfile on;
- #tcp_nopush on;
-
- #keepalive_timeout 0;
- keepalive_timeout 65;
-
- #gzip on;
-
- server {
- listen 80;
- server_name localhost;
-
- #charset koi8-r;
-
- #access_log logs/host.access.log main;
-
- location / {
- root html;
- index index.html index.htm;
- }
-
- #error_page 404 /404.html;
-
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
-
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
- #
- #location ~ \.php$ {
- # proxy_pass http://127.0.0.1;
- #}
-
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- #location ~ \.php$ {
- # root html;
- # fastcgi_pass 127.0.0.1:9000;
- # fastcgi_index index.php;
- # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
- # include fastcgi_params;
- #}
-
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- #location ~ /\.ht {
- # deny all;
- #}
- }
-
-
- # another virtual host using mix of IP-, name-, and port-based configuration
- #
- #server {
- # listen 8000;
- # listen somename:8080;
- # server_name somename alias another.alias;
-
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
-
-
- # HTTPS server
- #
- #server {
- # listen 443 ssl;
- # server_name localhost;
-
- # ssl_certificate cert.pem;
- # ssl_certificate_key cert.key;
-
- # ssl_session_cache shared:SSL:1m;
- # ssl_session_timeout 5m;
-
- # ssl_ciphers HIGH:!aNULL:!MD5;
- # ssl_prefer_server_ciphers on;
-
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
-
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/scgi_params b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/scgi_params
deleted file mode 100644
index 47348ca381c..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/scgi_params
+++ /dev/null
@@ -1,16 +0,0 @@
-
-scgi_param REQUEST_METHOD $request_method;
-scgi_param REQUEST_URI $request_uri;
-scgi_param QUERY_STRING $query_string;
-scgi_param CONTENT_TYPE $content_type;
-
-scgi_param DOCUMENT_URI $document_uri;
-scgi_param DOCUMENT_ROOT $document_root;
-scgi_param SCGI 1;
-scgi_param SERVER_PROTOCOL $server_protocol;
-scgi_param HTTPS $https if_not_empty;
-
-scgi_param REMOTE_ADDR $remote_addr;
-scgi_param REMOTE_PORT $remote_port;
-scgi_param SERVER_PORT $server_port;
-scgi_param SERVER_NAME $server_name;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/uwsgi_params b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/uwsgi_params
deleted file mode 100644
index f539451b6f5..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/uwsgi_params
+++ /dev/null
@@ -1,16 +0,0 @@
-
-uwsgi_param QUERY_STRING $query_string;
-uwsgi_param REQUEST_METHOD $request_method;
-uwsgi_param CONTENT_TYPE $content_type;
-uwsgi_param CONTENT_LENGTH $content_length;
-
-uwsgi_param REQUEST_URI $request_uri;
-uwsgi_param PATH_INFO $document_uri;
-uwsgi_param DOCUMENT_ROOT $document_root;
-uwsgi_param SERVER_PROTOCOL $server_protocol;
-uwsgi_param HTTPS $https if_not_empty;
-
-uwsgi_param REMOTE_ADDR $remote_addr;
-uwsgi_param REMOTE_PORT $remote_port;
-uwsgi_param SERVER_PORT $server_port;
-uwsgi_param SERVER_NAME $server_name;
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/win-utf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/win-utf
deleted file mode 100644
index ed8bc007a72..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/conf/win-utf
+++ /dev/null
@@ -1,126 +0,0 @@
-
-# This map is not a full windows-1251 <> utf8 map: it does not
-# contain Serbian and Macedonian letters. If you need a full map,
-# use contrib/unicode2nginx/win-utf map instead.
-
-charset_map windows-1251 utf-8 {
-
- 82 E2809A ; # single low-9 quotation mark
-
- 84 E2809E ; # double low-9 quotation mark
- 85 E280A6 ; # ellipsis
- 86 E280A0 ; # dagger
- 87 E280A1 ; # double dagger
- 88 E282AC ; # euro
- 89 E280B0 ; # per mille
-
- 91 E28098 ; # left single quotation mark
- 92 E28099 ; # right single quotation mark
- 93 E2809C ; # left double quotation mark
- 94 E2809D ; # right double quotation mark
- 95 E280A2 ; # bullet
- 96 E28093 ; # en dash
- 97 E28094 ; # em dash
-
- 99 E284A2 ; # trade mark sign
-
- A0 C2A0 ; # &nbsp;
- A1 D18E ; # capital Byelorussian short U
- A2 D19E ; # small Byelorussian short u
-
- A4 C2A4 ; # currency sign
- A5 D290 ; # capital Ukrainian soft G
- A6 C2A6 ; # borken bar
- A7 C2A7 ; # section sign
- A8 D081 ; # capital YO
- A9 C2A9 ; # (C)
- AA D084 ; # capital Ukrainian YE
- AB C2AB ; # left-pointing double angle quotation mark
- AC C2AC ; # not sign
- AD C2AD ; # soft hypen
- AE C2AE ; # (R)
- AF D087 ; # capital Ukrainian YI
-
- B0 C2B0 ; # &deg;
- B1 C2B1 ; # plus-minus sign
- B2 D086 ; # capital Ukrainian I
- B3 D196 ; # small Ukrainian i
- B4 D291 ; # small Ukrainian soft g
- B5 C2B5 ; # micro sign
- B6 C2B6 ; # pilcrow sign
- B7 C2B7 ; # &middot;
- B8 D191 ; # small yo
- B9 E28496 ; # numero sign
- BA D194 ; # small Ukrainian ye
- BB C2BB ; # right-pointing double angle quotation mark
-
- BF D197 ; # small Ukrainian yi
-
- C0 D090 ; # capital A
- C1 D091 ; # capital B
- C2 D092 ; # capital V
- C3 D093 ; # capital G
- C4 D094 ; # capital D
- C5 D095 ; # capital YE
- C6 D096 ; # capital ZH
- C7 D097 ; # capital Z
- C8 D098 ; # capital I
- C9 D099 ; # capital J
- CA D09A ; # capital K
- CB D09B ; # capital L
- CC D09C ; # capital M
- CD D09D ; # capital N
- CE D09E ; # capital O
- CF D09F ; # capital P
-
- D0 D0A0 ; # capital R
- D1 D0A1 ; # capital S
- D2 D0A2 ; # capital T
- D3 D0A3 ; # capital U
- D4 D0A4 ; # capital F
- D5 D0A5 ; # capital KH
- D6 D0A6 ; # capital TS
- D7 D0A7 ; # capital CH
- D8 D0A8 ; # capital SH
- D9 D0A9 ; # capital SHCH
- DA D0AA ; # capital hard sign
- DB D0AB ; # capital Y
- DC D0AC ; # capital soft sign
- DD D0AD ; # capital E
- DE D0AE ; # capital YU
- DF D0AF ; # capital YA
-
- E0 D0B0 ; # small a
- E1 D0B1 ; # small b
- E2 D0B2 ; # small v
- E3 D0B3 ; # small g
- E4 D0B4 ; # small d
- E5 D0B5 ; # small ye
- E6 D0B6 ; # small zh
- E7 D0B7 ; # small z
- E8 D0B8 ; # small i
- E9 D0B9 ; # small j
- EA D0BA ; # small k
- EB D0BB ; # small l
- EC D0BC ; # small m
- ED D0BD ; # small n
- EE D0BE ; # small o
- EF D0BF ; # small p
-
- F0 D180 ; # small r
- F1 D181 ; # small s
- F2 D182 ; # small t
- F3 D183 ; # small u
- F4 D184 ; # small f
- F5 D185 ; # small kh
- F6 D186 ; # small ts
- F7 D187 ; # small ch
- F8 D188 ; # small sh
- F9 D189 ; # small shch
- FA D18A ; # small hard sign
- FB D18B ; # small y
- FC D18C ; # small soft sign
- FD D18D ; # small e
- FE D18E ; # small yu
- FF D18F ; # small ya
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/README b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/README
deleted file mode 100644
index fec4b200863..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/README
+++ /dev/null
@@ -1,21 +0,0 @@
-
-geo2nginx.pl by Andrei Nigmatulin
-
- The perl script to convert CSV geoip database ( free download
- at http://www.maxmind.com/app/geoip_country ) to format, suitable
- for use by the ngx_http_geo_module.
-
-
-unicode2nginx by Maxim Dounin
-
- The perl script to convert unicode mappings ( available
- at http://www.unicode.org/Public/MAPPINGS/ ) to the nginx
- configuration file format.
- Two generated full maps for windows-1251 and koi8-r.
-
-
-vim by Evan Miller
-
- Syntax highlighting of nginx configuration for vim, to be
- placed into ~/.vim/.
-
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/geo2nginx.pl b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/geo2nginx.pl
deleted file mode 100644
index 29243ecf2b2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/geo2nginx.pl
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/perl -w
-
-# (c) Andrei Nigmatulin, 2005
-#
-# this script provided "as is", without any warranties. use it at your own risk.
-#
-# special thanx to Andrew Sitnikov for perl port
-#
-# this script converts CSV geoip database (free download at http://www.maxmind.com/app/geoip_country)
-# to format, suitable for use with nginx_http_geo module (http://sysoev.ru/nginx)
-#
-# for example, line with ip range
-#
-# "62.16.68.0","62.16.127.255","1041253376","1041268735","RU","Russian Federation"
-#
-# will be converted to four subnetworks:
-#
-# 62.16.68.0/22 RU;
-# 62.16.72.0/21 RU;
-# 62.16.80.0/20 RU;
-# 62.16.96.0/19 RU;
-
-
-use warnings;
-use strict;
-
-while( <STDIN> ){
- if (/"[^"]+","[^"]+","([^"]+)","([^"]+)","([^"]+)"/){
- print_subnets($1, $2, $3);
- }
-}
-
-sub print_subnets {
- my ($a1, $a2, $c) = @_;
- my $l;
- while ($a1 <= $a2) {
- for ($l = 0; ($a1 & (1 << $l)) == 0 && ($a1 + ((1 << ($l + 1)) - 1)) <= $a2; $l++){};
- print long2ip($a1) . "/" . (32 - $l) . " " . $c . ";\n";
- $a1 += (1 << $l);
- }
-}
-
-sub long2ip {
- my $ip = shift;
-
- my $str = 0;
-
- $str = ($ip & 255);
-
- $ip >>= 8;
- $str = ($ip & 255).".$str";
-
- $ip >>= 8;
- $str = ($ip & 255).".$str";
-
- $ip >>= 8;
- $str = ($ip & 255).".$str";
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/koi-utf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/koi-utf
deleted file mode 100644
index 48853af9af9..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/koi-utf
+++ /dev/null
@@ -1,131 +0,0 @@
-charset_map koi8-r utf-8 {
-
- 80 E29480 ; # BOX DRAWINGS LIGHT HORIZONTAL
- 81 E29482 ; # BOX DRAWINGS LIGHT VERTICAL
- 82 E2948C ; # BOX DRAWINGS LIGHT DOWN AND RIGHT
- 83 E29490 ; # BOX DRAWINGS LIGHT DOWN AND LEFT
- 84 E29494 ; # BOX DRAWINGS LIGHT UP AND RIGHT
- 85 E29498 ; # BOX DRAWINGS LIGHT UP AND LEFT
- 86 E2949C ; # BOX DRAWINGS LIGHT VERTICAL AND RIGHT
- 87 E294A4 ; # BOX DRAWINGS LIGHT VERTICAL AND LEFT
- 88 E294AC ; # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
- 89 E294B4 ; # BOX DRAWINGS LIGHT UP AND HORIZONTAL
- 8A E294BC ; # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
- 8B E29680 ; # UPPER HALF BLOCK
- 8C E29684 ; # LOWER HALF BLOCK
- 8D E29688 ; # FULL BLOCK
- 8E E2968C ; # LEFT HALF BLOCK
- 8F E29690 ; # RIGHT HALF BLOCK
- 90 E29691 ; # LIGHT SHADE
- 91 E29692 ; # MEDIUM SHADE
- 92 E29693 ; # DARK SHADE
- 93 E28CA0 ; # TOP HALF INTEGRAL
- 94 E296A0 ; # BLACK SQUARE
- 95 E28899 ; # BULLET OPERATOR
- 96 E2889A ; # SQUARE ROOT
- 97 E28988 ; # ALMOST EQUAL TO
- 98 E289A4 ; # LESS-THAN OR EQUAL TO
- 99 E289A5 ; # GREATER-THAN OR EQUAL TO
- 9A C2A0 ; # NO-BREAK SPACE
- 9B E28CA1 ; # BOTTOM HALF INTEGRAL
- 9C C2B0 ; # DEGREE SIGN
- 9D C2B2 ; # SUPERSCRIPT TWO
- 9E C2B7 ; # MIDDLE DOT
- 9F C3B7 ; # DIVISION SIGN
- A0 E29590 ; # BOX DRAWINGS DOUBLE HORIZONTAL
- A1 E29591 ; # BOX DRAWINGS DOUBLE VERTICAL
- A2 E29592 ; # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
- A3 D191 ; # CYRILLIC SMALL LETTER IO
- A4 E29593 ; # BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
- A5 E29594 ; # BOX DRAWINGS DOUBLE DOWN AND RIGHT
- A6 E29595 ; # BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
- A7 E29596 ; # BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
- A8 E29597 ; # BOX DRAWINGS DOUBLE DOWN AND LEFT
- A9 E29598 ; # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
- AA E29599 ; # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
- AB E2959A ; # BOX DRAWINGS DOUBLE UP AND RIGHT
- AC E2959B ; # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
- AD E2959C ; # BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
- AE E2959D ; # BOX DRAWINGS DOUBLE UP AND LEFT
- AF E2959E ; # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
- B0 E2959F ; # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
- B1 E295A0 ; # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
- B2 E295A1 ; # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
- B3 D081 ; # CYRILLIC CAPITAL LETTER IO
- B4 E295A2 ; # BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
- B5 E295A3 ; # BOX DRAWINGS DOUBLE VERTICAL AND LEFT
- B6 E295A4 ; # BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
- B7 E295A5 ; # BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
- B8 E295A6 ; # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
- B9 E295A7 ; # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
- BA E295A8 ; # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
- BB E295A9 ; # BOX DRAWINGS DOUBLE UP AND HORIZONTAL
- BC E295AA ; # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
- BD E295AB ; # BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
- BE E295AC ; # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
- BF C2A9 ; # COPYRIGHT SIGN
- C0 D18E ; # CYRILLIC SMALL LETTER YU
- C1 D0B0 ; # CYRILLIC SMALL LETTER A
- C2 D0B1 ; # CYRILLIC SMALL LETTER BE
- C3 D186 ; # CYRILLIC SMALL LETTER TSE
- C4 D0B4 ; # CYRILLIC SMALL LETTER DE
- C5 D0B5 ; # CYRILLIC SMALL LETTER IE
- C6 D184 ; # CYRILLIC SMALL LETTER EF
- C7 D0B3 ; # CYRILLIC SMALL LETTER GHE
- C8 D185 ; # CYRILLIC SMALL LETTER HA
- C9 D0B8 ; # CYRILLIC SMALL LETTER I
- CA D0B9 ; # CYRILLIC SMALL LETTER SHORT I
- CB D0BA ; # CYRILLIC SMALL LETTER KA
- CC D0BB ; # CYRILLIC SMALL LETTER EL
- CD D0BC ; # CYRILLIC SMALL LETTER EM
- CE D0BD ; # CYRILLIC SMALL LETTER EN
- CF D0BE ; # CYRILLIC SMALL LETTER O
- D0 D0BF ; # CYRILLIC SMALL LETTER PE
- D1 D18F ; # CYRILLIC SMALL LETTER YA
- D2 D180 ; # CYRILLIC SMALL LETTER ER
- D3 D181 ; # CYRILLIC SMALL LETTER ES
- D4 D182 ; # CYRILLIC SMALL LETTER TE
- D5 D183 ; # CYRILLIC SMALL LETTER U
- D6 D0B6 ; # CYRILLIC SMALL LETTER ZHE
- D7 D0B2 ; # CYRILLIC SMALL LETTER VE
- D8 D18C ; # CYRILLIC SMALL LETTER SOFT SIGN
- D9 D18B ; # CYRILLIC SMALL LETTER YERU
- DA D0B7 ; # CYRILLIC SMALL LETTER ZE
- DB D188 ; # CYRILLIC SMALL LETTER SHA
- DC D18D ; # CYRILLIC SMALL LETTER E
- DD D189 ; # CYRILLIC SMALL LETTER SHCHA
- DE D187 ; # CYRILLIC SMALL LETTER CHE
- DF D18A ; # CYRILLIC SMALL LETTER HARD SIGN
- E0 D0AE ; # CYRILLIC CAPITAL LETTER YU
- E1 D090 ; # CYRILLIC CAPITAL LETTER A
- E2 D091 ; # CYRILLIC CAPITAL LETTER BE
- E3 D0A6 ; # CYRILLIC CAPITAL LETTER TSE
- E4 D094 ; # CYRILLIC CAPITAL LETTER DE
- E5 D095 ; # CYRILLIC CAPITAL LETTER IE
- E6 D0A4 ; # CYRILLIC CAPITAL LETTER EF
- E7 D093 ; # CYRILLIC CAPITAL LETTER GHE
- E8 D0A5 ; # CYRILLIC CAPITAL LETTER HA
- E9 D098 ; # CYRILLIC CAPITAL LETTER I
- EA D099 ; # CYRILLIC CAPITAL LETTER SHORT I
- EB D09A ; # CYRILLIC CAPITAL LETTER KA
- EC D09B ; # CYRILLIC CAPITAL LETTER EL
- ED D09C ; # CYRILLIC CAPITAL LETTER EM
- EE D09D ; # CYRILLIC CAPITAL LETTER EN
- EF D09E ; # CYRILLIC CAPITAL LETTER O
- F0 D09F ; # CYRILLIC CAPITAL LETTER PE
- F1 D0AF ; # CYRILLIC CAPITAL LETTER YA
- F2 D0A0 ; # CYRILLIC CAPITAL LETTER ER
- F3 D0A1 ; # CYRILLIC CAPITAL LETTER ES
- F4 D0A2 ; # CYRILLIC CAPITAL LETTER TE
- F5 D0A3 ; # CYRILLIC CAPITAL LETTER U
- F6 D096 ; # CYRILLIC CAPITAL LETTER ZHE
- F7 D092 ; # CYRILLIC CAPITAL LETTER VE
- F8 D0AC ; # CYRILLIC CAPITAL LETTER SOFT SIGN
- F9 D0AB ; # CYRILLIC CAPITAL LETTER YERU
- FA D097 ; # CYRILLIC CAPITAL LETTER ZE
- FB D0A8 ; # CYRILLIC CAPITAL LETTER SHA
- FC D0AD ; # CYRILLIC CAPITAL LETTER E
- FD D0A9 ; # CYRILLIC CAPITAL LETTER SHCHA
- FE D0A7 ; # CYRILLIC CAPITAL LETTER CHE
- FF D0AA ; # CYRILLIC CAPITAL LETTER HARD SIGN
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/unicode-to-nginx.pl b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/unicode-to-nginx.pl
deleted file mode 100755
index daaf354a830..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/unicode-to-nginx.pl
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/perl -w
-
-# Convert unicode mappings to nginx configuration file format.
-
-# You may find useful mappings in various places, including
-# unicode.org official site:
-#
-# http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT
-# http://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT
-
-# Needs perl 5.6 or later.
-
-# Written by Maxim Dounin, mdounin@rambler-co.ru
-
-###############################################################################
-
-require 5.006;
-
-while (<>) {
- # Skip comments and empty lines
-
- next if /^#/;
- next if /^\s*$/;
- chomp;
-
- # Convert mappings
-
- if (/^\s*0x(..)\s*0x(....)\s*(#.*)/) {
- # Mapping <from-code> <unicode-code> "#" <unicode-name>
- my $cs_code = $1;
- my $un_code = $2;
- my $un_name = $3;
-
- # Produce UTF-8 sequence from character code;
-
- my $un_utf8 = join('', map { sprintf("%02X", $_) } unpack("C*", pack("U", hex($un_code))));
-
- print " $cs_code $un_utf8 ; $un_name\n";
-
- } else {
- warn "Unrecognized line: '$_'";
- }
-}
-
-###############################################################################
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/win-utf b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/win-utf
deleted file mode 100644
index af9f9aaa502..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/unicode2nginx/win-utf
+++ /dev/null
@@ -1,130 +0,0 @@
-charset_map windows-1251 utf-8 {
-
- 80 D082 ; #CYRILLIC CAPITAL LETTER DJE
- 81 D083 ; #CYRILLIC CAPITAL LETTER GJE
- 82 E2809A ; #SINGLE LOW-9 QUOTATION MARK
- 83 D193 ; #CYRILLIC SMALL LETTER GJE
- 84 E2809E ; #DOUBLE LOW-9 QUOTATION MARK
- 85 E280A6 ; #HORIZONTAL ELLIPSIS
- 86 E280A0 ; #DAGGER
- 87 E280A1 ; #DOUBLE DAGGER
- 88 E282AC ; #EURO SIGN
- 89 E280B0 ; #PER MILLE SIGN
- 8A D089 ; #CYRILLIC CAPITAL LETTER LJE
- 8B E280B9 ; #SINGLE LEFT-POINTING ANGLE QUOTATION MARK
- 8C D08A ; #CYRILLIC CAPITAL LETTER NJE
- 8D D08C ; #CYRILLIC CAPITAL LETTER KJE
- 8E D08B ; #CYRILLIC CAPITAL LETTER TSHE
- 8F D08F ; #CYRILLIC CAPITAL LETTER DZHE
- 90 D192 ; #CYRILLIC SMALL LETTER DJE
- 91 E28098 ; #LEFT SINGLE QUOTATION MARK
- 92 E28099 ; #RIGHT SINGLE QUOTATION MARK
- 93 E2809C ; #LEFT DOUBLE QUOTATION MARK
- 94 E2809D ; #RIGHT DOUBLE QUOTATION MARK
- 95 E280A2 ; #BULLET
- 96 E28093 ; #EN DASH
- 97 E28094 ; #EM DASH
- 99 E284A2 ; #TRADE MARK SIGN
- 9A D199 ; #CYRILLIC SMALL LETTER LJE
- 9B E280BA ; #SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
- 9C D19A ; #CYRILLIC SMALL LETTER NJE
- 9D D19C ; #CYRILLIC SMALL LETTER KJE
- 9E D19B ; #CYRILLIC SMALL LETTER TSHE
- 9F D19F ; #CYRILLIC SMALL LETTER DZHE
- A0 C2A0 ; #NO-BREAK SPACE
- A1 D08E ; #CYRILLIC CAPITAL LETTER SHORT U
- A2 D19E ; #CYRILLIC SMALL LETTER SHORT U
- A3 D088 ; #CYRILLIC CAPITAL LETTER JE
- A4 C2A4 ; #CURRENCY SIGN
- A5 D290 ; #CYRILLIC CAPITAL LETTER GHE WITH UPTURN
- A6 C2A6 ; #BROKEN BAR
- A7 C2A7 ; #SECTION SIGN
- A8 D081 ; #CYRILLIC CAPITAL LETTER IO
- A9 C2A9 ; #COPYRIGHT SIGN
- AA D084 ; #CYRILLIC CAPITAL LETTER UKRAINIAN IE
- AB C2AB ; #LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
- AC C2AC ; #NOT SIGN
- AD C2AD ; #SOFT HYPHEN
- AE C2AE ; #REGISTERED SIGN
- AF D087 ; #CYRILLIC CAPITAL LETTER YI
- B0 C2B0 ; #DEGREE SIGN
- B1 C2B1 ; #PLUS-MINUS SIGN
- B2 D086 ; #CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
- B3 D196 ; #CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
- B4 D291 ; #CYRILLIC SMALL LETTER GHE WITH UPTURN
- B5 C2B5 ; #MICRO SIGN
- B6 C2B6 ; #PILCROW SIGN
- B7 C2B7 ; #MIDDLE DOT
- B8 D191 ; #CYRILLIC SMALL LETTER IO
- B9 E28496 ; #NUMERO SIGN
- BA D194 ; #CYRILLIC SMALL LETTER UKRAINIAN IE
- BB C2BB ; #RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
- BC D198 ; #CYRILLIC SMALL LETTER JE
- BD D085 ; #CYRILLIC CAPITAL LETTER DZE
- BE D195 ; #CYRILLIC SMALL LETTER DZE
- BF D197 ; #CYRILLIC SMALL LETTER YI
- C0 D090 ; #CYRILLIC CAPITAL LETTER A
- C1 D091 ; #CYRILLIC CAPITAL LETTER BE
- C2 D092 ; #CYRILLIC CAPITAL LETTER VE
- C3 D093 ; #CYRILLIC CAPITAL LETTER GHE
- C4 D094 ; #CYRILLIC CAPITAL LETTER DE
- C5 D095 ; #CYRILLIC CAPITAL LETTER IE
- C6 D096 ; #CYRILLIC CAPITAL LETTER ZHE
- C7 D097 ; #CYRILLIC CAPITAL LETTER ZE
- C8 D098 ; #CYRILLIC CAPITAL LETTER I
- C9 D099 ; #CYRILLIC CAPITAL LETTER SHORT I
- CA D09A ; #CYRILLIC CAPITAL LETTER KA
- CB D09B ; #CYRILLIC CAPITAL LETTER EL
- CC D09C ; #CYRILLIC CAPITAL LETTER EM
- CD D09D ; #CYRILLIC CAPITAL LETTER EN
- CE D09E ; #CYRILLIC CAPITAL LETTER O
- CF D09F ; #CYRILLIC CAPITAL LETTER PE
- D0 D0A0 ; #CYRILLIC CAPITAL LETTER ER
- D1 D0A1 ; #CYRILLIC CAPITAL LETTER ES
- D2 D0A2 ; #CYRILLIC CAPITAL LETTER TE
- D3 D0A3 ; #CYRILLIC CAPITAL LETTER U
- D4 D0A4 ; #CYRILLIC CAPITAL LETTER EF
- D5 D0A5 ; #CYRILLIC CAPITAL LETTER HA
- D6 D0A6 ; #CYRILLIC CAPITAL LETTER TSE
- D7 D0A7 ; #CYRILLIC CAPITAL LETTER CHE
- D8 D0A8 ; #CYRILLIC CAPITAL LETTER SHA
- D9 D0A9 ; #CYRILLIC CAPITAL LETTER SHCHA
- DA D0AA ; #CYRILLIC CAPITAL LETTER HARD SIGN
- DB D0AB ; #CYRILLIC CAPITAL LETTER YERU
- DC D0AC ; #CYRILLIC CAPITAL LETTER SOFT SIGN
- DD D0AD ; #CYRILLIC CAPITAL LETTER E
- DE D0AE ; #CYRILLIC CAPITAL LETTER YU
- DF D0AF ; #CYRILLIC CAPITAL LETTER YA
- E0 D0B0 ; #CYRILLIC SMALL LETTER A
- E1 D0B1 ; #CYRILLIC SMALL LETTER BE
- E2 D0B2 ; #CYRILLIC SMALL LETTER VE
- E3 D0B3 ; #CYRILLIC SMALL LETTER GHE
- E4 D0B4 ; #CYRILLIC SMALL LETTER DE
- E5 D0B5 ; #CYRILLIC SMALL LETTER IE
- E6 D0B6 ; #CYRILLIC SMALL LETTER ZHE
- E7 D0B7 ; #CYRILLIC SMALL LETTER ZE
- E8 D0B8 ; #CYRILLIC SMALL LETTER I
- E9 D0B9 ; #CYRILLIC SMALL LETTER SHORT I
- EA D0BA ; #CYRILLIC SMALL LETTER KA
- EB D0BB ; #CYRILLIC SMALL LETTER EL
- EC D0BC ; #CYRILLIC SMALL LETTER EM
- ED D0BD ; #CYRILLIC SMALL LETTER EN
- EE D0BE ; #CYRILLIC SMALL LETTER O
- EF D0BF ; #CYRILLIC SMALL LETTER PE
- F0 D180 ; #CYRILLIC SMALL LETTER ER
- F1 D181 ; #CYRILLIC SMALL LETTER ES
- F2 D182 ; #CYRILLIC SMALL LETTER TE
- F3 D183 ; #CYRILLIC SMALL LETTER U
- F4 D184 ; #CYRILLIC SMALL LETTER EF
- F5 D185 ; #CYRILLIC SMALL LETTER HA
- F6 D186 ; #CYRILLIC SMALL LETTER TSE
- F7 D187 ; #CYRILLIC SMALL LETTER CHE
- F8 D188 ; #CYRILLIC SMALL LETTER SHA
- F9 D189 ; #CYRILLIC SMALL LETTER SHCHA
- FA D18A ; #CYRILLIC SMALL LETTER HARD SIGN
- FB D18B ; #CYRILLIC SMALL LETTER YERU
- FC D18C ; #CYRILLIC SMALL LETTER SOFT SIGN
- FD D18D ; #CYRILLIC SMALL LETTER E
- FE D18E ; #CYRILLIC SMALL LETTER YU
- FF D18F ; #CYRILLIC SMALL LETTER YA
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/ftdetect/nginx.vim b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/ftdetect/nginx.vim
deleted file mode 100644
index 3ae470d2494..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/ftdetect/nginx.vim
+++ /dev/null
@@ -1,4 +0,0 @@
-au BufRead,BufNewFile *.nginx set ft=nginx
-au BufRead,BufNewFile */etc/nginx/* set ft=nginx
-au BufRead,BufNewFile */usr/local/nginx/conf/* set ft=nginx
-au BufRead,BufNewFile nginx.conf set ft=nginx
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/indent/nginx.vim b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/indent/nginx.vim
deleted file mode 100644
index 8601366854a..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/indent/nginx.vim
+++ /dev/null
@@ -1,11 +0,0 @@
-if exists("b:did_indent")
- finish
-endif
-let b:did_indent = 1
-
-setlocal indentexpr=
-
-" cindent actually works for nginx' simple file structure
-setlocal cindent
-" Just make sure that the comments are not reset as defs would be.
-setlocal cinkeys-=0#
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/syntax/nginx.vim b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/syntax/nginx.vim
deleted file mode 100644
index 50d809bc460..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/contrib/vim/syntax/nginx.vim
+++ /dev/null
@@ -1,703 +0,0 @@
-" Vim syntax file
-" Language: nginx.conf
-
-if exists("b:current_syntax")
- finish
-end
-
-setlocal iskeyword+=.
-setlocal iskeyword+=/
-setlocal iskeyword+=:
-
-syn match ngxVariable '\$\(\w\+\|{\w\+}\)'
-syn match ngxVariableBlock '\$\(\w\+\|{\w\+}\)' contained
-syn match ngxVariableString '\$\(\w\+\|{\w\+}\)' contained
-syn region ngxBlock start=+^+ end=+{+ skip=+\${+ contains=ngxComment,ngxDirectiveBlock,ngxVariableBlock,ngxString oneline
-syn region ngxString start=+\z(["']\)+ end=+\z1+ skip=+\\\\\|\\\z1+ contains=ngxVariableString
-syn match ngxComment ' *#.*$'
-
-syn keyword ngxBoolean on
-syn keyword ngxBoolean off
-
-syn keyword ngxDirectiveBlock http contained
-syn keyword ngxDirectiveBlock mail contained
-syn keyword ngxDirectiveBlock events contained
-syn keyword ngxDirectiveBlock server contained
-syn keyword ngxDirectiveBlock types contained
-syn keyword ngxDirectiveBlock location contained
-syn keyword ngxDirectiveBlock upstream contained
-syn keyword ngxDirectiveBlock charset_map contained
-syn keyword ngxDirectiveBlock limit_except contained
-syn keyword ngxDirectiveBlock if contained
-syn keyword ngxDirectiveBlock geo contained
-syn keyword ngxDirectiveBlock map contained
-
-syn keyword ngxDirectiveImportant include
-syn keyword ngxDirectiveImportant root
-syn keyword ngxDirectiveImportant server
-syn keyword ngxDirectiveImportant server_name
-syn keyword ngxDirectiveImportant listen
-syn keyword ngxDirectiveImportant internal
-syn keyword ngxDirectiveImportant proxy_pass
-syn keyword ngxDirectiveImportant memcached_pass
-syn keyword ngxDirectiveImportant fastcgi_pass
-syn keyword ngxDirectiveImportant try_files
-
-syn keyword ngxDirectiveControl break
-syn keyword ngxDirectiveControl return
-syn keyword ngxDirectiveControl rewrite
-syn keyword ngxDirectiveControl set
-
-syn keyword ngxDirectiveError error_page
-syn keyword ngxDirectiveError post_action
-
-syn keyword ngxDirectiveDeprecated connections
-syn keyword ngxDirectiveDeprecated imap
-syn keyword ngxDirectiveDeprecated open_file_cache_retest
-syn keyword ngxDirectiveDeprecated optimize_server_names
-syn keyword ngxDirectiveDeprecated satisfy_any
-
-syn keyword ngxDirective accept_mutex
-syn keyword ngxDirective accept_mutex_delay
-syn keyword ngxDirective access_log
-syn keyword ngxDirective add_after_body
-syn keyword ngxDirective add_before_body
-syn keyword ngxDirective add_header
-syn keyword ngxDirective addition_types
-syn keyword ngxDirective aio
-syn keyword ngxDirective alias
-syn keyword ngxDirective allow
-syn keyword ngxDirective ancient_browser
-syn keyword ngxDirective ancient_browser_value
-syn keyword ngxDirective auth_basic
-syn keyword ngxDirective auth_basic_user_file
-syn keyword ngxDirective auth_http
-syn keyword ngxDirective auth_http_header
-syn keyword ngxDirective auth_http_timeout
-syn keyword ngxDirective autoindex
-syn keyword ngxDirective autoindex_exact_size
-syn keyword ngxDirective autoindex_localtime
-syn keyword ngxDirective charset
-syn keyword ngxDirective charset_types
-syn keyword ngxDirective client_body_buffer_size
-syn keyword ngxDirective client_body_in_file_only
-syn keyword ngxDirective client_body_in_single_buffer
-syn keyword ngxDirective client_body_temp_path
-syn keyword ngxDirective client_body_timeout
-syn keyword ngxDirective client_header_buffer_size
-syn keyword ngxDirective client_header_timeout
-syn keyword ngxDirective client_max_body_size
-syn keyword ngxDirective connection_pool_size
-syn keyword ngxDirective create_full_put_path
-syn keyword ngxDirective daemon
-syn keyword ngxDirective dav_access
-syn keyword ngxDirective dav_methods
-syn keyword ngxDirective debug_connection
-syn keyword ngxDirective debug_points
-syn keyword ngxDirective default_type
-syn keyword ngxDirective degradation
-syn keyword ngxDirective degrade
-syn keyword ngxDirective deny
-syn keyword ngxDirective devpoll_changes
-syn keyword ngxDirective devpoll_events
-syn keyword ngxDirective directio
-syn keyword ngxDirective directio_alignment
-syn keyword ngxDirective empty_gif
-syn keyword ngxDirective env
-syn keyword ngxDirective epoll_events
-syn keyword ngxDirective error_log
-syn keyword ngxDirective eventport_events
-syn keyword ngxDirective expires
-syn keyword ngxDirective fastcgi_bind
-syn keyword ngxDirective fastcgi_buffer_size
-syn keyword ngxDirective fastcgi_buffers
-syn keyword ngxDirective fastcgi_busy_buffers_size
-syn keyword ngxDirective fastcgi_cache
-syn keyword ngxDirective fastcgi_cache_key
-syn keyword ngxDirective fastcgi_cache_methods
-syn keyword ngxDirective fastcgi_cache_min_uses
-syn keyword ngxDirective fastcgi_cache_path
-syn keyword ngxDirective fastcgi_cache_use_stale
-syn keyword ngxDirective fastcgi_cache_valid
-syn keyword ngxDirective fastcgi_catch_stderr
-syn keyword ngxDirective fastcgi_connect_timeout
-syn keyword ngxDirective fastcgi_hide_header
-syn keyword ngxDirective fastcgi_ignore_client_abort
-syn keyword ngxDirective fastcgi_ignore_headers
-syn keyword ngxDirective fastcgi_index
-syn keyword ngxDirective fastcgi_intercept_errors
-syn keyword ngxDirective fastcgi_max_temp_file_size
-syn keyword ngxDirective fastcgi_next_upstream
-syn keyword ngxDirective fastcgi_param
-syn keyword ngxDirective fastcgi_pass_header
-syn keyword ngxDirective fastcgi_pass_request_body
-syn keyword ngxDirective fastcgi_pass_request_headers
-syn keyword ngxDirective fastcgi_read_timeout
-syn keyword ngxDirective fastcgi_send_lowat
-syn keyword ngxDirective fastcgi_send_timeout
-syn keyword ngxDirective fastcgi_split_path_info
-syn keyword ngxDirective fastcgi_store
-syn keyword ngxDirective fastcgi_store_access
-syn keyword ngxDirective fastcgi_temp_file_write_size
-syn keyword ngxDirective fastcgi_temp_path
-syn keyword ngxDirective fastcgi_upstream_fail_timeout
-syn keyword ngxDirective fastcgi_upstream_max_fails
-syn keyword ngxDirective flv
-syn keyword ngxDirective geoip_city
-syn keyword ngxDirective geoip_country
-syn keyword ngxDirective google_perftools_profiles
-syn keyword ngxDirective gzip
-syn keyword ngxDirective gzip_buffers
-syn keyword ngxDirective gzip_comp_level
-syn keyword ngxDirective gzip_disable
-syn keyword ngxDirective gzip_hash
-syn keyword ngxDirective gzip_http_version
-syn keyword ngxDirective gzip_min_length
-syn keyword ngxDirective gzip_no_buffer
-syn keyword ngxDirective gzip_proxied
-syn keyword ngxDirective gzip_static
-syn keyword ngxDirective gzip_types
-syn keyword ngxDirective gzip_vary
-syn keyword ngxDirective gzip_window
-syn keyword ngxDirective if_modified_since
-syn keyword ngxDirective ignore_invalid_headers
-syn keyword ngxDirective image_filter
-syn keyword ngxDirective image_filter_buffer
-syn keyword ngxDirective image_filter_jpeg_quality
-syn keyword ngxDirective image_filter_transparency
-syn keyword ngxDirective imap_auth
-syn keyword ngxDirective imap_capabilities
-syn keyword ngxDirective imap_client_buffer
-syn keyword ngxDirective index
-syn keyword ngxDirective ip_hash
-syn keyword ngxDirective keepalive_requests
-syn keyword ngxDirective keepalive_timeout
-syn keyword ngxDirective kqueue_changes
-syn keyword ngxDirective kqueue_events
-syn keyword ngxDirective large_client_header_buffers
-syn keyword ngxDirective limit_conn
-syn keyword ngxDirective limit_conn_log_level
-syn keyword ngxDirective limit_rate
-syn keyword ngxDirective limit_rate_after
-syn keyword ngxDirective limit_req
-syn keyword ngxDirective limit_req_log_level
-syn keyword ngxDirective limit_req_zone
-syn keyword ngxDirective limit_zone
-syn keyword ngxDirective lingering_time
-syn keyword ngxDirective lingering_timeout
-syn keyword ngxDirective lock_file
-syn keyword ngxDirective log_format
-syn keyword ngxDirective log_not_found
-syn keyword ngxDirective log_subrequest
-syn keyword ngxDirective map_hash_bucket_size
-syn keyword ngxDirective map_hash_max_size
-syn keyword ngxDirective master_process
-syn keyword ngxDirective memcached_bind
-syn keyword ngxDirective memcached_buffer_size
-syn keyword ngxDirective memcached_connect_timeout
-syn keyword ngxDirective memcached_next_upstream
-syn keyword ngxDirective memcached_read_timeout
-syn keyword ngxDirective memcached_send_timeout
-syn keyword ngxDirective memcached_upstream_fail_timeout
-syn keyword ngxDirective memcached_upstream_max_fails
-syn keyword ngxDirective merge_slashes
-syn keyword ngxDirective min_delete_depth
-syn keyword ngxDirective modern_browser
-syn keyword ngxDirective modern_browser_value
-syn keyword ngxDirective msie_padding
-syn keyword ngxDirective msie_refresh
-syn keyword ngxDirective multi_accept
-syn keyword ngxDirective open_file_cache
-syn keyword ngxDirective open_file_cache_errors
-syn keyword ngxDirective open_file_cache_events
-syn keyword ngxDirective open_file_cache_min_uses
-syn keyword ngxDirective open_file_cache_valid
-syn keyword ngxDirective open_log_file_cache
-syn keyword ngxDirective output_buffers
-syn keyword ngxDirective override_charset
-syn keyword ngxDirective perl
-syn keyword ngxDirective perl_modules
-syn keyword ngxDirective perl_require
-syn keyword ngxDirective perl_set
-syn keyword ngxDirective pid
-syn keyword ngxDirective pop3_auth
-syn keyword ngxDirective pop3_capabilities
-syn keyword ngxDirective port_in_redirect
-syn keyword ngxDirective postpone_gzipping
-syn keyword ngxDirective postpone_output
-syn keyword ngxDirective protocol
-syn keyword ngxDirective proxy
-syn keyword ngxDirective proxy_bind
-syn keyword ngxDirective proxy_buffer
-syn keyword ngxDirective proxy_buffer_size
-syn keyword ngxDirective proxy_buffering
-syn keyword ngxDirective proxy_buffers
-syn keyword ngxDirective proxy_busy_buffers_size
-syn keyword ngxDirective proxy_cache
-syn keyword ngxDirective proxy_cache_key
-syn keyword ngxDirective proxy_cache_methods
-syn keyword ngxDirective proxy_cache_min_uses
-syn keyword ngxDirective proxy_cache_path
-syn keyword ngxDirective proxy_cache_use_stale
-syn keyword ngxDirective proxy_cache_valid
-syn keyword ngxDirective proxy_connect_timeout
-syn keyword ngxDirective proxy_headers_hash_bucket_size
-syn keyword ngxDirective proxy_headers_hash_max_size
-syn keyword ngxDirective proxy_hide_header
-syn keyword ngxDirective proxy_ignore_client_abort
-syn keyword ngxDirective proxy_ignore_headers
-syn keyword ngxDirective proxy_intercept_errors
-syn keyword ngxDirective proxy_max_temp_file_size
-syn keyword ngxDirective proxy_method
-syn keyword ngxDirective proxy_next_upstream
-syn keyword ngxDirective proxy_pass_error_message
-syn keyword ngxDirective proxy_pass_header
-syn keyword ngxDirective proxy_pass_request_body
-syn keyword ngxDirective proxy_pass_request_headers
-syn keyword ngxDirective proxy_read_timeout
-syn keyword ngxDirective proxy_redirect
-syn keyword ngxDirective proxy_send_lowat
-syn keyword ngxDirective proxy_send_timeout
-syn keyword ngxDirective proxy_set_body
-syn keyword ngxDirective proxy_set_header
-syn keyword ngxDirective proxy_ssl_session_reuse
-syn keyword ngxDirective proxy_store
-syn keyword ngxDirective proxy_store_access
-syn keyword ngxDirective proxy_temp_file_write_size
-syn keyword ngxDirective proxy_temp_path
-syn keyword ngxDirective proxy_timeout
-syn keyword ngxDirective proxy_upstream_fail_timeout
-syn keyword ngxDirective proxy_upstream_max_fails
-syn keyword ngxDirective random_index
-syn keyword ngxDirective read_ahead
-syn keyword ngxDirective real_ip_header
-syn keyword ngxDirective recursive_error_pages
-syn keyword ngxDirective request_pool_size
-syn keyword ngxDirective reset_timedout_connection
-syn keyword ngxDirective resolver
-syn keyword ngxDirective resolver_timeout
-syn keyword ngxDirective rewrite_log
-syn keyword ngxDirective rtsig_overflow_events
-syn keyword ngxDirective rtsig_overflow_test
-syn keyword ngxDirective rtsig_overflow_threshold
-syn keyword ngxDirective rtsig_signo
-syn keyword ngxDirective satisfy
-syn keyword ngxDirective secure_link_secret
-syn keyword ngxDirective send_lowat
-syn keyword ngxDirective send_timeout
-syn keyword ngxDirective sendfile
-syn keyword ngxDirective sendfile_max_chunk
-syn keyword ngxDirective server_name_in_redirect
-syn keyword ngxDirective server_names_hash_bucket_size
-syn keyword ngxDirective server_names_hash_max_size
-syn keyword ngxDirective server_tokens
-syn keyword ngxDirective set_real_ip_from
-syn keyword ngxDirective smtp_auth
-syn keyword ngxDirective smtp_capabilities
-syn keyword ngxDirective smtp_client_buffer
-syn keyword ngxDirective smtp_greeting_delay
-syn keyword ngxDirective so_keepalive
-syn keyword ngxDirective source_charset
-syn keyword ngxDirective ssi
-syn keyword ngxDirective ssi_ignore_recycled_buffers
-syn keyword ngxDirective ssi_min_file_chunk
-syn keyword ngxDirective ssi_silent_errors
-syn keyword ngxDirective ssi_types
-syn keyword ngxDirective ssi_value_length
-syn keyword ngxDirective ssl
-syn keyword ngxDirective ssl_certificate
-syn keyword ngxDirective ssl_certificate_key
-syn keyword ngxDirective ssl_ciphers
-syn keyword ngxDirective ssl_client_certificate
-syn keyword ngxDirective ssl_crl
-syn keyword ngxDirective ssl_dhparam
-syn keyword ngxDirective ssl_engine
-syn keyword ngxDirective ssl_prefer_server_ciphers
-syn keyword ngxDirective ssl_protocols
-syn keyword ngxDirective ssl_session_cache
-syn keyword ngxDirective ssl_session_timeout
-syn keyword ngxDirective ssl_verify_client
-syn keyword ngxDirective ssl_verify_depth
-syn keyword ngxDirective starttls
-syn keyword ngxDirective stub_status
-syn keyword ngxDirective sub_filter
-syn keyword ngxDirective sub_filter_once
-syn keyword ngxDirective sub_filter_types
-syn keyword ngxDirective tcp_nodelay
-syn keyword ngxDirective tcp_nopush
-syn keyword ngxDirective thread_stack_size
-syn keyword ngxDirective timeout
-syn keyword ngxDirective timer_resolution
-syn keyword ngxDirective types_hash_bucket_size
-syn keyword ngxDirective types_hash_max_size
-syn keyword ngxDirective underscores_in_headers
-syn keyword ngxDirective uninitialized_variable_warn
-syn keyword ngxDirective use
-syn keyword ngxDirective user
-syn keyword ngxDirective userid
-syn keyword ngxDirective userid_domain
-syn keyword ngxDirective userid_expires
-syn keyword ngxDirective userid_mark
-syn keyword ngxDirective userid_name
-syn keyword ngxDirective userid_p3p
-syn keyword ngxDirective userid_path
-syn keyword ngxDirective userid_service
-syn keyword ngxDirective valid_referers
-syn keyword ngxDirective variables_hash_bucket_size
-syn keyword ngxDirective variables_hash_max_size
-syn keyword ngxDirective worker_connections
-syn keyword ngxDirective worker_cpu_affinity
-syn keyword ngxDirective worker_priority
-syn keyword ngxDirective worker_processes
-syn keyword ngxDirective worker_rlimit_core
-syn keyword ngxDirective worker_rlimit_nofile
-syn keyword ngxDirective worker_rlimit_sigpending
-syn keyword ngxDirective worker_threads
-syn keyword ngxDirective working_directory
-syn keyword ngxDirective xclient
-syn keyword ngxDirective xml_entities
-syn keyword ngxDirective xslt_stylesheet
-syn keyword ngxDirective xslt_types
-
-" 3rd party module list:
-" http://wiki.nginx.org/Nginx3rdPartyModules
-
-" Accept Language Module <http://wiki.nginx.org/NginxAcceptLanguageModule>
-" Parses the Accept-Language header and gives the most suitable locale from a list of supported locales.
-syn keyword ngxDirectiveThirdParty set_from_accept_language
-
-" Access Key Module <http://wiki.nginx.org/NginxHttpAccessKeyModule>
-" Denies access unless the request URL contains an access key.
-syn keyword ngxDirectiveThirdParty accesskey
-syn keyword ngxDirectiveThirdParty accesskey_arg
-syn keyword ngxDirectiveThirdParty accesskey_hashmethod
-syn keyword ngxDirectiveThirdParty accesskey_signature
-
-" Auth PAM Module <http://web.iti.upv.es/~sto/nginx/>
-" HTTP Basic Authentication using PAM.
-syn keyword ngxDirectiveThirdParty auth_pam
-syn keyword ngxDirectiveThirdParty auth_pam_service_name
-
-" Cache Purge Module <http://labs.frickle.com/nginx_ngx_cache_purge/>
-" Module adding ability to purge content from FastCGI and proxy caches.
-syn keyword ngxDirectiveThirdParty fastcgi_cache_purge
-syn keyword ngxDirectiveThirdParty proxy_cache_purge
-
-" Chunkin Module <http://wiki.nginx.org/NginxHttpChunkinModule>
-" HTTP 1.1 chunked-encoding request body support for Nginx.
-syn keyword ngxDirectiveThirdParty chunkin
-syn keyword ngxDirectiveThirdParty chunkin_keepalive
-syn keyword ngxDirectiveThirdParty chunkin_max_chunks_per_buf
-syn keyword ngxDirectiveThirdParty chunkin_resume
-
-" Circle GIF Module <http://wiki.nginx.org/NginxHttpCircleGifModule>
-" Generates simple circle images with the colors and size specified in the URL.
-syn keyword ngxDirectiveThirdParty circle_gif
-syn keyword ngxDirectiveThirdParty circle_gif_max_radius
-syn keyword ngxDirectiveThirdParty circle_gif_min_radius
-syn keyword ngxDirectiveThirdParty circle_gif_step_radius
-
-" Drizzle Module <http://github.com/chaoslawful/drizzle-nginx-module>
-" Make nginx talk directly to mysql, drizzle, and sqlite3 by libdrizzle.
-syn keyword ngxDirectiveThirdParty drizzle_connect_timeout
-syn keyword ngxDirectiveThirdParty drizzle_dbname
-syn keyword ngxDirectiveThirdParty drizzle_keepalive
-syn keyword ngxDirectiveThirdParty drizzle_module_header
-syn keyword ngxDirectiveThirdParty drizzle_pass
-syn keyword ngxDirectiveThirdParty drizzle_query
-syn keyword ngxDirectiveThirdParty drizzle_recv_cols_timeout
-syn keyword ngxDirectiveThirdParty drizzle_recv_rows_timeout
-syn keyword ngxDirectiveThirdParty drizzle_send_query_timeout
-syn keyword ngxDirectiveThirdParty drizzle_server
-
-" Echo Module <http://wiki.nginx.org/NginxHttpEchoModule>
-" Brings 'echo', 'sleep', 'time', 'exec' and more shell-style goodies to Nginx config file.
-syn keyword ngxDirectiveThirdParty echo
-syn keyword ngxDirectiveThirdParty echo_after_body
-syn keyword ngxDirectiveThirdParty echo_before_body
-syn keyword ngxDirectiveThirdParty echo_blocking_sleep
-syn keyword ngxDirectiveThirdParty echo_duplicate
-syn keyword ngxDirectiveThirdParty echo_end
-syn keyword ngxDirectiveThirdParty echo_exec
-syn keyword ngxDirectiveThirdParty echo_flush
-syn keyword ngxDirectiveThirdParty echo_foreach_split
-syn keyword ngxDirectiveThirdParty echo_location
-syn keyword ngxDirectiveThirdParty echo_location_async
-syn keyword ngxDirectiveThirdParty echo_read_request_body
-syn keyword ngxDirectiveThirdParty echo_request_body
-syn keyword ngxDirectiveThirdParty echo_reset_timer
-syn keyword ngxDirectiveThirdParty echo_sleep
-syn keyword ngxDirectiveThirdParty echo_subrequest
-syn keyword ngxDirectiveThirdParty echo_subrequest_async
-
-" Events Module <http://docs.dutov.org/nginx_modules_events_en.html>
-" Privides options for start/stop events.
-syn keyword ngxDirectiveThirdParty on_start
-syn keyword ngxDirectiveThirdParty on_stop
-
-" EY Balancer Module <http://github.com/ry/nginx-ey-balancer>
-" Adds a request queue to Nginx that allows the limiting of concurrent requests passed to the upstream.
-syn keyword ngxDirectiveThirdParty max_connections
-syn keyword ngxDirectiveThirdParty max_connections_max_queue_length
-syn keyword ngxDirectiveThirdParty max_connections_queue_timeout
-
-" Fancy Indexes Module <https://connectical.com/projects/ngx-fancyindex/wiki>
-" Like the built-in autoindex module, but fancier.
-syn keyword ngxDirectiveThirdParty fancyindex
-syn keyword ngxDirectiveThirdParty fancyindex_exact_size
-syn keyword ngxDirectiveThirdParty fancyindex_footer
-syn keyword ngxDirectiveThirdParty fancyindex_header
-syn keyword ngxDirectiveThirdParty fancyindex_localtime
-syn keyword ngxDirectiveThirdParty fancyindex_readme
-syn keyword ngxDirectiveThirdParty fancyindex_readme_mode
-
-" GeoIP Module (DEPRECATED) <http://wiki.nginx.org/NginxHttp3rdPartyGeoIPModule>
-" Country code lookups via the MaxMind GeoIP API.
-syn keyword ngxDirectiveThirdParty geoip_country_file
-
-" Headers More Module <http://wiki.nginx.org/NginxHttpHeadersMoreModule>
-" Set and clear input and output headers...more than "add"!
-syn keyword ngxDirectiveThirdParty more_clear_headers
-syn keyword ngxDirectiveThirdParty more_clear_input_headers
-syn keyword ngxDirectiveThirdParty more_set_headers
-syn keyword ngxDirectiveThirdParty more_set_input_headers
-
-" HTTP Push Module <http://pushmodule.slact.net/>
-" Turn Nginx into an adept long-polling HTTP Push (Comet) server.
-syn keyword ngxDirectiveThirdParty push_buffer_size
-syn keyword ngxDirectiveThirdParty push_listener
-syn keyword ngxDirectiveThirdParty push_message_timeout
-syn keyword ngxDirectiveThirdParty push_queue_messages
-syn keyword ngxDirectiveThirdParty push_sender
-
-" HTTP Redis Module <http://people.FreeBSD.ORG/~osa/ngx_http_redis-0.3.1.tar.gz>>
-" Redis <http://code.google.com/p/redis/> support.>
-syn keyword ngxDirectiveThirdParty redis_bind
-syn keyword ngxDirectiveThirdParty redis_buffer_size
-syn keyword ngxDirectiveThirdParty redis_connect_timeout
-syn keyword ngxDirectiveThirdParty redis_next_upstream
-syn keyword ngxDirectiveThirdParty redis_pass
-syn keyword ngxDirectiveThirdParty redis_read_timeout
-syn keyword ngxDirectiveThirdParty redis_send_timeout
-
-" HTTP JavaScript Module <http://wiki.github.com/kung-fu-tzu/ngx_http_js_module>
-" Embedding SpiderMonkey. Nearly full port on Perl module.
-syn keyword ngxDirectiveThirdParty js
-syn keyword ngxDirectiveThirdParty js_filter
-syn keyword ngxDirectiveThirdParty js_filter_types
-syn keyword ngxDirectiveThirdParty js_load
-syn keyword ngxDirectiveThirdParty js_maxmem
-syn keyword ngxDirectiveThirdParty js_require
-syn keyword ngxDirectiveThirdParty js_set
-syn keyword ngxDirectiveThirdParty js_utf8
-
-" Log Request Speed <http://wiki.nginx.org/NginxHttpLogRequestSpeed>
-" Log the time it took to process each request.
-syn keyword ngxDirectiveThirdParty log_request_speed_filter
-syn keyword ngxDirectiveThirdParty log_request_speed_filter_timeout
-
-" Memc Module <http://wiki.nginx.org/NginxHttpMemcModule>
-" An extended version of the standard memcached module that supports set, add, delete, and many more memcached commands.
-syn keyword ngxDirectiveThirdParty memc_buffer_size
-syn keyword ngxDirectiveThirdParty memc_cmds_allowed
-syn keyword ngxDirectiveThirdParty memc_connect_timeout
-syn keyword ngxDirectiveThirdParty memc_flags_to_last_modified
-syn keyword ngxDirectiveThirdParty memc_next_upstream
-syn keyword ngxDirectiveThirdParty memc_pass
-syn keyword ngxDirectiveThirdParty memc_read_timeout
-syn keyword ngxDirectiveThirdParty memc_send_timeout
-syn keyword ngxDirectiveThirdParty memc_upstream_fail_timeout
-syn keyword ngxDirectiveThirdParty memc_upstream_max_fails
-
-" Mogilefs Module <http://www.grid.net.ru/nginx/mogilefs.en.html>
-" Implements a MogileFS client, provides a replace to the Perlbal reverse proxy of the original MogileFS.
-syn keyword ngxDirectiveThirdParty mogilefs_connect_timeout
-syn keyword ngxDirectiveThirdParty mogilefs_domain
-syn keyword ngxDirectiveThirdParty mogilefs_methods
-syn keyword ngxDirectiveThirdParty mogilefs_noverify
-syn keyword ngxDirectiveThirdParty mogilefs_pass
-syn keyword ngxDirectiveThirdParty mogilefs_read_timeout
-syn keyword ngxDirectiveThirdParty mogilefs_send_timeout
-syn keyword ngxDirectiveThirdParty mogilefs_tracker
-
-" MP4 Streaming Lite Module <http://wiki.nginx.org/NginxMP4StreamingLite>
-" Will seek to a certain time within H.264/MP4 files when provided with a 'start' parameter in the URL.
-syn keyword ngxDirectiveThirdParty mp4
-
-" Nginx Notice Module <http://xph.us/software/nginx-notice/>
-" Serve static file to POST requests.
-syn keyword ngxDirectiveThirdParty notice
-syn keyword ngxDirectiveThirdParty notice_type
-
-" Phusion Passenger <http://www.modrails.com/documentation.html>
-" Easy and robust deployment of Ruby on Rails application on Apache and Nginx webservers.
-syn keyword ngxDirectiveThirdParty passenger_base_uri
-syn keyword ngxDirectiveThirdParty passenger_default_user
-syn keyword ngxDirectiveThirdParty passenger_enabled
-syn keyword ngxDirectiveThirdParty passenger_log_level
-syn keyword ngxDirectiveThirdParty passenger_max_instances_per_app
-syn keyword ngxDirectiveThirdParty passenger_max_pool_size
-syn keyword ngxDirectiveThirdParty passenger_pool_idle_time
-syn keyword ngxDirectiveThirdParty passenger_root
-syn keyword ngxDirectiveThirdParty passenger_ruby
-syn keyword ngxDirectiveThirdParty passenger_use_global_queue
-syn keyword ngxDirectiveThirdParty passenger_user_switching
-syn keyword ngxDirectiveThirdParty rack_env
-syn keyword ngxDirectiveThirdParty rails_app_spawner_idle_time
-syn keyword ngxDirectiveThirdParty rails_env
-syn keyword ngxDirectiveThirdParty rails_framework_spawner_idle_time
-syn keyword ngxDirectiveThirdParty rails_spawn_method
-
-" RDS JSON Module <http://github.com/agentzh/rds-json-nginx-module>
-" Help ngx_drizzle and other DBD modules emit JSON data.
-syn keyword ngxDirectiveThirdParty rds_json
-syn keyword ngxDirectiveThirdParty rds_json_content_type
-syn keyword ngxDirectiveThirdParty rds_json_format
-syn keyword ngxDirectiveThirdParty rds_json_ret
-
-" RRD Graph Module <http://wiki.nginx.org/NginxNgx_rrd_graph>
-" This module provides an HTTP interface to RRDtool's graphing facilities.
-syn keyword ngxDirectiveThirdParty rrd_graph
-syn keyword ngxDirectiveThirdParty rrd_graph_root
-
-" Secure Download <http://wiki.nginx.org/NginxHttpSecureDownload>
-" Create expiring links.
-syn keyword ngxDirectiveThirdParty secure_download
-syn keyword ngxDirectiveThirdParty secure_download_fail_location
-syn keyword ngxDirectiveThirdParty secure_download_path_mode
-syn keyword ngxDirectiveThirdParty secure_download_secret
-
-" SlowFS Cache Module <http://labs.frickle.com/nginx_ngx_slowfs_cache/>
-" Module adding ability to cache static files.
-syn keyword ngxDirectiveThirdParty slowfs_big_file_size
-syn keyword ngxDirectiveThirdParty slowfs_cache
-syn keyword ngxDirectiveThirdParty slowfs_cache_key
-syn keyword ngxDirectiveThirdParty slowfs_cache_min_uses
-syn keyword ngxDirectiveThirdParty slowfs_cache_path
-syn keyword ngxDirectiveThirdParty slowfs_cache_purge
-syn keyword ngxDirectiveThirdParty slowfs_cache_valid
-syn keyword ngxDirectiveThirdParty slowfs_temp_path
-
-" Strip Module <http://wiki.nginx.org/NginxHttpStripModule>
-" Whitespace remover.
-syn keyword ngxDirectiveThirdParty strip
-
-" Substitutions Module <http://wiki.nginx.org/NginxHttpSubsModule>
-" A filter module which can do both regular expression and fixed string substitutions on response bodies.
-syn keyword ngxDirectiveThirdParty subs_filter
-syn keyword ngxDirectiveThirdParty subs_filter_types
-
-" Supervisord Module <http://labs.frickle.com/nginx_ngx_supervisord/>
-" Module providing nginx with API to communicate with supervisord and manage (start/stop) backends on-demand.
-syn keyword ngxDirectiveThirdParty supervisord
-syn keyword ngxDirectiveThirdParty supervisord_inherit_backend_status
-syn keyword ngxDirectiveThirdParty supervisord_name
-syn keyword ngxDirectiveThirdParty supervisord_start
-syn keyword ngxDirectiveThirdParty supervisord_stop
-
-" Upload Module <http://www.grid.net.ru/nginx/upload.en.html>
-" Parses multipart/form-data allowing arbitrary handling of uploaded files.
-syn keyword ngxDirectiveThirdParty upload_aggregate_form_field
-syn keyword ngxDirectiveThirdParty upload_buffer_size
-syn keyword ngxDirectiveThirdParty upload_cleanup
-syn keyword ngxDirectiveThirdParty upload_limit_rate
-syn keyword ngxDirectiveThirdParty upload_max_file_size
-syn keyword ngxDirectiveThirdParty upload_max_output_body_len
-syn keyword ngxDirectiveThirdParty upload_max_part_header_len
-syn keyword ngxDirectiveThirdParty upload_pass
-syn keyword ngxDirectiveThirdParty upload_pass_args
-syn keyword ngxDirectiveThirdParty upload_pass_form_field
-syn keyword ngxDirectiveThirdParty upload_set_form_field
-syn keyword ngxDirectiveThirdParty upload_store
-syn keyword ngxDirectiveThirdParty upload_store_access
-
-" Upload Progress Module <http://wiki.nginx.org/NginxHttpUploadProgressModule>
-" Tracks and reports upload progress.
-syn keyword ngxDirectiveThirdParty report_uploads
-syn keyword ngxDirectiveThirdParty track_uploads
-syn keyword ngxDirectiveThirdParty upload_progress
-syn keyword ngxDirectiveThirdParty upload_progress_content_type
-syn keyword ngxDirectiveThirdParty upload_progress_header
-syn keyword ngxDirectiveThirdParty upload_progress_json_output
-syn keyword ngxDirectiveThirdParty upload_progress_template
-
-" Upstream Fair Balancer <http://wiki.nginx.org/NginxHttpUpstreamFairModule>
-" Sends an incoming request to the least-busy backend server, rather than distributing requests round-robin.
-syn keyword ngxDirectiveThirdParty fair
-syn keyword ngxDirectiveThirdParty upstream_fair_shm_size
-
-" Upstream Consistent Hash <http://wiki.nginx.org/NginxHttpUpstreamConsistentHash>
-" Select backend based on Consistent hash ring.
-syn keyword ngxDirectiveThirdParty consistent_hash
-
-" Upstream Hash Module <http://wiki.nginx.org/NginxHttpUpstreamRequestHashModule>
-" Provides simple upstream load distribution by hashing a configurable variable.
-syn keyword ngxDirectiveThirdParty hash
-syn keyword ngxDirectiveThirdParty hash_again
-
-" XSS Module <http://github.com/agentzh/xss-nginx-module>
-" Native support for cross-site scripting (XSS) in an nginx.
-syn keyword ngxDirectiveThirdParty xss_callback_arg
-syn keyword ngxDirectiveThirdParty xss_get
-syn keyword ngxDirectiveThirdParty xss_input_types
-syn keyword ngxDirectiveThirdParty xss_output_type
-
-" uWSGI Module <http://wiki.nginx.org/HttpUwsgiModule>
-" Allows Nginx to interact with uWSGI processes and control what parameters are passed to the process.
-syn keyword ngxDirectiveThirdParty uwsgi_bind
-syn keyword ngxDirectiveThirdParty uwsgi_buffer_size
-syn keyword ngxDirectiveThirdParty uwsgi_buffering
-syn keyword ngxDirectiveThirdParty uwsgi_buffers
-syn keyword ngxDirectiveThirdParty uwsgi_busy_buffers_size
-syn keyword ngxDirectiveThirdParty uwsgi_cache
-syn keyword ngxDirectiveThirdParty uwsgi_cache_bypass
-syn keyword ngxDirectiveThirdParty uwsgi_cache_key
-syn keyword ngxDirectiveThirdParty uwsgi_cache_lock
-syn keyword ngxDirectiveThirdParty uwsgi_cache_lock_timeout
-syn keyword ngxDirectiveThirdParty uwsgi_cache_methods
-syn keyword ngxDirectiveThirdParty uwsgi_cache_min_uses
-syn keyword ngxDirectiveThirdParty uwsgi_cache_path
-syn keyword ngxDirectiveThirdParty uwsgi_cache_use_stale
-syn keyword ngxDirectiveThirdParty uwsgi_cache_valid
-syn keyword ngxDirectiveThirdParty uwsgi_connect_timeout
-syn keyword ngxDirectiveThirdParty uwsgi_hide_header
-syn keyword ngxDirectiveThirdParty uwsgi_ignore_client_abort
-syn keyword ngxDirectiveThirdParty uwsgi_ignore_headers
-syn keyword ngxDirectiveThirdParty uwsgi_intercept_errors
-syn keyword ngxDirectiveThirdParty uwsgi_max_temp_file_size
-syn keyword ngxDirectiveThirdParty uwsgi_modifier1
-syn keyword ngxDirectiveThirdParty uwsgi_modifier2
-syn keyword ngxDirectiveThirdParty uwsgi_next_upstream
-syn keyword ngxDirectiveThirdParty uwsgi_no_cache
-syn keyword ngxDirectiveThirdParty uwsgi_param
-syn keyword ngxDirectiveThirdParty uwsgi_pass
-syn keyword ngxDirectiveThirdParty uwsgi_pass_header
-syn keyword ngxDirectiveThirdParty uwsgi_pass_request_body
-syn keyword ngxDirectiveThirdParty uwsgi_pass_request_headers
-syn keyword ngxDirectiveThirdParty uwsgi_read_timeout
-syn keyword ngxDirectiveThirdParty uwsgi_send_timeout
-syn keyword ngxDirectiveThirdParty uwsgi_store
-syn keyword ngxDirectiveThirdParty uwsgi_store_access
-syn keyword ngxDirectiveThirdParty uwsgi_string
-syn keyword ngxDirectiveThirdParty uwsgi_temp_file_write_size
-syn keyword ngxDirectiveThirdParty uwsgi_temp_path
-
-" highlight
-
-hi link ngxComment Comment
-hi link ngxVariable Identifier
-hi link ngxVariableBlock Identifier
-hi link ngxVariableString PreProc
-hi link ngxBlock Normal
-hi link ngxString String
-
-hi link ngxBoolean Boolean
-hi link ngxDirectiveBlock Statement
-hi link ngxDirectiveImportant Type
-hi link ngxDirectiveControl Keyword
-hi link ngxDirectiveError Constant
-hi link ngxDirectiveDeprecated Error
-hi link ngxDirective Identifier
-hi link ngxDirectiveThirdParty Special
-
-let b:current_syntax = "nginx"
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/50x.html b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/50x.html
deleted file mode 100644
index f60f5e72d17..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/50x.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Error</title>
-<style>
- body {
- width: 35em;
- margin: 0 auto;
- font-family: Tahoma, Verdana, Arial, sans-serif;
- }
-</style>
-</head>
-<body>
-<h1>An error occurred.</h1>
-<p>Sorry, the page you are looking for is currently unavailable.<br/>
-Please try again later.</p>
-<p>If you are the system administrator of this resource then you should check
-the <a href="http://nginx.org/r/error_log">error log</a> for details.</p>
-<p><em>Faithfully yours, nginx.</em></p>
-</body>
-</html>
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/index.html b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/index.html
deleted file mode 100644
index 2ca3b9543c0..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/html/index.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Welcome to nginx!</title>
-<style>
- body {
- width: 35em;
- margin: 0 auto;
- font-family: Tahoma, Verdana, Arial, sans-serif;
- }
-</style>
-</head>
-<body>
-<h1>Welcome to nginx!</h1>
-<p>If you see this page, the nginx web server is successfully installed and
-working. Further configuration is required.</p>
-
-<p>For online documentation and support please refer to
-<a href="http://nginx.org/">nginx.org</a>.<br/>
-Commercial support is available at
-<a href="http://nginx.com/">nginx.com</a>.</p>
-
-<p><em>Thank you for using nginx.</em></p>
-</body>
-</html>
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/man/nginx.8 b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/man/nginx.8
deleted file mode 100644
index f119a2327a8..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/man/nginx.8
+++ /dev/null
@@ -1,202 +0,0 @@
-.\"
-.\" Copyright (C) 2010 Sergey A. Osokin
-.\" Copyright (C) Nginx, Inc.
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\"
-.Dd March 6, 2012
-.Dt NGINX 8
-.Os
-.Sh NAME
-.Nm nginx
-.Nd "HTTP and reverse proxy server, mail proxy server"
-.Sh SYNOPSIS
-.Nm
-.Op Fl ?hqtVv
-.Op Fl c Ar file
-.Op Fl g Ar directives
-.Op Fl p Ar prefix
-.Op Fl s Ar signal
-.Sh DESCRIPTION
-.Nm
-(pronounced
-.Dq engine x )
-is an HTTP and reverse proxy server, as well as a mail proxy server.
-It is known for its high performance, stability, rich feature set, simple
-configuration, and low resource consumption.
-.Pp
-The options are as follows:
-.Bl -tag -width ".Fl d Ar directives"
-.It Fl ?\& , h
-Print help.
-.It Fl c Ar file
-Use an alternative configuration
-.Ar file .
-.It Fl g Ar directives
-Set global configuration directives.
-See
-.Sx EXAMPLES
-for details.
-.It Fl p Ar prefix
-Set the prefix path.
-The default value is
-.Pa %%PREFIX%% .
-.It Fl q
-Suppress non-error messages during configuration testing.
-.It Fl s Ar signal
-Send a signal to the master process.
-The argument
-.Ar signal
-can be one of:
-.Cm stop , quit , reopen , reload .
-The following table shows the corresponding system signals:
-.Pp
-.Bl -tag -width ".Cm reopen" -compact
-.It Cm stop
-.Dv SIGTERM
-.It Cm quit
-.Dv SIGQUIT
-.It Cm reopen
-.Dv SIGUSR1
-.It Cm reload
-.Dv SIGHUP
-.El
-.It Fl t
-Do not run, just test the configuration file.
-.Nm
-checks the configuration file syntax and then tries to open files
-referenced in the configuration file.
-.It Fl V
-Print the
-.Nm
-version, compiler version, and
-.Pa configure
-script parameters.
-.It Fl v
-Print the
-.Nm
-version.
-.El
-.Sh SIGNALS
-The master process of
-.Nm
-can handle the following signals:
-.Pp
-.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
-.It Dv SIGINT , SIGTERM
-Shut down quickly.
-.It Dv SIGHUP
-Reload configuration, start the new worker process with a new
-configuration, and gracefully shut down old worker processes.
-.It Dv SIGQUIT
-Shut down gracefully.
-.It Dv SIGUSR1
-Reopen log files.
-.It Dv SIGUSR2
-Upgrade the
-.Nm
-executable on the fly.
-.It Dv SIGWINCH
-Shut down worker processes gracefully.
-.El
-.Pp
-While there is no need to explicitly control worker processes normally,
-they support some signals too:
-.Pp
-.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
-.It Dv SIGTERM
-Shut down quickly.
-.It Dv SIGQUIT
-Shut down gracefully.
-.It Dv SIGUSR1
-Reopen log files.
-.El
-.Sh DEBUGGING LOG
-To enable a debugging log, reconfigure
-.Nm
-to build with debugging:
-.Pp
-.Dl "./configure --with-debug ..."
-.Pp
-and then set the
-.Cm debug
-level of the
-.Va error_log :
-.Pp
-.Dl "error_log /path/to/log debug;"
-.Pp
-It is also possible to enable the debugging for a particular IP address:
-.Bd -literal -offset indent
-events {
- debug_connection 127.0.0.1;
-}
-.Ed
-.Sh ENVIRONMENT
-The
-.Ev NGINX
-environment variable is used internally by
-.Nm
-and should not be set directly by the user.
-.Sh FILES
-.Bl -tag -width indent
-.It Pa %%PID_PATH%%
-Contains the process ID of
-.Nm .
-The contents of this file are not sensitive, so it can be world-readable.
-.It Pa %%CONF_PATH%%
-The main configuration file.
-.It Pa %%ERROR_LOG_PATH%%
-Error log file.
-.El
-.Sh EXIT STATUS
-Exit status is 0 on success, or 1 if the command fails.
-.Sh EXAMPLES
-Test configuration file
-.Pa ~/mynginx.conf
-with global directives for PID and quantity of worker processes:
-.Bd -literal -offset indent
-nginx -t -c ~/mynginx.conf \e
- -g "pid /var/run/mynginx.pid; worker_processes 2;"
-.Ed
-.Sh SEE ALSO
-.\"Xr nginx.conf 5
-.\"Pp
-Documentation at
-.Pa http://nginx.org/en/docs/ .
-.Pp
-For questions and technical support, please refer to
-.Pa http://nginx.org/en/support.html .
-.Sh HISTORY
-Development of
-.Nm
-started in 2002, with the first public release on October 4, 2004.
-.Sh AUTHORS
-.An -nosplit
-.An Igor Sysoev Aq igor@sysoev.ru .
-.Pp
-This manual page was originally written by
-.An Sergey A. Osokin Aq osa@FreeBSD.org.ru
-as a result of compiling many
-.Nm
-documents from all over the world.
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_aio_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_aio_module.c
deleted file mode 100644
index c881319d179..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_aio_module.c
+++ /dev/null
@@ -1,171 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-extern ngx_event_module_t ngx_kqueue_module_ctx;
-
-
-static ngx_int_t ngx_aio_init(ngx_cycle_t *cycle, ngx_msec_t timer);
-static void ngx_aio_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_aio_add_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_aio_del_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_aio_del_connection(ngx_connection_t *c, ngx_uint_t flags);
-static ngx_int_t ngx_aio_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags);
-
-
-ngx_os_io_t ngx_os_aio = {
- ngx_aio_read,
- ngx_aio_read_chain,
- NULL,
- ngx_aio_write,
- ngx_aio_write_chain,
- 0
-};
-
-
-static ngx_str_t aio_name = ngx_string("aio");
-
-ngx_event_module_t ngx_aio_module_ctx = {
- &aio_name,
- NULL, /* create configuration */
- NULL, /* init configuration */
-
- {
- ngx_aio_add_event, /* add an event */
- ngx_aio_del_event, /* delete an event */
- NULL, /* enable an event */
- NULL, /* disable an event */
- NULL, /* add an connection */
- ngx_aio_del_connection, /* delete an connection */
- NULL, /* process the changes */
- ngx_aio_process_events, /* process the events */
- ngx_aio_init, /* init the events */
- ngx_aio_done /* done the events */
- }
-
-};
-
-ngx_module_t ngx_aio_module = {
- NGX_MODULE_V1,
- &ngx_aio_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-#if (NGX_HAVE_KQUEUE)
-
-static ngx_int_t
-ngx_aio_init(ngx_cycle_t *cycle, ngx_msec_t timer)
-{
- if (ngx_kqueue_module_ctx.actions.init(cycle, timer) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- ngx_io = ngx_os_aio;
-
- ngx_event_flags = NGX_USE_AIO_EVENT;
- ngx_event_actions = ngx_aio_module_ctx.actions;
-
-
- return NGX_OK;
-}
-
-
-static void
-ngx_aio_done(ngx_cycle_t *cycle)
-{
- ngx_kqueue_module_ctx.actions.done(cycle);
-}
-
-
-/* the event adding and deleting are needed for the listening sockets */
-
-static ngx_int_t
-ngx_aio_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- return ngx_kqueue_module_ctx.actions.add(ev, event, flags);
-}
-
-
-static ngx_int_t
-ngx_aio_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- return ngx_kqueue_module_ctx.actions.del(ev, event, flags);
-}
-
-
-static ngx_int_t
-ngx_aio_del_connection(ngx_connection_t *c, ngx_uint_t flags)
-{
- int rc;
-
- if (c->read->active == 0 && c->write->active == 0) {
- return NGX_OK;
- }
-
- if (flags & NGX_CLOSE_EVENT) {
- return NGX_OK;
- }
-
- rc = aio_cancel(c->fd, NULL);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "aio_cancel: %d", rc);
-
- if (rc == AIO_CANCELED) {
- c->read->active = 0;
- c->write->active = 0;
- return NGX_OK;
- }
-
- if (rc == AIO_ALLDONE) {
- c->read->active = 0;
- c->write->active = 0;
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "aio_cancel() returned AIO_ALLDONE");
- return NGX_OK;
- }
-
- if (rc == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "aio_cancel() failed");
- return NGX_ERROR;
- }
-
- if (rc == AIO_NOTCANCELED) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "aio_cancel() returned AIO_NOTCANCELED");
-
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_aio_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
-{
- return ngx_kqueue_module_ctx.actions.process_events(cycle, timer, flags);
-}
-
-#endif /* NGX_HAVE_KQUEUE */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_devpoll_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_devpoll_module.c
deleted file mode 100644
index 5658e8620b2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_devpoll_module.c
+++ /dev/null
@@ -1,560 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#if (NGX_TEST_BUILD_DEVPOLL)
-
-/* Solaris declarations */
-
-#define POLLREMOVE 0x0800
-#define DP_POLL 0xD001
-#define DP_ISPOLLED 0xD002
-
-struct dvpoll {
- struct pollfd *dp_fds;
- int dp_nfds;
- int dp_timeout;
-};
-
-#endif
-
-
-typedef struct {
- ngx_uint_t changes;
- ngx_uint_t events;
-} ngx_devpoll_conf_t;
-
-
-static ngx_int_t ngx_devpoll_init(ngx_cycle_t *cycle, ngx_msec_t timer);
-static void ngx_devpoll_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_devpoll_add_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_devpoll_del_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_devpoll_set_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_devpoll_process_events(ngx_cycle_t *cycle,
- ngx_msec_t timer, ngx_uint_t flags);
-
-static void *ngx_devpoll_create_conf(ngx_cycle_t *cycle);
-static char *ngx_devpoll_init_conf(ngx_cycle_t *cycle, void *conf);
-
-static int dp = -1;
-static struct pollfd *change_list, *event_list;
-static ngx_uint_t nchanges, max_changes, nevents;
-
-static ngx_event_t **change_index;
-
-
-static ngx_str_t devpoll_name = ngx_string("/dev/poll");
-
-static ngx_command_t ngx_devpoll_commands[] = {
-
- { ngx_string("devpoll_changes"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_devpoll_conf_t, changes),
- NULL },
-
- { ngx_string("devpoll_events"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_devpoll_conf_t, events),
- NULL },
-
- ngx_null_command
-};
-
-
-ngx_event_module_t ngx_devpoll_module_ctx = {
- &devpoll_name,
- ngx_devpoll_create_conf, /* create configuration */
- ngx_devpoll_init_conf, /* init configuration */
-
- {
- ngx_devpoll_add_event, /* add an event */
- ngx_devpoll_del_event, /* delete an event */
- ngx_devpoll_add_event, /* enable an event */
- ngx_devpoll_del_event, /* disable an event */
- NULL, /* add an connection */
- NULL, /* delete an connection */
- NULL, /* process the changes */
- ngx_devpoll_process_events, /* process the events */
- ngx_devpoll_init, /* init the events */
- ngx_devpoll_done, /* done the events */
- }
-
-};
-
-ngx_module_t ngx_devpoll_module = {
- NGX_MODULE_V1,
- &ngx_devpoll_module_ctx, /* module context */
- ngx_devpoll_commands, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_devpoll_init(ngx_cycle_t *cycle, ngx_msec_t timer)
-{
- size_t n;
- ngx_devpoll_conf_t *dpcf;
-
- dpcf = ngx_event_get_conf(cycle->conf_ctx, ngx_devpoll_module);
-
- if (dp == -1) {
- dp = open("/dev/poll", O_RDWR);
-
- if (dp == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "open(/dev/poll) failed");
- return NGX_ERROR;
- }
- }
-
- if (max_changes < dpcf->changes) {
- if (nchanges) {
- n = nchanges * sizeof(struct pollfd);
- if (write(dp, change_list, n) != (ssize_t) n) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "write(/dev/poll) failed");
- return NGX_ERROR;
- }
-
- nchanges = 0;
- }
-
- if (change_list) {
- ngx_free(change_list);
- }
-
- change_list = ngx_alloc(sizeof(struct pollfd) * dpcf->changes,
- cycle->log);
- if (change_list == NULL) {
- return NGX_ERROR;
- }
-
- if (change_index) {
- ngx_free(change_index);
- }
-
- change_index = ngx_alloc(sizeof(ngx_event_t *) * dpcf->changes,
- cycle->log);
- if (change_index == NULL) {
- return NGX_ERROR;
- }
- }
-
- max_changes = dpcf->changes;
-
- if (nevents < dpcf->events) {
- if (event_list) {
- ngx_free(event_list);
- }
-
- event_list = ngx_alloc(sizeof(struct pollfd) * dpcf->events,
- cycle->log);
- if (event_list == NULL) {
- return NGX_ERROR;
- }
- }
-
- nevents = dpcf->events;
-
- ngx_io = ngx_os_io;
-
- ngx_event_actions = ngx_devpoll_module_ctx.actions;
-
- ngx_event_flags = NGX_USE_LEVEL_EVENT|NGX_USE_FD_EVENT;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_devpoll_done(ngx_cycle_t *cycle)
-{
- if (close(dp) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "close(/dev/poll) failed");
- }
-
- dp = -1;
-
- ngx_free(change_list);
- ngx_free(event_list);
- ngx_free(change_index);
-
- change_list = NULL;
- event_list = NULL;
- change_index = NULL;
- max_changes = 0;
- nchanges = 0;
- nevents = 0;
-}
-
-
-static ngx_int_t
-ngx_devpoll_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
-#if (NGX_DEBUG)
- ngx_connection_t *c;
-#endif
-
-#if (NGX_READ_EVENT != POLLIN)
- event = (event == NGX_READ_EVENT) ? POLLIN : POLLOUT;
-#endif
-
-#if (NGX_DEBUG)
- c = ev->data;
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "devpoll add event: fd:%d ev:%04Xi", c->fd, event);
-#endif
-
- ev->active = 1;
-
- return ngx_devpoll_set_event(ev, event, 0);
-}
-
-
-static ngx_int_t
-ngx_devpoll_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_event_t *e;
- ngx_connection_t *c;
-
- c = ev->data;
-
-#if (NGX_READ_EVENT != POLLIN)
- event = (event == NGX_READ_EVENT) ? POLLIN : POLLOUT;
-#endif
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "devpoll del event: fd:%d ev:%04Xi", c->fd, event);
-
- if (ngx_devpoll_set_event(ev, POLLREMOVE, flags) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- ev->active = 0;
-
- if (flags & NGX_CLOSE_EVENT) {
- e = (event == POLLIN) ? c->write : c->read;
-
- if (e) {
- e->active = 0;
- }
-
- return NGX_OK;
- }
-
- /* restore the pair event if it exists */
-
- if (event == POLLIN) {
- e = c->write;
- event = POLLOUT;
-
- } else {
- e = c->read;
- event = POLLIN;
- }
-
- if (e && e->active) {
- return ngx_devpoll_set_event(e, event, 0);
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_devpoll_set_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- size_t n;
- ngx_connection_t *c;
-
- c = ev->data;
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "devpoll fd:%d ev:%04Xi fl:%04Xi", c->fd, event, flags);
-
- if (nchanges >= max_changes) {
- ngx_log_error(NGX_LOG_WARN, ev->log, 0,
- "/dev/pool change list is filled up");
-
- n = nchanges * sizeof(struct pollfd);
- if (write(dp, change_list, n) != (ssize_t) n) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "write(/dev/poll) failed");
- return NGX_ERROR;
- }
-
- nchanges = 0;
- }
-
- change_list[nchanges].fd = c->fd;
- change_list[nchanges].events = (short) event;
- change_list[nchanges].revents = 0;
-
- change_index[nchanges] = ev;
- ev->index = nchanges;
-
- nchanges++;
-
- if (flags & NGX_CLOSE_EVENT) {
- n = nchanges * sizeof(struct pollfd);
- if (write(dp, change_list, n) != (ssize_t) n) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "write(/dev/poll) failed");
- return NGX_ERROR;
- }
-
- nchanges = 0;
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_devpoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags)
-{
- int events, revents, rc;
- size_t n;
- ngx_fd_t fd;
- ngx_err_t err;
- ngx_int_t i;
- ngx_uint_t level, instance;
- ngx_event_t *rev, *wev;
- ngx_queue_t *queue;
- ngx_connection_t *c;
- struct pollfd pfd;
- struct dvpoll dvp;
-
- /* NGX_TIMER_INFINITE == INFTIM */
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "devpoll timer: %M", timer);
-
- if (nchanges) {
- n = nchanges * sizeof(struct pollfd);
- if (write(dp, change_list, n) != (ssize_t) n) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "write(/dev/poll) failed");
- return NGX_ERROR;
- }
-
- nchanges = 0;
- }
-
- dvp.dp_fds = event_list;
- dvp.dp_nfds = (int) nevents;
- dvp.dp_timeout = timer;
- events = ioctl(dp, DP_POLL, &dvp);
-
- err = (events == -1) ? ngx_errno : 0;
-
- if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
- ngx_time_update();
- }
-
- if (err) {
- if (err == NGX_EINTR) {
-
- if (ngx_event_timer_alarm) {
- ngx_event_timer_alarm = 0;
- return NGX_OK;
- }
-
- level = NGX_LOG_INFO;
-
- } else {
- level = NGX_LOG_ALERT;
- }
-
- ngx_log_error(level, cycle->log, err, "ioctl(DP_POLL) failed");
- return NGX_ERROR;
- }
-
- if (events == 0) {
- if (timer != NGX_TIMER_INFINITE) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "ioctl(DP_POLL) returned no events without timeout");
- return NGX_ERROR;
- }
-
- for (i = 0; i < events; i++) {
-
- fd = event_list[i].fd;
- revents = event_list[i].revents;
-
- c = ngx_cycle->files[fd];
-
- if (c == NULL || c->fd == -1) {
-
- pfd.fd = fd;
- pfd.events = 0;
- pfd.revents = 0;
-
- rc = ioctl(dp, DP_ISPOLLED, &pfd);
-
- switch (rc) {
-
- case -1:
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "ioctl(DP_ISPOLLED) failed for socket %d, event %04Xd",
- fd, revents);
- break;
-
- case 0:
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "phantom event %04Xd for closed and removed socket %d",
- revents, fd);
- break;
-
- default:
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "unexpected event %04Xd for closed and removed socket %d, ",
- "ioctl(DP_ISPOLLED) returned rc:%d, fd:%d, event %04Xd",
- revents, fd, rc, pfd.fd, pfd.revents);
-
- pfd.fd = fd;
- pfd.events = POLLREMOVE;
- pfd.revents = 0;
-
- if (write(dp, &pfd, sizeof(struct pollfd))
- != (ssize_t) sizeof(struct pollfd))
- {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "write(/dev/poll) for %d failed", fd);
- }
-
- if (close(fd) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "close(%d) failed", fd);
- }
-
- break;
- }
-
- continue;
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "devpoll: fd:%d, ev:%04Xd, rev:%04Xd",
- fd, event_list[i].events, revents);
-
- if (revents & (POLLERR|POLLHUP|POLLNVAL)) {
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "ioctl(DP_POLL) error fd:%d ev:%04Xd rev:%04Xd",
- fd, event_list[i].events, revents);
- }
-
- if (revents & ~(POLLIN|POLLOUT|POLLERR|POLLHUP|POLLNVAL)) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "strange ioctl(DP_POLL) events "
- "fd:%d ev:%04Xd rev:%04Xd",
- fd, event_list[i].events, revents);
- }
-
- if ((revents & (POLLERR|POLLHUP|POLLNVAL))
- && (revents & (POLLIN|POLLOUT)) == 0)
- {
- /*
- * if the error events were returned without POLLIN or POLLOUT,
- * then add these flags to handle the events at least in one
- * active handler
- */
-
- revents |= POLLIN|POLLOUT;
- }
-
- rev = c->read;
-
- if ((revents & POLLIN) && rev->active) {
- rev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- queue = rev->accept ? &ngx_posted_accept_events
- : &ngx_posted_events;
-
- ngx_post_event(rev, queue);
-
- } else {
- instance = rev->instance;
-
- rev->handler(rev);
-
- if (c->fd == -1 || rev->instance != instance) {
- continue;
- }
- }
- }
-
- wev = c->write;
-
- if ((revents & POLLOUT) && wev->active) {
- wev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- ngx_post_event(wev, &ngx_posted_events);
-
- } else {
- wev->handler(wev);
- }
- }
- }
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_devpoll_create_conf(ngx_cycle_t *cycle)
-{
- ngx_devpoll_conf_t *dpcf;
-
- dpcf = ngx_palloc(cycle->pool, sizeof(ngx_devpoll_conf_t));
- if (dpcf == NULL) {
- return NULL;
- }
-
- dpcf->changes = NGX_CONF_UNSET;
- dpcf->events = NGX_CONF_UNSET;
-
- return dpcf;
-}
-
-
-static char *
-ngx_devpoll_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- ngx_devpoll_conf_t *dpcf = conf;
-
- ngx_conf_init_uint_value(dpcf->changes, 32);
- ngx_conf_init_uint_value(dpcf->events, 32);
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_epoll_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_epoll_module.c
deleted file mode 100644
index 2674d382b69..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_epoll_module.c
+++ /dev/null
@@ -1,832 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#if (NGX_TEST_BUILD_EPOLL)
-
-/* epoll declarations */
-
-#define EPOLLIN 0x001
-#define EPOLLPRI 0x002
-#define EPOLLOUT 0x004
-#define EPOLLRDNORM 0x040
-#define EPOLLRDBAND 0x080
-#define EPOLLWRNORM 0x100
-#define EPOLLWRBAND 0x200
-#define EPOLLMSG 0x400
-#define EPOLLERR 0x008
-#define EPOLLHUP 0x010
-
-#define EPOLLRDHUP 0x2000
-
-#define EPOLLET 0x80000000
-#define EPOLLONESHOT 0x40000000
-
-#define EPOLL_CTL_ADD 1
-#define EPOLL_CTL_DEL 2
-#define EPOLL_CTL_MOD 3
-
-typedef union epoll_data {
- void *ptr;
- int fd;
- uint32_t u32;
- uint64_t u64;
-} epoll_data_t;
-
-struct epoll_event {
- uint32_t events;
- epoll_data_t data;
-};
-
-
-int epoll_create(int size);
-
-int epoll_create(int size)
-{
- return -1;
-}
-
-
-int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
-
-int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
-{
- return -1;
-}
-
-
-int epoll_wait(int epfd, struct epoll_event *events, int nevents, int timeout);
-
-int epoll_wait(int epfd, struct epoll_event *events, int nevents, int timeout)
-{
- return -1;
-}
-
-#if (NGX_HAVE_FILE_AIO)
-
-#define SYS_io_setup 245
-#define SYS_io_destroy 246
-#define SYS_io_getevents 247
-#define SYS_eventfd 323
-
-typedef u_int aio_context_t;
-
-struct io_event {
- uint64_t data; /* the data field from the iocb */
- uint64_t obj; /* what iocb this event came from */
- int64_t res; /* result code for this event */
- int64_t res2; /* secondary result */
-};
-
-
-#endif
-#endif
-
-
-typedef struct {
- ngx_uint_t events;
- ngx_uint_t aio_requests;
-} ngx_epoll_conf_t;
-
-
-static ngx_int_t ngx_epoll_init(ngx_cycle_t *cycle, ngx_msec_t timer);
-static void ngx_epoll_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_epoll_add_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_epoll_del_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_epoll_add_connection(ngx_connection_t *c);
-static ngx_int_t ngx_epoll_del_connection(ngx_connection_t *c,
- ngx_uint_t flags);
-static ngx_int_t ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags);
-
-#if (NGX_HAVE_FILE_AIO)
-static void ngx_epoll_eventfd_handler(ngx_event_t *ev);
-#endif
-
-static void *ngx_epoll_create_conf(ngx_cycle_t *cycle);
-static char *ngx_epoll_init_conf(ngx_cycle_t *cycle, void *conf);
-
-static int ep = -1;
-static struct epoll_event *event_list;
-static ngx_uint_t nevents;
-
-#if (NGX_HAVE_FILE_AIO)
-
-int ngx_eventfd = -1;
-aio_context_t ngx_aio_ctx = 0;
-
-static ngx_event_t ngx_eventfd_event;
-static ngx_connection_t ngx_eventfd_conn;
-
-#endif
-
-static ngx_str_t epoll_name = ngx_string("epoll");
-
-static ngx_command_t ngx_epoll_commands[] = {
-
- { ngx_string("epoll_events"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_epoll_conf_t, events),
- NULL },
-
- { ngx_string("worker_aio_requests"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_epoll_conf_t, aio_requests),
- NULL },
-
- ngx_null_command
-};
-
-
-ngx_event_module_t ngx_epoll_module_ctx = {
- &epoll_name,
- ngx_epoll_create_conf, /* create configuration */
- ngx_epoll_init_conf, /* init configuration */
-
- {
- ngx_epoll_add_event, /* add an event */
- ngx_epoll_del_event, /* delete an event */
- ngx_epoll_add_event, /* enable an event */
- ngx_epoll_del_event, /* disable an event */
- ngx_epoll_add_connection, /* add an connection */
- ngx_epoll_del_connection, /* delete an connection */
- NULL, /* process the changes */
- ngx_epoll_process_events, /* process the events */
- ngx_epoll_init, /* init the events */
- ngx_epoll_done, /* done the events */
- }
-};
-
-ngx_module_t ngx_epoll_module = {
- NGX_MODULE_V1,
- &ngx_epoll_module_ctx, /* module context */
- ngx_epoll_commands, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-#if (NGX_HAVE_FILE_AIO)
-
-/*
- * We call io_setup(), io_destroy() io_submit(), and io_getevents() directly
- * as syscalls instead of libaio usage, because the library header file
- * supports eventfd() since 0.3.107 version only.
- */
-
-static int
-io_setup(u_int nr_reqs, aio_context_t *ctx)
-{
- return syscall(SYS_io_setup, nr_reqs, ctx);
-}
-
-
-static int
-io_destroy(aio_context_t ctx)
-{
- return syscall(SYS_io_destroy, ctx);
-}
-
-
-static int
-io_getevents(aio_context_t ctx, long min_nr, long nr, struct io_event *events,
- struct timespec *tmo)
-{
- return syscall(SYS_io_getevents, ctx, min_nr, nr, events, tmo);
-}
-
-
-static void
-ngx_epoll_aio_init(ngx_cycle_t *cycle, ngx_epoll_conf_t *epcf)
-{
- int n;
- struct epoll_event ee;
-
-#if (NGX_HAVE_SYS_EVENTFD_H)
- ngx_eventfd = eventfd(0, 0);
-#else
- ngx_eventfd = syscall(SYS_eventfd, 0);
-#endif
-
- if (ngx_eventfd == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "eventfd() failed");
- ngx_file_aio = 0;
- return;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "eventfd: %d", ngx_eventfd);
-
- n = 1;
-
- if (ioctl(ngx_eventfd, FIONBIO, &n) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "ioctl(eventfd, FIONBIO) failed");
- goto failed;
- }
-
- if (io_setup(epcf->aio_requests, &ngx_aio_ctx) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "io_setup() failed");
- goto failed;
- }
-
- ngx_eventfd_event.data = &ngx_eventfd_conn;
- ngx_eventfd_event.handler = ngx_epoll_eventfd_handler;
- ngx_eventfd_event.log = cycle->log;
- ngx_eventfd_event.active = 1;
- ngx_eventfd_conn.fd = ngx_eventfd;
- ngx_eventfd_conn.read = &ngx_eventfd_event;
- ngx_eventfd_conn.log = cycle->log;
-
- ee.events = EPOLLIN|EPOLLET;
- ee.data.ptr = &ngx_eventfd_conn;
-
- if (epoll_ctl(ep, EPOLL_CTL_ADD, ngx_eventfd, &ee) != -1) {
- return;
- }
-
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "epoll_ctl(EPOLL_CTL_ADD, eventfd) failed");
-
- if (io_destroy(ngx_aio_ctx) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "io_destroy() failed");
- }
-
-failed:
-
- if (close(ngx_eventfd) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "eventfd close() failed");
- }
-
- ngx_eventfd = -1;
- ngx_aio_ctx = 0;
- ngx_file_aio = 0;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_epoll_init(ngx_cycle_t *cycle, ngx_msec_t timer)
-{
- ngx_epoll_conf_t *epcf;
-
- epcf = ngx_event_get_conf(cycle->conf_ctx, ngx_epoll_module);
-
- if (ep == -1) {
- ep = epoll_create(cycle->connection_n / 2);
-
- if (ep == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "epoll_create() failed");
- return NGX_ERROR;
- }
-
-#if (NGX_HAVE_FILE_AIO)
-
- ngx_epoll_aio_init(cycle, epcf);
-
-#endif
- }
-
- if (nevents < epcf->events) {
- if (event_list) {
- ngx_free(event_list);
- }
-
- event_list = ngx_alloc(sizeof(struct epoll_event) * epcf->events,
- cycle->log);
- if (event_list == NULL) {
- return NGX_ERROR;
- }
- }
-
- nevents = epcf->events;
-
- ngx_io = ngx_os_io;
-
- ngx_event_actions = ngx_epoll_module_ctx.actions;
-
-#if (NGX_HAVE_CLEAR_EVENT)
- ngx_event_flags = NGX_USE_CLEAR_EVENT
-#else
- ngx_event_flags = NGX_USE_LEVEL_EVENT
-#endif
- |NGX_USE_GREEDY_EVENT
- |NGX_USE_EPOLL_EVENT;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_epoll_done(ngx_cycle_t *cycle)
-{
- if (close(ep) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "epoll close() failed");
- }
-
- ep = -1;
-
-#if (NGX_HAVE_FILE_AIO)
-
- if (ngx_eventfd != -1) {
-
- if (io_destroy(ngx_aio_ctx) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "io_destroy() failed");
- }
-
- if (close(ngx_eventfd) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "eventfd close() failed");
- }
-
- ngx_eventfd = -1;
- }
-
- ngx_aio_ctx = 0;
-
-#endif
-
- ngx_free(event_list);
-
- event_list = NULL;
- nevents = 0;
-}
-
-
-static ngx_int_t
-ngx_epoll_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- int op;
- uint32_t events, prev;
- ngx_event_t *e;
- ngx_connection_t *c;
- struct epoll_event ee;
-
- c = ev->data;
-
- events = (uint32_t) event;
-
- if (event == NGX_READ_EVENT) {
- e = c->write;
- prev = EPOLLOUT;
-#if (NGX_READ_EVENT != EPOLLIN|EPOLLRDHUP)
- events = EPOLLIN|EPOLLRDHUP;
-#endif
-
- } else {
- e = c->read;
- prev = EPOLLIN|EPOLLRDHUP;
-#if (NGX_WRITE_EVENT != EPOLLOUT)
- events = EPOLLOUT;
-#endif
- }
-
- if (e->active) {
- op = EPOLL_CTL_MOD;
- events |= prev;
-
- } else {
- op = EPOLL_CTL_ADD;
- }
-
- ee.events = events | (uint32_t) flags;
- ee.data.ptr = (void *) ((uintptr_t) c | ev->instance);
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "epoll add event: fd:%d op:%d ev:%08XD",
- c->fd, op, ee.events);
-
- if (epoll_ctl(ep, op, c->fd, &ee) == -1) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "epoll_ctl(%d, %d) failed", op, c->fd);
- return NGX_ERROR;
- }
-
- ev->active = 1;
-#if 0
- ev->oneshot = (flags & NGX_ONESHOT_EVENT) ? 1 : 0;
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_epoll_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- int op;
- uint32_t prev;
- ngx_event_t *e;
- ngx_connection_t *c;
- struct epoll_event ee;
-
- /*
- * when the file descriptor is closed, the epoll automatically deletes
- * it from its queue, so we do not need to delete explicitly the event
- * before the closing the file descriptor
- */
-
- if (flags & NGX_CLOSE_EVENT) {
- ev->active = 0;
- return NGX_OK;
- }
-
- c = ev->data;
-
- if (event == NGX_READ_EVENT) {
- e = c->write;
- prev = EPOLLOUT;
-
- } else {
- e = c->read;
- prev = EPOLLIN|EPOLLRDHUP;
- }
-
- if (e->active) {
- op = EPOLL_CTL_MOD;
- ee.events = prev | (uint32_t) flags;
- ee.data.ptr = (void *) ((uintptr_t) c | ev->instance);
-
- } else {
- op = EPOLL_CTL_DEL;
- ee.events = 0;
- ee.data.ptr = NULL;
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "epoll del event: fd:%d op:%d ev:%08XD",
- c->fd, op, ee.events);
-
- if (epoll_ctl(ep, op, c->fd, &ee) == -1) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "epoll_ctl(%d, %d) failed", op, c->fd);
- return NGX_ERROR;
- }
-
- ev->active = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_epoll_add_connection(ngx_connection_t *c)
-{
- struct epoll_event ee;
-
- ee.events = EPOLLIN|EPOLLOUT|EPOLLET|EPOLLRDHUP;
- ee.data.ptr = (void *) ((uintptr_t) c | c->read->instance);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "epoll add connection: fd:%d ev:%08XD", c->fd, ee.events);
-
- if (epoll_ctl(ep, EPOLL_CTL_ADD, c->fd, &ee) == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "epoll_ctl(EPOLL_CTL_ADD, %d) failed", c->fd);
- return NGX_ERROR;
- }
-
- c->read->active = 1;
- c->write->active = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_epoll_del_connection(ngx_connection_t *c, ngx_uint_t flags)
-{
- int op;
- struct epoll_event ee;
-
- /*
- * when the file descriptor is closed the epoll automatically deletes
- * it from its queue so we do not need to delete explicitly the event
- * before the closing the file descriptor
- */
-
- if (flags & NGX_CLOSE_EVENT) {
- c->read->active = 0;
- c->write->active = 0;
- return NGX_OK;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "epoll del connection: fd:%d", c->fd);
-
- op = EPOLL_CTL_DEL;
- ee.events = 0;
- ee.data.ptr = NULL;
-
- if (epoll_ctl(ep, op, c->fd, &ee) == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "epoll_ctl(%d, %d) failed", op, c->fd);
- return NGX_ERROR;
- }
-
- c->read->active = 0;
- c->write->active = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_epoll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
-{
- int events;
- uint32_t revents;
- ngx_int_t instance, i;
- ngx_uint_t level;
- ngx_err_t err;
- ngx_event_t *rev, *wev;
- ngx_queue_t *queue;
- ngx_connection_t *c;
-
- /* NGX_TIMER_INFINITE == INFTIM */
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "epoll timer: %M", timer);
-
- events = epoll_wait(ep, event_list, (int) nevents, timer);
-
- err = (events == -1) ? ngx_errno : 0;
-
- if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
- ngx_time_update();
- }
-
- if (err) {
- if (err == NGX_EINTR) {
-
- if (ngx_event_timer_alarm) {
- ngx_event_timer_alarm = 0;
- return NGX_OK;
- }
-
- level = NGX_LOG_INFO;
-
- } else {
- level = NGX_LOG_ALERT;
- }
-
- ngx_log_error(level, cycle->log, err, "epoll_wait() failed");
- return NGX_ERROR;
- }
-
- if (events == 0) {
- if (timer != NGX_TIMER_INFINITE) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "epoll_wait() returned no events without timeout");
- return NGX_ERROR;
- }
-
- for (i = 0; i < events; i++) {
- c = event_list[i].data.ptr;
-
- instance = (uintptr_t) c & 1;
- c = (ngx_connection_t *) ((uintptr_t) c & (uintptr_t) ~1);
-
- rev = c->read;
-
- if (c->fd == -1 || rev->instance != instance) {
-
- /*
- * the stale event from a file descriptor
- * that was just closed in this iteration
- */
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "epoll: stale event %p", c);
- continue;
- }
-
- revents = event_list[i].events;
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "epoll: fd:%d ev:%04XD d:%p",
- c->fd, revents, event_list[i].data.ptr);
-
- if (revents & (EPOLLERR|EPOLLHUP)) {
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "epoll_wait() error on fd:%d ev:%04XD",
- c->fd, revents);
- }
-
-#if 0
- if (revents & ~(EPOLLIN|EPOLLOUT|EPOLLERR|EPOLLHUP)) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "strange epoll_wait() events fd:%d ev:%04XD",
- c->fd, revents);
- }
-#endif
-
- if ((revents & (EPOLLERR|EPOLLHUP))
- && (revents & (EPOLLIN|EPOLLOUT)) == 0)
- {
- /*
- * if the error events were returned without EPOLLIN or EPOLLOUT,
- * then add these flags to handle the events at least in one
- * active handler
- */
-
- revents |= EPOLLIN|EPOLLOUT;
- }
-
- if ((revents & EPOLLIN) && rev->active) {
-
-#if (NGX_HAVE_EPOLLRDHUP)
- if (revents & EPOLLRDHUP) {
- rev->pending_eof = 1;
- }
-#endif
-
- rev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- queue = rev->accept ? &ngx_posted_accept_events
- : &ngx_posted_events;
-
- ngx_post_event(rev, queue);
-
- } else {
- rev->handler(rev);
- }
- }
-
- wev = c->write;
-
- if ((revents & EPOLLOUT) && wev->active) {
-
- if (c->fd == -1 || wev->instance != instance) {
-
- /*
- * the stale event from a file descriptor
- * that was just closed in this iteration
- */
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "epoll: stale event %p", c);
- continue;
- }
-
- wev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- ngx_post_event(wev, &ngx_posted_events);
-
- } else {
- wev->handler(wev);
- }
- }
- }
-
- return NGX_OK;
-}
-
-
-#if (NGX_HAVE_FILE_AIO)
-
-static void
-ngx_epoll_eventfd_handler(ngx_event_t *ev)
-{
- int n, events;
- long i;
- uint64_t ready;
- ngx_err_t err;
- ngx_event_t *e;
- ngx_event_aio_t *aio;
- struct io_event event[64];
- struct timespec ts;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, 0, "eventfd handler");
-
- n = read(ngx_eventfd, &ready, 8);
-
- err = ngx_errno;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ev->log, 0, "eventfd: %d", n);
-
- if (n != 8) {
- if (n == -1) {
- if (err == NGX_EAGAIN) {
- return;
- }
-
- ngx_log_error(NGX_LOG_ALERT, ev->log, err, "read(eventfd) failed");
- return;
- }
-
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "read(eventfd) returned only %d bytes", n);
- return;
- }
-
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
-
- while (ready) {
-
- events = io_getevents(ngx_aio_ctx, 1, 64, event, &ts);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "io_getevents: %l", events);
-
- if (events > 0) {
- ready -= events;
-
- for (i = 0; i < events; i++) {
-
- ngx_log_debug4(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "io_event: %uXL %uXL %L %L",
- event[i].data, event[i].obj,
- event[i].res, event[i].res2);
-
- e = (ngx_event_t *) (uintptr_t) event[i].data;
-
- e->complete = 1;
- e->active = 0;
- e->ready = 1;
-
- aio = e->data;
- aio->res = event[i].res;
-
- ngx_post_event(e, &ngx_posted_events);
- }
-
- continue;
- }
-
- if (events == 0) {
- return;
- }
-
- /* events == -1 */
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "io_getevents() failed");
- return;
- }
-}
-
-#endif
-
-
-static void *
-ngx_epoll_create_conf(ngx_cycle_t *cycle)
-{
- ngx_epoll_conf_t *epcf;
-
- epcf = ngx_palloc(cycle->pool, sizeof(ngx_epoll_conf_t));
- if (epcf == NULL) {
- return NULL;
- }
-
- epcf->events = NGX_CONF_UNSET;
- epcf->aio_requests = NGX_CONF_UNSET;
-
- return epcf;
-}
-
-
-static char *
-ngx_epoll_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- ngx_epoll_conf_t *epcf = conf;
-
- ngx_conf_init_uint_value(epcf->events, 512);
- ngx_conf_init_uint_value(epcf->aio_requests, 32);
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_eventport_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_eventport_module.c
deleted file mode 100644
index a9d8a6246f1..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_eventport_module.c
+++ /dev/null
@@ -1,618 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#if (NGX_TEST_BUILD_EVENTPORT)
-
-#define ushort_t u_short
-#define uint_t u_int
-
-#ifndef CLOCK_REALTIME
-#define CLOCK_REALTIME 0
-typedef int clockid_t;
-typedef void * timer_t;
-#endif
-
-/* Solaris declarations */
-
-#define PORT_SOURCE_AIO 1
-#define PORT_SOURCE_TIMER 2
-#define PORT_SOURCE_USER 3
-#define PORT_SOURCE_FD 4
-#define PORT_SOURCE_ALERT 5
-#define PORT_SOURCE_MQ 6
-
-#ifndef ETIME
-#define ETIME 64
-#endif
-
-#define SIGEV_PORT 4
-
-typedef struct {
- int portev_events; /* event data is source specific */
- ushort_t portev_source; /* event source */
- ushort_t portev_pad; /* port internal use */
- uintptr_t portev_object; /* source specific object */
- void *portev_user; /* user cookie */
-} port_event_t;
-
-typedef struct port_notify {
- int portnfy_port; /* bind request(s) to port */
- void *portnfy_user; /* user defined */
-} port_notify_t;
-
-#if (__FreeBSD_version < 700005)
-
-typedef struct itimerspec { /* definition per POSIX.4 */
- struct timespec it_interval;/* timer period */
- struct timespec it_value; /* timer expiration */
-} itimerspec_t;
-
-#endif
-
-int port_create(void);
-
-int port_create(void)
-{
- return -1;
-}
-
-
-int port_associate(int port, int source, uintptr_t object, int events,
- void *user);
-
-int port_associate(int port, int source, uintptr_t object, int events,
- void *user)
-{
- return -1;
-}
-
-
-int port_dissociate(int port, int source, uintptr_t object);
-
-int port_dissociate(int port, int source, uintptr_t object)
-{
- return -1;
-}
-
-
-int port_getn(int port, port_event_t list[], uint_t max, uint_t *nget,
- struct timespec *timeout);
-
-int port_getn(int port, port_event_t list[], uint_t max, uint_t *nget,
- struct timespec *timeout)
-{
- return -1;
-}
-
-
-int timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid);
-
-int timer_create(clockid_t clock_id, struct sigevent *evp, timer_t *timerid)
-{
- return -1;
-}
-
-
-int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
- struct itimerspec *ovalue);
-
-int timer_settime(timer_t timerid, int flags, const struct itimerspec *value,
- struct itimerspec *ovalue)
-{
- return -1;
-}
-
-
-int timer_delete(timer_t timerid);
-
-int timer_delete(timer_t timerid)
-{
- return -1;
-}
-
-#endif
-
-
-typedef struct {
- ngx_uint_t events;
-} ngx_eventport_conf_t;
-
-
-static ngx_int_t ngx_eventport_init(ngx_cycle_t *cycle, ngx_msec_t timer);
-static void ngx_eventport_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_eventport_add_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_eventport_del_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_eventport_process_events(ngx_cycle_t *cycle,
- ngx_msec_t timer, ngx_uint_t flags);
-
-static void *ngx_eventport_create_conf(ngx_cycle_t *cycle);
-static char *ngx_eventport_init_conf(ngx_cycle_t *cycle, void *conf);
-
-static int ep = -1;
-static port_event_t *event_list;
-static ngx_uint_t nevents;
-static timer_t event_timer = (timer_t) -1;
-
-static ngx_str_t eventport_name = ngx_string("eventport");
-
-
-static ngx_command_t ngx_eventport_commands[] = {
-
- { ngx_string("eventport_events"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_eventport_conf_t, events),
- NULL },
-
- ngx_null_command
-};
-
-
-ngx_event_module_t ngx_eventport_module_ctx = {
- &eventport_name,
- ngx_eventport_create_conf, /* create configuration */
- ngx_eventport_init_conf, /* init configuration */
-
- {
- ngx_eventport_add_event, /* add an event */
- ngx_eventport_del_event, /* delete an event */
- ngx_eventport_add_event, /* enable an event */
- ngx_eventport_del_event, /* disable an event */
- NULL, /* add an connection */
- NULL, /* delete an connection */
- NULL, /* process the changes */
- ngx_eventport_process_events, /* process the events */
- ngx_eventport_init, /* init the events */
- ngx_eventport_done, /* done the events */
- }
-
-};
-
-ngx_module_t ngx_eventport_module = {
- NGX_MODULE_V1,
- &ngx_eventport_module_ctx, /* module context */
- ngx_eventport_commands, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_eventport_init(ngx_cycle_t *cycle, ngx_msec_t timer)
-{
- port_notify_t pn;
- struct itimerspec its;
- struct sigevent sev;
- ngx_eventport_conf_t *epcf;
-
- epcf = ngx_event_get_conf(cycle->conf_ctx, ngx_eventport_module);
-
- if (ep == -1) {
- ep = port_create();
-
- if (ep == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "port_create() failed");
- return NGX_ERROR;
- }
- }
-
- if (nevents < epcf->events) {
- if (event_list) {
- ngx_free(event_list);
- }
-
- event_list = ngx_alloc(sizeof(port_event_t) * epcf->events,
- cycle->log);
- if (event_list == NULL) {
- return NGX_ERROR;
- }
- }
-
- ngx_event_flags = NGX_USE_EVENTPORT_EVENT;
-
- if (timer) {
- ngx_memzero(&pn, sizeof(port_notify_t));
- pn.portnfy_port = ep;
-
- ngx_memzero(&sev, sizeof(struct sigevent));
- sev.sigev_notify = SIGEV_PORT;
-#if !(NGX_TEST_BUILD_EVENTPORT)
- sev.sigev_value.sival_ptr = &pn;
-#endif
-
- if (timer_create(CLOCK_REALTIME, &sev, &event_timer) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "timer_create() failed");
- return NGX_ERROR;
- }
-
- its.it_interval.tv_sec = timer / 1000;
- its.it_interval.tv_nsec = (timer % 1000) * 1000000;
- its.it_value.tv_sec = timer / 1000;
- its.it_value.tv_nsec = (timer % 1000) * 1000000;
-
- if (timer_settime(event_timer, 0, &its, NULL) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "timer_settime() failed");
- return NGX_ERROR;
- }
-
- ngx_event_flags |= NGX_USE_TIMER_EVENT;
- }
-
- nevents = epcf->events;
-
- ngx_io = ngx_os_io;
-
- ngx_event_actions = ngx_eventport_module_ctx.actions;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_eventport_done(ngx_cycle_t *cycle)
-{
- if (event_timer != (timer_t) -1) {
- if (timer_delete(event_timer) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "timer_delete() failed");
- }
-
- event_timer = (timer_t) -1;
- }
-
- if (close(ep) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "close() event port failed");
- }
-
- ep = -1;
-
- ngx_free(event_list);
-
- event_list = NULL;
- nevents = 0;
-}
-
-
-static ngx_int_t
-ngx_eventport_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_int_t events, prev;
- ngx_event_t *e;
- ngx_connection_t *c;
-
- c = ev->data;
-
- events = event;
-
- if (event == NGX_READ_EVENT) {
- e = c->write;
- prev = POLLOUT;
-#if (NGX_READ_EVENT != POLLIN)
- events = POLLIN;
-#endif
-
- } else {
- e = c->read;
- prev = POLLIN;
-#if (NGX_WRITE_EVENT != POLLOUT)
- events = POLLOUT;
-#endif
- }
-
- if (e->oneshot) {
- events |= prev;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "eventport add event: fd:%d ev:%04Xi", c->fd, events);
-
- if (port_associate(ep, PORT_SOURCE_FD, c->fd, events,
- (void *) ((uintptr_t) ev | ev->instance))
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "port_associate() failed");
- return NGX_ERROR;
- }
-
- ev->active = 1;
- ev->oneshot = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_eventport_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_event_t *e;
- ngx_connection_t *c;
-
- /*
- * when the file descriptor is closed, the event port automatically
- * dissociates it from the port, so we do not need to dissociate explicitly
- * the event before the closing the file descriptor
- */
-
- if (flags & NGX_CLOSE_EVENT) {
- ev->active = 0;
- ev->oneshot = 0;
- return NGX_OK;
- }
-
- c = ev->data;
-
- if (event == NGX_READ_EVENT) {
- e = c->write;
- event = POLLOUT;
-
- } else {
- e = c->read;
- event = POLLIN;
- }
-
- if (e->oneshot) {
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "eventport change event: fd:%d ev:%04Xi", c->fd, event);
-
- if (port_associate(ep, PORT_SOURCE_FD, c->fd, event,
- (void *) ((uintptr_t) ev | ev->instance))
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "port_associate() failed");
- return NGX_ERROR;
- }
-
- } else {
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "eventport del event: fd:%d", c->fd);
-
- if (port_dissociate(ep, PORT_SOURCE_FD, c->fd) == -1) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "port_dissociate() failed");
- return NGX_ERROR;
- }
- }
-
- ev->active = 0;
- ev->oneshot = 0;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_eventport_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags)
-{
- int n, revents;
- u_int events;
- ngx_err_t err;
- ngx_int_t instance;
- ngx_uint_t i, level;
- ngx_event_t *ev, *rev, *wev;
- ngx_queue_t *queue;
- ngx_connection_t *c;
- struct timespec ts, *tp;
-
- if (timer == NGX_TIMER_INFINITE) {
- tp = NULL;
-
- } else {
- ts.tv_sec = timer / 1000;
- ts.tv_nsec = (timer % 1000) * 1000000;
- tp = &ts;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "eventport timer: %M", timer);
-
- events = 1;
-
- n = port_getn(ep, event_list, (u_int) nevents, &events, tp);
-
- err = ngx_errno;
-
- if (flags & NGX_UPDATE_TIME) {
- ngx_time_update();
- }
-
- if (n == -1) {
- if (err == ETIME) {
- if (timer != NGX_TIMER_INFINITE) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "port_getn() returned no events without timeout");
- return NGX_ERROR;
- }
-
- level = (err == NGX_EINTR) ? NGX_LOG_INFO : NGX_LOG_ALERT;
- ngx_log_error(level, cycle->log, err, "port_getn() failed");
- return NGX_ERROR;
- }
-
- if (events == 0) {
- if (timer != NGX_TIMER_INFINITE) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "port_getn() returned no events without timeout");
- return NGX_ERROR;
- }
-
- for (i = 0; i < events; i++) {
-
- if (event_list[i].portev_source == PORT_SOURCE_TIMER) {
- ngx_time_update();
- continue;
- }
-
- ev = event_list[i].portev_user;
-
- switch (event_list[i].portev_source) {
-
- case PORT_SOURCE_FD:
-
- instance = (uintptr_t) ev & 1;
- ev = (ngx_event_t *) ((uintptr_t) ev & (uintptr_t) ~1);
-
- if (ev->closed || ev->instance != instance) {
-
- /*
- * the stale event from a file descriptor
- * that was just closed in this iteration
- */
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "eventport: stale event %p", ev);
- continue;
- }
-
- revents = event_list[i].portev_events;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "eventport: fd:%d, ev:%04Xd",
- event_list[i].portev_object, revents);
-
- if (revents & (POLLERR|POLLHUP|POLLNVAL)) {
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "port_getn() error fd:%d ev:%04Xd",
- event_list[i].portev_object, revents);
- }
-
- if (revents & ~(POLLIN|POLLOUT|POLLERR|POLLHUP|POLLNVAL)) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "strange port_getn() events fd:%d ev:%04Xd",
- event_list[i].portev_object, revents);
- }
-
- if ((revents & (POLLERR|POLLHUP|POLLNVAL))
- && (revents & (POLLIN|POLLOUT)) == 0)
- {
- /*
- * if the error events were returned without POLLIN or POLLOUT,
- * then add these flags to handle the events at least in one
- * active handler
- */
-
- revents |= POLLIN|POLLOUT;
- }
-
- c = ev->data;
- rev = c->read;
- wev = c->write;
-
- rev->active = 0;
- wev->active = 0;
-
- if (revents & POLLIN) {
- rev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- queue = rev->accept ? &ngx_posted_accept_events
- : &ngx_posted_events;
-
- ngx_post_event(rev, queue);
-
- } else {
- rev->handler(rev);
-
- if (ev->closed || ev->instance != instance) {
- continue;
- }
- }
-
- if (rev->accept) {
- if (ngx_use_accept_mutex) {
- ngx_accept_events = 1;
- continue;
- }
-
- if (port_associate(ep, PORT_SOURCE_FD, c->fd, POLLIN,
- (void *) ((uintptr_t) ev | ev->instance))
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "port_associate() failed");
- return NGX_ERROR;
- }
- }
- }
-
- if (revents & POLLOUT) {
- wev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- ngx_post_event(wev, &ngx_posted_events);
-
- } else {
- wev->handler(wev);
- }
- }
-
- continue;
-
- default:
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "unexpected even_port object %d",
- event_list[i].portev_object);
- continue;
- }
- }
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_eventport_create_conf(ngx_cycle_t *cycle)
-{
- ngx_eventport_conf_t *epcf;
-
- epcf = ngx_palloc(cycle->pool, sizeof(ngx_eventport_conf_t));
- if (epcf == NULL) {
- return NULL;
- }
-
- epcf->events = NGX_CONF_UNSET;
-
- return epcf;
-}
-
-
-static char *
-ngx_eventport_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- ngx_eventport_conf_t *epcf = conf;
-
- ngx_conf_init_uint_value(epcf->events, 32);
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_kqueue_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_kqueue_module.c
deleted file mode 100644
index 9e7a1bdb692..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_kqueue_module.c
+++ /dev/null
@@ -1,765 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-typedef struct {
- ngx_uint_t changes;
- ngx_uint_t events;
-} ngx_kqueue_conf_t;
-
-
-static ngx_int_t ngx_kqueue_init(ngx_cycle_t *cycle, ngx_msec_t timer);
-static void ngx_kqueue_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_kqueue_add_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_kqueue_del_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_kqueue_set_event(ngx_event_t *ev, ngx_int_t filter,
- ngx_uint_t flags);
-static ngx_int_t ngx_kqueue_process_changes(ngx_cycle_t *cycle, ngx_uint_t try);
-static ngx_int_t ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags);
-static ngx_inline void ngx_kqueue_dump_event(ngx_log_t *log,
- struct kevent *kev);
-
-static void *ngx_kqueue_create_conf(ngx_cycle_t *cycle);
-static char *ngx_kqueue_init_conf(ngx_cycle_t *cycle, void *conf);
-
-
-int ngx_kqueue = -1;
-
-/*
- * The "change_list" should be declared as ngx_thread_volatile.
- * However, the use of the change_list is localized in kqueue functions and
- * is protected by the mutex so even the "icc -ipo" should not build the code
- * with the race condition. Thus we avoid the declaration to make a more
- * readable code.
- */
-
-static struct kevent *change_list, *change_list0, *change_list1;
-static struct kevent *event_list;
-static ngx_uint_t max_changes, nchanges, nevents;
-
-#if (NGX_THREADS)
-static ngx_mutex_t *list_mutex;
-static ngx_mutex_t *kevent_mutex;
-#endif
-
-
-
-static ngx_str_t kqueue_name = ngx_string("kqueue");
-
-static ngx_command_t ngx_kqueue_commands[] = {
-
- { ngx_string("kqueue_changes"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_kqueue_conf_t, changes),
- NULL },
-
- { ngx_string("kqueue_events"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_kqueue_conf_t, events),
- NULL },
-
- ngx_null_command
-};
-
-
-ngx_event_module_t ngx_kqueue_module_ctx = {
- &kqueue_name,
- ngx_kqueue_create_conf, /* create configuration */
- ngx_kqueue_init_conf, /* init configuration */
-
- {
- ngx_kqueue_add_event, /* add an event */
- ngx_kqueue_del_event, /* delete an event */
- ngx_kqueue_add_event, /* enable an event */
- ngx_kqueue_del_event, /* disable an event */
- NULL, /* add an connection */
- NULL, /* delete an connection */
- ngx_kqueue_process_changes, /* process the changes */
- ngx_kqueue_process_events, /* process the events */
- ngx_kqueue_init, /* init the events */
- ngx_kqueue_done /* done the events */
- }
-
-};
-
-ngx_module_t ngx_kqueue_module = {
- NGX_MODULE_V1,
- &ngx_kqueue_module_ctx, /* module context */
- ngx_kqueue_commands, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_kqueue_init(ngx_cycle_t *cycle, ngx_msec_t timer)
-{
- ngx_kqueue_conf_t *kcf;
- struct timespec ts;
-#if (NGX_HAVE_TIMER_EVENT)
- struct kevent kev;
-#endif
-
- kcf = ngx_event_get_conf(cycle->conf_ctx, ngx_kqueue_module);
-
- if (ngx_kqueue == -1) {
- ngx_kqueue = kqueue();
-
- if (ngx_kqueue == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "kqueue() failed");
- return NGX_ERROR;
- }
-
-#if (NGX_THREADS)
-
- list_mutex = ngx_mutex_init(cycle->log, 0);
- if (list_mutex == NULL) {
- return NGX_ERROR;
- }
-
- kevent_mutex = ngx_mutex_init(cycle->log, 0);
- if (kevent_mutex == NULL) {
- return NGX_ERROR;
- }
-
-#endif
- }
-
- if (max_changes < kcf->changes) {
- if (nchanges) {
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
-
- if (kevent(ngx_kqueue, change_list, (int) nchanges, NULL, 0, &ts)
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "kevent() failed");
- return NGX_ERROR;
- }
- nchanges = 0;
- }
-
- if (change_list0) {
- ngx_free(change_list0);
- }
-
- change_list0 = ngx_alloc(kcf->changes * sizeof(struct kevent),
- cycle->log);
- if (change_list0 == NULL) {
- return NGX_ERROR;
- }
-
- if (change_list1) {
- ngx_free(change_list1);
- }
-
- change_list1 = ngx_alloc(kcf->changes * sizeof(struct kevent),
- cycle->log);
- if (change_list1 == NULL) {
- return NGX_ERROR;
- }
-
- change_list = change_list0;
- }
-
- max_changes = kcf->changes;
-
- if (nevents < kcf->events) {
- if (event_list) {
- ngx_free(event_list);
- }
-
- event_list = ngx_alloc(kcf->events * sizeof(struct kevent), cycle->log);
- if (event_list == NULL) {
- return NGX_ERROR;
- }
- }
-
- ngx_event_flags = NGX_USE_ONESHOT_EVENT
- |NGX_USE_KQUEUE_EVENT
- |NGX_USE_VNODE_EVENT;
-
-#if (NGX_HAVE_TIMER_EVENT)
-
- if (timer) {
- kev.ident = 0;
- kev.filter = EVFILT_TIMER;
- kev.flags = EV_ADD|EV_ENABLE;
- kev.fflags = 0;
- kev.data = timer;
- kev.udata = 0;
-
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
-
- if (kevent(ngx_kqueue, &kev, 1, NULL, 0, &ts) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "kevent(EVFILT_TIMER) failed");
- return NGX_ERROR;
- }
-
- ngx_event_flags |= NGX_USE_TIMER_EVENT;
- }
-
-#endif
-
-#if (NGX_HAVE_CLEAR_EVENT)
- ngx_event_flags |= NGX_USE_CLEAR_EVENT;
-#else
- ngx_event_flags |= NGX_USE_LEVEL_EVENT;
-#endif
-
-#if (NGX_HAVE_LOWAT_EVENT)
- ngx_event_flags |= NGX_USE_LOWAT_EVENT;
-#endif
-
- nevents = kcf->events;
-
- ngx_io = ngx_os_io;
-
- ngx_event_actions = ngx_kqueue_module_ctx.actions;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_kqueue_done(ngx_cycle_t *cycle)
-{
- if (close(ngx_kqueue) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "kqueue close() failed");
- }
-
- ngx_kqueue = -1;
-
-#if (NGX_THREADS)
- ngx_mutex_destroy(kevent_mutex);
- ngx_mutex_destroy(list_mutex);
-#endif
-
- ngx_free(change_list1);
- ngx_free(change_list0);
- ngx_free(event_list);
-
- change_list1 = NULL;
- change_list0 = NULL;
- change_list = NULL;
- event_list = NULL;
- max_changes = 0;
- nchanges = 0;
- nevents = 0;
-}
-
-
-static ngx_int_t
-ngx_kqueue_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_int_t rc;
-#if 0
- ngx_event_t *e;
- ngx_connection_t *c;
-#endif
-
- ev->active = 1;
- ev->disabled = 0;
- ev->oneshot = (flags & NGX_ONESHOT_EVENT) ? 1 : 0;
-
- ngx_mutex_lock(list_mutex);
-
-#if 0
-
- if (ev->index < nchanges
- && ((uintptr_t) change_list[ev->index].udata & (uintptr_t) ~1)
- == (uintptr_t) ev)
- {
- if (change_list[ev->index].flags == EV_DISABLE) {
-
- /*
- * if the EV_DISABLE is still not passed to a kernel
- * we will not pass it
- */
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "kevent activated: %d: ft:%i",
- ngx_event_ident(ev->data), event);
-
- if (ev->index < --nchanges) {
- e = (ngx_event_t *)
- ((uintptr_t) change_list[nchanges].udata & (uintptr_t) ~1);
- change_list[ev->index] = change_list[nchanges];
- e->index = ev->index;
- }
-
- ngx_mutex_unlock(list_mutex);
-
- return NGX_OK;
- }
-
- c = ev->data;
-
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "previous event on #%d were not passed in kernel", c->fd);
-
- ngx_mutex_unlock(list_mutex);
-
- return NGX_ERROR;
- }
-
-#endif
-
- rc = ngx_kqueue_set_event(ev, event, EV_ADD|EV_ENABLE|flags);
-
- ngx_mutex_unlock(list_mutex);
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_kqueue_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_int_t rc;
- ngx_event_t *e;
-
- ev->active = 0;
- ev->disabled = 0;
-
- ngx_mutex_lock(list_mutex);
-
- if (ev->index < nchanges
- && ((uintptr_t) change_list[ev->index].udata & (uintptr_t) ~1)
- == (uintptr_t) ev)
- {
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "kevent deleted: %d: ft:%i",
- ngx_event_ident(ev->data), event);
-
- /* if the event is still not passed to a kernel we will not pass it */
-
- nchanges--;
-
- if (ev->index < nchanges) {
- e = (ngx_event_t *)
- ((uintptr_t) change_list[nchanges].udata & (uintptr_t) ~1);
- change_list[ev->index] = change_list[nchanges];
- e->index = ev->index;
- }
-
- ngx_mutex_unlock(list_mutex);
-
- return NGX_OK;
- }
-
- /*
- * when the file descriptor is closed the kqueue automatically deletes
- * its filters so we do not need to delete explicitly the event
- * before the closing the file descriptor.
- */
-
- if (flags & NGX_CLOSE_EVENT) {
- ngx_mutex_unlock(list_mutex);
- return NGX_OK;
- }
-
- if (flags & NGX_DISABLE_EVENT) {
- ev->disabled = 1;
-
- } else {
- flags |= EV_DELETE;
- }
-
- rc = ngx_kqueue_set_event(ev, event, flags);
-
- ngx_mutex_unlock(list_mutex);
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_kqueue_set_event(ngx_event_t *ev, ngx_int_t filter, ngx_uint_t flags)
-{
- struct kevent *kev;
- struct timespec ts;
- ngx_connection_t *c;
-
- c = ev->data;
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "kevent set event: %d: ft:%i fl:%04Xi",
- c->fd, filter, flags);
-
- if (nchanges >= max_changes) {
- ngx_log_error(NGX_LOG_WARN, ev->log, 0,
- "kqueue change list is filled up");
-
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
-
- if (kevent(ngx_kqueue, change_list, (int) nchanges, NULL, 0, &ts)
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno, "kevent() failed");
- return NGX_ERROR;
- }
-
- nchanges = 0;
- }
-
- kev = &change_list[nchanges];
-
- kev->ident = c->fd;
- kev->filter = (short) filter;
- kev->flags = (u_short) flags;
- kev->udata = NGX_KQUEUE_UDATA_T ((uintptr_t) ev | ev->instance);
-
- if (filter == EVFILT_VNODE) {
- kev->fflags = NOTE_DELETE|NOTE_WRITE|NOTE_EXTEND
- |NOTE_ATTRIB|NOTE_RENAME
-#if (__FreeBSD__ == 4 && __FreeBSD_version >= 430000) \
- || __FreeBSD_version >= 500018
- |NOTE_REVOKE
-#endif
- ;
- kev->data = 0;
-
- } else {
-#if (NGX_HAVE_LOWAT_EVENT)
- if (flags & NGX_LOWAT_EVENT) {
- kev->fflags = NOTE_LOWAT;
- kev->data = ev->available;
-
- } else {
- kev->fflags = 0;
- kev->data = 0;
- }
-#else
- kev->fflags = 0;
- kev->data = 0;
-#endif
- }
-
- ev->index = nchanges;
- nchanges++;
-
- if (flags & NGX_FLUSH_EVENT) {
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, 0, "kevent flush");
-
- if (kevent(ngx_kqueue, change_list, (int) nchanges, NULL, 0, &ts)
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno, "kevent() failed");
- return NGX_ERROR;
- }
-
- nchanges = 0;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_kqueue_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags)
-{
- int events, n;
- ngx_int_t i, instance;
- ngx_uint_t level;
- ngx_err_t err;
- ngx_event_t *ev;
- ngx_queue_t *queue;
- struct timespec ts, *tp;
-
- if (ngx_threaded) {
- if (ngx_kqueue_process_changes(cycle, 0) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- n = 0;
-
- } else {
- n = (int) nchanges;
- nchanges = 0;
- }
-
- if (timer == NGX_TIMER_INFINITE) {
- tp = NULL;
-
- } else {
-
- ts.tv_sec = timer / 1000;
- ts.tv_nsec = (timer % 1000) * 1000000;
-
- /*
- * 64-bit Darwin kernel has the bug: kernel level ts.tv_nsec is
- * the int32_t while user level ts.tv_nsec is the long (64-bit),
- * so on the big endian PowerPC all nanoseconds are lost.
- */
-
-#if (NGX_DARWIN_KEVENT_BUG)
- ts.tv_nsec <<= 32;
-#endif
-
- tp = &ts;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "kevent timer: %M, changes: %d", timer, n);
-
- events = kevent(ngx_kqueue, change_list, n, event_list, (int) nevents, tp);
-
- err = (events == -1) ? ngx_errno : 0;
-
- if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
- ngx_time_update();
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "kevent events: %d", events);
-
- if (err) {
- if (err == NGX_EINTR) {
-
- if (ngx_event_timer_alarm) {
- ngx_event_timer_alarm = 0;
- return NGX_OK;
- }
-
- level = NGX_LOG_INFO;
-
- } else {
- level = NGX_LOG_ALERT;
- }
-
- ngx_log_error(level, cycle->log, err, "kevent() failed");
- return NGX_ERROR;
- }
-
- if (events == 0) {
- if (timer != NGX_TIMER_INFINITE) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "kevent() returned no events without timeout");
- return NGX_ERROR;
- }
-
- for (i = 0; i < events; i++) {
-
- ngx_kqueue_dump_event(cycle->log, &event_list[i]);
-
- if (event_list[i].flags & EV_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, event_list[i].data,
- "kevent() error on %d filter:%d flags:%04Xd",
- event_list[i].ident, event_list[i].filter,
- event_list[i].flags);
- continue;
- }
-
-#if (NGX_HAVE_TIMER_EVENT)
-
- if (event_list[i].filter == EVFILT_TIMER) {
- ngx_time_update();
- continue;
- }
-
-#endif
-
- ev = (ngx_event_t *) event_list[i].udata;
-
- switch (event_list[i].filter) {
-
- case EVFILT_READ:
- case EVFILT_WRITE:
-
- instance = (uintptr_t) ev & 1;
- ev = (ngx_event_t *) ((uintptr_t) ev & (uintptr_t) ~1);
-
- if (ev->closed || ev->instance != instance) {
-
- /*
- * the stale event from a file descriptor
- * that was just closed in this iteration
- */
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "kevent: stale event %p", ev);
- continue;
- }
-
- if (ev->log && (ev->log->log_level & NGX_LOG_DEBUG_CONNECTION)) {
- ngx_kqueue_dump_event(ev->log, &event_list[i]);
- }
-
- if (ev->oneshot) {
- ev->active = 0;
- }
-
- ev->available = event_list[i].data;
-
- if (event_list[i].flags & EV_EOF) {
- ev->pending_eof = 1;
- ev->kq_errno = event_list[i].fflags;
- }
-
- ev->ready = 1;
-
- break;
-
- case EVFILT_VNODE:
- ev->kq_vnode = 1;
-
- break;
-
- case EVFILT_AIO:
- ev->complete = 1;
- ev->ready = 1;
-
- break;
-
- default:
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "unexpected kevent() filter %d",
- event_list[i].filter);
- continue;
- }
-
- if (flags & NGX_POST_EVENTS) {
- queue = ev->accept ? &ngx_posted_accept_events
- : &ngx_posted_events;
-
- ngx_post_event(ev, queue);
-
- continue;
- }
-
- ev->handler(ev);
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_kqueue_process_changes(ngx_cycle_t *cycle, ngx_uint_t try)
-{
- int n;
- ngx_int_t rc;
- ngx_err_t err;
- struct timespec ts;
- struct kevent *changes;
-
- ngx_mutex_lock(kevent_mutex);
-
- ngx_mutex_lock(list_mutex);
-
- if (nchanges == 0) {
- ngx_mutex_unlock(list_mutex);
- ngx_mutex_unlock(kevent_mutex);
- return NGX_OK;
- }
-
- changes = change_list;
- if (change_list == change_list0) {
- change_list = change_list1;
- } else {
- change_list = change_list0;
- }
-
- n = (int) nchanges;
- nchanges = 0;
-
- ngx_mutex_unlock(list_mutex);
-
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "kevent changes: %d", n);
-
- if (kevent(ngx_kqueue, changes, n, NULL, 0, &ts) == -1) {
- err = ngx_errno;
- ngx_log_error((err == NGX_EINTR) ? NGX_LOG_INFO : NGX_LOG_ALERT,
- cycle->log, err, "kevent() failed");
- rc = NGX_ERROR;
-
- } else {
- rc = NGX_OK;
- }
-
- ngx_mutex_unlock(kevent_mutex);
-
- return rc;
-}
-
-
-static ngx_inline void
-ngx_kqueue_dump_event(ngx_log_t *log, struct kevent *kev)
-{
- ngx_log_debug6(NGX_LOG_DEBUG_EVENT, log, 0,
- (kev->ident > 0x8000000 && kev->ident != (unsigned) -1) ?
- "kevent: %p: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p":
- "kevent: %d: ft:%d fl:%04Xd ff:%08Xd d:%d ud:%p",
- kev->ident, kev->filter,
- kev->flags, kev->fflags,
- kev->data, kev->udata);
-}
-
-
-static void *
-ngx_kqueue_create_conf(ngx_cycle_t *cycle)
-{
- ngx_kqueue_conf_t *kcf;
-
- kcf = ngx_palloc(cycle->pool, sizeof(ngx_kqueue_conf_t));
- if (kcf == NULL) {
- return NULL;
- }
-
- kcf->changes = NGX_CONF_UNSET;
- kcf->events = NGX_CONF_UNSET;
-
- return kcf;
-}
-
-
-static char *
-ngx_kqueue_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- ngx_kqueue_conf_t *kcf = conf;
-
- ngx_conf_init_uint_value(kcf->changes, 512);
- ngx_conf_init_uint_value(kcf->events, 512);
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_poll_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_poll_module.c
deleted file mode 100644
index bad1a7d2a2d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_poll_module.c
+++ /dev/null
@@ -1,427 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-static ngx_int_t ngx_poll_init(ngx_cycle_t *cycle, ngx_msec_t timer);
-static void ngx_poll_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_poll_add_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_poll_del_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags);
-static char *ngx_poll_init_conf(ngx_cycle_t *cycle, void *conf);
-
-
-static struct pollfd *event_list;
-static ngx_uint_t nevents;
-
-
-static ngx_str_t poll_name = ngx_string("poll");
-
-ngx_event_module_t ngx_poll_module_ctx = {
- &poll_name,
- NULL, /* create configuration */
- ngx_poll_init_conf, /* init configuration */
-
- {
- ngx_poll_add_event, /* add an event */
- ngx_poll_del_event, /* delete an event */
- ngx_poll_add_event, /* enable an event */
- ngx_poll_del_event, /* disable an event */
- NULL, /* add an connection */
- NULL, /* delete an connection */
- NULL, /* process the changes */
- ngx_poll_process_events, /* process the events */
- ngx_poll_init, /* init the events */
- ngx_poll_done /* done the events */
- }
-
-};
-
-ngx_module_t ngx_poll_module = {
- NGX_MODULE_V1,
- &ngx_poll_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-
-static ngx_int_t
-ngx_poll_init(ngx_cycle_t *cycle, ngx_msec_t timer)
-{
- struct pollfd *list;
-
- if (event_list == NULL) {
- nevents = 0;
- }
-
- if (ngx_process >= NGX_PROCESS_WORKER
- || cycle->old_cycle == NULL
- || cycle->old_cycle->connection_n < cycle->connection_n)
- {
- list = ngx_alloc(sizeof(struct pollfd) * cycle->connection_n,
- cycle->log);
- if (list == NULL) {
- return NGX_ERROR;
- }
-
- if (event_list) {
- ngx_memcpy(list, event_list, sizeof(ngx_event_t *) * nevents);
- ngx_free(event_list);
- }
-
- event_list = list;
- }
-
- ngx_io = ngx_os_io;
-
- ngx_event_actions = ngx_poll_module_ctx.actions;
-
- ngx_event_flags = NGX_USE_LEVEL_EVENT|NGX_USE_FD_EVENT;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_poll_done(ngx_cycle_t *cycle)
-{
- ngx_free(event_list);
-
- event_list = NULL;
-}
-
-
-static ngx_int_t
-ngx_poll_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_event_t *e;
- ngx_connection_t *c;
-
- c = ev->data;
-
- ev->active = 1;
-
- if (ev->index != NGX_INVALID_INDEX) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "poll event fd:%d ev:%i is already set", c->fd, event);
- return NGX_OK;
- }
-
- if (event == NGX_READ_EVENT) {
- e = c->write;
-#if (NGX_READ_EVENT != POLLIN)
- event = POLLIN;
-#endif
-
- } else {
- e = c->read;
-#if (NGX_WRITE_EVENT != POLLOUT)
- event = POLLOUT;
-#endif
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "poll add event: fd:%d ev:%i", c->fd, event);
-
- if (e == NULL || e->index == NGX_INVALID_INDEX) {
- event_list[nevents].fd = c->fd;
- event_list[nevents].events = (short) event;
- event_list[nevents].revents = 0;
-
- ev->index = nevents;
- nevents++;
-
- } else {
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "poll add index: %i", e->index);
-
- event_list[e->index].events |= (short) event;
- ev->index = e->index;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_poll_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_event_t *e;
- ngx_connection_t *c;
-
- c = ev->data;
-
- ev->active = 0;
-
- if (ev->index == NGX_INVALID_INDEX) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "poll event fd:%d ev:%i is already deleted",
- c->fd, event);
- return NGX_OK;
- }
-
- if (event == NGX_READ_EVENT) {
- e = c->write;
-#if (NGX_READ_EVENT != POLLIN)
- event = POLLIN;
-#endif
-
- } else {
- e = c->read;
-#if (NGX_WRITE_EVENT != POLLOUT)
- event = POLLOUT;
-#endif
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "poll del event: fd:%d ev:%i", c->fd, event);
-
- if (e == NULL || e->index == NGX_INVALID_INDEX) {
- nevents--;
-
- if (ev->index < nevents) {
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "index: copy event %ui to %i", nevents, ev->index);
-
- event_list[ev->index] = event_list[nevents];
-
- c = ngx_cycle->files[event_list[nevents].fd];
-
- if (c->fd == -1) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "unexpected last event");
-
- } else {
- if (c->read->index == nevents) {
- c->read->index = ev->index;
- }
-
- if (c->write->index == nevents) {
- c->write->index = ev->index;
- }
- }
- }
-
- } else {
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "poll del index: %i", e->index);
-
- event_list[e->index].events &= (short) ~event;
- }
-
- ev->index = NGX_INVALID_INDEX;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_poll_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
-{
- int ready, revents;
- ngx_err_t err;
- ngx_uint_t i, found, level;
- ngx_event_t *ev;
- ngx_queue_t *queue;
- ngx_connection_t *c;
-
- /* NGX_TIMER_INFINITE == INFTIM */
-
-#if (NGX_DEBUG0)
- if (cycle->log->log_level & NGX_LOG_DEBUG_ALL) {
- for (i = 0; i < nevents; i++) {
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "poll: %ui: fd:%d ev:%04Xd",
- i, event_list[i].fd, event_list[i].events);
- }
- }
-#endif
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "poll timer: %M", timer);
-
- ready = poll(event_list, (u_int) nevents, (int) timer);
-
- err = (ready == -1) ? ngx_errno : 0;
-
- if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
- ngx_time_update();
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "poll ready %d of %ui", ready, nevents);
-
- if (err) {
- if (err == NGX_EINTR) {
-
- if (ngx_event_timer_alarm) {
- ngx_event_timer_alarm = 0;
- return NGX_OK;
- }
-
- level = NGX_LOG_INFO;
-
- } else {
- level = NGX_LOG_ALERT;
- }
-
- ngx_log_error(level, cycle->log, err, "poll() failed");
- return NGX_ERROR;
- }
-
- if (ready == 0) {
- if (timer != NGX_TIMER_INFINITE) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "poll() returned no events without timeout");
- return NGX_ERROR;
- }
-
- for (i = 0; i < nevents && ready; i++) {
-
- revents = event_list[i].revents;
-
-#if 1
- ngx_log_debug4(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "poll: %ui: fd:%d ev:%04Xd rev:%04Xd",
- i, event_list[i].fd, event_list[i].events, revents);
-#else
- if (revents) {
- ngx_log_debug4(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "poll: %ui: fd:%d ev:%04Xd rev:%04Xd",
- i, event_list[i].fd, event_list[i].events, revents);
- }
-#endif
-
- if (revents & POLLNVAL) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "poll() error fd:%d ev:%04Xd rev:%04Xd",
- event_list[i].fd, event_list[i].events, revents);
- }
-
- if (revents & ~(POLLIN|POLLOUT|POLLERR|POLLHUP|POLLNVAL)) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "strange poll() events fd:%d ev:%04Xd rev:%04Xd",
- event_list[i].fd, event_list[i].events, revents);
- }
-
- if (event_list[i].fd == -1) {
- /*
- * the disabled event, a workaround for our possible bug,
- * see the comment below
- */
- continue;
- }
-
- c = ngx_cycle->files[event_list[i].fd];
-
- if (c->fd == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "unexpected event");
-
- /*
- * it is certainly our fault and it should be investigated,
- * in the meantime we disable this event to avoid a CPU spinning
- */
-
- if (i == nevents - 1) {
- nevents--;
- } else {
- event_list[i].fd = -1;
- }
-
- continue;
- }
-
- if ((revents & (POLLERR|POLLHUP|POLLNVAL))
- && (revents & (POLLIN|POLLOUT)) == 0)
- {
- /*
- * if the error events were returned without POLLIN or POLLOUT,
- * then add these flags to handle the events at least in one
- * active handler
- */
-
- revents |= POLLIN|POLLOUT;
- }
-
- found = 0;
-
- if ((revents & POLLIN) && c->read->active) {
- found = 1;
-
- ev = c->read;
- ev->ready = 1;
-
- queue = ev->accept ? &ngx_posted_accept_events
- : &ngx_posted_events;
-
- ngx_post_event(ev, queue);
- }
-
- if ((revents & POLLOUT) && c->write->active) {
- found = 1;
-
- ev = c->write;
- ev->ready = 1;
-
- ngx_post_event(ev, &ngx_posted_events);
- }
-
- if (found) {
- ready--;
- continue;
- }
- }
-
- if (ready != 0) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "poll ready != events");
- }
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_poll_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- ngx_event_conf_t *ecf;
-
- ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module);
-
- if (ecf->use != ngx_poll_module.ctx_index) {
- return NGX_CONF_OK;
- }
-
-#if (NGX_THREADS)
-
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
- "poll() is not supported in the threaded mode");
- return NGX_CONF_ERROR;
-
-#else
-
- return NGX_CONF_OK;
-
-#endif
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_rtsig_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_rtsig_module.c
deleted file mode 100644
index 9e31afa1cef..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_rtsig_module.c
+++ /dev/null
@@ -1,735 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#if (NGX_TEST_BUILD_RTSIG)
-
-#if (NGX_DARWIN)
-
-#define SIGRTMIN 33
-#define si_fd __pad[0]
-
-#else
-
-#ifdef SIGRTMIN
-#define si_fd _reason.__spare__.__spare2__[0]
-#else
-#define SIGRTMIN 33
-#define si_fd __spare__[0]
-#endif
-
-#endif
-
-#define F_SETSIG 10
-#define KERN_RTSIGNR 30
-#define KERN_RTSIGMAX 31
-
-int sigtimedwait(const sigset_t *set, siginfo_t *info,
- const struct timespec *timeout);
-
-int sigtimedwait(const sigset_t *set, siginfo_t *info,
- const struct timespec *timeout)
-{
- return -1;
-}
-
-int ngx_linux_rtsig_max;
-
-#endif
-
-
-typedef struct {
- ngx_uint_t signo;
- ngx_uint_t overflow_events;
- ngx_uint_t overflow_test;
- ngx_uint_t overflow_threshold;
-} ngx_rtsig_conf_t;
-
-
-extern ngx_event_module_t ngx_poll_module_ctx;
-
-static ngx_int_t ngx_rtsig_init(ngx_cycle_t *cycle, ngx_msec_t timer);
-static void ngx_rtsig_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_rtsig_add_connection(ngx_connection_t *c);
-static ngx_int_t ngx_rtsig_del_connection(ngx_connection_t *c,
- ngx_uint_t flags);
-static ngx_int_t ngx_rtsig_process_events(ngx_cycle_t *cycle,
- ngx_msec_t timer, ngx_uint_t flags);
-static ngx_int_t ngx_rtsig_process_overflow(ngx_cycle_t *cycle,
- ngx_msec_t timer, ngx_uint_t flags);
-
-static void *ngx_rtsig_create_conf(ngx_cycle_t *cycle);
-static char *ngx_rtsig_init_conf(ngx_cycle_t *cycle, void *conf);
-static char *ngx_check_ngx_overflow_threshold_bounds(ngx_conf_t *cf,
- void *post, void *data);
-
-
-static sigset_t set;
-static ngx_uint_t overflow, overflow_current;
-static struct pollfd *overflow_list;
-
-
-static ngx_str_t rtsig_name = ngx_string("rtsig");
-
-static ngx_conf_num_bounds_t ngx_overflow_threshold_bounds = {
- ngx_check_ngx_overflow_threshold_bounds, 2, 10
-};
-
-
-static ngx_command_t ngx_rtsig_commands[] = {
-
- { ngx_string("rtsig_signo"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_rtsig_conf_t, signo),
- NULL },
-
- { ngx_string("rtsig_overflow_events"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_rtsig_conf_t, overflow_events),
- NULL },
-
- { ngx_string("rtsig_overflow_test"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_rtsig_conf_t, overflow_test),
- NULL },
-
- { ngx_string("rtsig_overflow_threshold"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- 0,
- offsetof(ngx_rtsig_conf_t, overflow_threshold),
- &ngx_overflow_threshold_bounds },
-
- ngx_null_command
-};
-
-
-ngx_event_module_t ngx_rtsig_module_ctx = {
- &rtsig_name,
- ngx_rtsig_create_conf, /* create configuration */
- ngx_rtsig_init_conf, /* init configuration */
-
- {
- NULL, /* add an event */
- NULL, /* delete an event */
- NULL, /* enable an event */
- NULL, /* disable an event */
- ngx_rtsig_add_connection, /* add an connection */
- ngx_rtsig_del_connection, /* delete an connection */
- NULL, /* process the changes */
- ngx_rtsig_process_events, /* process the events */
- ngx_rtsig_init, /* init the events */
- ngx_rtsig_done, /* done the events */
- }
-
-};
-
-ngx_module_t ngx_rtsig_module = {
- NGX_MODULE_V1,
- &ngx_rtsig_module_ctx, /* module context */
- ngx_rtsig_commands, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_rtsig_init(ngx_cycle_t *cycle, ngx_msec_t timer)
-{
- ngx_rtsig_conf_t *rtscf;
-
- rtscf = ngx_event_get_conf(cycle->conf_ctx, ngx_rtsig_module);
-
- sigemptyset(&set);
- sigaddset(&set, (int) rtscf->signo);
- sigaddset(&set, (int) rtscf->signo + 1);
- sigaddset(&set, SIGIO);
- sigaddset(&set, SIGALRM);
-
- if (sigprocmask(SIG_BLOCK, &set, NULL) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "sigprocmask() failed");
- return NGX_ERROR;
- }
-
- if (overflow_list) {
- ngx_free(overflow_list);
- }
-
- overflow_list = ngx_alloc(sizeof(struct pollfd) * rtscf->overflow_events,
- cycle->log);
- if (overflow_list == NULL) {
- return NGX_ERROR;
- }
-
- ngx_io = ngx_os_io;
-
- ngx_event_actions = ngx_rtsig_module_ctx.actions;
-
- ngx_event_flags = NGX_USE_RTSIG_EVENT
- |NGX_USE_GREEDY_EVENT
- |NGX_USE_FD_EVENT;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_rtsig_done(ngx_cycle_t *cycle)
-{
- ngx_free(overflow_list);
-
- overflow_list = NULL;
-}
-
-
-static ngx_int_t
-ngx_rtsig_add_connection(ngx_connection_t *c)
-{
- ngx_uint_t signo;
- ngx_rtsig_conf_t *rtscf;
-
- if (c->read->accept && c->read->disabled) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "rtsig enable connection: fd:%d", c->fd);
-
- if (fcntl(c->fd, F_SETOWN, ngx_pid) == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "fcntl(F_SETOWN) failed");
- return NGX_ERROR;
- }
-
- c->read->active = 1;
- c->read->disabled = 0;
- }
-
- rtscf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_rtsig_module);
-
- signo = rtscf->signo + c->read->instance;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "rtsig add connection: fd:%d signo:%ui", c->fd, signo);
-
- if (fcntl(c->fd, F_SETFL, O_RDWR|O_NONBLOCK|O_ASYNC) == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "fcntl(O_RDWR|O_NONBLOCK|O_ASYNC) failed");
- return NGX_ERROR;
- }
-
- if (fcntl(c->fd, F_SETSIG, (int) signo) == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "fcntl(F_SETSIG) failed");
- return NGX_ERROR;
- }
-
- if (fcntl(c->fd, F_SETOWN, ngx_pid) == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "fcntl(F_SETOWN) failed");
- return NGX_ERROR;
- }
-
-#if (NGX_HAVE_ONESIGFD)
- if (fcntl(c->fd, F_SETAUXFL, O_ONESIGFD) == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "fcntl(F_SETAUXFL) failed");
- return NGX_ERROR;
- }
-#endif
-
- c->read->active = 1;
- c->write->active = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_rtsig_del_connection(ngx_connection_t *c, ngx_uint_t flags)
-{
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "rtsig del connection: fd:%d", c->fd);
-
- if ((flags & NGX_DISABLE_EVENT) && c->read->accept) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "rtsig disable connection: fd:%d", c->fd);
-
- c->read->active = 0;
- c->read->disabled = 1;
- return NGX_OK;
- }
-
- if (flags & NGX_CLOSE_EVENT) {
- c->read->active = 0;
- c->write->active = 0;
- return NGX_OK;
- }
-
- if (fcntl(c->fd, F_SETFL, O_RDWR|O_NONBLOCK) == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "fcntl(O_RDWR|O_NONBLOCK) failed");
- return NGX_ERROR;
- }
-
- c->read->active = 0;
- c->write->active = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_rtsig_process_events(ngx_cycle_t *cycle, ngx_msec_t timer, ngx_uint_t flags)
-{
- int signo;
- ngx_int_t instance;
- ngx_err_t err;
- siginfo_t si;
- ngx_event_t *rev, *wev;
- ngx_queue_t *queue;
- struct timespec ts, *tp;
- struct sigaction sa;
- ngx_connection_t *c;
- ngx_rtsig_conf_t *rtscf;
-
- if (timer == NGX_TIMER_INFINITE) {
- tp = NULL;
-
- } else {
- ts.tv_sec = timer / 1000;
- ts.tv_nsec = (timer % 1000) * 1000000;
- tp = &ts;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "rtsig timer: %M", timer);
-
- /* Linux's sigwaitinfo() is sigtimedwait() with the NULL timeout pointer */
-
- signo = sigtimedwait(&set, &si, tp);
-
- if (signo == -1) {
- err = ngx_errno;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, err,
- "rtsig signo:%d", signo);
-
- if (flags & NGX_UPDATE_TIME) {
- ngx_time_update();
- }
-
- if (err == NGX_EAGAIN) {
-
- /* timeout */
-
- if (timer != NGX_TIMER_INFINITE) {
- return NGX_AGAIN;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- "sigtimedwait() returned EAGAIN without timeout");
- return NGX_ERROR;
- }
-
- ngx_log_error((err == NGX_EINTR) ? NGX_LOG_INFO : NGX_LOG_ALERT,
- cycle->log, err, "sigtimedwait() failed");
- return NGX_ERROR;
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "rtsig signo:%d fd:%d band:%04Xd",
- signo, si.si_fd, si.si_band);
-
- if (flags & NGX_UPDATE_TIME) {
- ngx_time_update();
- }
-
- rtscf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_rtsig_module);
-
- if (signo == (int) rtscf->signo || signo == (int) rtscf->signo + 1) {
-
- if (overflow && (ngx_uint_t) si.si_fd > overflow_current) {
- return NGX_OK;
- }
-
- c = ngx_cycle->files[si.si_fd];
-
- if (c == NULL) {
-
- /* the stale event */
-
- return NGX_OK;
- }
-
- instance = signo - (int) rtscf->signo;
-
- rev = c->read;
-
- if (rev->instance != instance) {
-
- /*
- * the stale event from a file descriptor
- * that was just closed in this iteration
- */
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "rtsig: stale event %p", c);
-
- return NGX_OK;
- }
-
- if ((si.si_band & (POLLIN|POLLHUP|POLLERR)) && rev->active) {
-
- rev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- queue = rev->accept ? &ngx_posted_accept_events
- : &ngx_posted_events;
-
- ngx_post_event(rev, queue);
-
- } else {
- rev->handler(rev);
- }
- }
-
- wev = c->write;
-
- if ((si.si_band & (POLLOUT|POLLHUP|POLLERR)) && wev->active) {
-
- wev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- ngx_post_event(wev, &ngx_posted_events);
-
- } else {
- wev->handler(wev);
- }
- }
-
- return NGX_OK;
-
- } else if (signo == SIGALRM) {
-
- ngx_time_update();
-
- return NGX_OK;
-
- } else if (signo == SIGIO) {
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "rt signal queue overflowed");
-
- /* flush the RT signal queue */
-
- ngx_memzero(&sa, sizeof(struct sigaction));
- sa.sa_handler = SIG_DFL;
- sigemptyset(&sa.sa_mask);
-
- if (sigaction(rtscf->signo, &sa, NULL) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "sigaction(%d, SIG_DFL) failed", rtscf->signo);
- }
-
- if (sigaction(rtscf->signo + 1, &sa, NULL) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "sigaction(%d, SIG_DFL) failed", rtscf->signo + 1);
- }
-
- overflow = 1;
- overflow_current = 0;
- ngx_event_actions.process_events = ngx_rtsig_process_overflow;
-
- return NGX_ERROR;
-
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "sigtimedwait() returned unexpected signal: %d", signo);
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_rtsig_process_overflow(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags)
-{
- int name[2], rtsig_max, rtsig_nr, events, ready;
- size_t len;
- ngx_err_t err;
- ngx_uint_t tested, n, i;
- ngx_event_t *rev, *wev;
- ngx_queue_t *queue;
- ngx_connection_t *c;
- ngx_rtsig_conf_t *rtscf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "rtsig process overflow");
-
- rtscf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_rtsig_module);
-
- tested = 0;
-
- for ( ;; ) {
-
- n = 0;
- while (n < rtscf->overflow_events) {
-
- if (overflow_current == cycle->connection_n) {
- break;
- }
-
- c = cycle->files[overflow_current++];
-
- if (c == NULL || c->fd == -1) {
- continue;
- }
-
- events = 0;
-
- if (c->read->active && c->read->handler) {
- events |= POLLIN;
- }
-
- if (c->write->active && c->write->handler) {
- events |= POLLOUT;
- }
-
- if (events == 0) {
- continue;
- }
-
- overflow_list[n].fd = c->fd;
- overflow_list[n].events = events;
- overflow_list[n].revents = 0;
- n++;
- }
-
- if (n == 0) {
- break;
- }
-
- for ( ;; ) {
- ready = poll(overflow_list, n, 0);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "rtsig overflow poll:%d", ready);
-
- if (ready == -1) {
- err = ngx_errno;
- ngx_log_error((err == NGX_EINTR) ? NGX_LOG_INFO : NGX_LOG_ALERT,
- cycle->log, 0,
- "poll() failed while the overflow recover");
-
- if (err == NGX_EINTR) {
- continue;
- }
- }
-
- break;
- }
-
- if (ready <= 0) {
- continue;
- }
-
- for (i = 0; i < n; i++) {
- c = cycle->files[overflow_list[i].fd];
-
- if (c == NULL) {
- continue;
- }
-
- rev = c->read;
-
- if (rev->active
- && !rev->closed
- && rev->handler
- && (overflow_list[i].revents
- & (POLLIN|POLLERR|POLLHUP|POLLNVAL)))
- {
- tested++;
-
- rev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- queue = rev->accept ? &ngx_posted_accept_events
- : &ngx_posted_events;
-
- ngx_post_event(rev, queue);
-
- } else {
- rev->handler(rev);
- }
- }
-
- wev = c->write;
-
- if (wev->active
- && !wev->closed
- && wev->handler
- && (overflow_list[i].revents
- & (POLLOUT|POLLERR|POLLHUP|POLLNVAL)))
- {
- tested++;
-
- wev->ready = 1;
-
- if (flags & NGX_POST_EVENTS) {
- ngx_post_event(wev, &ngx_posted_events);
-
- } else {
- wev->handler(wev);
- }
- }
- }
-
- if (tested >= rtscf->overflow_test) {
-
- if (ngx_linux_rtsig_max) {
-
- /*
- * Check the current rt queue length to prevent
- * the new overflow.
- *
- * learn the "/proc/sys/kernel/rtsig-max" value because
- * it can be changed since the last checking
- */
-
- name[0] = CTL_KERN;
- name[1] = KERN_RTSIGMAX;
- len = sizeof(rtsig_max);
-
- if (sysctl(name, 2, &rtsig_max, &len, NULL, 0) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, errno,
- "sysctl(KERN_RTSIGMAX) failed");
- return NGX_ERROR;
- }
-
- /* name[0] = CTL_KERN; */
- name[1] = KERN_RTSIGNR;
- len = sizeof(rtsig_nr);
-
- if (sysctl(name, 2, &rtsig_nr, &len, NULL, 0) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, errno,
- "sysctl(KERN_RTSIGNR) failed");
- return NGX_ERROR;
- }
-
- /*
- * drain the rt signal queue if the /"proc/sys/kernel/rtsig-nr"
- * is bigger than
- * "/proc/sys/kernel/rtsig-max" / "rtsig_overflow_threshold"
- */
-
- if (rtsig_max / (int) rtscf->overflow_threshold < rtsig_nr) {
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "rtsig queue state: %d/%d",
- rtsig_nr, rtsig_max);
- while (ngx_rtsig_process_events(cycle, 0, flags) == NGX_OK)
- {
- /* void */
- }
- }
-
- } else {
-
- /*
- * Linux has not KERN_RTSIGMAX since 2.6.6-mm2
- * so drain the rt signal queue unconditionally
- */
-
- while (ngx_rtsig_process_events(cycle, 0, flags) == NGX_OK) {
- /* void */
- }
- }
-
- tested = 0;
- }
- }
-
- if (flags & NGX_UPDATE_TIME) {
- ngx_time_update();
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "rt signal queue overflow recovered");
-
- overflow = 0;
- ngx_event_actions.process_events = ngx_rtsig_process_events;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_rtsig_create_conf(ngx_cycle_t *cycle)
-{
- ngx_rtsig_conf_t *rtscf;
-
- rtscf = ngx_palloc(cycle->pool, sizeof(ngx_rtsig_conf_t));
- if (rtscf == NULL) {
- return NULL;
- }
-
- rtscf->signo = NGX_CONF_UNSET;
- rtscf->overflow_events = NGX_CONF_UNSET;
- rtscf->overflow_test = NGX_CONF_UNSET;
- rtscf->overflow_threshold = NGX_CONF_UNSET;
-
- return rtscf;
-}
-
-
-static char *
-ngx_rtsig_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- ngx_rtsig_conf_t *rtscf = conf;
-
- /* LinuxThreads use the first 3 RT signals */
- ngx_conf_init_uint_value(rtscf->signo, SIGRTMIN + 10);
-
- ngx_conf_init_uint_value(rtscf->overflow_events, 16);
- ngx_conf_init_uint_value(rtscf->overflow_test, 32);
- ngx_conf_init_uint_value(rtscf->overflow_threshold, 10);
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_check_ngx_overflow_threshold_bounds(ngx_conf_t *cf, void *post, void *data)
-{
- if (ngx_linux_rtsig_max) {
- return ngx_conf_check_num_bounds(cf, post, data);
- }
-
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "\"rtsig_overflow_threshold\" is not supported "
- "since Linux 2.6.6-mm2, ignored");
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_select_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_select_module.c
deleted file mode 100644
index fa2d55ae2ac..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_select_module.c
+++ /dev/null
@@ -1,433 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-static ngx_int_t ngx_select_init(ngx_cycle_t *cycle, ngx_msec_t timer);
-static void ngx_select_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_select_add_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_select_del_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags);
-static void ngx_select_repair_fd_sets(ngx_cycle_t *cycle);
-static char *ngx_select_init_conf(ngx_cycle_t *cycle, void *conf);
-
-
-static fd_set master_read_fd_set;
-static fd_set master_write_fd_set;
-static fd_set work_read_fd_set;
-static fd_set work_write_fd_set;
-
-static ngx_int_t max_fd;
-static ngx_uint_t nevents;
-
-static ngx_event_t **event_index;
-
-
-static ngx_str_t select_name = ngx_string("select");
-
-ngx_event_module_t ngx_select_module_ctx = {
- &select_name,
- NULL, /* create configuration */
- ngx_select_init_conf, /* init configuration */
-
- {
- ngx_select_add_event, /* add an event */
- ngx_select_del_event, /* delete an event */
- ngx_select_add_event, /* enable an event */
- ngx_select_del_event, /* disable an event */
- NULL, /* add an connection */
- NULL, /* delete an connection */
- NULL, /* process the changes */
- ngx_select_process_events, /* process the events */
- ngx_select_init, /* init the events */
- ngx_select_done /* done the events */
- }
-
-};
-
-ngx_module_t ngx_select_module = {
- NGX_MODULE_V1,
- &ngx_select_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_select_init(ngx_cycle_t *cycle, ngx_msec_t timer)
-{
- ngx_event_t **index;
-
- if (event_index == NULL) {
- FD_ZERO(&master_read_fd_set);
- FD_ZERO(&master_write_fd_set);
- nevents = 0;
- }
-
- if (ngx_process >= NGX_PROCESS_WORKER
- || cycle->old_cycle == NULL
- || cycle->old_cycle->connection_n < cycle->connection_n)
- {
- index = ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
- cycle->log);
- if (index == NULL) {
- return NGX_ERROR;
- }
-
- if (event_index) {
- ngx_memcpy(index, event_index, sizeof(ngx_event_t *) * nevents);
- ngx_free(event_index);
- }
-
- event_index = index;
- }
-
- ngx_io = ngx_os_io;
-
- ngx_event_actions = ngx_select_module_ctx.actions;
-
- ngx_event_flags = NGX_USE_LEVEL_EVENT;
-
- max_fd = -1;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_select_done(ngx_cycle_t *cycle)
-{
- ngx_free(event_index);
-
- event_index = NULL;
-}
-
-
-static ngx_int_t
-ngx_select_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_connection_t *c;
-
- c = ev->data;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "select add event fd:%d ev:%i", c->fd, event);
-
- if (ev->index != NGX_INVALID_INDEX) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "select event fd:%d ev:%i is already set", c->fd, event);
- return NGX_OK;
- }
-
- if ((event == NGX_READ_EVENT && ev->write)
- || (event == NGX_WRITE_EVENT && !ev->write))
- {
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "invalid select %s event fd:%d ev:%i",
- ev->write ? "write" : "read", c->fd, event);
- return NGX_ERROR;
- }
-
- if (event == NGX_READ_EVENT) {
- FD_SET(c->fd, &master_read_fd_set);
-
- } else if (event == NGX_WRITE_EVENT) {
- FD_SET(c->fd, &master_write_fd_set);
- }
-
- if (max_fd != -1 && max_fd < c->fd) {
- max_fd = c->fd;
- }
-
- ev->active = 1;
-
- event_index[nevents] = ev;
- ev->index = nevents;
- nevents++;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_select_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_event_t *e;
- ngx_connection_t *c;
-
- c = ev->data;
-
- ev->active = 0;
-
- if (ev->index == NGX_INVALID_INDEX) {
- return NGX_OK;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "select del event fd:%d ev:%i", c->fd, event);
-
- if (event == NGX_READ_EVENT) {
- FD_CLR(c->fd, &master_read_fd_set);
-
- } else if (event == NGX_WRITE_EVENT) {
- FD_CLR(c->fd, &master_write_fd_set);
- }
-
- if (max_fd == c->fd) {
- max_fd = -1;
- }
-
- if (ev->index < --nevents) {
- e = event_index[nevents];
- event_index[ev->index] = e;
- e->index = ev->index;
- }
-
- ev->index = NGX_INVALID_INDEX;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags)
-{
- int ready, nready;
- ngx_err_t err;
- ngx_uint_t i, found;
- ngx_event_t *ev;
- ngx_queue_t *queue;
- struct timeval tv, *tp;
- ngx_connection_t *c;
-
- if (max_fd == -1) {
- for (i = 0; i < nevents; i++) {
- c = event_index[i]->data;
- if (max_fd < c->fd) {
- max_fd = c->fd;
- }
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "change max_fd: %i", max_fd);
- }
-
-#if (NGX_DEBUG)
- if (cycle->log->log_level & NGX_LOG_DEBUG_ALL) {
- for (i = 0; i < nevents; i++) {
- ev = event_index[i];
- c = ev->data;
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select event: fd:%d wr:%d", c->fd, ev->write);
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "max_fd: %i", max_fd);
- }
-#endif
-
- if (timer == NGX_TIMER_INFINITE) {
- tp = NULL;
-
- } else {
- tv.tv_sec = (long) (timer / 1000);
- tv.tv_usec = (long) ((timer % 1000) * 1000);
- tp = &tv;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select timer: %M", timer);
-
- work_read_fd_set = master_read_fd_set;
- work_write_fd_set = master_write_fd_set;
-
- ready = select(max_fd + 1, &work_read_fd_set, &work_write_fd_set, NULL, tp);
-
- err = (ready == -1) ? ngx_errno : 0;
-
- if (flags & NGX_UPDATE_TIME || ngx_event_timer_alarm) {
- ngx_time_update();
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select ready %d", ready);
-
- if (err) {
- ngx_uint_t level;
-
- if (err == NGX_EINTR) {
-
- if (ngx_event_timer_alarm) {
- ngx_event_timer_alarm = 0;
- return NGX_OK;
- }
-
- level = NGX_LOG_INFO;
-
- } else {
- level = NGX_LOG_ALERT;
- }
-
- ngx_log_error(level, cycle->log, err, "select() failed");
-
- if (err == NGX_EBADF) {
- ngx_select_repair_fd_sets(cycle);
- }
-
- return NGX_ERROR;
- }
-
- if (ready == 0) {
- if (timer != NGX_TIMER_INFINITE) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "select() returned no events without timeout");
- return NGX_ERROR;
- }
-
- nready = 0;
-
- for (i = 0; i < nevents; i++) {
- ev = event_index[i];
- c = ev->data;
- found = 0;
-
- if (ev->write) {
- if (FD_ISSET(c->fd, &work_write_fd_set)) {
- found = 1;
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select write %d", c->fd);
- }
-
- } else {
- if (FD_ISSET(c->fd, &work_read_fd_set)) {
- found = 1;
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select read %d", c->fd);
- }
- }
-
- if (found) {
- ev->ready = 1;
-
- queue = ev->accept ? &ngx_posted_accept_events
- : &ngx_posted_events;
-
- ngx_post_event(ev, queue);
-
- nready++;
- }
- }
-
- if (ready != nready) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "select ready != events: %d:%d", ready, nready);
-
- ngx_select_repair_fd_sets(cycle);
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_select_repair_fd_sets(ngx_cycle_t *cycle)
-{
- int n;
- socklen_t len;
- ngx_err_t err;
- ngx_socket_t s;
-
- for (s = 0; s <= max_fd; s++) {
-
- if (FD_ISSET(s, &master_read_fd_set) == 0) {
- continue;
- }
-
- len = sizeof(int);
-
- if (getsockopt(s, SOL_SOCKET, SO_TYPE, &n, &len) == -1) {
- err = ngx_socket_errno;
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- "invalid descriptor #%d in read fd_set", s);
-
- FD_CLR(s, &master_read_fd_set);
- }
- }
-
- for (s = 0; s <= max_fd; s++) {
-
- if (FD_ISSET(s, &master_write_fd_set) == 0) {
- continue;
- }
-
- len = sizeof(int);
-
- if (getsockopt(s, SOL_SOCKET, SO_TYPE, &n, &len) == -1) {
- err = ngx_socket_errno;
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- "invalid descriptor #%d in write fd_set", s);
-
- FD_CLR(s, &master_write_fd_set);
- }
- }
-
- max_fd = -1;
-}
-
-
-static char *
-ngx_select_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- ngx_event_conf_t *ecf;
-
- ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module);
-
- if (ecf->use != ngx_select_module.ctx_index) {
- return NGX_CONF_OK;
- }
-
- /* disable warning: the default FD_SETSIZE is 1024U in FreeBSD 5.x */
-
- if (cycle->connection_n > FD_SETSIZE) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
- "the maximum number of files "
- "supported by select() is %ud", FD_SETSIZE);
- return NGX_CONF_ERROR;
- }
-
-#if (NGX_THREADS)
-
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
- "select() is not supported in the threaded mode");
- return NGX_CONF_ERROR;
-
-#else
-
- return NGX_CONF_OK;
-
-#endif
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_win32_select_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_win32_select_module.c
deleted file mode 100644
index be87ded247f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/modules/ngx_win32_select_module.c
+++ /dev/null
@@ -1,398 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-static ngx_int_t ngx_select_init(ngx_cycle_t *cycle, ngx_msec_t timer);
-static void ngx_select_done(ngx_cycle_t *cycle);
-static ngx_int_t ngx_select_add_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_select_del_event(ngx_event_t *ev, ngx_int_t event,
- ngx_uint_t flags);
-static ngx_int_t ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags);
-static void ngx_select_repair_fd_sets(ngx_cycle_t *cycle);
-static char *ngx_select_init_conf(ngx_cycle_t *cycle, void *conf);
-
-
-static fd_set master_read_fd_set;
-static fd_set master_write_fd_set;
-static fd_set work_read_fd_set;
-static fd_set work_write_fd_set;
-
-static ngx_uint_t max_read;
-static ngx_uint_t max_write;
-static ngx_uint_t nevents;
-
-static ngx_event_t **event_index;
-
-
-static ngx_str_t select_name = ngx_string("select");
-
-ngx_event_module_t ngx_select_module_ctx = {
- &select_name,
- NULL, /* create configuration */
- ngx_select_init_conf, /* init configuration */
-
- {
- ngx_select_add_event, /* add an event */
- ngx_select_del_event, /* delete an event */
- ngx_select_add_event, /* enable an event */
- ngx_select_del_event, /* disable an event */
- NULL, /* add an connection */
- NULL, /* delete an connection */
- NULL, /* process the changes */
- ngx_select_process_events, /* process the events */
- ngx_select_init, /* init the events */
- ngx_select_done /* done the events */
- }
-
-};
-
-ngx_module_t ngx_select_module = {
- NGX_MODULE_V1,
- &ngx_select_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_select_init(ngx_cycle_t *cycle, ngx_msec_t timer)
-{
- ngx_event_t **index;
-
- if (event_index == NULL) {
- FD_ZERO(&master_read_fd_set);
- FD_ZERO(&master_write_fd_set);
- nevents = 0;
- }
-
- if (ngx_process >= NGX_PROCESS_WORKER
- || cycle->old_cycle == NULL
- || cycle->old_cycle->connection_n < cycle->connection_n)
- {
- index = ngx_alloc(sizeof(ngx_event_t *) * 2 * cycle->connection_n,
- cycle->log);
- if (index == NULL) {
- return NGX_ERROR;
- }
-
- if (event_index) {
- ngx_memcpy(index, event_index, sizeof(ngx_event_t *) * nevents);
- ngx_free(event_index);
- }
-
- event_index = index;
- }
-
- ngx_io = ngx_os_io;
-
- ngx_event_actions = ngx_select_module_ctx.actions;
-
- ngx_event_flags = NGX_USE_LEVEL_EVENT;
-
- max_read = 0;
- max_write = 0;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_select_done(ngx_cycle_t *cycle)
-{
- ngx_free(event_index);
-
- event_index = NULL;
-}
-
-
-static ngx_int_t
-ngx_select_add_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_connection_t *c;
-
- c = ev->data;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "select add event fd:%d ev:%i", c->fd, event);
-
- if (ev->index != NGX_INVALID_INDEX) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "select event fd:%d ev:%i is already set", c->fd, event);
- return NGX_OK;
- }
-
- if ((event == NGX_READ_EVENT && ev->write)
- || (event == NGX_WRITE_EVENT && !ev->write))
- {
- ngx_log_error(NGX_LOG_ALERT, ev->log, 0,
- "invalid select %s event fd:%d ev:%i",
- ev->write ? "write" : "read", c->fd, event);
- return NGX_ERROR;
- }
-
- if ((event == NGX_READ_EVENT && max_read >= FD_SETSIZE)
- || (event == NGX_WRITE_EVENT && max_write >= FD_SETSIZE))
- {
- ngx_log_error(NGX_LOG_ERR, ev->log, 0,
- "maximum number of descriptors "
- "supported by select() is %d", FD_SETSIZE);
- return NGX_ERROR;
- }
-
- if (event == NGX_READ_EVENT) {
- FD_SET(c->fd, &master_read_fd_set);
- max_read++;
-
- } else if (event == NGX_WRITE_EVENT) {
- FD_SET(c->fd, &master_write_fd_set);
- max_write++;
- }
-
- ev->active = 1;
-
- event_index[nevents] = ev;
- ev->index = nevents;
- nevents++;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_select_del_event(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags)
-{
- ngx_event_t *e;
- ngx_connection_t *c;
-
- c = ev->data;
-
- ev->active = 0;
-
- if (ev->index == NGX_INVALID_INDEX) {
- return NGX_OK;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "select del event fd:%d ev:%i", c->fd, event);
-
- if (event == NGX_READ_EVENT) {
- FD_CLR(c->fd, &master_read_fd_set);
- max_read--;
-
- } else if (event == NGX_WRITE_EVENT) {
- FD_CLR(c->fd, &master_write_fd_set);
- max_write--;
- }
-
- if (ev->index < --nevents) {
- e = event_index[nevents];
- event_index[ev->index] = e;
- e->index = ev->index;
- }
-
- ev->index = NGX_INVALID_INDEX;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_select_process_events(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags)
-{
- int ready, nready;
- ngx_err_t err;
- ngx_uint_t i, found;
- ngx_event_t *ev;
- ngx_queue_t *queue;
- struct timeval tv, *tp;
- ngx_connection_t *c;
-
-#if (NGX_DEBUG)
- if (cycle->log->log_level & NGX_LOG_DEBUG_ALL) {
- for (i = 0; i < nevents; i++) {
- ev = event_index[i];
- c = ev->data;
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select event: fd:%d wr:%d", c->fd, ev->write);
- }
- }
-#endif
-
- if (timer == NGX_TIMER_INFINITE) {
- tp = NULL;
-
- } else {
- tv.tv_sec = (long) (timer / 1000);
- tv.tv_usec = (long) ((timer % 1000) * 1000);
- tp = &tv;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select timer: %M", timer);
-
- work_read_fd_set = master_read_fd_set;
- work_write_fd_set = master_write_fd_set;
-
- if (max_read || max_write) {
- ready = select(0, &work_read_fd_set, &work_write_fd_set, NULL, tp);
-
- } else {
-
- /*
- * Winsock select() requires that at least one descriptor set must be
- * be non-null, and any non-null descriptor set must contain at least
- * one handle to a socket. Otherwise select() returns WSAEINVAL.
- */
-
- ngx_msleep(timer);
-
- ready = 0;
- }
-
- err = (ready == -1) ? ngx_socket_errno : 0;
-
- if (flags & NGX_UPDATE_TIME) {
- ngx_time_update();
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select ready %d", ready);
-
- if (err) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err, "select() failed");
-
- if (err == WSAENOTSOCK) {
- ngx_select_repair_fd_sets(cycle);
- }
-
- return NGX_ERROR;
- }
-
- if (ready == 0) {
- if (timer != NGX_TIMER_INFINITE) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "select() returned no events without timeout");
- return NGX_ERROR;
- }
-
- nready = 0;
-
- for (i = 0; i < nevents; i++) {
- ev = event_index[i];
- c = ev->data;
- found = 0;
-
- if (ev->write) {
- if (FD_ISSET(c->fd, &work_write_fd_set)) {
- found = 1;
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select write %d", c->fd);
- }
-
- } else {
- if (FD_ISSET(c->fd, &work_read_fd_set)) {
- found = 1;
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "select read %d", c->fd);
- }
- }
-
- if (found) {
- ev->ready = 1;
-
- queue = ev->accept ? &ngx_posted_accept_events
- : &ngx_posted_events;
-
- ngx_post_event(ev, queue);
-
- nready++;
- }
- }
-
- if (ready != nready) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "select ready != events: %d:%d", ready, nready);
-
- ngx_select_repair_fd_sets(cycle);
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_select_repair_fd_sets(ngx_cycle_t *cycle)
-{
- int n;
- u_int i;
- socklen_t len;
- ngx_err_t err;
- ngx_socket_t s;
-
- for (i = 0; i < master_read_fd_set.fd_count; i++) {
-
- s = master_read_fd_set.fd_array[i];
- len = sizeof(int);
-
- if (getsockopt(s, SOL_SOCKET, SO_TYPE, (char *) &n, &len) == -1) {
- err = ngx_socket_errno;
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- "invalid descriptor #%d in read fd_set", s);
-
- FD_CLR(s, &master_read_fd_set);
- }
- }
-
- for (i = 0; i < master_write_fd_set.fd_count; i++) {
-
- s = master_write_fd_set.fd_array[i];
- len = sizeof(int);
-
- if (getsockopt(s, SOL_SOCKET, SO_TYPE, (char *) &n, &len) == -1) {
- err = ngx_socket_errno;
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- "invalid descriptor #%d in write fd_set", s);
-
- FD_CLR(s, &master_write_fd_set);
- }
- }
-}
-
-
-static char *
-ngx_select_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- ngx_event_conf_t *ecf;
-
- ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module);
-
- if (ecf->use != ngx_select_module.ctx_index) {
- return NGX_CONF_OK;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.c
deleted file mode 100644
index 26c3b971669..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.c
+++ /dev/null
@@ -1,1315 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#define DEFAULT_CONNECTIONS 512
-
-
-extern ngx_module_t ngx_kqueue_module;
-extern ngx_module_t ngx_eventport_module;
-extern ngx_module_t ngx_devpoll_module;
-extern ngx_module_t ngx_epoll_module;
-extern ngx_module_t ngx_rtsig_module;
-extern ngx_module_t ngx_select_module;
-
-
-static char *ngx_event_init_conf(ngx_cycle_t *cycle, void *conf);
-static ngx_int_t ngx_event_module_init(ngx_cycle_t *cycle);
-static ngx_int_t ngx_event_process_init(ngx_cycle_t *cycle);
-static char *ngx_events_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-
-static char *ngx_event_connections(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_event_use(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static char *ngx_event_debug_connection(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-static void *ngx_event_core_create_conf(ngx_cycle_t *cycle);
-static char *ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf);
-
-
-static ngx_uint_t ngx_timer_resolution;
-sig_atomic_t ngx_event_timer_alarm;
-
-static ngx_uint_t ngx_event_max_module;
-
-ngx_uint_t ngx_event_flags;
-ngx_event_actions_t ngx_event_actions;
-
-
-static ngx_atomic_t connection_counter = 1;
-ngx_atomic_t *ngx_connection_counter = &connection_counter;
-
-
-ngx_atomic_t *ngx_accept_mutex_ptr;
-ngx_shmtx_t ngx_accept_mutex;
-ngx_uint_t ngx_use_accept_mutex;
-ngx_uint_t ngx_accept_events;
-ngx_uint_t ngx_accept_mutex_held;
-ngx_msec_t ngx_accept_mutex_delay;
-ngx_int_t ngx_accept_disabled;
-
-
-#if (NGX_STAT_STUB)
-
-ngx_atomic_t ngx_stat_accepted0;
-ngx_atomic_t *ngx_stat_accepted = &ngx_stat_accepted0;
-ngx_atomic_t ngx_stat_handled0;
-ngx_atomic_t *ngx_stat_handled = &ngx_stat_handled0;
-ngx_atomic_t ngx_stat_requests0;
-ngx_atomic_t *ngx_stat_requests = &ngx_stat_requests0;
-ngx_atomic_t ngx_stat_active0;
-ngx_atomic_t *ngx_stat_active = &ngx_stat_active0;
-ngx_atomic_t ngx_stat_reading0;
-ngx_atomic_t *ngx_stat_reading = &ngx_stat_reading0;
-ngx_atomic_t ngx_stat_writing0;
-ngx_atomic_t *ngx_stat_writing = &ngx_stat_writing0;
-ngx_atomic_t ngx_stat_waiting0;
-ngx_atomic_t *ngx_stat_waiting = &ngx_stat_waiting0;
-
-#endif
-
-
-
-static ngx_command_t ngx_events_commands[] = {
-
- { ngx_string("events"),
- NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
- ngx_events_block,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_core_module_t ngx_events_module_ctx = {
- ngx_string("events"),
- NULL,
- ngx_event_init_conf
-};
-
-
-ngx_module_t ngx_events_module = {
- NGX_MODULE_V1,
- &ngx_events_module_ctx, /* module context */
- ngx_events_commands, /* module directives */
- NGX_CORE_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t event_core_name = ngx_string("event_core");
-
-
-static ngx_command_t ngx_event_core_commands[] = {
-
- { ngx_string("worker_connections"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_event_connections,
- 0,
- 0,
- NULL },
-
- { ngx_string("connections"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_event_connections,
- 0,
- 0,
- NULL },
-
- { ngx_string("use"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_event_use,
- 0,
- 0,
- NULL },
-
- { ngx_string("multi_accept"),
- NGX_EVENT_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- 0,
- offsetof(ngx_event_conf_t, multi_accept),
- NULL },
-
- { ngx_string("accept_mutex"),
- NGX_EVENT_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- 0,
- offsetof(ngx_event_conf_t, accept_mutex),
- NULL },
-
- { ngx_string("accept_mutex_delay"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- 0,
- offsetof(ngx_event_conf_t, accept_mutex_delay),
- NULL },
-
- { ngx_string("debug_connection"),
- NGX_EVENT_CONF|NGX_CONF_TAKE1,
- ngx_event_debug_connection,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-ngx_event_module_t ngx_event_core_module_ctx = {
- &event_core_name,
- ngx_event_core_create_conf, /* create configuration */
- ngx_event_core_init_conf, /* init configuration */
-
- { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
-};
-
-
-ngx_module_t ngx_event_core_module = {
- NGX_MODULE_V1,
- &ngx_event_core_module_ctx, /* module context */
- ngx_event_core_commands, /* module directives */
- NGX_EVENT_MODULE, /* module type */
- NULL, /* init master */
- ngx_event_module_init, /* init module */
- ngx_event_process_init, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-void
-ngx_process_events_and_timers(ngx_cycle_t *cycle)
-{
- ngx_uint_t flags;
- ngx_msec_t timer, delta;
-
- if (ngx_timer_resolution) {
- timer = NGX_TIMER_INFINITE;
- flags = 0;
-
- } else {
- timer = ngx_event_find_timer();
- flags = NGX_UPDATE_TIME;
-
-#if (NGX_THREADS)
-
- if (timer == NGX_TIMER_INFINITE || timer > 500) {
- timer = 500;
- }
-
-#endif
- }
-
- if (ngx_use_accept_mutex) {
- if (ngx_accept_disabled > 0) {
- ngx_accept_disabled--;
-
- } else {
- if (ngx_trylock_accept_mutex(cycle) == NGX_ERROR) {
- return;
- }
-
- if (ngx_accept_mutex_held) {
- flags |= NGX_POST_EVENTS;
-
- } else {
- if (timer == NGX_TIMER_INFINITE
- || timer > ngx_accept_mutex_delay)
- {
- timer = ngx_accept_mutex_delay;
- }
- }
- }
- }
-
- delta = ngx_current_msec;
-
- (void) ngx_process_events(cycle, timer, flags);
-
- delta = ngx_current_msec - delta;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "timer delta: %M", delta);
-
- ngx_event_process_posted(cycle, &ngx_posted_accept_events);
-
- if (ngx_accept_mutex_held) {
- ngx_shmtx_unlock(&ngx_accept_mutex);
- }
-
- if (delta) {
- ngx_event_expire_timers();
- }
-
- ngx_event_process_posted(cycle, &ngx_posted_events);
-}
-
-
-ngx_int_t
-ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags)
-{
- if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
-
- /* kqueue, epoll */
-
- if (!rev->active && !rev->ready) {
- if (ngx_add_event(rev, NGX_READ_EVENT, NGX_CLEAR_EVENT)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-
- } else if (ngx_event_flags & NGX_USE_LEVEL_EVENT) {
-
- /* select, poll, /dev/poll */
-
- if (!rev->active && !rev->ready) {
- if (ngx_add_event(rev, NGX_READ_EVENT, NGX_LEVEL_EVENT)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
-
- if (rev->active && (rev->ready || (flags & NGX_CLOSE_EVENT))) {
- if (ngx_del_event(rev, NGX_READ_EVENT, NGX_LEVEL_EVENT | flags)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
-
- } else if (ngx_event_flags & NGX_USE_EVENTPORT_EVENT) {
-
- /* event ports */
-
- if (!rev->active && !rev->ready) {
- if (ngx_add_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
-
- if (rev->oneshot && !rev->ready) {
- if (ngx_del_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
- }
-
- /* aio, iocp, rtsig */
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_handle_write_event(ngx_event_t *wev, size_t lowat)
-{
- ngx_connection_t *c;
-
- if (lowat) {
- c = wev->data;
-
- if (ngx_send_lowat(c, lowat) == NGX_ERROR) {
- return NGX_ERROR;
- }
- }
-
- if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
-
- /* kqueue, epoll */
-
- if (!wev->active && !wev->ready) {
- if (ngx_add_event(wev, NGX_WRITE_EVENT,
- NGX_CLEAR_EVENT | (lowat ? NGX_LOWAT_EVENT : 0))
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-
- } else if (ngx_event_flags & NGX_USE_LEVEL_EVENT) {
-
- /* select, poll, /dev/poll */
-
- if (!wev->active && !wev->ready) {
- if (ngx_add_event(wev, NGX_WRITE_EVENT, NGX_LEVEL_EVENT)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
-
- if (wev->active && wev->ready) {
- if (ngx_del_event(wev, NGX_WRITE_EVENT, NGX_LEVEL_EVENT)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
-
- } else if (ngx_event_flags & NGX_USE_EVENTPORT_EVENT) {
-
- /* event ports */
-
- if (!wev->active && !wev->ready) {
- if (ngx_add_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
-
- if (wev->oneshot && wev->ready) {
- if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
- }
-
- /* aio, iocp, rtsig */
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_event_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- if (ngx_get_conf(cycle->conf_ctx, ngx_events_module) == NULL) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
- "no \"events\" section in configuration");
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_event_module_init(ngx_cycle_t *cycle)
-{
- void ***cf;
- u_char *shared;
- size_t size, cl;
- ngx_shm_t shm;
- ngx_time_t *tp;
- ngx_core_conf_t *ccf;
- ngx_event_conf_t *ecf;
-
- cf = ngx_get_conf(cycle->conf_ctx, ngx_events_module);
- ecf = (*cf)[ngx_event_core_module.ctx_index];
-
- if (!ngx_test_config && ngx_process <= NGX_PROCESS_MASTER) {
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0,
- "using the \"%s\" event method", ecf->name);
- }
-
- ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
-
- ngx_timer_resolution = ccf->timer_resolution;
-
-#if !(NGX_WIN32)
- {
- ngx_int_t limit;
- struct rlimit rlmt;
-
- if (getrlimit(RLIMIT_NOFILE, &rlmt) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "getrlimit(RLIMIT_NOFILE) failed, ignored");
-
- } else {
- if (ecf->connections > (ngx_uint_t) rlmt.rlim_cur
- && (ccf->rlimit_nofile == NGX_CONF_UNSET
- || ecf->connections > (ngx_uint_t) ccf->rlimit_nofile))
- {
- limit = (ccf->rlimit_nofile == NGX_CONF_UNSET) ?
- (ngx_int_t) rlmt.rlim_cur : ccf->rlimit_nofile;
-
- ngx_log_error(NGX_LOG_WARN, cycle->log, 0,
- "%ui worker_connections exceed "
- "open file resource limit: %i",
- ecf->connections, limit);
- }
- }
- }
-#endif /* !(NGX_WIN32) */
-
-
- if (ccf->master == 0) {
- return NGX_OK;
- }
-
- if (ngx_accept_mutex_ptr) {
- return NGX_OK;
- }
-
-
- /* cl should be equal to or greater than cache line size */
-
- cl = 128;
-
- size = cl /* ngx_accept_mutex */
- + cl /* ngx_connection_counter */
- + cl; /* ngx_temp_number */
-
-#if (NGX_STAT_STUB)
-
- size += cl /* ngx_stat_accepted */
- + cl /* ngx_stat_handled */
- + cl /* ngx_stat_requests */
- + cl /* ngx_stat_active */
- + cl /* ngx_stat_reading */
- + cl /* ngx_stat_writing */
- + cl; /* ngx_stat_waiting */
-
-#endif
-
- shm.size = size;
- shm.name.len = sizeof("nginx_shared_zone");
- shm.name.data = (u_char *) "nginx_shared_zone";
- shm.log = cycle->log;
-
- if (ngx_shm_alloc(&shm) != NGX_OK) {
- return NGX_ERROR;
- }
-
- shared = shm.addr;
-
- ngx_accept_mutex_ptr = (ngx_atomic_t *) shared;
- ngx_accept_mutex.spin = (ngx_uint_t) -1;
-
- if (ngx_shmtx_create(&ngx_accept_mutex, (ngx_shmtx_sh_t *) shared,
- cycle->lock_file.data)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- ngx_connection_counter = (ngx_atomic_t *) (shared + 1 * cl);
-
- (void) ngx_atomic_cmp_set(ngx_connection_counter, 0, 1);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "counter: %p, %d",
- ngx_connection_counter, *ngx_connection_counter);
-
- ngx_temp_number = (ngx_atomic_t *) (shared + 2 * cl);
-
- tp = ngx_timeofday();
-
- ngx_random_number = (tp->msec << 16) + ngx_pid;
-
-#if (NGX_STAT_STUB)
-
- ngx_stat_accepted = (ngx_atomic_t *) (shared + 3 * cl);
- ngx_stat_handled = (ngx_atomic_t *) (shared + 4 * cl);
- ngx_stat_requests = (ngx_atomic_t *) (shared + 5 * cl);
- ngx_stat_active = (ngx_atomic_t *) (shared + 6 * cl);
- ngx_stat_reading = (ngx_atomic_t *) (shared + 7 * cl);
- ngx_stat_writing = (ngx_atomic_t *) (shared + 8 * cl);
- ngx_stat_waiting = (ngx_atomic_t *) (shared + 9 * cl);
-
-#endif
-
- return NGX_OK;
-}
-
-
-#if !(NGX_WIN32)
-
-static void
-ngx_timer_signal_handler(int signo)
-{
- ngx_event_timer_alarm = 1;
-
-#if 1
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ngx_cycle->log, 0, "timer signal");
-#endif
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_event_process_init(ngx_cycle_t *cycle)
-{
- ngx_uint_t m, i;
- ngx_event_t *rev, *wev;
- ngx_listening_t *ls;
- ngx_connection_t *c, *next, *old;
- ngx_core_conf_t *ccf;
- ngx_event_conf_t *ecf;
- ngx_event_module_t *module;
-
- ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
- ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module);
-
- if (ccf->master && ccf->worker_processes > 1 && ecf->accept_mutex) {
- ngx_use_accept_mutex = 1;
- ngx_accept_mutex_held = 0;
- ngx_accept_mutex_delay = ecf->accept_mutex_delay;
-
- } else {
- ngx_use_accept_mutex = 0;
- }
-
-#if (NGX_WIN32)
-
- /*
- * disable accept mutex on win32 as it may cause deadlock if
- * grabbed by a process which can't accept connections
- */
-
- ngx_use_accept_mutex = 0;
-
-#endif
-
- ngx_queue_init(&ngx_posted_accept_events);
- ngx_queue_init(&ngx_posted_events);
-
- if (ngx_event_timer_init(cycle->log) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_EVENT_MODULE) {
- continue;
- }
-
- if (ngx_modules[m]->ctx_index != ecf->use) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
-
- if (module->actions.init(cycle, ngx_timer_resolution) != NGX_OK) {
- /* fatal */
- exit(2);
- }
-
- break;
- }
-
-#if !(NGX_WIN32)
-
- if (ngx_timer_resolution && !(ngx_event_flags & NGX_USE_TIMER_EVENT)) {
- struct sigaction sa;
- struct itimerval itv;
-
- ngx_memzero(&sa, sizeof(struct sigaction));
- sa.sa_handler = ngx_timer_signal_handler;
- sigemptyset(&sa.sa_mask);
-
- if (sigaction(SIGALRM, &sa, NULL) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "sigaction(SIGALRM) failed");
- return NGX_ERROR;
- }
-
- itv.it_interval.tv_sec = ngx_timer_resolution / 1000;
- itv.it_interval.tv_usec = (ngx_timer_resolution % 1000) * 1000;
- itv.it_value.tv_sec = ngx_timer_resolution / 1000;
- itv.it_value.tv_usec = (ngx_timer_resolution % 1000 ) * 1000;
-
- if (setitimer(ITIMER_REAL, &itv, NULL) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "setitimer() failed");
- }
- }
-
- if (ngx_event_flags & NGX_USE_FD_EVENT) {
- struct rlimit rlmt;
-
- if (getrlimit(RLIMIT_NOFILE, &rlmt) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "getrlimit(RLIMIT_NOFILE) failed");
- return NGX_ERROR;
- }
-
- cycle->files_n = (ngx_uint_t) rlmt.rlim_cur;
-
- cycle->files = ngx_calloc(sizeof(ngx_connection_t *) * cycle->files_n,
- cycle->log);
- if (cycle->files == NULL) {
- return NGX_ERROR;
- }
- }
-
-#endif
-
- cycle->connections =
- ngx_alloc(sizeof(ngx_connection_t) * cycle->connection_n, cycle->log);
- if (cycle->connections == NULL) {
- return NGX_ERROR;
- }
-
- c = cycle->connections;
-
- cycle->read_events = ngx_alloc(sizeof(ngx_event_t) * cycle->connection_n,
- cycle->log);
- if (cycle->read_events == NULL) {
- return NGX_ERROR;
- }
-
- rev = cycle->read_events;
- for (i = 0; i < cycle->connection_n; i++) {
- rev[i].closed = 1;
- rev[i].instance = 1;
- }
-
- cycle->write_events = ngx_alloc(sizeof(ngx_event_t) * cycle->connection_n,
- cycle->log);
- if (cycle->write_events == NULL) {
- return NGX_ERROR;
- }
-
- wev = cycle->write_events;
- for (i = 0; i < cycle->connection_n; i++) {
- wev[i].closed = 1;
- }
-
- i = cycle->connection_n;
- next = NULL;
-
- do {
- i--;
-
- c[i].data = next;
- c[i].read = &cycle->read_events[i];
- c[i].write = &cycle->write_events[i];
- c[i].fd = (ngx_socket_t) -1;
-
- next = &c[i];
-
-#if (NGX_THREADS)
- c[i].lock = 0;
-#endif
- } while (i);
-
- cycle->free_connections = next;
- cycle->free_connection_n = cycle->connection_n;
-
- /* for each listening socket */
-
- ls = cycle->listening.elts;
- for (i = 0; i < cycle->listening.nelts; i++) {
-
- c = ngx_get_connection(ls[i].fd, cycle->log);
-
- if (c == NULL) {
- return NGX_ERROR;
- }
-
- c->log = &ls[i].log;
-
- c->listening = &ls[i];
- ls[i].connection = c;
-
- rev = c->read;
-
- rev->log = c->log;
- rev->accept = 1;
-
-#if (NGX_HAVE_DEFERRED_ACCEPT)
- rev->deferred_accept = ls[i].deferred_accept;
-#endif
-
- if (!(ngx_event_flags & NGX_USE_IOCP_EVENT)) {
- if (ls[i].previous) {
-
- /*
- * delete the old accept events that were bound to
- * the old cycle read events array
- */
-
- old = ls[i].previous->connection;
-
- if (ngx_del_event(old->read, NGX_READ_EVENT, NGX_CLOSE_EVENT)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
-
- old->fd = (ngx_socket_t) -1;
- }
- }
-
-#if (NGX_WIN32)
-
- if (ngx_event_flags & NGX_USE_IOCP_EVENT) {
- ngx_iocp_conf_t *iocpcf;
-
- rev->handler = ngx_event_acceptex;
-
- if (ngx_use_accept_mutex) {
- continue;
- }
-
- if (ngx_add_event(rev, 0, NGX_IOCP_ACCEPT) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- ls[i].log.handler = ngx_acceptex_log_error;
-
- iocpcf = ngx_event_get_conf(cycle->conf_ctx, ngx_iocp_module);
- if (ngx_event_post_acceptex(&ls[i], iocpcf->post_acceptex)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
-
- } else {
- rev->handler = ngx_event_accept;
-
- if (ngx_use_accept_mutex) {
- continue;
- }
-
- if (ngx_add_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
- return NGX_ERROR;
- }
- }
-
-#else
-
- rev->handler = ngx_event_accept;
-
- if (ngx_use_accept_mutex) {
- continue;
- }
-
- if (ngx_event_flags & NGX_USE_RTSIG_EVENT) {
- if (ngx_add_conn(c) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- } else {
- if (ngx_add_event(rev, NGX_READ_EVENT, 0) == NGX_ERROR) {
- return NGX_ERROR;
- }
- }
-
-#endif
-
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_send_lowat(ngx_connection_t *c, size_t lowat)
-{
- int sndlowat;
-
-#if (NGX_HAVE_LOWAT_EVENT)
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- c->write->available = lowat;
- return NGX_OK;
- }
-
-#endif
-
- if (lowat == 0 || c->sndlowat) {
- return NGX_OK;
- }
-
- sndlowat = (int) lowat;
-
- if (setsockopt(c->fd, SOL_SOCKET, SO_SNDLOWAT,
- (const void *) &sndlowat, sizeof(int))
- == -1)
- {
- ngx_connection_error(c, ngx_socket_errno,
- "setsockopt(SO_SNDLOWAT) failed");
- return NGX_ERROR;
- }
-
- c->sndlowat = 1;
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_events_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *rv;
- void ***ctx;
- ngx_uint_t i;
- ngx_conf_t pcf;
- ngx_event_module_t *m;
-
- if (*(void **) conf) {
- return "is duplicate";
- }
-
- /* count the number of the event modules and set up their indices */
-
- ngx_event_max_module = 0;
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_EVENT_MODULE) {
- continue;
- }
-
- ngx_modules[i]->ctx_index = ngx_event_max_module++;
- }
-
- ctx = ngx_pcalloc(cf->pool, sizeof(void *));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *ctx = ngx_pcalloc(cf->pool, ngx_event_max_module * sizeof(void *));
- if (*ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *(void **) conf = ctx;
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_EVENT_MODULE) {
- continue;
- }
-
- m = ngx_modules[i]->ctx;
-
- if (m->create_conf) {
- (*ctx)[ngx_modules[i]->ctx_index] = m->create_conf(cf->cycle);
- if ((*ctx)[ngx_modules[i]->ctx_index] == NULL) {
- return NGX_CONF_ERROR;
- }
- }
- }
-
- pcf = *cf;
- cf->ctx = ctx;
- cf->module_type = NGX_EVENT_MODULE;
- cf->cmd_type = NGX_EVENT_CONF;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = pcf;
-
- if (rv != NGX_CONF_OK)
- return rv;
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_EVENT_MODULE) {
- continue;
- }
-
- m = ngx_modules[i]->ctx;
-
- if (m->init_conf) {
- rv = m->init_conf(cf->cycle, (*ctx)[ngx_modules[i]->ctx_index]);
- if (rv != NGX_CONF_OK) {
- return rv;
- }
- }
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_event_connections(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_event_conf_t *ecf = conf;
-
- ngx_str_t *value;
-
- if (ecf->connections != NGX_CONF_UNSET_UINT) {
- return "is duplicate";
- }
-
- if (ngx_strcmp(cmd->name.data, "connections") == 0) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "the \"connections\" directive is deprecated, "
- "use the \"worker_connections\" directive instead");
- }
-
- value = cf->args->elts;
- ecf->connections = ngx_atoi(value[1].data, value[1].len);
- if (ecf->connections == (ngx_uint_t) NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid number \"%V\"", &value[1]);
-
- return NGX_CONF_ERROR;
- }
-
- cf->cycle->connection_n = ecf->connections;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_event_use(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_event_conf_t *ecf = conf;
-
- ngx_int_t m;
- ngx_str_t *value;
- ngx_event_conf_t *old_ecf;
- ngx_event_module_t *module;
-
- if (ecf->use != NGX_CONF_UNSET_UINT) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (cf->cycle->old_cycle->conf_ctx) {
- old_ecf = ngx_event_get_conf(cf->cycle->old_cycle->conf_ctx,
- ngx_event_core_module);
- } else {
- old_ecf = NULL;
- }
-
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_EVENT_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
- if (module->name->len == value[1].len) {
- if (ngx_strcmp(module->name->data, value[1].data) == 0) {
- ecf->use = ngx_modules[m]->ctx_index;
- ecf->name = module->name->data;
-
- if (ngx_process == NGX_PROCESS_SINGLE
- && old_ecf
- && old_ecf->use != ecf->use)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "when the server runs without a master process "
- "the \"%V\" event type must be the same as "
- "in previous configuration - \"%s\" "
- "and it cannot be changed on the fly, "
- "to change it you need to stop server "
- "and start it again",
- &value[1], old_ecf->name);
-
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
- }
- }
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid event type \"%V\"", &value[1]);
-
- return NGX_CONF_ERROR;
-}
-
-
-static char *
-ngx_event_debug_connection(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
-#if (NGX_DEBUG)
- ngx_event_conf_t *ecf = conf;
-
- ngx_int_t rc;
- ngx_str_t *value;
- ngx_url_t u;
- ngx_cidr_t c, *cidr;
- ngx_uint_t i;
- struct sockaddr_in *sin;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
-
- value = cf->args->elts;
-
-#if (NGX_HAVE_UNIX_DOMAIN)
-
- if (ngx_strcmp(value[1].data, "unix:") == 0) {
- cidr = ngx_array_push(&ecf->debug_connection);
- if (cidr == NULL) {
- return NGX_CONF_ERROR;
- }
-
- cidr->family = AF_UNIX;
- return NGX_CONF_OK;
- }
-
-#endif
-
- rc = ngx_ptocidr(&value[1], &c);
-
- if (rc != NGX_ERROR) {
- if (rc == NGX_DONE) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "low address bits of %V are meaningless",
- &value[1]);
- }
-
- cidr = ngx_array_push(&ecf->debug_connection);
- if (cidr == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *cidr = c;
-
- return NGX_CONF_OK;
- }
-
- ngx_memzero(&u, sizeof(ngx_url_t));
- u.host = value[1];
-
- if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
- if (u.err) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%s in debug_connection \"%V\"",
- u.err, &u.host);
- }
-
- return NGX_CONF_ERROR;
- }
-
- cidr = ngx_array_push_n(&ecf->debug_connection, u.naddrs);
- if (cidr == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(cidr, u.naddrs * sizeof(ngx_cidr_t));
-
- for (i = 0; i < u.naddrs; i++) {
- cidr[i].family = u.addrs[i].sockaddr->sa_family;
-
- switch (cidr[i].family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) u.addrs[i].sockaddr;
- cidr[i].u.in6.addr = sin6->sin6_addr;
- ngx_memset(cidr[i].u.in6.mask.s6_addr, 0xff, 16);
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) u.addrs[i].sockaddr;
- cidr[i].u.in.addr = sin->sin_addr.s_addr;
- cidr[i].u.in.mask = 0xffffffff;
- break;
- }
- }
-
-#else
-
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "\"debug_connection\" is ignored, you need to rebuild "
- "nginx using --with-debug option to enable it");
-
-#endif
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_event_core_create_conf(ngx_cycle_t *cycle)
-{
- ngx_event_conf_t *ecf;
-
- ecf = ngx_palloc(cycle->pool, sizeof(ngx_event_conf_t));
- if (ecf == NULL) {
- return NULL;
- }
-
- ecf->connections = NGX_CONF_UNSET_UINT;
- ecf->use = NGX_CONF_UNSET_UINT;
- ecf->multi_accept = NGX_CONF_UNSET;
- ecf->accept_mutex = NGX_CONF_UNSET;
- ecf->accept_mutex_delay = NGX_CONF_UNSET_MSEC;
- ecf->name = (void *) NGX_CONF_UNSET;
-
-#if (NGX_DEBUG)
-
- if (ngx_array_init(&ecf->debug_connection, cycle->pool, 4,
- sizeof(ngx_cidr_t)) == NGX_ERROR)
- {
- return NULL;
- }
-
-#endif
-
- return ecf;
-}
-
-
-static char *
-ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf)
-{
- ngx_event_conf_t *ecf = conf;
-
-#if (NGX_HAVE_EPOLL) && !(NGX_TEST_BUILD_EPOLL)
- int fd;
-#endif
-#if (NGX_HAVE_RTSIG)
- ngx_uint_t rtsig;
- ngx_core_conf_t *ccf;
-#endif
- ngx_int_t i;
- ngx_module_t *module;
- ngx_event_module_t *event_module;
-
- module = NULL;
-
-#if (NGX_HAVE_EPOLL) && !(NGX_TEST_BUILD_EPOLL)
-
- fd = epoll_create(100);
-
- if (fd != -1) {
- (void) close(fd);
- module = &ngx_epoll_module;
-
- } else if (ngx_errno != NGX_ENOSYS) {
- module = &ngx_epoll_module;
- }
-
-#endif
-
-#if (NGX_HAVE_RTSIG)
-
- if (module == NULL) {
- module = &ngx_rtsig_module;
- rtsig = 1;
-
- } else {
- rtsig = 0;
- }
-
-#endif
-
-#if (NGX_HAVE_DEVPOLL)
-
- module = &ngx_devpoll_module;
-
-#endif
-
-#if (NGX_HAVE_KQUEUE)
-
- module = &ngx_kqueue_module;
-
-#endif
-
-#if (NGX_HAVE_SELECT)
-
- if (module == NULL) {
- module = &ngx_select_module;
- }
-
-#endif
-
- if (module == NULL) {
- for (i = 0; ngx_modules[i]; i++) {
-
- if (ngx_modules[i]->type != NGX_EVENT_MODULE) {
- continue;
- }
-
- event_module = ngx_modules[i]->ctx;
-
- if (ngx_strcmp(event_module->name->data, event_core_name.data) == 0)
- {
- continue;
- }
-
- module = ngx_modules[i];
- break;
- }
- }
-
- if (module == NULL) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, "no events module found");
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_init_uint_value(ecf->connections, DEFAULT_CONNECTIONS);
- cycle->connection_n = ecf->connections;
-
- ngx_conf_init_uint_value(ecf->use, module->ctx_index);
-
- event_module = module->ctx;
- ngx_conf_init_ptr_value(ecf->name, event_module->name->data);
-
- ngx_conf_init_value(ecf->multi_accept, 0);
- ngx_conf_init_value(ecf->accept_mutex, 1);
- ngx_conf_init_msec_value(ecf->accept_mutex_delay, 500);
-
-
-#if (NGX_HAVE_RTSIG)
-
- if (!rtsig) {
- return NGX_CONF_OK;
- }
-
- if (ecf->accept_mutex) {
- return NGX_CONF_OK;
- }
-
- ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
-
- if (ccf->worker_processes == 0) {
- return NGX_CONF_OK;
- }
-
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
- "the \"rtsig\" method requires \"accept_mutex\" to be on");
-
- return NGX_CONF_ERROR;
-
-#else
-
- return NGX_CONF_OK;
-
-#endif
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.h
deleted file mode 100644
index 6531ec7add3..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event.h
+++ /dev/null
@@ -1,541 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_EVENT_H_INCLUDED_
-#define _NGX_EVENT_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-#define NGX_INVALID_INDEX 0xd0d0d0d0
-
-
-#if (NGX_HAVE_IOCP)
-
-typedef struct {
- WSAOVERLAPPED ovlp;
- ngx_event_t *event;
- int error;
-} ngx_event_ovlp_t;
-
-#endif
-
-
-typedef struct {
- ngx_uint_t lock;
-
- ngx_event_t *events;
- ngx_event_t *last;
-} ngx_event_mutex_t;
-
-
-struct ngx_event_s {
- void *data;
-
- unsigned write:1;
-
- unsigned accept:1;
-
- /* used to detect the stale events in kqueue, rtsig, and epoll */
- unsigned instance:1;
-
- /*
- * the event was passed or would be passed to a kernel;
- * in aio mode - operation was posted.
- */
- unsigned active:1;
-
- unsigned disabled:1;
-
- /* the ready event; in aio mode 0 means that no operation can be posted */
- unsigned ready:1;
-
- unsigned oneshot:1;
-
- /* aio operation is complete */
- unsigned complete:1;
-
- unsigned eof:1;
- unsigned error:1;
-
- unsigned timedout:1;
- unsigned timer_set:1;
-
- unsigned delayed:1;
-
- unsigned deferred_accept:1;
-
- /* the pending eof reported by kqueue, epoll or in aio chain operation */
- unsigned pending_eof:1;
-
- unsigned posted:1;
-
-#if (NGX_WIN32)
- /* setsockopt(SO_UPDATE_ACCEPT_CONTEXT) was successful */
- unsigned accept_context_updated:1;
-#endif
-
-#if (NGX_HAVE_KQUEUE)
- unsigned kq_vnode:1;
-
- /* the pending errno reported by kqueue */
- int kq_errno;
-#endif
-
- /*
- * kqueue only:
- * accept: number of sockets that wait to be accepted
- * read: bytes to read when event is ready
- * or lowat when event is set with NGX_LOWAT_EVENT flag
- * write: available space in buffer when event is ready
- * or lowat when event is set with NGX_LOWAT_EVENT flag
- *
- * iocp: TODO
- *
- * otherwise:
- * accept: 1 if accept many, 0 otherwise
- */
-
-#if (NGX_HAVE_KQUEUE) || (NGX_HAVE_IOCP)
- int available;
-#else
- unsigned available:1;
-#endif
-
- ngx_event_handler_pt handler;
-
-
-#if (NGX_HAVE_AIO)
-
-#if (NGX_HAVE_IOCP)
- ngx_event_ovlp_t ovlp;
-#else
- struct aiocb aiocb;
-#endif
-
-#endif
-
- ngx_uint_t index;
-
- ngx_log_t *log;
-
- ngx_rbtree_node_t timer;
-
- /* the posted queue */
- ngx_queue_t queue;
-
- unsigned closed:1;
-
- /* to test on worker exit */
- unsigned channel:1;
- unsigned resolver:1;
-
-
-#if 0
-
- /* the threads support */
-
- /*
- * the event thread context, we store it here
- * if $(CC) does not understand __thread declaration
- * and pthread_getspecific() is too costly
- */
-
- void *thr_ctx;
-
-#if (NGX_EVENT_T_PADDING)
-
- /* event should not cross cache line in SMP */
-
- uint32_t padding[NGX_EVENT_T_PADDING];
-#endif
-#endif
-};
-
-
-#if (NGX_HAVE_FILE_AIO)
-
-struct ngx_event_aio_s {
- void *data;
- ngx_event_handler_pt handler;
- ngx_file_t *file;
-
- ngx_fd_t fd;
-
-#if (NGX_HAVE_EVENTFD)
- int64_t res;
-#if (NGX_TEST_BUILD_EPOLL)
- ngx_err_t err;
- size_t nbytes;
-#endif
-#else
- ngx_err_t err;
- size_t nbytes;
-#endif
-
-#if (NGX_HAVE_AIO_SENDFILE)
- off_t last_offset;
-#endif
-
- ngx_aiocb_t aiocb;
- ngx_event_t event;
-};
-
-#endif
-
-
-typedef struct {
- ngx_int_t (*add)(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags);
- ngx_int_t (*del)(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags);
-
- ngx_int_t (*enable)(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags);
- ngx_int_t (*disable)(ngx_event_t *ev, ngx_int_t event, ngx_uint_t flags);
-
- ngx_int_t (*add_conn)(ngx_connection_t *c);
- ngx_int_t (*del_conn)(ngx_connection_t *c, ngx_uint_t flags);
-
- ngx_int_t (*process_changes)(ngx_cycle_t *cycle, ngx_uint_t nowait);
- ngx_int_t (*process_events)(ngx_cycle_t *cycle, ngx_msec_t timer,
- ngx_uint_t flags);
-
- ngx_int_t (*init)(ngx_cycle_t *cycle, ngx_msec_t timer);
- void (*done)(ngx_cycle_t *cycle);
-} ngx_event_actions_t;
-
-
-extern ngx_event_actions_t ngx_event_actions;
-
-
-/*
- * The event filter requires to read/write the whole data:
- * select, poll, /dev/poll, kqueue, epoll.
- */
-#define NGX_USE_LEVEL_EVENT 0x00000001
-
-/*
- * The event filter is deleted after a notification without an additional
- * syscall: kqueue, epoll.
- */
-#define NGX_USE_ONESHOT_EVENT 0x00000002
-
-/*
- * The event filter notifies only the changes and an initial level:
- * kqueue, epoll.
- */
-#define NGX_USE_CLEAR_EVENT 0x00000004
-
-/*
- * The event filter has kqueue features: the eof flag, errno,
- * available data, etc.
- */
-#define NGX_USE_KQUEUE_EVENT 0x00000008
-
-/*
- * The event filter supports low water mark: kqueue's NOTE_LOWAT.
- * kqueue in FreeBSD 4.1-4.2 has no NOTE_LOWAT so we need a separate flag.
- */
-#define NGX_USE_LOWAT_EVENT 0x00000010
-
-/*
- * The event filter requires to do i/o operation until EAGAIN: epoll, rtsig.
- */
-#define NGX_USE_GREEDY_EVENT 0x00000020
-
-/*
- * The event filter is epoll.
- */
-#define NGX_USE_EPOLL_EVENT 0x00000040
-
-/*
- * No need to add or delete the event filters: rtsig.
- */
-#define NGX_USE_RTSIG_EVENT 0x00000080
-
-/*
- * No need to add or delete the event filters: overlapped, aio_read,
- * aioread, io_submit.
- */
-#define NGX_USE_AIO_EVENT 0x00000100
-
-/*
- * Need to add socket or handle only once: i/o completion port.
- * It also requires NGX_HAVE_AIO and NGX_USE_AIO_EVENT to be set.
- */
-#define NGX_USE_IOCP_EVENT 0x00000200
-
-/*
- * The event filter has no opaque data and requires file descriptors table:
- * poll, /dev/poll, rtsig.
- */
-#define NGX_USE_FD_EVENT 0x00000400
-
-/*
- * The event module handles periodic or absolute timer event by itself:
- * kqueue in FreeBSD 4.4, NetBSD 2.0, and MacOSX 10.4, Solaris 10's event ports.
- */
-#define NGX_USE_TIMER_EVENT 0x00000800
-
-/*
- * All event filters on file descriptor are deleted after a notification:
- * Solaris 10's event ports.
- */
-#define NGX_USE_EVENTPORT_EVENT 0x00001000
-
-/*
- * The event filter support vnode notifications: kqueue.
- */
-#define NGX_USE_VNODE_EVENT 0x00002000
-
-
-/*
- * The event filter is deleted just before the closing file.
- * Has no meaning for select and poll.
- * kqueue, epoll, rtsig, eventport: allows to avoid explicit delete,
- * because filter automatically is deleted
- * on file close,
- *
- * /dev/poll: we need to flush POLLREMOVE event
- * before closing file.
- */
-#define NGX_CLOSE_EVENT 1
-
-/*
- * disable temporarily event filter, this may avoid locks
- * in kernel malloc()/free(): kqueue.
- */
-#define NGX_DISABLE_EVENT 2
-
-/*
- * event must be passed to kernel right now, do not wait until batch processing.
- */
-#define NGX_FLUSH_EVENT 4
-
-
-/* these flags have a meaning only for kqueue */
-#define NGX_LOWAT_EVENT 0
-#define NGX_VNODE_EVENT 0
-
-
-#if (NGX_HAVE_EPOLL) && !(NGX_HAVE_EPOLLRDHUP)
-#define EPOLLRDHUP 0
-#endif
-
-
-#if (NGX_HAVE_KQUEUE)
-
-#define NGX_READ_EVENT EVFILT_READ
-#define NGX_WRITE_EVENT EVFILT_WRITE
-
-#undef NGX_VNODE_EVENT
-#define NGX_VNODE_EVENT EVFILT_VNODE
-
-/*
- * NGX_CLOSE_EVENT, NGX_LOWAT_EVENT, and NGX_FLUSH_EVENT are the module flags
- * and they must not go into a kernel so we need to choose the value
- * that must not interfere with any existent and future kqueue flags.
- * kqueue has such values - EV_FLAG1, EV_EOF, and EV_ERROR:
- * they are reserved and cleared on a kernel entrance.
- */
-#undef NGX_CLOSE_EVENT
-#define NGX_CLOSE_EVENT EV_EOF
-
-#undef NGX_LOWAT_EVENT
-#define NGX_LOWAT_EVENT EV_FLAG1
-
-#undef NGX_FLUSH_EVENT
-#define NGX_FLUSH_EVENT EV_ERROR
-
-#define NGX_LEVEL_EVENT 0
-#define NGX_ONESHOT_EVENT EV_ONESHOT
-#define NGX_CLEAR_EVENT EV_CLEAR
-
-#undef NGX_DISABLE_EVENT
-#define NGX_DISABLE_EVENT EV_DISABLE
-
-
-#elif (NGX_HAVE_DEVPOLL || NGX_HAVE_EVENTPORT)
-
-#define NGX_READ_EVENT POLLIN
-#define NGX_WRITE_EVENT POLLOUT
-
-#define NGX_LEVEL_EVENT 0
-#define NGX_ONESHOT_EVENT 1
-
-
-#elif (NGX_HAVE_EPOLL)
-
-#define NGX_READ_EVENT (EPOLLIN|EPOLLRDHUP)
-#define NGX_WRITE_EVENT EPOLLOUT
-
-#define NGX_LEVEL_EVENT 0
-#define NGX_CLEAR_EVENT EPOLLET
-#define NGX_ONESHOT_EVENT 0x70000000
-#if 0
-#define NGX_ONESHOT_EVENT EPOLLONESHOT
-#endif
-
-
-#elif (NGX_HAVE_POLL)
-
-#define NGX_READ_EVENT POLLIN
-#define NGX_WRITE_EVENT POLLOUT
-
-#define NGX_LEVEL_EVENT 0
-#define NGX_ONESHOT_EVENT 1
-
-
-#else /* select */
-
-#define NGX_READ_EVENT 0
-#define NGX_WRITE_EVENT 1
-
-#define NGX_LEVEL_EVENT 0
-#define NGX_ONESHOT_EVENT 1
-
-#endif /* NGX_HAVE_KQUEUE */
-
-
-#if (NGX_HAVE_IOCP)
-#define NGX_IOCP_ACCEPT 0
-#define NGX_IOCP_IO 1
-#define NGX_IOCP_CONNECT 2
-#endif
-
-
-#ifndef NGX_CLEAR_EVENT
-#define NGX_CLEAR_EVENT 0 /* dummy declaration */
-#endif
-
-
-#define ngx_process_changes ngx_event_actions.process_changes
-#define ngx_process_events ngx_event_actions.process_events
-#define ngx_done_events ngx_event_actions.done
-
-#define ngx_add_event ngx_event_actions.add
-#define ngx_del_event ngx_event_actions.del
-#define ngx_add_conn ngx_event_actions.add_conn
-#define ngx_del_conn ngx_event_actions.del_conn
-
-#define ngx_add_timer ngx_event_add_timer
-#define ngx_del_timer ngx_event_del_timer
-
-
-extern ngx_os_io_t ngx_io;
-
-#define ngx_recv ngx_io.recv
-#define ngx_recv_chain ngx_io.recv_chain
-#define ngx_udp_recv ngx_io.udp_recv
-#define ngx_send ngx_io.send
-#define ngx_send_chain ngx_io.send_chain
-
-
-#define NGX_EVENT_MODULE 0x544E5645 /* "EVNT" */
-#define NGX_EVENT_CONF 0x02000000
-
-
-typedef struct {
- ngx_uint_t connections;
- ngx_uint_t use;
-
- ngx_flag_t multi_accept;
- ngx_flag_t accept_mutex;
-
- ngx_msec_t accept_mutex_delay;
-
- u_char *name;
-
-#if (NGX_DEBUG)
- ngx_array_t debug_connection;
-#endif
-} ngx_event_conf_t;
-
-
-typedef struct {
- ngx_str_t *name;
-
- void *(*create_conf)(ngx_cycle_t *cycle);
- char *(*init_conf)(ngx_cycle_t *cycle, void *conf);
-
- ngx_event_actions_t actions;
-} ngx_event_module_t;
-
-
-extern ngx_atomic_t *ngx_connection_counter;
-
-extern ngx_atomic_t *ngx_accept_mutex_ptr;
-extern ngx_shmtx_t ngx_accept_mutex;
-extern ngx_uint_t ngx_use_accept_mutex;
-extern ngx_uint_t ngx_accept_events;
-extern ngx_uint_t ngx_accept_mutex_held;
-extern ngx_msec_t ngx_accept_mutex_delay;
-extern ngx_int_t ngx_accept_disabled;
-
-
-#if (NGX_STAT_STUB)
-
-extern ngx_atomic_t *ngx_stat_accepted;
-extern ngx_atomic_t *ngx_stat_handled;
-extern ngx_atomic_t *ngx_stat_requests;
-extern ngx_atomic_t *ngx_stat_active;
-extern ngx_atomic_t *ngx_stat_reading;
-extern ngx_atomic_t *ngx_stat_writing;
-extern ngx_atomic_t *ngx_stat_waiting;
-
-#endif
-
-
-#define NGX_UPDATE_TIME 1
-#define NGX_POST_EVENTS 2
-
-
-extern sig_atomic_t ngx_event_timer_alarm;
-extern ngx_uint_t ngx_event_flags;
-extern ngx_module_t ngx_events_module;
-extern ngx_module_t ngx_event_core_module;
-
-
-#define ngx_event_get_conf(conf_ctx, module) \
- (*(ngx_get_conf(conf_ctx, ngx_events_module))) [module.ctx_index];
-
-
-
-void ngx_event_accept(ngx_event_t *ev);
-ngx_int_t ngx_trylock_accept_mutex(ngx_cycle_t *cycle);
-u_char *ngx_accept_log_error(ngx_log_t *log, u_char *buf, size_t len);
-
-
-void ngx_process_events_and_timers(ngx_cycle_t *cycle);
-ngx_int_t ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags);
-ngx_int_t ngx_handle_write_event(ngx_event_t *wev, size_t lowat);
-
-
-#if (NGX_WIN32)
-void ngx_event_acceptex(ngx_event_t *ev);
-ngx_int_t ngx_event_post_acceptex(ngx_listening_t *ls, ngx_uint_t n);
-u_char *ngx_acceptex_log_error(ngx_log_t *log, u_char *buf, size_t len);
-#endif
-
-
-ngx_int_t ngx_send_lowat(ngx_connection_t *c, size_t lowat);
-
-
-/* used in ngx_log_debugX() */
-#define ngx_event_ident(p) ((ngx_connection_t *) (p))->fd
-
-
-#include <ngx_event_timer.h>
-#include <ngx_event_posted.h>
-#include <ngx_event_busy_lock.h>
-
-#if (NGX_WIN32)
-#include <ngx_iocp_module.h>
-#endif
-
-
-#endif /* _NGX_EVENT_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_accept.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_accept.c
deleted file mode 100644
index 6285baafba2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_accept.c
+++ /dev/null
@@ -1,508 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-static ngx_int_t ngx_enable_accept_events(ngx_cycle_t *cycle);
-static ngx_int_t ngx_disable_accept_events(ngx_cycle_t *cycle);
-static void ngx_close_accepted_connection(ngx_connection_t *c);
-
-
-void
-ngx_event_accept(ngx_event_t *ev)
-{
- socklen_t socklen;
- ngx_err_t err;
- ngx_log_t *log;
- ngx_uint_t level;
- ngx_socket_t s;
- ngx_event_t *rev, *wev;
- ngx_listening_t *ls;
- ngx_connection_t *c, *lc;
- ngx_event_conf_t *ecf;
- u_char sa[NGX_SOCKADDRLEN];
-#if (NGX_HAVE_ACCEPT4)
- static ngx_uint_t use_accept4 = 1;
-#endif
-
- if (ev->timedout) {
- if (ngx_enable_accept_events((ngx_cycle_t *) ngx_cycle) != NGX_OK) {
- return;
- }
-
- ev->timedout = 0;
- }
-
- ecf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_event_core_module);
-
- if (ngx_event_flags & NGX_USE_RTSIG_EVENT) {
- ev->available = 1;
-
- } else if (!(ngx_event_flags & NGX_USE_KQUEUE_EVENT)) {
- ev->available = ecf->multi_accept;
- }
-
- lc = ev->data;
- ls = lc->listening;
- ev->ready = 0;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "accept on %V, ready: %d", &ls->addr_text, ev->available);
-
- do {
- socklen = NGX_SOCKADDRLEN;
-
-#if (NGX_HAVE_ACCEPT4)
- if (use_accept4) {
- s = accept4(lc->fd, (struct sockaddr *) sa, &socklen,
- SOCK_NONBLOCK);
- } else {
- s = accept(lc->fd, (struct sockaddr *) sa, &socklen);
- }
-#else
- s = accept(lc->fd, (struct sockaddr *) sa, &socklen);
-#endif
-
- if (s == (ngx_socket_t) -1) {
- err = ngx_socket_errno;
-
- if (err == NGX_EAGAIN) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, err,
- "accept() not ready");
- return;
- }
-
- level = NGX_LOG_ALERT;
-
- if (err == NGX_ECONNABORTED) {
- level = NGX_LOG_ERR;
-
- } else if (err == NGX_EMFILE || err == NGX_ENFILE) {
- level = NGX_LOG_CRIT;
- }
-
-#if (NGX_HAVE_ACCEPT4)
- ngx_log_error(level, ev->log, err,
- use_accept4 ? "accept4() failed" : "accept() failed");
-
- if (use_accept4 && err == NGX_ENOSYS) {
- use_accept4 = 0;
- ngx_inherited_nonblocking = 0;
- continue;
- }
-#else
- ngx_log_error(level, ev->log, err, "accept() failed");
-#endif
-
- if (err == NGX_ECONNABORTED) {
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- ev->available--;
- }
-
- if (ev->available) {
- continue;
- }
- }
-
- if (err == NGX_EMFILE || err == NGX_ENFILE) {
- if (ngx_disable_accept_events((ngx_cycle_t *) ngx_cycle)
- != NGX_OK)
- {
- return;
- }
-
- if (ngx_use_accept_mutex) {
- if (ngx_accept_mutex_held) {
- ngx_shmtx_unlock(&ngx_accept_mutex);
- ngx_accept_mutex_held = 0;
- }
-
- ngx_accept_disabled = 1;
-
- } else {
- ngx_add_timer(ev, ecf->accept_mutex_delay);
- }
- }
-
- return;
- }
-
-#if (NGX_STAT_STUB)
- (void) ngx_atomic_fetch_add(ngx_stat_accepted, 1);
-#endif
-
- ngx_accept_disabled = ngx_cycle->connection_n / 8
- - ngx_cycle->free_connection_n;
-
- c = ngx_get_connection(s, ev->log);
-
- if (c == NULL) {
- if (ngx_close_socket(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
- ngx_close_socket_n " failed");
- }
-
- return;
- }
-
-#if (NGX_STAT_STUB)
- (void) ngx_atomic_fetch_add(ngx_stat_active, 1);
-#endif
-
- c->pool = ngx_create_pool(ls->pool_size, ev->log);
- if (c->pool == NULL) {
- ngx_close_accepted_connection(c);
- return;
- }
-
- c->sockaddr = ngx_palloc(c->pool, socklen);
- if (c->sockaddr == NULL) {
- ngx_close_accepted_connection(c);
- return;
- }
-
- ngx_memcpy(c->sockaddr, sa, socklen);
-
- log = ngx_palloc(c->pool, sizeof(ngx_log_t));
- if (log == NULL) {
- ngx_close_accepted_connection(c);
- return;
- }
-
- /* set a blocking mode for aio and non-blocking mode for others */
-
- if (ngx_inherited_nonblocking) {
- if (ngx_event_flags & NGX_USE_AIO_EVENT) {
- if (ngx_blocking(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
- ngx_blocking_n " failed");
- ngx_close_accepted_connection(c);
- return;
- }
- }
-
- } else {
- if (!(ngx_event_flags & (NGX_USE_AIO_EVENT|NGX_USE_RTSIG_EVENT))) {
- if (ngx_nonblocking(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
- ngx_nonblocking_n " failed");
- ngx_close_accepted_connection(c);
- return;
- }
- }
- }
-
- *log = ls->log;
-
- c->recv = ngx_recv;
- c->send = ngx_send;
- c->recv_chain = ngx_recv_chain;
- c->send_chain = ngx_send_chain;
-
- c->log = log;
- c->pool->log = log;
-
- c->socklen = socklen;
- c->listening = ls;
- c->local_sockaddr = ls->sockaddr;
- c->local_socklen = ls->socklen;
-
- c->unexpected_eof = 1;
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- if (c->sockaddr->sa_family == AF_UNIX) {
- c->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
- c->tcp_nodelay = NGX_TCP_NODELAY_DISABLED;
-#if (NGX_SOLARIS)
- /* Solaris's sendfilev() supports AF_NCA, AF_INET, and AF_INET6 */
- c->sendfile = 0;
-#endif
- }
-#endif
-
- rev = c->read;
- wev = c->write;
-
- wev->ready = 1;
-
- if (ngx_event_flags & (NGX_USE_AIO_EVENT|NGX_USE_RTSIG_EVENT)) {
- /* rtsig, aio, iocp */
- rev->ready = 1;
- }
-
- if (ev->deferred_accept) {
- rev->ready = 1;
-#if (NGX_HAVE_KQUEUE)
- rev->available = 1;
-#endif
- }
-
- rev->log = log;
- wev->log = log;
-
- /*
- * TODO: MT: - ngx_atomic_fetch_add()
- * or protection by critical section or light mutex
- *
- * TODO: MP: - allocated in a shared memory
- * - ngx_atomic_fetch_add()
- * or protection by critical section or light mutex
- */
-
- c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1);
-
-#if (NGX_STAT_STUB)
- (void) ngx_atomic_fetch_add(ngx_stat_handled, 1);
-#endif
-
- if (ls->addr_ntop) {
- c->addr_text.data = ngx_pnalloc(c->pool, ls->addr_text_max_len);
- if (c->addr_text.data == NULL) {
- ngx_close_accepted_connection(c);
- return;
- }
-
- c->addr_text.len = ngx_sock_ntop(c->sockaddr, c->socklen,
- c->addr_text.data,
- ls->addr_text_max_len, 0);
- if (c->addr_text.len == 0) {
- ngx_close_accepted_connection(c);
- return;
- }
- }
-
-#if (NGX_DEBUG)
- {
-
- ngx_str_t addr;
- struct sockaddr_in *sin;
- ngx_cidr_t *cidr;
- ngx_uint_t i;
- u_char text[NGX_SOCKADDR_STRLEN];
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
- ngx_uint_t n;
-#endif
-
- cidr = ecf->debug_connection.elts;
- for (i = 0; i < ecf->debug_connection.nelts; i++) {
- if (cidr[i].family != (ngx_uint_t) c->sockaddr->sa_family) {
- goto next;
- }
-
- switch (cidr[i].family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) c->sockaddr;
- for (n = 0; n < 16; n++) {
- if ((sin6->sin6_addr.s6_addr[n]
- & cidr[i].u.in6.mask.s6_addr[n])
- != cidr[i].u.in6.addr.s6_addr[n])
- {
- goto next;
- }
- }
- break;
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) c->sockaddr;
- if ((sin->sin_addr.s_addr & cidr[i].u.in.mask)
- != cidr[i].u.in.addr)
- {
- goto next;
- }
- break;
- }
-
- log->log_level = NGX_LOG_DEBUG_CONNECTION|NGX_LOG_DEBUG_ALL;
- break;
-
- next:
- continue;
- }
-
- if (log->log_level & NGX_LOG_DEBUG_EVENT) {
- addr.data = text;
- addr.len = ngx_sock_ntop(c->sockaddr, c->socklen, text,
- NGX_SOCKADDR_STRLEN, 1);
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, log, 0,
- "*%uA accept: %V fd:%d", c->number, &addr, s);
- }
-
- }
-#endif
-
- if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) {
- if (ngx_add_conn(c) == NGX_ERROR) {
- ngx_close_accepted_connection(c);
- return;
- }
- }
-
- log->data = NULL;
- log->handler = NULL;
-
- ls->handler(c);
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- ev->available--;
- }
-
- } while (ev->available);
-}
-
-
-ngx_int_t
-ngx_trylock_accept_mutex(ngx_cycle_t *cycle)
-{
- if (ngx_shmtx_trylock(&ngx_accept_mutex)) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "accept mutex locked");
-
- if (ngx_accept_mutex_held
- && ngx_accept_events == 0
- && !(ngx_event_flags & NGX_USE_RTSIG_EVENT))
- {
- return NGX_OK;
- }
-
- if (ngx_enable_accept_events(cycle) == NGX_ERROR) {
- ngx_shmtx_unlock(&ngx_accept_mutex);
- return NGX_ERROR;
- }
-
- ngx_accept_events = 0;
- ngx_accept_mutex_held = 1;
-
- return NGX_OK;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "accept mutex lock failed: %ui", ngx_accept_mutex_held);
-
- if (ngx_accept_mutex_held) {
- if (ngx_disable_accept_events(cycle) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- ngx_accept_mutex_held = 0;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_enable_accept_events(ngx_cycle_t *cycle)
-{
- ngx_uint_t i;
- ngx_listening_t *ls;
- ngx_connection_t *c;
-
- ls = cycle->listening.elts;
- for (i = 0; i < cycle->listening.nelts; i++) {
-
- c = ls[i].connection;
-
- if (c->read->active) {
- continue;
- }
-
- if (ngx_event_flags & NGX_USE_RTSIG_EVENT) {
-
- if (ngx_add_conn(c) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- } else {
- if (ngx_add_event(c->read, NGX_READ_EVENT, 0) == NGX_ERROR) {
- return NGX_ERROR;
- }
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_disable_accept_events(ngx_cycle_t *cycle)
-{
- ngx_uint_t i;
- ngx_listening_t *ls;
- ngx_connection_t *c;
-
- ls = cycle->listening.elts;
- for (i = 0; i < cycle->listening.nelts; i++) {
-
- c = ls[i].connection;
-
- if (!c->read->active) {
- continue;
- }
-
- if (ngx_event_flags & NGX_USE_RTSIG_EVENT) {
- if (ngx_del_conn(c, NGX_DISABLE_EVENT) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- } else {
- if (ngx_del_event(c->read, NGX_READ_EVENT, NGX_DISABLE_EVENT)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
- }
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_close_accepted_connection(ngx_connection_t *c)
-{
- ngx_socket_t fd;
-
- ngx_free_connection(c);
-
- fd = c->fd;
- c->fd = (ngx_socket_t) -1;
-
- if (ngx_close_socket(fd) == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_socket_errno,
- ngx_close_socket_n " failed");
- }
-
- if (c->pool) {
- ngx_destroy_pool(c->pool);
- }
-
-#if (NGX_STAT_STUB)
- (void) ngx_atomic_fetch_add(ngx_stat_active, -1);
-#endif
-}
-
-
-u_char *
-ngx_accept_log_error(ngx_log_t *log, u_char *buf, size_t len)
-{
- return ngx_snprintf(buf, len, " while accepting new connection on %V",
- log->data);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.c
deleted file mode 100644
index fdac0da8fd2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.c
+++ /dev/null
@@ -1,286 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-static ngx_int_t ngx_event_busy_lock_look_cacheable(ngx_event_busy_lock_t *bl,
- ngx_event_busy_lock_ctx_t *ctx);
-static void ngx_event_busy_lock_handler(ngx_event_t *ev);
-static void ngx_event_busy_lock_posted_handler(ngx_event_t *ev);
-
-
-/*
- * NGX_OK: the busy lock is held
- * NGX_AGAIN: the all busy locks are held but we will wait the specified time
- * NGX_BUSY: ctx->timer == 0: there are many the busy locks
- * ctx->timer != 0: there are many the waiting locks
- */
-
-ngx_int_t
-ngx_event_busy_lock(ngx_event_busy_lock_t *bl, ngx_event_busy_lock_ctx_t *ctx)
-{
- ngx_int_t rc;
-
- ngx_mutex_lock(bl->mutex);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ctx->event->log, 0,
- "event busy lock: b:%d mb:%d",
- bl->busy, bl->max_busy);
-
- if (bl->busy < bl->max_busy) {
- bl->busy++;
-
- rc = NGX_OK;
-
- } else if (ctx->timer && bl->waiting < bl->max_waiting) {
- bl->waiting++;
- ngx_add_timer(ctx->event, ctx->timer);
- ctx->event->handler = ngx_event_busy_lock_handler;
-
- if (bl->events) {
- bl->last->next = ctx;
-
- } else {
- bl->events = ctx;
- }
-
- bl->last = ctx;
-
- rc = NGX_AGAIN;
-
- } else {
- rc = NGX_BUSY;
- }
-
- ngx_mutex_unlock(bl->mutex);
-
- return rc;
-}
-
-
-ngx_int_t
-ngx_event_busy_lock_cacheable(ngx_event_busy_lock_t *bl,
- ngx_event_busy_lock_ctx_t *ctx)
-{
- ngx_int_t rc;
-
- ngx_mutex_lock(bl->mutex);
-
- rc = ngx_event_busy_lock_look_cacheable(bl, ctx);
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ctx->event->log, 0,
- "event busy lock: %d w:%d mw:%d",
- rc, bl->waiting, bl->max_waiting);
-
- /*
- * NGX_OK: no the same request, there is free slot and we locked it
- * NGX_BUSY: no the same request and there is no free slot
- * NGX_AGAIN: the same request is processing
- */
-
- if (rc == NGX_AGAIN) {
-
- if (ctx->timer && bl->waiting < bl->max_waiting) {
- bl->waiting++;
- ngx_add_timer(ctx->event, ctx->timer);
- ctx->event->handler = ngx_event_busy_lock_handler;
-
- if (bl->events == NULL) {
- bl->events = ctx;
- } else {
- bl->last->next = ctx;
- }
- bl->last = ctx;
-
- } else {
- rc = NGX_BUSY;
- }
- }
-
- ngx_mutex_unlock(bl->mutex);
-
- return rc;
-}
-
-
-void
-ngx_event_busy_unlock(ngx_event_busy_lock_t *bl,
- ngx_event_busy_lock_ctx_t *ctx)
-{
- ngx_event_t *ev;
- ngx_event_busy_lock_ctx_t *wakeup;
-
- ngx_mutex_lock(bl->mutex);
-
- if (bl->events) {
- wakeup = bl->events;
- bl->events = bl->events->next;
-
- } else {
- wakeup = NULL;
- bl->busy--;
- }
-
- /*
- * MP: all ctx's and their queue must be in shared memory,
- * each ctx has pid to wake up
- */
-
- if (wakeup == NULL) {
- ngx_mutex_unlock(bl->mutex);
- return;
- }
-
- if (ctx->md5) {
- for (wakeup = bl->events; wakeup; wakeup = wakeup->next) {
- if (wakeup->md5 == NULL || wakeup->slot != ctx->slot) {
- continue;
- }
-
- wakeup->handler = ngx_event_busy_lock_posted_handler;
- wakeup->cache_updated = 1;
-
- ev = wakeup->event;
-
- ngx_post_event(ev, &ngx_posted_events);
- }
-
- ngx_mutex_unlock(bl->mutex);
-
- } else {
- bl->waiting--;
-
- ngx_mutex_unlock(bl->mutex);
-
- wakeup->handler = ngx_event_busy_lock_posted_handler;
- wakeup->locked = 1;
-
- ev = wakeup->event;
-
- if (ev->timer_set) {
- ngx_del_timer(ev);
- }
-
- ngx_post_event(ev, &ngx_posted_events);
- }
-}
-
-
-void
-ngx_event_busy_lock_cancel(ngx_event_busy_lock_t *bl,
- ngx_event_busy_lock_ctx_t *ctx)
-{
- ngx_event_busy_lock_ctx_t *c, *p;
-
- ngx_mutex_lock(bl->mutex);
-
- bl->waiting--;
-
- if (ctx == bl->events) {
- bl->events = ctx->next;
-
- } else {
- p = bl->events;
- for (c = bl->events->next; c; c = c->next) {
- if (c == ctx) {
- p->next = ctx->next;
- break;
- }
- p = c;
- }
- }
-
- ngx_mutex_unlock(bl->mutex);
-}
-
-
-static ngx_int_t
-ngx_event_busy_lock_look_cacheable(ngx_event_busy_lock_t *bl,
- ngx_event_busy_lock_ctx_t *ctx)
-{
- ngx_int_t free;
- ngx_uint_t i, bit, cacheable, mask;
-
- bit = 0;
- cacheable = 0;
- free = -1;
-
-#if (NGX_SUPPRESS_WARN)
- mask = 0;
-#endif
-
- for (i = 0; i < bl->max_busy; i++) {
-
- if ((bit & 7) == 0) {
- mask = bl->md5_mask[i / 8];
- }
-
- if (mask & 1) {
- if (ngx_memcmp(&bl->md5[i * 16], ctx->md5, 16) == 0) {
- ctx->waiting = 1;
- ctx->slot = i;
- return NGX_AGAIN;
- }
- cacheable++;
-
- } else if (free == -1) {
- free = i;
- }
-
- if (cacheable == bl->cacheable) {
- if (free == -1 && cacheable < bl->max_busy) {
- free = i + 1;
- }
-
- break;
- }
-
- mask >>= 1;
- bit++;
- }
-
- if (free == -1) {
- return NGX_BUSY;
- }
-
-#if 0
- if (bl->busy == bl->max_busy) {
- return NGX_BUSY;
- }
-#endif
-
- ngx_memcpy(&bl->md5[free * 16], ctx->md5, 16);
- bl->md5_mask[free / 8] |= 1 << (free & 7);
- ctx->slot = free;
-
- bl->cacheable++;
- bl->busy++;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_event_busy_lock_handler(ngx_event_t *ev)
-{
- ev->handler = ngx_event_busy_lock_posted_handler;
-
- ngx_post_event(ev, &ngx_posted_events);
-}
-
-
-static void
-ngx_event_busy_lock_posted_handler(ngx_event_t *ev)
-{
- ngx_event_busy_lock_ctx_t *ctx;
-
- ctx = ev->data;
- ctx->handler(ev);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.h
deleted file mode 100644
index 254c233e776..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_busy_lock.h
+++ /dev/null
@@ -1,65 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_EVENT_BUSY_LOCK_H_INCLUDED_
-#define _NGX_EVENT_BUSY_LOCK_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-typedef struct ngx_event_busy_lock_ctx_s ngx_event_busy_lock_ctx_t;
-
-struct ngx_event_busy_lock_ctx_s {
- ngx_event_t *event;
- ngx_event_handler_pt handler;
- void *data;
- ngx_msec_t timer;
-
- unsigned locked:1;
- unsigned waiting:1;
- unsigned cache_updated:1;
-
- char *md5;
- ngx_int_t slot;
-
- ngx_event_busy_lock_ctx_t *next;
-};
-
-
-typedef struct {
- u_char *md5_mask;
- char *md5;
- ngx_uint_t cacheable;
-
- ngx_uint_t busy;
- ngx_uint_t max_busy;
-
- ngx_uint_t waiting;
- ngx_uint_t max_waiting;
-
- ngx_event_busy_lock_ctx_t *events;
- ngx_event_busy_lock_ctx_t *last;
-
-#if (NGX_THREADS)
- ngx_mutex_t *mutex;
-#endif
-} ngx_event_busy_lock_t;
-
-
-ngx_int_t ngx_event_busy_lock(ngx_event_busy_lock_t *bl,
- ngx_event_busy_lock_ctx_t *ctx);
-ngx_int_t ngx_event_busy_lock_cacheable(ngx_event_busy_lock_t *bl,
- ngx_event_busy_lock_ctx_t *ctx);
-void ngx_event_busy_unlock(ngx_event_busy_lock_t *bl,
- ngx_event_busy_lock_ctx_t *ctx);
-void ngx_event_busy_lock_cancel(ngx_event_busy_lock_t *bl,
- ngx_event_busy_lock_ctx_t *ctx);
-
-
-#endif /* _NGX_EVENT_BUSY_LOCK_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.c
deleted file mode 100644
index a09d2e5d704..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.c
+++ /dev/null
@@ -1,247 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_event_connect.h>
-
-
-ngx_int_t
-ngx_event_connect_peer(ngx_peer_connection_t *pc)
-{
- int rc;
- ngx_int_t event;
- ngx_err_t err;
- ngx_uint_t level;
- ngx_socket_t s;
- ngx_event_t *rev, *wev;
- ngx_connection_t *c;
-
- rc = pc->get(pc, pc->data);
- if (rc != NGX_OK) {
- return rc;
- }
-
- s = ngx_socket(pc->sockaddr->sa_family, SOCK_STREAM, 0);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pc->log, 0, "socket %d", s);
-
- if (s == (ngx_socket_t) -1) {
- ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
- ngx_socket_n " failed");
- return NGX_ERROR;
- }
-
-
- c = ngx_get_connection(s, pc->log);
-
- if (c == NULL) {
- if (ngx_close_socket(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
- ngx_close_socket_n "failed");
- }
-
- return NGX_ERROR;
- }
-
- if (pc->rcvbuf) {
- if (setsockopt(s, SOL_SOCKET, SO_RCVBUF,
- (const void *) &pc->rcvbuf, sizeof(int)) == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
- "setsockopt(SO_RCVBUF) failed");
- goto failed;
- }
- }
-
- if (ngx_nonblocking(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
- ngx_nonblocking_n " failed");
-
- goto failed;
- }
-
- if (pc->local) {
- if (bind(s, pc->local->sockaddr, pc->local->socklen) == -1) {
- ngx_log_error(NGX_LOG_CRIT, pc->log, ngx_socket_errno,
- "bind(%V) failed", &pc->local->name);
-
- goto failed;
- }
- }
-
- c->recv = ngx_recv;
- c->send = ngx_send;
- c->recv_chain = ngx_recv_chain;
- c->send_chain = ngx_send_chain;
-
- c->sendfile = 1;
-
- c->log_error = pc->log_error;
-
- if (pc->sockaddr->sa_family == AF_UNIX) {
- c->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
- c->tcp_nodelay = NGX_TCP_NODELAY_DISABLED;
-
-#if (NGX_SOLARIS)
- /* Solaris's sendfilev() supports AF_NCA, AF_INET, and AF_INET6 */
- c->sendfile = 0;
-#endif
- }
-
- rev = c->read;
- wev = c->write;
-
- rev->log = pc->log;
- wev->log = pc->log;
-
- pc->connection = c;
-
- c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1);
-
- if (ngx_add_conn) {
- if (ngx_add_conn(c) == NGX_ERROR) {
- goto failed;
- }
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, pc->log, 0,
- "connect to %V, fd:%d #%uA", pc->name, s, c->number);
-
- rc = connect(s, pc->sockaddr, pc->socklen);
-
- if (rc == -1) {
- err = ngx_socket_errno;
-
-
- if (err != NGX_EINPROGRESS
-#if (NGX_WIN32)
- /* Winsock returns WSAEWOULDBLOCK (NGX_EAGAIN) */
- && err != NGX_EAGAIN
-#endif
- )
- {
- if (err == NGX_ECONNREFUSED
-#if (NGX_LINUX)
- /*
- * Linux returns EAGAIN instead of ECONNREFUSED
- * for unix sockets if listen queue is full
- */
- || err == NGX_EAGAIN
-#endif
- || err == NGX_ECONNRESET
- || err == NGX_ENETDOWN
- || err == NGX_ENETUNREACH
- || err == NGX_EHOSTDOWN
- || err == NGX_EHOSTUNREACH)
- {
- level = NGX_LOG_ERR;
-
- } else {
- level = NGX_LOG_CRIT;
- }
-
- ngx_log_error(level, c->log, err, "connect() to %V failed",
- pc->name);
-
- ngx_close_connection(c);
- pc->connection = NULL;
-
- return NGX_DECLINED;
- }
- }
-
- if (ngx_add_conn) {
- if (rc == -1) {
-
- /* NGX_EINPROGRESS */
-
- return NGX_AGAIN;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pc->log, 0, "connected");
-
- wev->ready = 1;
-
- return NGX_OK;
- }
-
- if (ngx_event_flags & NGX_USE_AIO_EVENT) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pc->log, ngx_socket_errno,
- "connect(): %d", rc);
-
- /* aio, iocp */
-
- if (ngx_blocking(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
- ngx_blocking_n " failed");
- goto failed;
- }
-
- /*
- * FreeBSD's aio allows to post an operation on non-connected socket.
- * NT does not support it.
- *
- * TODO: check in Win32, etc. As workaround we can use NGX_ONESHOT_EVENT
- */
-
- rev->ready = 1;
- wev->ready = 1;
-
- return NGX_OK;
- }
-
- if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
-
- /* kqueue */
-
- event = NGX_CLEAR_EVENT;
-
- } else {
-
- /* select, poll, /dev/poll */
-
- event = NGX_LEVEL_EVENT;
- }
-
- if (ngx_add_event(rev, NGX_READ_EVENT, event) != NGX_OK) {
- goto failed;
- }
-
- if (rc == -1) {
-
- /* NGX_EINPROGRESS */
-
- if (ngx_add_event(wev, NGX_WRITE_EVENT, event) != NGX_OK) {
- goto failed;
- }
-
- return NGX_AGAIN;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, pc->log, 0, "connected");
-
- wev->ready = 1;
-
- return NGX_OK;
-
-failed:
-
- ngx_close_connection(c);
- pc->connection = NULL;
-
- return NGX_ERROR;
-}
-
-
-ngx_int_t
-ngx_event_get_peer(ngx_peer_connection_t *pc, void *data)
-{
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.h
deleted file mode 100644
index e73825885fc..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_connect.h
+++ /dev/null
@@ -1,77 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_EVENT_CONNECT_H_INCLUDED_
-#define _NGX_EVENT_CONNECT_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#define NGX_PEER_KEEPALIVE 1
-#define NGX_PEER_NEXT 2
-#define NGX_PEER_FAILED 4
-
-
-typedef struct ngx_peer_connection_s ngx_peer_connection_t;
-
-typedef ngx_int_t (*ngx_event_get_peer_pt)(ngx_peer_connection_t *pc,
- void *data);
-typedef void (*ngx_event_free_peer_pt)(ngx_peer_connection_t *pc, void *data,
- ngx_uint_t state);
-#if (NGX_SSL)
-
-typedef ngx_int_t (*ngx_event_set_peer_session_pt)(ngx_peer_connection_t *pc,
- void *data);
-typedef void (*ngx_event_save_peer_session_pt)(ngx_peer_connection_t *pc,
- void *data);
-#endif
-
-
-struct ngx_peer_connection_s {
- ngx_connection_t *connection;
-
- struct sockaddr *sockaddr;
- socklen_t socklen;
- ngx_str_t *name;
-
- ngx_uint_t tries;
- ngx_msec_t start_time;
-
- ngx_event_get_peer_pt get;
- ngx_event_free_peer_pt free;
- void *data;
-
-#if (NGX_SSL)
- ngx_event_set_peer_session_pt set_session;
- ngx_event_save_peer_session_pt save_session;
-#endif
-
-#if (NGX_THREADS)
- ngx_atomic_t *lock;
-#endif
-
- ngx_addr_t *local;
-
- int rcvbuf;
-
- ngx_log_t *log;
-
- unsigned cached:1;
-
- /* ngx_connection_log_error_e */
- unsigned log_error:2;
-};
-
-
-ngx_int_t ngx_event_connect_peer(ngx_peer_connection_t *pc);
-ngx_int_t ngx_event_get_peer(ngx_peer_connection_t *pc, void *data);
-
-
-#endif /* _NGX_EVENT_CONNECT_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_mutex.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_mutex.c
deleted file mode 100644
index 98efbb0d87e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_mutex.c
+++ /dev/null
@@ -1,70 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-ngx_int_t ngx_event_mutex_timedlock(ngx_event_mutex_t *m, ngx_msec_t timer,
- ngx_event_t *ev)
-{
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "lock event mutex %p lock:%XD", m, m->lock);
-
- if (m->lock) {
-
- if (m->events == NULL) {
- m->events = ev;
-
- } else {
- m->last->next = ev;
- }
-
- m->last = ev;
- ev->next = NULL;
-
-#if (NGX_THREADS0)
- ev->light = 1;
-#endif
-
- ngx_add_timer(ev, timer);
-
- return NGX_AGAIN;
- }
-
- m->lock = 1;
-
- return NGX_OK;
-}
-
-
-ngx_int_t ngx_event_mutex_unlock(ngx_event_mutex_t *m, ngx_log_t *log)
-{
- ngx_event_t *ev;
-
- if (m->lock == 0) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "tring to unlock the free event mutex %p", m);
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, log, 0,
- "unlock event mutex %p, next event: %p", m, m->events);
-
- m->lock = 0;
-
- if (m->events) {
- ev = m->events;
- m->events = ev->next;
-
- ev->next = ngx_posted_events;
- ngx_posted_events = ev;
- }
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.c
deleted file mode 100644
index 975a8e00111..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.c
+++ /dev/null
@@ -1,3455 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#define NGX_SSL_PASSWORD_BUFFER_SIZE 4096
-
-
-typedef struct {
- ngx_uint_t engine; /* unsigned engine:1; */
-} ngx_openssl_conf_t;
-
-
-static int ngx_ssl_password_callback(char *buf, int size, int rwflag,
- void *userdata);
-static int ngx_ssl_verify_callback(int ok, X509_STORE_CTX *x509_store);
-static void ngx_ssl_info_callback(const ngx_ssl_conn_t *ssl_conn, int where,
- int ret);
-static void ngx_ssl_passwords_cleanup(void *data);
-static void ngx_ssl_handshake_handler(ngx_event_t *ev);
-static ngx_int_t ngx_ssl_handle_recv(ngx_connection_t *c, int n);
-static void ngx_ssl_write_handler(ngx_event_t *wev);
-static void ngx_ssl_read_handler(ngx_event_t *rev);
-static void ngx_ssl_shutdown_handler(ngx_event_t *ev);
-static void ngx_ssl_connection_error(ngx_connection_t *c, int sslerr,
- ngx_err_t err, char *text);
-static void ngx_ssl_clear_error(ngx_log_t *log);
-
-static ngx_int_t ngx_ssl_session_id_context(ngx_ssl_t *ssl,
- ngx_str_t *sess_ctx);
-ngx_int_t ngx_ssl_session_cache_init(ngx_shm_zone_t *shm_zone, void *data);
-static int ngx_ssl_new_session(ngx_ssl_conn_t *ssl_conn,
- ngx_ssl_session_t *sess);
-static ngx_ssl_session_t *ngx_ssl_get_cached_session(ngx_ssl_conn_t *ssl_conn,
- u_char *id, int len, int *copy);
-static void ngx_ssl_remove_session(SSL_CTX *ssl, ngx_ssl_session_t *sess);
-static void ngx_ssl_expire_sessions(ngx_ssl_session_cache_t *cache,
- ngx_slab_pool_t *shpool, ngx_uint_t n);
-static void ngx_ssl_session_rbtree_insert_value(ngx_rbtree_node_t *temp,
- ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel);
-
-#ifdef SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB
-static int ngx_ssl_session_ticket_key_callback(ngx_ssl_conn_t *ssl_conn,
- unsigned char *name, unsigned char *iv, EVP_CIPHER_CTX *ectx,
- HMAC_CTX *hctx, int enc);
-#endif
-
-#if (OPENSSL_VERSION_NUMBER < 0x10002002L || defined LIBRESSL_VERSION_NUMBER)
-static ngx_int_t ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *str);
-#endif
-
-static void *ngx_openssl_create_conf(ngx_cycle_t *cycle);
-static char *ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static void ngx_openssl_exit(ngx_cycle_t *cycle);
-
-
-static ngx_command_t ngx_openssl_commands[] = {
-
- { ngx_string("ssl_engine"),
- NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
- ngx_openssl_engine,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_core_module_t ngx_openssl_module_ctx = {
- ngx_string("openssl"),
- ngx_openssl_create_conf,
- NULL
-};
-
-
-ngx_module_t ngx_openssl_module = {
- NGX_MODULE_V1,
- &ngx_openssl_module_ctx, /* module context */
- ngx_openssl_commands, /* module directives */
- NGX_CORE_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- ngx_openssl_exit, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-int ngx_ssl_connection_index;
-int ngx_ssl_server_conf_index;
-int ngx_ssl_session_cache_index;
-int ngx_ssl_session_ticket_keys_index;
-int ngx_ssl_certificate_index;
-int ngx_ssl_stapling_index;
-
-
-ngx_int_t
-ngx_ssl_init(ngx_log_t *log)
-{
-#ifndef OPENSSL_IS_BORINGSSL
- OPENSSL_config(NULL);
-#endif
-
- SSL_library_init();
- SSL_load_error_strings();
-
- OpenSSL_add_all_algorithms();
-
-#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
-#ifndef SSL_OP_NO_COMPRESSION
- {
- /*
- * Disable gzip compression in OpenSSL prior to 1.0.0 version,
- * this saves about 522K per connection.
- */
- int n;
- STACK_OF(SSL_COMP) *ssl_comp_methods;
-
- ssl_comp_methods = SSL_COMP_get_compression_methods();
- n = sk_SSL_COMP_num(ssl_comp_methods);
-
- while (n--) {
- (void) sk_SSL_COMP_pop(ssl_comp_methods);
- }
- }
-#endif
-#endif
-
- ngx_ssl_connection_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL);
-
- if (ngx_ssl_connection_index == -1) {
- ngx_ssl_error(NGX_LOG_ALERT, log, 0, "SSL_get_ex_new_index() failed");
- return NGX_ERROR;
- }
-
- ngx_ssl_server_conf_index = SSL_CTX_get_ex_new_index(0, NULL, NULL, NULL,
- NULL);
- if (ngx_ssl_server_conf_index == -1) {
- ngx_ssl_error(NGX_LOG_ALERT, log, 0,
- "SSL_CTX_get_ex_new_index() failed");
- return NGX_ERROR;
- }
-
- ngx_ssl_session_cache_index = SSL_CTX_get_ex_new_index(0, NULL, NULL, NULL,
- NULL);
- if (ngx_ssl_session_cache_index == -1) {
- ngx_ssl_error(NGX_LOG_ALERT, log, 0,
- "SSL_CTX_get_ex_new_index() failed");
- return NGX_ERROR;
- }
-
- ngx_ssl_session_ticket_keys_index = SSL_CTX_get_ex_new_index(0, NULL, NULL,
- NULL, NULL);
- if (ngx_ssl_session_ticket_keys_index == -1) {
- ngx_ssl_error(NGX_LOG_ALERT, log, 0,
- "SSL_CTX_get_ex_new_index() failed");
- return NGX_ERROR;
- }
-
- ngx_ssl_certificate_index = SSL_CTX_get_ex_new_index(0, NULL, NULL, NULL,
- NULL);
- if (ngx_ssl_certificate_index == -1) {
- ngx_ssl_error(NGX_LOG_ALERT, log, 0,
- "SSL_CTX_get_ex_new_index() failed");
- return NGX_ERROR;
- }
-
- ngx_ssl_stapling_index = SSL_CTX_get_ex_new_index(0, NULL, NULL, NULL,
- NULL);
- if (ngx_ssl_stapling_index == -1) {
- ngx_ssl_error(NGX_LOG_ALERT, log, 0,
- "SSL_CTX_get_ex_new_index() failed");
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_create(ngx_ssl_t *ssl, ngx_uint_t protocols, void *data)
-{
- ssl->ctx = SSL_CTX_new(SSLv23_method());
-
- if (ssl->ctx == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0, "SSL_CTX_new() failed");
- return NGX_ERROR;
- }
-
- if (SSL_CTX_set_ex_data(ssl->ctx, ngx_ssl_server_conf_index, data) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_set_ex_data() failed");
- return NGX_ERROR;
- }
-
- ssl->buffer_size = NGX_SSL_BUFSIZE;
-
- /* client side options */
-
-#ifdef SSL_OP_MICROSOFT_SESS_ID_BUG
- SSL_CTX_set_options(ssl->ctx, SSL_OP_MICROSOFT_SESS_ID_BUG);
-#endif
-
-#ifdef SSL_OP_NETSCAPE_CHALLENGE_BUG
- SSL_CTX_set_options(ssl->ctx, SSL_OP_NETSCAPE_CHALLENGE_BUG);
-#endif
-
- /* server side options */
-
-#ifdef SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
- SSL_CTX_set_options(ssl->ctx, SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG);
-#endif
-
-#ifdef SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
- SSL_CTX_set_options(ssl->ctx, SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER);
-#endif
-
-#ifdef SSL_OP_MSIE_SSLV2_RSA_PADDING
- /* this option allow a potential SSL 2.0 rollback (CAN-2005-2969) */
- SSL_CTX_set_options(ssl->ctx, SSL_OP_MSIE_SSLV2_RSA_PADDING);
-#endif
-
-#ifdef SSL_OP_SSLEAY_080_CLIENT_DH_BUG
- SSL_CTX_set_options(ssl->ctx, SSL_OP_SSLEAY_080_CLIENT_DH_BUG);
-#endif
-
-#ifdef SSL_OP_TLS_D5_BUG
- SSL_CTX_set_options(ssl->ctx, SSL_OP_TLS_D5_BUG);
-#endif
-
-#ifdef SSL_OP_TLS_BLOCK_PADDING_BUG
- SSL_CTX_set_options(ssl->ctx, SSL_OP_TLS_BLOCK_PADDING_BUG);
-#endif
-
-#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
- SSL_CTX_set_options(ssl->ctx, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS);
-#endif
-
- SSL_CTX_set_options(ssl->ctx, SSL_OP_SINGLE_DH_USE);
-
- if (!(protocols & NGX_SSL_SSLv2)) {
- SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_SSLv2);
- }
- if (!(protocols & NGX_SSL_SSLv3)) {
- SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_SSLv3);
- }
- if (!(protocols & NGX_SSL_TLSv1)) {
- SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_TLSv1);
- }
-#ifdef SSL_OP_NO_TLSv1_1
- if (!(protocols & NGX_SSL_TLSv1_1)) {
- SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_TLSv1_1);
- }
-#endif
-#ifdef SSL_OP_NO_TLSv1_2
- if (!(protocols & NGX_SSL_TLSv1_2)) {
- SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_TLSv1_2);
- }
-#endif
-
-#ifdef SSL_OP_NO_COMPRESSION
- SSL_CTX_set_options(ssl->ctx, SSL_OP_NO_COMPRESSION);
-#endif
-
-#ifdef SSL_MODE_RELEASE_BUFFERS
- SSL_CTX_set_mode(ssl->ctx, SSL_MODE_RELEASE_BUFFERS);
-#endif
-
- SSL_CTX_set_read_ahead(ssl->ctx, 1);
-
- SSL_CTX_set_info_callback(ssl->ctx, ngx_ssl_info_callback);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *cert,
- ngx_str_t *key, ngx_array_t *passwords)
-{
- BIO *bio;
- X509 *x509;
- u_long n;
- ngx_str_t *pwd;
- ngx_uint_t tries;
-
- if (ngx_conf_full_name(cf->cycle, cert, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- /*
- * we can't use SSL_CTX_use_certificate_chain_file() as it doesn't
- * allow to access certificate later from SSL_CTX, so we reimplement
- * it here
- */
-
- bio = BIO_new_file((char *) cert->data, "r");
- if (bio == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "BIO_new_file(\"%s\") failed", cert->data);
- return NGX_ERROR;
- }
-
- x509 = PEM_read_bio_X509_AUX(bio, NULL, NULL, NULL);
- if (x509 == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "PEM_read_bio_X509_AUX(\"%s\") failed", cert->data);
- BIO_free(bio);
- return NGX_ERROR;
- }
-
- if (SSL_CTX_use_certificate(ssl->ctx, x509) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_use_certificate(\"%s\") failed", cert->data);
- X509_free(x509);
- BIO_free(bio);
- return NGX_ERROR;
- }
-
- if (SSL_CTX_set_ex_data(ssl->ctx, ngx_ssl_certificate_index, x509)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_set_ex_data() failed");
- X509_free(x509);
- BIO_free(bio);
- return NGX_ERROR;
- }
-
- X509_free(x509);
-
- /* read rest of the chain */
-
- for ( ;; ) {
-
- x509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
- if (x509 == NULL) {
- n = ERR_peek_last_error();
-
- if (ERR_GET_LIB(n) == ERR_LIB_PEM
- && ERR_GET_REASON(n) == PEM_R_NO_START_LINE)
- {
- /* end of file */
- ERR_clear_error();
- break;
- }
-
- /* some real error */
-
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "PEM_read_bio_X509(\"%s\") failed", cert->data);
- BIO_free(bio);
- return NGX_ERROR;
- }
-
- if (SSL_CTX_add_extra_chain_cert(ssl->ctx, x509) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_add_extra_chain_cert(\"%s\") failed",
- cert->data);
- X509_free(x509);
- BIO_free(bio);
- return NGX_ERROR;
- }
- }
-
- BIO_free(bio);
-
- if (ngx_conf_full_name(cf->cycle, key, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (passwords) {
- tries = passwords->nelts;
- pwd = passwords->elts;
-
- SSL_CTX_set_default_passwd_cb(ssl->ctx, ngx_ssl_password_callback);
- SSL_CTX_set_default_passwd_cb_userdata(ssl->ctx, pwd);
-
- } else {
- tries = 1;
-#if (NGX_SUPPRESS_WARN)
- pwd = NULL;
-#endif
- }
-
- for ( ;; ) {
-
- if (SSL_CTX_use_PrivateKey_file(ssl->ctx, (char *) key->data,
- SSL_FILETYPE_PEM)
- != 0)
- {
- break;
- }
-
- if (--tries) {
- n = ERR_peek_error();
-
-#ifdef OPENSSL_IS_BORINGSSL
- if (ERR_GET_LIB(n) == ERR_LIB_CIPHER
- && ERR_GET_REASON(n) == CIPHER_R_BAD_DECRYPT)
-#else
- if (ERR_GET_LIB(n) == ERR_LIB_EVP
- && ERR_GET_REASON(n) == EVP_R_BAD_DECRYPT)
-#endif
- {
- ERR_clear_error();
- SSL_CTX_set_default_passwd_cb_userdata(ssl->ctx, ++pwd);
- continue;
- }
- }
-
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_use_PrivateKey_file(\"%s\") failed", key->data);
- return NGX_ERROR;
- }
-
- SSL_CTX_set_default_passwd_cb(ssl->ctx, NULL);
-
- return NGX_OK;
-}
-
-
-static int
-ngx_ssl_password_callback(char *buf, int size, int rwflag, void *userdata)
-{
- ngx_str_t *pwd = userdata;
-
- if (rwflag) {
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
- "ngx_ssl_password_callback() is called for encryption");
- return 0;
- }
-
- if (pwd->len > (size_t) size) {
- ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, 0,
- "password is truncated to %d bytes", size);
- } else {
- size = pwd->len;
- }
-
- ngx_memcpy(buf, pwd->data, size);
-
- return size;
-}
-
-
-ngx_int_t
-ngx_ssl_client_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *cert,
- ngx_int_t depth)
-{
- STACK_OF(X509_NAME) *list;
-
- SSL_CTX_set_verify(ssl->ctx, SSL_VERIFY_PEER, ngx_ssl_verify_callback);
-
- SSL_CTX_set_verify_depth(ssl->ctx, depth);
-
- if (cert->len == 0) {
- return NGX_OK;
- }
-
- if (ngx_conf_full_name(cf->cycle, cert, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (SSL_CTX_load_verify_locations(ssl->ctx, (char *) cert->data, NULL)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_load_verify_locations(\"%s\") failed",
- cert->data);
- return NGX_ERROR;
- }
-
- /*
- * SSL_CTX_load_verify_locations() may leave errors in the error queue
- * while returning success
- */
-
- ERR_clear_error();
-
- list = SSL_load_client_CA_file((char *) cert->data);
-
- if (list == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_load_client_CA_file(\"%s\") failed", cert->data);
- return NGX_ERROR;
- }
-
- /*
- * before 0.9.7h and 0.9.8 SSL_load_client_CA_file()
- * always leaved an error in the error queue
- */
-
- ERR_clear_error();
-
- SSL_CTX_set_client_CA_list(ssl->ctx, list);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_trusted_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *cert,
- ngx_int_t depth)
-{
- SSL_CTX_set_verify_depth(ssl->ctx, depth);
-
- if (cert->len == 0) {
- return NGX_OK;
- }
-
- if (ngx_conf_full_name(cf->cycle, cert, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (SSL_CTX_load_verify_locations(ssl->ctx, (char *) cert->data, NULL)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_load_verify_locations(\"%s\") failed",
- cert->data);
- return NGX_ERROR;
- }
-
- /*
- * SSL_CTX_load_verify_locations() may leave errors in the error queue
- * while returning success
- */
-
- ERR_clear_error();
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_crl(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *crl)
-{
- X509_STORE *store;
- X509_LOOKUP *lookup;
-
- if (crl->len == 0) {
- return NGX_OK;
- }
-
- if (ngx_conf_full_name(cf->cycle, crl, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- store = SSL_CTX_get_cert_store(ssl->ctx);
-
- if (store == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_get_cert_store() failed");
- return NGX_ERROR;
- }
-
- lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
-
- if (lookup == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "X509_STORE_add_lookup() failed");
- return NGX_ERROR;
- }
-
- if (X509_LOOKUP_load_file(lookup, (char *) crl->data, X509_FILETYPE_PEM)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "X509_LOOKUP_load_file(\"%s\") failed", crl->data);
- return NGX_ERROR;
- }
-
- X509_STORE_set_flags(store,
- X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL);
-
- return NGX_OK;
-}
-
-
-static int
-ngx_ssl_verify_callback(int ok, X509_STORE_CTX *x509_store)
-{
-#if (NGX_DEBUG)
- char *subject, *issuer;
- int err, depth;
- X509 *cert;
- X509_NAME *sname, *iname;
- ngx_connection_t *c;
- ngx_ssl_conn_t *ssl_conn;
-
- ssl_conn = X509_STORE_CTX_get_ex_data(x509_store,
- SSL_get_ex_data_X509_STORE_CTX_idx());
-
- c = ngx_ssl_get_connection(ssl_conn);
-
- cert = X509_STORE_CTX_get_current_cert(x509_store);
- err = X509_STORE_CTX_get_error(x509_store);
- depth = X509_STORE_CTX_get_error_depth(x509_store);
-
- sname = X509_get_subject_name(cert);
- subject = sname ? X509_NAME_oneline(sname, NULL, 0) : "(none)";
-
- iname = X509_get_issuer_name(cert);
- issuer = iname ? X509_NAME_oneline(iname, NULL, 0) : "(none)";
-
- ngx_log_debug5(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "verify:%d, error:%d, depth:%d, "
- "subject:\"%s\", issuer:\"%s\"",
- ok, err, depth, subject, issuer);
-
- if (sname) {
- OPENSSL_free(subject);
- }
-
- if (iname) {
- OPENSSL_free(issuer);
- }
-#endif
-
- return 1;
-}
-
-
-static void
-ngx_ssl_info_callback(const ngx_ssl_conn_t *ssl_conn, int where, int ret)
-{
- BIO *rbio, *wbio;
- ngx_connection_t *c;
-
- if (where & SSL_CB_HANDSHAKE_START) {
- c = ngx_ssl_get_connection((ngx_ssl_conn_t *) ssl_conn);
-
- if (c->ssl->handshaked) {
- c->ssl->renegotiation = 1;
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL renegotiation");
- }
- }
-
- if ((where & SSL_CB_ACCEPT_LOOP) == SSL_CB_ACCEPT_LOOP) {
- c = ngx_ssl_get_connection((ngx_ssl_conn_t *) ssl_conn);
-
- if (!c->ssl->handshake_buffer_set) {
- /*
- * By default OpenSSL uses 4k buffer during a handshake,
- * which is too low for long certificate chains and might
- * result in extra round-trips.
- *
- * To adjust a buffer size we detect that buffering was added
- * to write side of the connection by comparing rbio and wbio.
- * If they are different, we assume that it's due to buffering
- * added to wbio, and set buffer size.
- */
-
- rbio = SSL_get_rbio((ngx_ssl_conn_t *) ssl_conn);
- wbio = SSL_get_wbio((ngx_ssl_conn_t *) ssl_conn);
-
- if (rbio != wbio) {
- (void) BIO_set_write_buffer_size(wbio, NGX_SSL_BUFSIZE);
- c->ssl->handshake_buffer_set = 1;
- }
- }
- }
-}
-
-
-RSA *
-ngx_ssl_rsa512_key_callback(ngx_ssl_conn_t *ssl_conn, int is_export,
- int key_length)
-{
- static RSA *key;
-
- if (key_length != 512) {
- return NULL;
- }
-
-#ifndef OPENSSL_NO_DEPRECATED
-
- if (key == NULL) {
- key = RSA_generate_key(512, RSA_F4, NULL, NULL);
- }
-
-#endif
-
- return key;
-}
-
-
-ngx_array_t *
-ngx_ssl_read_password_file(ngx_conf_t *cf, ngx_str_t *file)
-{
- u_char *p, *last, *end;
- size_t len;
- ssize_t n;
- ngx_fd_t fd;
- ngx_str_t *pwd;
- ngx_array_t *passwords;
- ngx_pool_cleanup_t *cln;
- u_char buf[NGX_SSL_PASSWORD_BUFFER_SIZE];
-
- if (ngx_conf_full_name(cf->cycle, file, 1) != NGX_OK) {
- return NULL;
- }
-
- cln = ngx_pool_cleanup_add(cf->temp_pool, 0);
- passwords = ngx_array_create(cf->temp_pool, 4, sizeof(ngx_str_t));
-
- if (cln == NULL || passwords == NULL) {
- return NULL;
- }
-
- cln->handler = ngx_ssl_passwords_cleanup;
- cln->data = passwords;
-
- fd = ngx_open_file(file->data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
- if (fd == NGX_INVALID_FILE) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
- ngx_open_file_n " \"%s\" failed", file->data);
- return NULL;
- }
-
- len = 0;
- last = buf;
-
- do {
- n = ngx_read_fd(fd, last, NGX_SSL_PASSWORD_BUFFER_SIZE - len);
-
- if (n == -1) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
- ngx_read_fd_n " \"%s\" failed", file->data);
- passwords = NULL;
- goto cleanup;
- }
-
- end = last + n;
-
- if (len && n == 0) {
- *end++ = LF;
- }
-
- p = buf;
-
- for ( ;; ) {
- last = ngx_strlchr(last, end, LF);
-
- if (last == NULL) {
- break;
- }
-
- len = last++ - p;
-
- if (len && p[len - 1] == CR) {
- len--;
- }
-
- if (len) {
- pwd = ngx_array_push(passwords);
- if (pwd == NULL) {
- passwords = NULL;
- goto cleanup;
- }
-
- pwd->len = len;
- pwd->data = ngx_pnalloc(cf->temp_pool, len);
-
- if (pwd->data == NULL) {
- passwords->nelts--;
- passwords = NULL;
- goto cleanup;
- }
-
- ngx_memcpy(pwd->data, p, len);
- }
-
- p = last;
- }
-
- len = end - p;
-
- if (len == NGX_SSL_PASSWORD_BUFFER_SIZE) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "too long line in \"%s\"", file->data);
- passwords = NULL;
- goto cleanup;
- }
-
- ngx_memmove(buf, p, len);
- last = buf + len;
-
- } while (n != 0);
-
- if (passwords->nelts == 0) {
- pwd = ngx_array_push(passwords);
- if (pwd == NULL) {
- passwords = NULL;
- goto cleanup;
- }
-
- ngx_memzero(pwd, sizeof(ngx_str_t));
- }
-
-cleanup:
-
- if (ngx_close_file(fd) == NGX_FILE_ERROR) {
- ngx_conf_log_error(NGX_LOG_ALERT, cf, ngx_errno,
- ngx_close_file_n " \"%s\" failed", file->data);
- }
-
- ngx_memzero(buf, NGX_SSL_PASSWORD_BUFFER_SIZE);
-
- return passwords;
-}
-
-
-static void
-ngx_ssl_passwords_cleanup(void *data)
-{
- ngx_array_t *passwords = data;
-
- ngx_str_t *pwd;
- ngx_uint_t i;
-
- pwd = passwords->elts;
-
- for (i = 0; i < passwords->nelts; i++) {
- ngx_memzero(pwd[i].data, pwd[i].len);
- }
-}
-
-
-ngx_int_t
-ngx_ssl_dhparam(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *file)
-{
- DH *dh;
- BIO *bio;
-
- /*
- * -----BEGIN DH PARAMETERS-----
- * MIGHAoGBALu8LcrYRnSQfEP89YDpz9vZWKP1aLQtSwju1OsPs1BMbAMCducQgAxc
- * y7qokiYUxb7spWWl/fHSh6K8BJvmd4Bg6RqSp1fjBI9osHb302zI8pul34HcLKcl
- * 7OZicMyaUDXYzs7vnqAnSmOrHlj6/UmI0PZdFGdX2gcd8EXP4WubAgEC
- * -----END DH PARAMETERS-----
- */
-
- static unsigned char dh1024_p[] = {
- 0xBB, 0xBC, 0x2D, 0xCA, 0xD8, 0x46, 0x74, 0x90, 0x7C, 0x43, 0xFC, 0xF5,
- 0x80, 0xE9, 0xCF, 0xDB, 0xD9, 0x58, 0xA3, 0xF5, 0x68, 0xB4, 0x2D, 0x4B,
- 0x08, 0xEE, 0xD4, 0xEB, 0x0F, 0xB3, 0x50, 0x4C, 0x6C, 0x03, 0x02, 0x76,
- 0xE7, 0x10, 0x80, 0x0C, 0x5C, 0xCB, 0xBA, 0xA8, 0x92, 0x26, 0x14, 0xC5,
- 0xBE, 0xEC, 0xA5, 0x65, 0xA5, 0xFD, 0xF1, 0xD2, 0x87, 0xA2, 0xBC, 0x04,
- 0x9B, 0xE6, 0x77, 0x80, 0x60, 0xE9, 0x1A, 0x92, 0xA7, 0x57, 0xE3, 0x04,
- 0x8F, 0x68, 0xB0, 0x76, 0xF7, 0xD3, 0x6C, 0xC8, 0xF2, 0x9B, 0xA5, 0xDF,
- 0x81, 0xDC, 0x2C, 0xA7, 0x25, 0xEC, 0xE6, 0x62, 0x70, 0xCC, 0x9A, 0x50,
- 0x35, 0xD8, 0xCE, 0xCE, 0xEF, 0x9E, 0xA0, 0x27, 0x4A, 0x63, 0xAB, 0x1E,
- 0x58, 0xFA, 0xFD, 0x49, 0x88, 0xD0, 0xF6, 0x5D, 0x14, 0x67, 0x57, 0xDA,
- 0x07, 0x1D, 0xF0, 0x45, 0xCF, 0xE1, 0x6B, 0x9B
- };
-
- static unsigned char dh1024_g[] = { 0x02 };
-
-
- if (file->len == 0) {
-
- dh = DH_new();
- if (dh == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0, "DH_new() failed");
- return NGX_ERROR;
- }
-
- dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
- dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
-
- if (dh->p == NULL || dh->g == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0, "BN_bin2bn() failed");
- DH_free(dh);
- return NGX_ERROR;
- }
-
- SSL_CTX_set_tmp_dh(ssl->ctx, dh);
-
- DH_free(dh);
-
- return NGX_OK;
- }
-
- if (ngx_conf_full_name(cf->cycle, file, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- bio = BIO_new_file((char *) file->data, "r");
- if (bio == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "BIO_new_file(\"%s\") failed", file->data);
- return NGX_ERROR;
- }
-
- dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
- if (dh == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "PEM_read_bio_DHparams(\"%s\") failed", file->data);
- BIO_free(bio);
- return NGX_ERROR;
- }
-
- SSL_CTX_set_tmp_dh(ssl->ctx, dh);
-
- DH_free(dh);
- BIO_free(bio);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_ecdh_curve(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *name)
-{
-#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
-#ifndef OPENSSL_NO_ECDH
- int nid;
- EC_KEY *ecdh;
-
- /*
- * Elliptic-Curve Diffie-Hellman parameters are either "named curves"
- * from RFC 4492 section 5.1.1, or explicitly described curves over
- * binary fields. OpenSSL only supports the "named curves", which provide
- * maximum interoperability.
- */
-
- nid = OBJ_sn2nid((const char *) name->data);
- if (nid == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "Unknown curve name \"%s\"", name->data);
- return NGX_ERROR;
- }
-
- ecdh = EC_KEY_new_by_curve_name(nid);
- if (ecdh == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "Unable to create curve \"%s\"", name->data);
- return NGX_ERROR;
- }
-
- SSL_CTX_set_options(ssl->ctx, SSL_OP_SINGLE_ECDH_USE);
-
- SSL_CTX_set_tmp_ecdh(ssl->ctx, ecdh);
-
- EC_KEY_free(ecdh);
-#endif
-#endif
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_create_connection(ngx_ssl_t *ssl, ngx_connection_t *c, ngx_uint_t flags)
-{
- ngx_ssl_connection_t *sc;
-
- sc = ngx_pcalloc(c->pool, sizeof(ngx_ssl_connection_t));
- if (sc == NULL) {
- return NGX_ERROR;
- }
-
- sc->buffer = ((flags & NGX_SSL_BUFFER) != 0);
- sc->buffer_size = ssl->buffer_size;
-
- sc->connection = SSL_new(ssl->ctx);
-
- if (sc->connection == NULL) {
- ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, "SSL_new() failed");
- return NGX_ERROR;
- }
-
- if (SSL_set_fd(sc->connection, c->fd) == 0) {
- ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, "SSL_set_fd() failed");
- return NGX_ERROR;
- }
-
- if (flags & NGX_SSL_CLIENT) {
- SSL_set_connect_state(sc->connection);
-
- } else {
- SSL_set_accept_state(sc->connection);
- }
-
- if (SSL_set_ex_data(sc->connection, ngx_ssl_connection_index, c) == 0) {
- ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, "SSL_set_ex_data() failed");
- return NGX_ERROR;
- }
-
- c->ssl = sc;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_set_session(ngx_connection_t *c, ngx_ssl_session_t *session)
-{
- if (session) {
- if (SSL_set_session(c->ssl->connection, session) == 0) {
- ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, "SSL_set_session() failed");
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_handshake(ngx_connection_t *c)
-{
- int n, sslerr;
- ngx_err_t err;
-
- ngx_ssl_clear_error(c->log);
-
- n = SSL_do_handshake(c->ssl->connection);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_do_handshake: %d", n);
-
- if (n == 1) {
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
-#if (NGX_DEBUG)
- {
- char buf[129], *s, *d;
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- const
-#endif
- SSL_CIPHER *cipher;
-
- cipher = SSL_get_current_cipher(c->ssl->connection);
-
- if (cipher) {
- SSL_CIPHER_description(cipher, &buf[1], 128);
-
- for (s = &buf[1], d = buf; *s; s++) {
- if (*s == ' ' && *d == ' ') {
- continue;
- }
-
- if (*s == LF || *s == CR) {
- continue;
- }
-
- *++d = *s;
- }
-
- if (*d != ' ') {
- d++;
- }
-
- *d = '\0';
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL: %s, cipher: \"%s\"",
- SSL_get_version(c->ssl->connection), &buf[1]);
-
- if (SSL_session_reused(c->ssl->connection)) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL reused session");
- }
-
- } else {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL no shared ciphers");
- }
- }
-#endif
-
- c->ssl->handshaked = 1;
-
- c->recv = ngx_ssl_recv;
- c->send = ngx_ssl_write;
- c->recv_chain = ngx_ssl_recv_chain;
- c->send_chain = ngx_ssl_send_chain;
-
- /* initial handshake done, disable renegotiation (CVE-2009-3555) */
- if (c->ssl->connection->s3) {
- c->ssl->connection->s3->flags |= SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS;
- }
-
- return NGX_OK;
- }
-
- sslerr = SSL_get_error(c->ssl->connection, n);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_get_error: %d", sslerr);
-
- if (sslerr == SSL_ERROR_WANT_READ) {
- c->read->ready = 0;
- c->read->handler = ngx_ssl_handshake_handler;
- c->write->handler = ngx_ssl_handshake_handler;
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_AGAIN;
- }
-
- if (sslerr == SSL_ERROR_WANT_WRITE) {
- c->write->ready = 0;
- c->read->handler = ngx_ssl_handshake_handler;
- c->write->handler = ngx_ssl_handshake_handler;
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_AGAIN;
- }
-
- err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0;
-
- c->ssl->no_wait_shutdown = 1;
- c->ssl->no_send_shutdown = 1;
- c->read->eof = 1;
-
- if (sslerr == SSL_ERROR_ZERO_RETURN || ERR_peek_error() == 0) {
- ngx_connection_error(c, err,
- "peer closed connection in SSL handshake");
-
- return NGX_ERROR;
- }
-
- c->read->error = 1;
-
- ngx_ssl_connection_error(c, sslerr, err, "SSL_do_handshake() failed");
-
- return NGX_ERROR;
-}
-
-
-static void
-ngx_ssl_handshake_handler(ngx_event_t *ev)
-{
- ngx_connection_t *c;
-
- c = ev->data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL handshake handler: %d", ev->write);
-
- if (ev->timedout) {
- c->ssl->handler(c);
- return;
- }
-
- if (ngx_ssl_handshake(c) == NGX_AGAIN) {
- return;
- }
-
- c->ssl->handler(c);
-}
-
-
-ssize_t
-ngx_ssl_recv_chain(ngx_connection_t *c, ngx_chain_t *cl)
-{
- u_char *last;
- ssize_t n, bytes;
- ngx_buf_t *b;
-
- bytes = 0;
-
- b = cl->buf;
- last = b->last;
-
- for ( ;; ) {
-
- n = ngx_ssl_recv(c, last, b->end - last);
-
- if (n > 0) {
- last += n;
- bytes += n;
-
- if (last == b->end) {
- cl = cl->next;
-
- if (cl == NULL) {
- return bytes;
- }
-
- b = cl->buf;
- last = b->last;
- }
-
- continue;
- }
-
- if (bytes) {
-
- if (n == 0 || n == NGX_ERROR) {
- c->read->ready = 1;
- }
-
- return bytes;
- }
-
- return n;
- }
-}
-
-
-ssize_t
-ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size)
-{
- int n, bytes;
-
- if (c->ssl->last == NGX_ERROR) {
- c->read->error = 1;
- return NGX_ERROR;
- }
-
- if (c->ssl->last == NGX_DONE) {
- c->read->ready = 0;
- c->read->eof = 1;
- return 0;
- }
-
- bytes = 0;
-
- ngx_ssl_clear_error(c->log);
-
- /*
- * SSL_read() may return data in parts, so try to read
- * until SSL_read() would return no data
- */
-
- for ( ;; ) {
-
- n = SSL_read(c->ssl->connection, buf, size);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_read: %d", n);
-
- if (n > 0) {
- bytes += n;
- }
-
- c->ssl->last = ngx_ssl_handle_recv(c, n);
-
- if (c->ssl->last == NGX_OK) {
-
- size -= n;
-
- if (size == 0) {
- c->read->ready = 1;
- return bytes;
- }
-
- buf += n;
-
- continue;
- }
-
- if (bytes) {
- if (c->ssl->last != NGX_AGAIN) {
- c->read->ready = 1;
- }
-
- return bytes;
- }
-
- switch (c->ssl->last) {
-
- case NGX_DONE:
- c->read->ready = 0;
- c->read->eof = 1;
- return 0;
-
- case NGX_ERROR:
- c->read->error = 1;
-
- /* fall through */
-
- case NGX_AGAIN:
- return c->ssl->last;
- }
- }
-}
-
-
-static ngx_int_t
-ngx_ssl_handle_recv(ngx_connection_t *c, int n)
-{
- int sslerr;
- ngx_err_t err;
-
- if (c->ssl->renegotiation) {
- /*
- * disable renegotiation (CVE-2009-3555):
- * OpenSSL (at least up to 0.9.8l) does not handle disabled
- * renegotiation gracefully, so drop connection here
- */
-
- ngx_log_error(NGX_LOG_NOTICE, c->log, 0, "SSL renegotiation disabled");
-
- while (ERR_peek_error()) {
- ngx_ssl_error(NGX_LOG_DEBUG, c->log, 0,
- "ignoring stale global SSL error");
- }
-
- ERR_clear_error();
-
- c->ssl->no_wait_shutdown = 1;
- c->ssl->no_send_shutdown = 1;
-
- return NGX_ERROR;
- }
-
- if (n > 0) {
-
- if (c->ssl->saved_write_handler) {
-
- c->write->handler = c->ssl->saved_write_handler;
- c->ssl->saved_write_handler = NULL;
- c->write->ready = 1;
-
- if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_post_event(c->write, &ngx_posted_events);
- }
-
- return NGX_OK;
- }
-
- sslerr = SSL_get_error(c->ssl->connection, n);
-
- err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_get_error: %d", sslerr);
-
- if (sslerr == SSL_ERROR_WANT_READ) {
- c->read->ready = 0;
- return NGX_AGAIN;
- }
-
- if (sslerr == SSL_ERROR_WANT_WRITE) {
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "peer started SSL renegotiation");
-
- c->write->ready = 0;
-
- if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- /*
- * we do not set the timer because there is already the read event timer
- */
-
- if (c->ssl->saved_write_handler == NULL) {
- c->ssl->saved_write_handler = c->write->handler;
- c->write->handler = ngx_ssl_write_handler;
- }
-
- return NGX_AGAIN;
- }
-
- c->ssl->no_wait_shutdown = 1;
- c->ssl->no_send_shutdown = 1;
-
- if (sslerr == SSL_ERROR_ZERO_RETURN || ERR_peek_error() == 0) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "peer shutdown SSL cleanly");
- return NGX_DONE;
- }
-
- ngx_ssl_connection_error(c, sslerr, err, "SSL_read() failed");
-
- return NGX_ERROR;
-}
-
-
-static void
-ngx_ssl_write_handler(ngx_event_t *wev)
-{
- ngx_connection_t *c;
-
- c = wev->data;
-
- c->read->handler(c->read);
-}
-
-
-/*
- * OpenSSL has no SSL_writev() so we copy several bufs into our 16K buffer
- * before the SSL_write() call to decrease a SSL overhead.
- *
- * Besides for protocols such as HTTP it is possible to always buffer
- * the output to decrease a SSL overhead some more.
- */
-
-ngx_chain_t *
-ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
-{
- int n;
- ngx_uint_t flush;
- ssize_t send, size;
- ngx_buf_t *buf;
-
- if (!c->ssl->buffer) {
-
- while (in) {
- if (ngx_buf_special(in->buf)) {
- in = in->next;
- continue;
- }
-
- n = ngx_ssl_write(c, in->buf->pos, in->buf->last - in->buf->pos);
-
- if (n == NGX_ERROR) {
- return NGX_CHAIN_ERROR;
- }
-
- if (n == NGX_AGAIN) {
- return in;
- }
-
- in->buf->pos += n;
- c->sent += n;
-
- if (in->buf->pos == in->buf->last) {
- in = in->next;
- }
- }
-
- return in;
- }
-
-
- /* the maximum limit size is the maximum int32_t value - the page size */
-
- if (limit == 0 || limit > (off_t) (NGX_MAX_INT32_VALUE - ngx_pagesize)) {
- limit = NGX_MAX_INT32_VALUE - ngx_pagesize;
- }
-
- buf = c->ssl->buf;
-
- if (buf == NULL) {
- buf = ngx_create_temp_buf(c->pool, c->ssl->buffer_size);
- if (buf == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- c->ssl->buf = buf;
- }
-
- if (buf->start == NULL) {
- buf->start = ngx_palloc(c->pool, c->ssl->buffer_size);
- if (buf->start == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- buf->pos = buf->start;
- buf->last = buf->start;
- buf->end = buf->start + c->ssl->buffer_size;
- }
-
- send = buf->last - buf->pos;
- flush = (in == NULL) ? 1 : buf->flush;
-
- for ( ;; ) {
-
- while (in && buf->last < buf->end && send < limit) {
- if (in->buf->last_buf || in->buf->flush) {
- flush = 1;
- }
-
- if (ngx_buf_special(in->buf)) {
- in = in->next;
- continue;
- }
-
- size = in->buf->last - in->buf->pos;
-
- if (size > buf->end - buf->last) {
- size = buf->end - buf->last;
- }
-
- if (send + size > limit) {
- size = (ssize_t) (limit - send);
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL buf copy: %d", size);
-
- ngx_memcpy(buf->last, in->buf->pos, size);
-
- buf->last += size;
- in->buf->pos += size;
- send += size;
-
- if (in->buf->pos == in->buf->last) {
- in = in->next;
- }
- }
-
- if (!flush && send < limit && buf->last < buf->end) {
- break;
- }
-
- size = buf->last - buf->pos;
-
- if (size == 0) {
- buf->flush = 0;
- c->buffered &= ~NGX_SSL_BUFFERED;
- return in;
- }
-
- n = ngx_ssl_write(c, buf->pos, size);
-
- if (n == NGX_ERROR) {
- return NGX_CHAIN_ERROR;
- }
-
- if (n == NGX_AGAIN) {
- break;
- }
-
- buf->pos += n;
- c->sent += n;
-
- if (n < size) {
- break;
- }
-
- flush = 0;
-
- buf->pos = buf->start;
- buf->last = buf->start;
-
- if (in == NULL || send == limit) {
- break;
- }
- }
-
- buf->flush = flush;
-
- if (buf->pos < buf->last) {
- c->buffered |= NGX_SSL_BUFFERED;
-
- } else {
- c->buffered &= ~NGX_SSL_BUFFERED;
- }
-
- return in;
-}
-
-
-ssize_t
-ngx_ssl_write(ngx_connection_t *c, u_char *data, size_t size)
-{
- int n, sslerr;
- ngx_err_t err;
-
- ngx_ssl_clear_error(c->log);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL to write: %d", size);
-
- n = SSL_write(c->ssl->connection, data, size);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_write: %d", n);
-
- if (n > 0) {
-
- if (c->ssl->saved_read_handler) {
-
- c->read->handler = c->ssl->saved_read_handler;
- c->ssl->saved_read_handler = NULL;
- c->read->ready = 1;
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_post_event(c->read, &ngx_posted_events);
- }
-
- return n;
- }
-
- sslerr = SSL_get_error(c->ssl->connection, n);
-
- err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_get_error: %d", sslerr);
-
- if (sslerr == SSL_ERROR_WANT_WRITE) {
- c->write->ready = 0;
- return NGX_AGAIN;
- }
-
- if (sslerr == SSL_ERROR_WANT_READ) {
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "peer started SSL renegotiation");
-
- c->read->ready = 0;
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- /*
- * we do not set the timer because there is already
- * the write event timer
- */
-
- if (c->ssl->saved_read_handler == NULL) {
- c->ssl->saved_read_handler = c->read->handler;
- c->read->handler = ngx_ssl_read_handler;
- }
-
- return NGX_AGAIN;
- }
-
- c->ssl->no_wait_shutdown = 1;
- c->ssl->no_send_shutdown = 1;
- c->write->error = 1;
-
- ngx_ssl_connection_error(c, sslerr, err, "SSL_write() failed");
-
- return NGX_ERROR;
-}
-
-
-static void
-ngx_ssl_read_handler(ngx_event_t *rev)
-{
- ngx_connection_t *c;
-
- c = rev->data;
-
- c->write->handler(c->write);
-}
-
-
-void
-ngx_ssl_free_buffer(ngx_connection_t *c)
-{
- if (c->ssl->buf && c->ssl->buf->start) {
- if (ngx_pfree(c->pool, c->ssl->buf->start) == NGX_OK) {
- c->ssl->buf->start = NULL;
- }
- }
-}
-
-
-ngx_int_t
-ngx_ssl_shutdown(ngx_connection_t *c)
-{
- int n, sslerr, mode;
- ngx_err_t err;
-
- if (c->timedout) {
- mode = SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN;
- SSL_set_quiet_shutdown(c->ssl->connection, 1);
-
- } else {
- mode = SSL_get_shutdown(c->ssl->connection);
-
- if (c->ssl->no_wait_shutdown) {
- mode |= SSL_RECEIVED_SHUTDOWN;
- }
-
- if (c->ssl->no_send_shutdown) {
- mode |= SSL_SENT_SHUTDOWN;
- }
-
- if (c->ssl->no_wait_shutdown && c->ssl->no_send_shutdown) {
- SSL_set_quiet_shutdown(c->ssl->connection, 1);
- }
- }
-
- SSL_set_shutdown(c->ssl->connection, mode);
-
- ngx_ssl_clear_error(c->log);
-
- n = SSL_shutdown(c->ssl->connection);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_shutdown: %d", n);
-
- sslerr = 0;
-
- /* SSL_shutdown() never returns -1, on error it returns 0 */
-
- if (n != 1 && ERR_peek_error()) {
- sslerr = SSL_get_error(c->ssl->connection, n);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL_get_error: %d", sslerr);
- }
-
- if (n == 1 || sslerr == 0 || sslerr == SSL_ERROR_ZERO_RETURN) {
- SSL_free(c->ssl->connection);
- c->ssl = NULL;
-
- return NGX_OK;
- }
-
- if (sslerr == SSL_ERROR_WANT_READ || sslerr == SSL_ERROR_WANT_WRITE) {
- c->read->handler = ngx_ssl_shutdown_handler;
- c->write->handler = ngx_ssl_shutdown_handler;
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (sslerr == SSL_ERROR_WANT_READ) {
- ngx_add_timer(c->read, 30000);
- }
-
- return NGX_AGAIN;
- }
-
- err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0;
-
- ngx_ssl_connection_error(c, sslerr, err, "SSL_shutdown() failed");
-
- SSL_free(c->ssl->connection);
- c->ssl = NULL;
-
- return NGX_ERROR;
-}
-
-
-static void
-ngx_ssl_shutdown_handler(ngx_event_t *ev)
-{
- ngx_connection_t *c;
- ngx_connection_handler_pt handler;
-
- c = ev->data;
- handler = c->ssl->handler;
-
- if (ev->timedout) {
- c->timedout = 1;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, 0, "SSL shutdown handler");
-
- if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
- return;
- }
-
- handler(c);
-}
-
-
-static void
-ngx_ssl_connection_error(ngx_connection_t *c, int sslerr, ngx_err_t err,
- char *text)
-{
- int n;
- ngx_uint_t level;
-
- level = NGX_LOG_CRIT;
-
- if (sslerr == SSL_ERROR_SYSCALL) {
-
- if (err == NGX_ECONNRESET
- || err == NGX_EPIPE
- || err == NGX_ENOTCONN
- || err == NGX_ETIMEDOUT
- || err == NGX_ECONNREFUSED
- || err == NGX_ENETDOWN
- || err == NGX_ENETUNREACH
- || err == NGX_EHOSTDOWN
- || err == NGX_EHOSTUNREACH)
- {
- switch (c->log_error) {
-
- case NGX_ERROR_IGNORE_ECONNRESET:
- case NGX_ERROR_INFO:
- level = NGX_LOG_INFO;
- break;
-
- case NGX_ERROR_ERR:
- level = NGX_LOG_ERR;
- break;
-
- default:
- break;
- }
- }
-
- } else if (sslerr == SSL_ERROR_SSL) {
-
- n = ERR_GET_REASON(ERR_peek_error());
-
- /* handshake failures */
- if (n == SSL_R_BAD_CHANGE_CIPHER_SPEC /* 103 */
- || n == SSL_R_BLOCK_CIPHER_PAD_IS_WRONG /* 129 */
- || n == SSL_R_DIGEST_CHECK_FAILED /* 149 */
- || n == SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST /* 151 */
- || n == SSL_R_EXCESSIVE_MESSAGE_SIZE /* 152 */
- || n == SSL_R_LENGTH_MISMATCH /* 159 */
- || n == SSL_R_NO_CIPHERS_PASSED /* 182 */
- || n == SSL_R_NO_CIPHERS_SPECIFIED /* 183 */
- || n == SSL_R_NO_COMPRESSION_SPECIFIED /* 187 */
- || n == SSL_R_NO_SHARED_CIPHER /* 193 */
- || n == SSL_R_RECORD_LENGTH_MISMATCH /* 213 */
-#ifdef SSL_R_PARSE_TLSEXT
- || n == SSL_R_PARSE_TLSEXT /* 227 */
-#endif
- || n == SSL_R_UNEXPECTED_MESSAGE /* 244 */
- || n == SSL_R_UNEXPECTED_RECORD /* 245 */
- || n == SSL_R_UNKNOWN_ALERT_TYPE /* 246 */
- || n == SSL_R_UNKNOWN_PROTOCOL /* 252 */
- || n == SSL_R_WRONG_VERSION_NUMBER /* 267 */
- || n == SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC /* 281 */
-#ifdef SSL_R_RENEGOTIATE_EXT_TOO_LONG
- || n == SSL_R_RENEGOTIATE_EXT_TOO_LONG /* 335 */
- || n == SSL_R_RENEGOTIATION_ENCODING_ERR /* 336 */
- || n == SSL_R_RENEGOTIATION_MISMATCH /* 337 */
-#endif
-#ifdef SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED
- || n == SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED /* 338 */
-#endif
-#ifdef SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING
- || n == SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING /* 345 */
-#endif
- || n == 1000 /* SSL_R_SSLV3_ALERT_CLOSE_NOTIFY */
- || n == SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE /* 1010 */
- || n == SSL_R_SSLV3_ALERT_BAD_RECORD_MAC /* 1020 */
- || n == SSL_R_TLSV1_ALERT_DECRYPTION_FAILED /* 1021 */
- || n == SSL_R_TLSV1_ALERT_RECORD_OVERFLOW /* 1022 */
- || n == SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE /* 1030 */
- || n == SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE /* 1040 */
- || n == SSL_R_SSLV3_ALERT_NO_CERTIFICATE /* 1041 */
- || n == SSL_R_SSLV3_ALERT_BAD_CERTIFICATE /* 1042 */
- || n == SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE /* 1043 */
- || n == SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED /* 1044 */
- || n == SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED /* 1045 */
- || n == SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN /* 1046 */
- || n == SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER /* 1047 */
- || n == SSL_R_TLSV1_ALERT_UNKNOWN_CA /* 1048 */
- || n == SSL_R_TLSV1_ALERT_ACCESS_DENIED /* 1049 */
- || n == SSL_R_TLSV1_ALERT_DECODE_ERROR /* 1050 */
- || n == SSL_R_TLSV1_ALERT_DECRYPT_ERROR /* 1051 */
- || n == SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION /* 1060 */
- || n == SSL_R_TLSV1_ALERT_PROTOCOL_VERSION /* 1070 */
- || n == SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY /* 1071 */
- || n == SSL_R_TLSV1_ALERT_INTERNAL_ERROR /* 1080 */
- || n == SSL_R_TLSV1_ALERT_USER_CANCELLED /* 1090 */
- || n == SSL_R_TLSV1_ALERT_NO_RENEGOTIATION) /* 1100 */
- {
- switch (c->log_error) {
-
- case NGX_ERROR_IGNORE_ECONNRESET:
- case NGX_ERROR_INFO:
- level = NGX_LOG_INFO;
- break;
-
- case NGX_ERROR_ERR:
- level = NGX_LOG_ERR;
- break;
-
- default:
- break;
- }
- }
- }
-
- ngx_ssl_error(level, c->log, err, text);
-}
-
-
-static void
-ngx_ssl_clear_error(ngx_log_t *log)
-{
- while (ERR_peek_error()) {
- ngx_ssl_error(NGX_LOG_ALERT, log, 0, "ignoring stale global SSL error");
- }
-
- ERR_clear_error();
-}
-
-
-void ngx_cdecl
-ngx_ssl_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err, char *fmt, ...)
-{
- int flags;
- u_long n;
- va_list args;
- u_char *p, *last;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
- const char *data;
-
- last = errstr + NGX_MAX_CONF_ERRSTR;
-
- va_start(args, fmt);
- p = ngx_vslprintf(errstr, last - 1, fmt, args);
- va_end(args);
-
- p = ngx_cpystrn(p, (u_char *) " (SSL:", last - p);
-
- for ( ;; ) {
-
- n = ERR_peek_error_line_data(NULL, NULL, &data, &flags);
-
- if (n == 0) {
- break;
- }
-
- if (p >= last) {
- goto next;
- }
-
- *p++ = ' ';
-
- ERR_error_string_n(n, (char *) p, last - p);
-
- while (p < last && *p) {
- p++;
- }
-
- if (p < last && *data && (flags & ERR_TXT_STRING)) {
- *p++ = ':';
- p = ngx_cpystrn(p, (u_char *) data, last - p);
- }
-
- next:
-
- (void) ERR_get_error();
- }
-
- ngx_log_error(level, log, err, "%s)", errstr);
-}
-
-
-ngx_int_t
-ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
- ssize_t builtin_session_cache, ngx_shm_zone_t *shm_zone, time_t timeout)
-{
- long cache_mode;
-
- SSL_CTX_set_timeout(ssl->ctx, (long) timeout);
-
- if (ngx_ssl_session_id_context(ssl, sess_ctx) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (builtin_session_cache == NGX_SSL_NO_SCACHE) {
- SSL_CTX_set_session_cache_mode(ssl->ctx, SSL_SESS_CACHE_OFF);
- return NGX_OK;
- }
-
- if (builtin_session_cache == NGX_SSL_NONE_SCACHE) {
-
- /*
- * If the server explicitly says that it does not support
- * session reuse (see SSL_SESS_CACHE_OFF above), then
- * Outlook Express fails to upload a sent email to
- * the Sent Items folder on the IMAP server via a separate IMAP
- * connection in the background. Therefore we have a special
- * mode (SSL_SESS_CACHE_SERVER|SSL_SESS_CACHE_NO_INTERNAL_STORE)
- * where the server pretends that it supports session reuse,
- * but it does not actually store any session.
- */
-
- SSL_CTX_set_session_cache_mode(ssl->ctx,
- SSL_SESS_CACHE_SERVER
- |SSL_SESS_CACHE_NO_AUTO_CLEAR
- |SSL_SESS_CACHE_NO_INTERNAL_STORE);
-
- SSL_CTX_sess_set_cache_size(ssl->ctx, 1);
-
- return NGX_OK;
- }
-
- cache_mode = SSL_SESS_CACHE_SERVER;
-
- if (shm_zone && builtin_session_cache == NGX_SSL_NO_BUILTIN_SCACHE) {
- cache_mode |= SSL_SESS_CACHE_NO_INTERNAL;
- }
-
- SSL_CTX_set_session_cache_mode(ssl->ctx, cache_mode);
-
- if (builtin_session_cache != NGX_SSL_NO_BUILTIN_SCACHE) {
-
- if (builtin_session_cache != NGX_SSL_DFLT_BUILTIN_SCACHE) {
- SSL_CTX_sess_set_cache_size(ssl->ctx, builtin_session_cache);
- }
- }
-
- if (shm_zone) {
- SSL_CTX_sess_set_new_cb(ssl->ctx, ngx_ssl_new_session);
- SSL_CTX_sess_set_get_cb(ssl->ctx, ngx_ssl_get_cached_session);
- SSL_CTX_sess_set_remove_cb(ssl->ctx, ngx_ssl_remove_session);
-
- if (SSL_CTX_set_ex_data(ssl->ctx, ngx_ssl_session_cache_index, shm_zone)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_set_ex_data() failed");
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_ssl_session_id_context(ngx_ssl_t *ssl, ngx_str_t *sess_ctx)
-{
- int n, i;
- X509 *cert;
- X509_NAME *name;
- EVP_MD_CTX md;
- unsigned int len;
- STACK_OF(X509_NAME) *list;
- u_char buf[EVP_MAX_MD_SIZE];
-
- /*
- * Session ID context is set based on the string provided,
- * the server certificate, and the client CA list.
- */
-
- EVP_MD_CTX_init(&md);
-
- if (EVP_DigestInit_ex(&md, EVP_sha1(), NULL) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "EVP_DigestInit_ex() failed");
- goto failed;
- }
-
- if (EVP_DigestUpdate(&md, sess_ctx->data, sess_ctx->len) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "EVP_DigestUpdate() failed");
- goto failed;
- }
-
- cert = SSL_CTX_get_ex_data(ssl->ctx, ngx_ssl_certificate_index);
-
- if (X509_digest(cert, EVP_sha1(), buf, &len) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "X509_digest() failed");
- goto failed;
- }
-
- if (EVP_DigestUpdate(&md, buf, len) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "EVP_DigestUpdate() failed");
- goto failed;
- }
-
- list = SSL_CTX_get_client_CA_list(ssl->ctx);
-
- if (list != NULL) {
- n = sk_X509_NAME_num(list);
-
- for (i = 0; i < n; i++) {
- name = sk_X509_NAME_value(list, i);
-
- if (X509_NAME_digest(name, EVP_sha1(), buf, &len) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "X509_NAME_digest() failed");
- goto failed;
- }
-
- if (EVP_DigestUpdate(&md, buf, len) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "EVP_DigestUpdate() failed");
- goto failed;
- }
- }
- }
-
- if (EVP_DigestFinal_ex(&md, buf, &len) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "EVP_DigestUpdate() failed");
- goto failed;
- }
-
- EVP_MD_CTX_cleanup(&md);
-
- if (SSL_CTX_set_session_id_context(ssl->ctx, buf, len) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_set_session_id_context() failed");
- return NGX_ERROR;
- }
-
- return NGX_OK;
-
-failed:
-
- EVP_MD_CTX_cleanup(&md);
-
- return NGX_ERROR;
-}
-
-
-ngx_int_t
-ngx_ssl_session_cache_init(ngx_shm_zone_t *shm_zone, void *data)
-{
- size_t len;
- ngx_slab_pool_t *shpool;
- ngx_ssl_session_cache_t *cache;
-
- if (data) {
- shm_zone->data = data;
- return NGX_OK;
- }
-
- shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
-
- if (shm_zone->shm.exists) {
- shm_zone->data = shpool->data;
- return NGX_OK;
- }
-
- cache = ngx_slab_alloc(shpool, sizeof(ngx_ssl_session_cache_t));
- if (cache == NULL) {
- return NGX_ERROR;
- }
-
- shpool->data = cache;
- shm_zone->data = cache;
-
- ngx_rbtree_init(&cache->session_rbtree, &cache->sentinel,
- ngx_ssl_session_rbtree_insert_value);
-
- ngx_queue_init(&cache->expire_queue);
-
- len = sizeof(" in SSL session shared cache \"\"") + shm_zone->shm.name.len;
-
- shpool->log_ctx = ngx_slab_alloc(shpool, len);
- if (shpool->log_ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_sprintf(shpool->log_ctx, " in SSL session shared cache \"%V\"%Z",
- &shm_zone->shm.name);
-
- shpool->log_nomem = 0;
-
- return NGX_OK;
-}
-
-
-/*
- * The length of the session id is 16 bytes for SSLv2 sessions and
- * between 1 and 32 bytes for SSLv3/TLSv1, typically 32 bytes.
- * It seems that the typical length of the external ASN1 representation
- * of a session is 118 or 119 bytes for SSLv3/TSLv1.
- *
- * Thus on 32-bit platforms we allocate separately an rbtree node,
- * a session id, and an ASN1 representation, they take accordingly
- * 64, 32, and 128 bytes.
- *
- * On 64-bit platforms we allocate separately an rbtree node + session_id,
- * and an ASN1 representation, they take accordingly 128 and 128 bytes.
- *
- * OpenSSL's i2d_SSL_SESSION() and d2i_SSL_SESSION are slow,
- * so they are outside the code locked by shared pool mutex
- */
-
-static int
-ngx_ssl_new_session(ngx_ssl_conn_t *ssl_conn, ngx_ssl_session_t *sess)
-{
- int len;
- u_char *p, *id, *cached_sess, *session_id;
- uint32_t hash;
- SSL_CTX *ssl_ctx;
- unsigned int session_id_length;
- ngx_shm_zone_t *shm_zone;
- ngx_connection_t *c;
- ngx_slab_pool_t *shpool;
- ngx_ssl_sess_id_t *sess_id;
- ngx_ssl_session_cache_t *cache;
- u_char buf[NGX_SSL_MAX_SESSION_SIZE];
-
- len = i2d_SSL_SESSION(sess, NULL);
-
- /* do not cache too big session */
-
- if (len > (int) NGX_SSL_MAX_SESSION_SIZE) {
- return 0;
- }
-
- p = buf;
- i2d_SSL_SESSION(sess, &p);
-
- c = ngx_ssl_get_connection(ssl_conn);
-
- ssl_ctx = SSL_get_SSL_CTX(ssl_conn);
- shm_zone = SSL_CTX_get_ex_data(ssl_ctx, ngx_ssl_session_cache_index);
-
- cache = shm_zone->data;
- shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
-
- ngx_shmtx_lock(&shpool->mutex);
-
- /* drop one or two expired sessions */
- ngx_ssl_expire_sessions(cache, shpool, 1);
-
- cached_sess = ngx_slab_alloc_locked(shpool, len);
-
- if (cached_sess == NULL) {
-
- /* drop the oldest non-expired session and try once more */
-
- ngx_ssl_expire_sessions(cache, shpool, 0);
-
- cached_sess = ngx_slab_alloc_locked(shpool, len);
-
- if (cached_sess == NULL) {
- sess_id = NULL;
- goto failed;
- }
- }
-
- sess_id = ngx_slab_alloc_locked(shpool, sizeof(ngx_ssl_sess_id_t));
-
- if (sess_id == NULL) {
-
- /* drop the oldest non-expired session and try once more */
-
- ngx_ssl_expire_sessions(cache, shpool, 0);
-
- sess_id = ngx_slab_alloc_locked(shpool, sizeof(ngx_ssl_sess_id_t));
-
- if (sess_id == NULL) {
- goto failed;
- }
- }
-
-#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
-
- session_id = (u_char *) SSL_SESSION_get_id(sess, &session_id_length);
-
-#else
-
- session_id = sess->session_id;
- session_id_length = sess->session_id_length;
-
-#endif
-
-#if (NGX_PTR_SIZE == 8)
-
- id = sess_id->sess_id;
-
-#else
-
- id = ngx_slab_alloc_locked(shpool, session_id_length);
-
- if (id == NULL) {
-
- /* drop the oldest non-expired session and try once more */
-
- ngx_ssl_expire_sessions(cache, shpool, 0);
-
- id = ngx_slab_alloc_locked(shpool, session_id_length);
-
- if (id == NULL) {
- goto failed;
- }
- }
-
-#endif
-
- ngx_memcpy(cached_sess, buf, len);
-
- ngx_memcpy(id, session_id, session_id_length);
-
- hash = ngx_crc32_short(session_id, session_id_length);
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "ssl new session: %08XD:%ud:%d",
- hash, session_id_length, len);
-
- sess_id->node.key = hash;
- sess_id->node.data = (u_char) session_id_length;
- sess_id->id = id;
- sess_id->len = len;
- sess_id->session = cached_sess;
-
- sess_id->expire = ngx_time() + SSL_CTX_get_timeout(ssl_ctx);
-
- ngx_queue_insert_head(&cache->expire_queue, &sess_id->queue);
-
- ngx_rbtree_insert(&cache->session_rbtree, &sess_id->node);
-
- ngx_shmtx_unlock(&shpool->mutex);
-
- return 0;
-
-failed:
-
- if (cached_sess) {
- ngx_slab_free_locked(shpool, cached_sess);
- }
-
- if (sess_id) {
- ngx_slab_free_locked(shpool, sess_id);
- }
-
- ngx_shmtx_unlock(&shpool->mutex);
-
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "could not allocate new session%s", shpool->log_ctx);
-
- return 0;
-}
-
-
-static ngx_ssl_session_t *
-ngx_ssl_get_cached_session(ngx_ssl_conn_t *ssl_conn, u_char *id, int len,
- int *copy)
-{
-#if OPENSSL_VERSION_NUMBER >= 0x0090707fL
- const
-#endif
- u_char *p;
- uint32_t hash;
- ngx_int_t rc;
- ngx_shm_zone_t *shm_zone;
- ngx_slab_pool_t *shpool;
- ngx_rbtree_node_t *node, *sentinel;
- ngx_ssl_session_t *sess;
- ngx_ssl_sess_id_t *sess_id;
- ngx_ssl_session_cache_t *cache;
- u_char buf[NGX_SSL_MAX_SESSION_SIZE];
-#if (NGX_DEBUG)
- ngx_connection_t *c;
-#endif
-
- hash = ngx_crc32_short(id, (size_t) len);
- *copy = 0;
-
-#if (NGX_DEBUG)
- c = ngx_ssl_get_connection(ssl_conn);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "ssl get session: %08XD:%d", hash, len);
-#endif
-
- shm_zone = SSL_CTX_get_ex_data(SSL_get_SSL_CTX(ssl_conn),
- ngx_ssl_session_cache_index);
-
- cache = shm_zone->data;
-
- sess = NULL;
-
- shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
-
- ngx_shmtx_lock(&shpool->mutex);
-
- node = cache->session_rbtree.root;
- sentinel = cache->session_rbtree.sentinel;
-
- while (node != sentinel) {
-
- if (hash < node->key) {
- node = node->left;
- continue;
- }
-
- if (hash > node->key) {
- node = node->right;
- continue;
- }
-
- /* hash == node->key */
-
- sess_id = (ngx_ssl_sess_id_t *) node;
-
- rc = ngx_memn2cmp(id, sess_id->id, (size_t) len, (size_t) node->data);
-
- if (rc == 0) {
-
- if (sess_id->expire > ngx_time()) {
- ngx_memcpy(buf, sess_id->session, sess_id->len);
-
- ngx_shmtx_unlock(&shpool->mutex);
-
- p = buf;
- sess = d2i_SSL_SESSION(NULL, &p, sess_id->len);
-
- return sess;
- }
-
- ngx_queue_remove(&sess_id->queue);
-
- ngx_rbtree_delete(&cache->session_rbtree, node);
-
- ngx_slab_free_locked(shpool, sess_id->session);
-#if (NGX_PTR_SIZE == 4)
- ngx_slab_free_locked(shpool, sess_id->id);
-#endif
- ngx_slab_free_locked(shpool, sess_id);
-
- sess = NULL;
-
- goto done;
- }
-
- node = (rc < 0) ? node->left : node->right;
- }
-
-done:
-
- ngx_shmtx_unlock(&shpool->mutex);
-
- return sess;
-}
-
-
-void
-ngx_ssl_remove_cached_session(SSL_CTX *ssl, ngx_ssl_session_t *sess)
-{
- SSL_CTX_remove_session(ssl, sess);
-
- ngx_ssl_remove_session(ssl, sess);
-}
-
-
-static void
-ngx_ssl_remove_session(SSL_CTX *ssl, ngx_ssl_session_t *sess)
-{
- u_char *id;
- uint32_t hash;
- ngx_int_t rc;
- unsigned int len;
- ngx_shm_zone_t *shm_zone;
- ngx_slab_pool_t *shpool;
- ngx_rbtree_node_t *node, *sentinel;
- ngx_ssl_sess_id_t *sess_id;
- ngx_ssl_session_cache_t *cache;
-
- shm_zone = SSL_CTX_get_ex_data(ssl, ngx_ssl_session_cache_index);
-
- if (shm_zone == NULL) {
- return;
- }
-
- cache = shm_zone->data;
-
-#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
-
- id = (u_char *) SSL_SESSION_get_id(sess, &len);
-
-#else
-
- id = sess->session_id;
- len = sess->session_id_length;
-
-#endif
-
- hash = ngx_crc32_short(id, len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ngx_cycle->log, 0,
- "ssl remove session: %08XD:%ud", hash, len);
-
- shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
-
- ngx_shmtx_lock(&shpool->mutex);
-
- node = cache->session_rbtree.root;
- sentinel = cache->session_rbtree.sentinel;
-
- while (node != sentinel) {
-
- if (hash < node->key) {
- node = node->left;
- continue;
- }
-
- if (hash > node->key) {
- node = node->right;
- continue;
- }
-
- /* hash == node->key */
-
- sess_id = (ngx_ssl_sess_id_t *) node;
-
- rc = ngx_memn2cmp(id, sess_id->id, len, (size_t) node->data);
-
- if (rc == 0) {
-
- ngx_queue_remove(&sess_id->queue);
-
- ngx_rbtree_delete(&cache->session_rbtree, node);
-
- ngx_slab_free_locked(shpool, sess_id->session);
-#if (NGX_PTR_SIZE == 4)
- ngx_slab_free_locked(shpool, sess_id->id);
-#endif
- ngx_slab_free_locked(shpool, sess_id);
-
- goto done;
- }
-
- node = (rc < 0) ? node->left : node->right;
- }
-
-done:
-
- ngx_shmtx_unlock(&shpool->mutex);
-}
-
-
-static void
-ngx_ssl_expire_sessions(ngx_ssl_session_cache_t *cache,
- ngx_slab_pool_t *shpool, ngx_uint_t n)
-{
- time_t now;
- ngx_queue_t *q;
- ngx_ssl_sess_id_t *sess_id;
-
- now = ngx_time();
-
- while (n < 3) {
-
- if (ngx_queue_empty(&cache->expire_queue)) {
- return;
- }
-
- q = ngx_queue_last(&cache->expire_queue);
-
- sess_id = ngx_queue_data(q, ngx_ssl_sess_id_t, queue);
-
- if (n++ != 0 && sess_id->expire > now) {
- return;
- }
-
- ngx_queue_remove(q);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ngx_cycle->log, 0,
- "expire session: %08Xi", sess_id->node.key);
-
- ngx_rbtree_delete(&cache->session_rbtree, &sess_id->node);
-
- ngx_slab_free_locked(shpool, sess_id->session);
-#if (NGX_PTR_SIZE == 4)
- ngx_slab_free_locked(shpool, sess_id->id);
-#endif
- ngx_slab_free_locked(shpool, sess_id);
- }
-}
-
-
-static void
-ngx_ssl_session_rbtree_insert_value(ngx_rbtree_node_t *temp,
- ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel)
-{
- ngx_rbtree_node_t **p;
- ngx_ssl_sess_id_t *sess_id, *sess_id_temp;
-
- for ( ;; ) {
-
- if (node->key < temp->key) {
-
- p = &temp->left;
-
- } else if (node->key > temp->key) {
-
- p = &temp->right;
-
- } else { /* node->key == temp->key */
-
- sess_id = (ngx_ssl_sess_id_t *) node;
- sess_id_temp = (ngx_ssl_sess_id_t *) temp;
-
- p = (ngx_memn2cmp(sess_id->id, sess_id_temp->id,
- (size_t) node->data, (size_t) temp->data)
- < 0) ? &temp->left : &temp->right;
- }
-
- if (*p == sentinel) {
- break;
- }
-
- temp = *p;
- }
-
- *p = node;
- node->parent = temp;
- node->left = sentinel;
- node->right = sentinel;
- ngx_rbt_red(node);
-}
-
-
-#ifdef SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB
-
-ngx_int_t
-ngx_ssl_session_ticket_keys(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_array_t *paths)
-{
- u_char buf[48];
- ssize_t n;
- ngx_str_t *path;
- ngx_file_t file;
- ngx_uint_t i;
- ngx_array_t *keys;
- ngx_file_info_t fi;
- ngx_ssl_session_ticket_key_t *key;
-
- if (paths == NULL) {
- return NGX_OK;
- }
-
- keys = ngx_array_create(cf->pool, paths->nelts,
- sizeof(ngx_ssl_session_ticket_key_t));
- if (keys == NULL) {
- return NGX_ERROR;
- }
-
- path = paths->elts;
- for (i = 0; i < paths->nelts; i++) {
-
- if (ngx_conf_full_name(cf->cycle, &path[i], 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_memzero(&file, sizeof(ngx_file_t));
- file.name = path[i];
- file.log = cf->log;
-
- file.fd = ngx_open_file(file.name.data, NGX_FILE_RDONLY, 0, 0);
- if (file.fd == NGX_INVALID_FILE) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, ngx_errno,
- ngx_open_file_n " \"%V\" failed", &file.name);
- return NGX_ERROR;
- }
-
- if (ngx_fd_info(file.fd, &fi) == NGX_FILE_ERROR) {
- ngx_conf_log_error(NGX_LOG_CRIT, cf, ngx_errno,
- ngx_fd_info_n " \"%V\" failed", &file.name);
- goto failed;
- }
-
- if (ngx_file_size(&fi) != 48) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"%V\" must be 48 bytes", &file.name);
- goto failed;
- }
-
- n = ngx_read_file(&file, buf, 48, 0);
-
- if (n == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_CRIT, cf, ngx_errno,
- ngx_read_file_n " \"%V\" failed", &file.name);
- goto failed;
- }
-
- if (n != 48) {
- ngx_conf_log_error(NGX_LOG_CRIT, cf, 0,
- ngx_read_file_n " \"%V\" returned only "
- "%z bytes instead of 48", &file.name, n);
- goto failed;
- }
-
- key = ngx_array_push(keys);
- if (key == NULL) {
- goto failed;
- }
-
- ngx_memcpy(key->name, buf, 16);
- ngx_memcpy(key->aes_key, buf + 16, 16);
- ngx_memcpy(key->hmac_key, buf + 32, 16);
-
- if (ngx_close_file(file.fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
- ngx_close_file_n " \"%V\" failed", &file.name);
- }
- }
-
- if (SSL_CTX_set_ex_data(ssl->ctx, ngx_ssl_session_ticket_keys_index, keys)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_set_ex_data() failed");
- return NGX_ERROR;
- }
-
- if (SSL_CTX_set_tlsext_ticket_key_cb(ssl->ctx,
- ngx_ssl_session_ticket_key_callback)
- == 0)
- {
- ngx_log_error(NGX_LOG_WARN, cf->log, 0,
- "nginx was built with Session Tickets support, however, "
- "now it is linked dynamically to an OpenSSL library "
- "which has no tlsext support, therefore Session Tickets "
- "are not available");
- }
-
- return NGX_OK;
-
-failed:
-
- if (ngx_close_file(file.fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
- ngx_close_file_n " \"%V\" failed", &file.name);
- }
-
- return NGX_ERROR;
-}
-
-
-#ifdef OPENSSL_NO_SHA256
-#define ngx_ssl_session_ticket_md EVP_sha1
-#else
-#define ngx_ssl_session_ticket_md EVP_sha256
-#endif
-
-
-static int
-ngx_ssl_session_ticket_key_callback(ngx_ssl_conn_t *ssl_conn,
- unsigned char *name, unsigned char *iv, EVP_CIPHER_CTX *ectx,
- HMAC_CTX *hctx, int enc)
-{
- SSL_CTX *ssl_ctx;
- ngx_uint_t i;
- ngx_array_t *keys;
- ngx_ssl_session_ticket_key_t *key;
-#if (NGX_DEBUG)
- u_char buf[32];
- ngx_connection_t *c;
-#endif
-
- ssl_ctx = SSL_get_SSL_CTX(ssl_conn);
-
- keys = SSL_CTX_get_ex_data(ssl_ctx, ngx_ssl_session_ticket_keys_index);
- if (keys == NULL) {
- return -1;
- }
-
- key = keys->elts;
-
-#if (NGX_DEBUG)
- c = ngx_ssl_get_connection(ssl_conn);
-#endif
-
- if (enc == 1) {
- /* encrypt session ticket */
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "ssl session ticket encrypt, key: \"%*s\" (%s session)",
- ngx_hex_dump(buf, key[0].name, 16) - buf, buf,
- SSL_session_reused(ssl_conn) ? "reused" : "new");
-
- RAND_pseudo_bytes(iv, 16);
- EVP_EncryptInit_ex(ectx, EVP_aes_128_cbc(), NULL, key[0].aes_key, iv);
- HMAC_Init_ex(hctx, key[0].hmac_key, 16,
- ngx_ssl_session_ticket_md(), NULL);
- ngx_memcpy(name, key[0].name, 16);
-
- return 0;
-
- } else {
- /* decrypt session ticket */
-
- for (i = 0; i < keys->nelts; i++) {
- if (ngx_memcmp(name, key[i].name, 16) == 0) {
- goto found;
- }
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "ssl session ticket decrypt, key: \"%*s\" not found",
- ngx_hex_dump(buf, name, 16) - buf, buf);
-
- return 0;
-
- found:
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "ssl session ticket decrypt, key: \"%*s\"%s",
- ngx_hex_dump(buf, key[i].name, 16) - buf, buf,
- (i == 0) ? " (default)" : "");
-
- HMAC_Init_ex(hctx, key[i].hmac_key, 16,
- ngx_ssl_session_ticket_md(), NULL);
- EVP_DecryptInit_ex(ectx, EVP_aes_128_cbc(), NULL, key[i].aes_key, iv);
-
- return (i == 0) ? 1 : 2 /* renew */;
- }
-}
-
-#else
-
-ngx_int_t
-ngx_ssl_session_ticket_keys(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_array_t *paths)
-{
- if (paths) {
- ngx_log_error(NGX_LOG_WARN, ssl->log, 0,
- "\"ssl_session_ticket_keys\" ignored, not supported");
- }
-
- return NGX_OK;
-}
-
-#endif
-
-
-void
-ngx_ssl_cleanup_ctx(void *data)
-{
- ngx_ssl_t *ssl = data;
-
- SSL_CTX_free(ssl->ctx);
-}
-
-
-ngx_int_t
-ngx_ssl_check_host(ngx_connection_t *c, ngx_str_t *name)
-{
- X509 *cert;
-
- cert = SSL_get_peer_certificate(c->ssl->connection);
- if (cert == NULL) {
- return NGX_ERROR;
- }
-
-#if (OPENSSL_VERSION_NUMBER >= 0x10002002L && !defined LIBRESSL_VERSION_NUMBER)
-
- /* X509_check_host() is only available in OpenSSL 1.0.2+ */
-
- if (name->len == 0) {
- goto failed;
- }
-
- if (X509_check_host(cert, (char *) name->data, name->len, 0, NULL) != 1) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "X509_check_host(): no match");
- goto failed;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "X509_check_host(): match");
-
- goto found;
-
-#else
- {
- int n, i;
- X509_NAME *sname;
- ASN1_STRING *str;
- X509_NAME_ENTRY *entry;
- GENERAL_NAME *altname;
- STACK_OF(GENERAL_NAME) *altnames;
-
- /*
- * As per RFC6125 and RFC2818, we check subjectAltName extension,
- * and if it's not present - commonName in Subject is checked.
- */
-
- altnames = X509_get_ext_d2i(cert, NID_subject_alt_name, NULL, NULL);
-
- if (altnames) {
- n = sk_GENERAL_NAME_num(altnames);
-
- for (i = 0; i < n; i++) {
- altname = sk_GENERAL_NAME_value(altnames, i);
-
- if (altname->type != GEN_DNS) {
- continue;
- }
-
- str = altname->d.dNSName;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL subjectAltName: \"%*s\"",
- ASN1_STRING_length(str), ASN1_STRING_data(str));
-
- if (ngx_ssl_check_name(name, str) == NGX_OK) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL subjectAltName: match");
- GENERAL_NAMES_free(altnames);
- goto found;
- }
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL subjectAltName: no match");
-
- GENERAL_NAMES_free(altnames);
- goto failed;
- }
-
- /*
- * If there is no subjectAltName extension, check commonName
- * in Subject. While RFC2818 requires to only check "most specific"
- * CN, both Apache and OpenSSL check all CNs, and so do we.
- */
-
- sname = X509_get_subject_name(cert);
-
- if (sname == NULL) {
- goto failed;
- }
-
- i = -1;
- for ( ;; ) {
- i = X509_NAME_get_index_by_NID(sname, NID_commonName, i);
-
- if (i < 0) {
- break;
- }
-
- entry = X509_NAME_get_entry(sname, i);
- str = X509_NAME_ENTRY_get_data(entry);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL commonName: \"%*s\"",
- ASN1_STRING_length(str), ASN1_STRING_data(str));
-
- if (ngx_ssl_check_name(name, str) == NGX_OK) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL commonName: match");
- goto found;
- }
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL commonName: no match");
- }
-#endif
-
-failed:
-
- X509_free(cert);
- return NGX_ERROR;
-
-found:
-
- X509_free(cert);
- return NGX_OK;
-}
-
-
-#if (OPENSSL_VERSION_NUMBER < 0x10002002L || defined LIBRESSL_VERSION_NUMBER)
-
-static ngx_int_t
-ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *pattern)
-{
- u_char *s, *p, *end;
- size_t slen, plen;
-
- s = name->data;
- slen = name->len;
-
- p = ASN1_STRING_data(pattern);
- plen = ASN1_STRING_length(pattern);
-
- if (slen == plen && ngx_strncasecmp(s, p, plen) == 0) {
- return NGX_OK;
- }
-
- if (plen > 2 && p[0] == '*' && p[1] == '.') {
- plen -= 1;
- p += 1;
-
- end = s + slen;
- s = ngx_strlchr(s, end, '.');
-
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- slen = end - s;
-
- if (plen == slen && ngx_strncasecmp(s, p, plen) == 0) {
- return NGX_OK;
- }
- }
-
- return NGX_ERROR;
-}
-
-#endif
-
-
-ngx_int_t
-ngx_ssl_get_protocol(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- s->data = (u_char *) SSL_get_version(c->ssl->connection);
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_cipher_name(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- s->data = (u_char *) SSL_get_cipher_name(c->ssl->connection);
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_session_id(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- u_char *buf;
- SSL_SESSION *sess;
- unsigned int len;
-
- sess = SSL_get0_session(c->ssl->connection);
- if (sess == NULL) {
- s->len = 0;
- return NGX_OK;
- }
-
-#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
-
- buf = (u_char *) SSL_SESSION_get_id(sess, &len);
-
-#else
-
- buf = sess->session_id;
- len = sess->session_id_length;
-
-#endif
-
- s->len = 2 * len;
- s->data = ngx_pnalloc(pool, 2 * len);
- if (s->data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_hex_dump(s->data, buf, len);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_session_reused(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- if (SSL_session_reused(c->ssl->connection)) {
- ngx_str_set(s, "r");
-
- } else {
- ngx_str_set(s, ".");
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_server_name(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
-#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
-
- const char *servername;
-
- servername = SSL_get_servername(c->ssl->connection,
- TLSEXT_NAMETYPE_host_name);
- if (servername) {
- s->data = (u_char *) servername;
- s->len = ngx_strlen(servername);
- return NGX_OK;
- }
-
-#endif
-
- s->len = 0;
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_raw_certificate(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- size_t len;
- BIO *bio;
- X509 *cert;
-
- s->len = 0;
-
- cert = SSL_get_peer_certificate(c->ssl->connection);
- if (cert == NULL) {
- return NGX_OK;
- }
-
- bio = BIO_new(BIO_s_mem());
- if (bio == NULL) {
- ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, "BIO_new() failed");
- X509_free(cert);
- return NGX_ERROR;
- }
-
- if (PEM_write_bio_X509(bio, cert) == 0) {
- ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, "PEM_write_bio_X509() failed");
- goto failed;
- }
-
- len = BIO_pending(bio);
- s->len = len;
-
- s->data = ngx_pnalloc(pool, len);
- if (s->data == NULL) {
- goto failed;
- }
-
- BIO_read(bio, s->data, len);
-
- BIO_free(bio);
- X509_free(cert);
-
- return NGX_OK;
-
-failed:
-
- BIO_free(bio);
- X509_free(cert);
-
- return NGX_ERROR;
-}
-
-
-ngx_int_t
-ngx_ssl_get_certificate(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- u_char *p;
- size_t len;
- ngx_uint_t i;
- ngx_str_t cert;
-
- if (ngx_ssl_get_raw_certificate(c, pool, &cert) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (cert.len == 0) {
- s->len = 0;
- return NGX_OK;
- }
-
- len = cert.len - 1;
-
- for (i = 0; i < cert.len - 1; i++) {
- if (cert.data[i] == LF) {
- len++;
- }
- }
-
- s->len = len;
- s->data = ngx_pnalloc(pool, len);
- if (s->data == NULL) {
- return NGX_ERROR;
- }
-
- p = s->data;
-
- for (i = 0; i < cert.len - 1; i++) {
- *p++ = cert.data[i];
- if (cert.data[i] == LF) {
- *p++ = '\t';
- }
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_subject_dn(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- char *p;
- size_t len;
- X509 *cert;
- X509_NAME *name;
-
- s->len = 0;
-
- cert = SSL_get_peer_certificate(c->ssl->connection);
- if (cert == NULL) {
- return NGX_OK;
- }
-
- name = X509_get_subject_name(cert);
- if (name == NULL) {
- X509_free(cert);
- return NGX_ERROR;
- }
-
- p = X509_NAME_oneline(name, NULL, 0);
-
- for (len = 0; p[len]; len++) { /* void */ }
-
- s->len = len;
- s->data = ngx_pnalloc(pool, len);
- if (s->data == NULL) {
- OPENSSL_free(p);
- X509_free(cert);
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->data, p, len);
-
- OPENSSL_free(p);
- X509_free(cert);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_issuer_dn(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- char *p;
- size_t len;
- X509 *cert;
- X509_NAME *name;
-
- s->len = 0;
-
- cert = SSL_get_peer_certificate(c->ssl->connection);
- if (cert == NULL) {
- return NGX_OK;
- }
-
- name = X509_get_issuer_name(cert);
- if (name == NULL) {
- X509_free(cert);
- return NGX_ERROR;
- }
-
- p = X509_NAME_oneline(name, NULL, 0);
-
- for (len = 0; p[len]; len++) { /* void */ }
-
- s->len = len;
- s->data = ngx_pnalloc(pool, len);
- if (s->data == NULL) {
- OPENSSL_free(p);
- X509_free(cert);
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->data, p, len);
-
- OPENSSL_free(p);
- X509_free(cert);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_serial_number(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- size_t len;
- X509 *cert;
- BIO *bio;
-
- s->len = 0;
-
- cert = SSL_get_peer_certificate(c->ssl->connection);
- if (cert == NULL) {
- return NGX_OK;
- }
-
- bio = BIO_new(BIO_s_mem());
- if (bio == NULL) {
- X509_free(cert);
- return NGX_ERROR;
- }
-
- i2a_ASN1_INTEGER(bio, X509_get_serialNumber(cert));
- len = BIO_pending(bio);
-
- s->len = len;
- s->data = ngx_pnalloc(pool, len);
- if (s->data == NULL) {
- BIO_free(bio);
- X509_free(cert);
- return NGX_ERROR;
- }
-
- BIO_read(bio, s->data, len);
- BIO_free(bio);
- X509_free(cert);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_fingerprint(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- X509 *cert;
- unsigned int len;
- u_char buf[EVP_MAX_MD_SIZE];
-
- s->len = 0;
-
- cert = SSL_get_peer_certificate(c->ssl->connection);
- if (cert == NULL) {
- return NGX_OK;
- }
-
- if (!X509_digest(cert, EVP_sha1(), buf, &len)) {
- X509_free(cert);
- return NGX_ERROR;
- }
-
- s->len = 2 * len;
- s->data = ngx_pnalloc(pool, 2 * len);
- if (s->data == NULL) {
- X509_free(cert);
- return NGX_ERROR;
- }
-
- ngx_hex_dump(s->data, buf, len);
-
- X509_free(cert);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_get_client_verify(ngx_connection_t *c, ngx_pool_t *pool, ngx_str_t *s)
-{
- X509 *cert;
-
- if (SSL_get_verify_result(c->ssl->connection) != X509_V_OK) {
- ngx_str_set(s, "FAILED");
- return NGX_OK;
- }
-
- cert = SSL_get_peer_certificate(c->ssl->connection);
-
- if (cert) {
- ngx_str_set(s, "SUCCESS");
-
- } else {
- ngx_str_set(s, "NONE");
- }
-
- X509_free(cert);
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_openssl_create_conf(ngx_cycle_t *cycle)
-{
- ngx_openssl_conf_t *oscf;
-
- oscf = ngx_pcalloc(cycle->pool, sizeof(ngx_openssl_conf_t));
- if (oscf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * oscf->engine = 0;
- */
-
- return oscf;
-}
-
-
-static char *
-ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
-#ifndef OPENSSL_NO_ENGINE
-
- ngx_openssl_conf_t *oscf = conf;
-
- ENGINE *engine;
- ngx_str_t *value;
-
- if (oscf->engine) {
- return "is duplicate";
- }
-
- oscf->engine = 1;
-
- value = cf->args->elts;
-
- engine = ENGINE_by_id((const char *) value[1].data);
-
- if (engine == NULL) {
- ngx_ssl_error(NGX_LOG_WARN, cf->log, 0,
- "ENGINE_by_id(\"%V\") failed", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- if (ENGINE_set_default(engine, ENGINE_METHOD_ALL) == 0) {
- ngx_ssl_error(NGX_LOG_WARN, cf->log, 0,
- "ENGINE_set_default(\"%V\", ENGINE_METHOD_ALL) failed",
- &value[1]);
-
- ENGINE_free(engine);
-
- return NGX_CONF_ERROR;
- }
-
- ENGINE_free(engine);
-
- return NGX_CONF_OK;
-
-#else
-
- return "is not supported";
-
-#endif
-}
-
-
-static void
-ngx_openssl_exit(ngx_cycle_t *cycle)
-{
- EVP_cleanup();
-#ifndef OPENSSL_NO_ENGINE
- ENGINE_cleanup();
-#endif
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.h
deleted file mode 100644
index 40869403519..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl.h
+++ /dev/null
@@ -1,215 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_EVENT_OPENSSL_H_INCLUDED_
-#define _NGX_EVENT_OPENSSL_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#include <openssl/bn.h>
-#include <openssl/conf.h>
-#include <openssl/crypto.h>
-#include <openssl/dh.h>
-#ifndef OPENSSL_NO_ENGINE
-#include <openssl/engine.h>
-#endif
-#include <openssl/evp.h>
-#ifndef OPENSSL_NO_OCSP
-#include <openssl/ocsp.h>
-#endif
-#include <openssl/rand.h>
-#include <openssl/rsa.h>
-#include <openssl/x509.h>
-#include <openssl/x509v3.h>
-
-#define NGX_SSL_NAME "OpenSSL"
-
-
-#define ngx_ssl_session_t SSL_SESSION
-#define ngx_ssl_conn_t SSL
-
-
-typedef struct {
- SSL_CTX *ctx;
- ngx_log_t *log;
- size_t buffer_size;
-} ngx_ssl_t;
-
-
-typedef struct {
- ngx_ssl_conn_t *connection;
-
- ngx_int_t last;
- ngx_buf_t *buf;
- size_t buffer_size;
-
- ngx_connection_handler_pt handler;
-
- ngx_event_handler_pt saved_read_handler;
- ngx_event_handler_pt saved_write_handler;
-
- unsigned handshaked:1;
- unsigned renegotiation:1;
- unsigned buffer:1;
- unsigned no_wait_shutdown:1;
- unsigned no_send_shutdown:1;
- unsigned handshake_buffer_set:1;
-} ngx_ssl_connection_t;
-
-
-#define NGX_SSL_NO_SCACHE -2
-#define NGX_SSL_NONE_SCACHE -3
-#define NGX_SSL_NO_BUILTIN_SCACHE -4
-#define NGX_SSL_DFLT_BUILTIN_SCACHE -5
-
-
-#define NGX_SSL_MAX_SESSION_SIZE 4096
-
-typedef struct ngx_ssl_sess_id_s ngx_ssl_sess_id_t;
-
-struct ngx_ssl_sess_id_s {
- ngx_rbtree_node_t node;
- u_char *id;
- size_t len;
- u_char *session;
- ngx_queue_t queue;
- time_t expire;
-#if (NGX_PTR_SIZE == 8)
- void *stub;
- u_char sess_id[32];
-#endif
-};
-
-
-typedef struct {
- ngx_rbtree_t session_rbtree;
- ngx_rbtree_node_t sentinel;
- ngx_queue_t expire_queue;
-} ngx_ssl_session_cache_t;
-
-
-#ifdef SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB
-
-typedef struct {
- u_char name[16];
- u_char aes_key[16];
- u_char hmac_key[16];
-} ngx_ssl_session_ticket_key_t;
-
-#endif
-
-
-#define NGX_SSL_SSLv2 0x0002
-#define NGX_SSL_SSLv3 0x0004
-#define NGX_SSL_TLSv1 0x0008
-#define NGX_SSL_TLSv1_1 0x0010
-#define NGX_SSL_TLSv1_2 0x0020
-
-
-#define NGX_SSL_BUFFER 1
-#define NGX_SSL_CLIENT 2
-
-#define NGX_SSL_BUFSIZE 16384
-
-
-ngx_int_t ngx_ssl_init(ngx_log_t *log);
-ngx_int_t ngx_ssl_create(ngx_ssl_t *ssl, ngx_uint_t protocols, void *data);
-ngx_int_t ngx_ssl_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_str_t *cert, ngx_str_t *key, ngx_array_t *passwords);
-ngx_int_t ngx_ssl_client_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_str_t *cert, ngx_int_t depth);
-ngx_int_t ngx_ssl_trusted_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_str_t *cert, ngx_int_t depth);
-ngx_int_t ngx_ssl_crl(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *crl);
-ngx_int_t ngx_ssl_stapling(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_str_t *file, ngx_str_t *responder, ngx_uint_t verify);
-ngx_int_t ngx_ssl_stapling_resolver(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_resolver_t *resolver, ngx_msec_t resolver_timeout);
-RSA *ngx_ssl_rsa512_key_callback(ngx_ssl_conn_t *ssl_conn, int is_export,
- int key_length);
-ngx_array_t *ngx_ssl_read_password_file(ngx_conf_t *cf, ngx_str_t *file);
-ngx_int_t ngx_ssl_dhparam(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *file);
-ngx_int_t ngx_ssl_ecdh_curve(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *name);
-ngx_int_t ngx_ssl_session_cache(ngx_ssl_t *ssl, ngx_str_t *sess_ctx,
- ssize_t builtin_session_cache, ngx_shm_zone_t *shm_zone, time_t timeout);
-ngx_int_t ngx_ssl_session_ticket_keys(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_array_t *paths);
-ngx_int_t ngx_ssl_session_cache_init(ngx_shm_zone_t *shm_zone, void *data);
-ngx_int_t ngx_ssl_create_connection(ngx_ssl_t *ssl, ngx_connection_t *c,
- ngx_uint_t flags);
-
-void ngx_ssl_remove_cached_session(SSL_CTX *ssl, ngx_ssl_session_t *sess);
-ngx_int_t ngx_ssl_set_session(ngx_connection_t *c, ngx_ssl_session_t *session);
-#define ngx_ssl_get_session(c) SSL_get1_session(c->ssl->connection)
-#define ngx_ssl_free_session SSL_SESSION_free
-#define ngx_ssl_get_connection(ssl_conn) \
- SSL_get_ex_data(ssl_conn, ngx_ssl_connection_index)
-#define ngx_ssl_get_server_conf(ssl_ctx) \
- SSL_CTX_get_ex_data(ssl_ctx, ngx_ssl_server_conf_index)
-
-#define ngx_ssl_verify_error_optional(n) \
- (n == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT \
- || n == X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN \
- || n == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY \
- || n == X509_V_ERR_CERT_UNTRUSTED \
- || n == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE)
-
-ngx_int_t ngx_ssl_check_host(ngx_connection_t *c, ngx_str_t *name);
-
-
-ngx_int_t ngx_ssl_get_protocol(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_cipher_name(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_session_id(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_session_reused(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_server_name(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_raw_certificate(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_certificate(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_subject_dn(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_issuer_dn(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_serial_number(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_fingerprint(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-ngx_int_t ngx_ssl_get_client_verify(ngx_connection_t *c, ngx_pool_t *pool,
- ngx_str_t *s);
-
-
-ngx_int_t ngx_ssl_handshake(ngx_connection_t *c);
-ssize_t ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size);
-ssize_t ngx_ssl_write(ngx_connection_t *c, u_char *data, size_t size);
-ssize_t ngx_ssl_recv_chain(ngx_connection_t *c, ngx_chain_t *cl);
-ngx_chain_t *ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in,
- off_t limit);
-void ngx_ssl_free_buffer(ngx_connection_t *c);
-ngx_int_t ngx_ssl_shutdown(ngx_connection_t *c);
-void ngx_cdecl ngx_ssl_error(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
- char *fmt, ...);
-void ngx_ssl_cleanup_ctx(void *data);
-
-
-extern int ngx_ssl_connection_index;
-extern int ngx_ssl_server_conf_index;
-extern int ngx_ssl_session_cache_index;
-extern int ngx_ssl_session_ticket_keys_index;
-extern int ngx_ssl_certificate_index;
-extern int ngx_ssl_stapling_index;
-
-
-#endif /* _NGX_EVENT_OPENSSL_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl_stapling.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl_stapling.c
deleted file mode 100644
index 2fa0673093e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_openssl_stapling.c
+++ /dev/null
@@ -1,1762 +0,0 @@
-
-/*
- * Copyright (C) Maxim Dounin
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_event_connect.h>
-
-
-#if (!defined OPENSSL_NO_OCSP && defined SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB)
-
-
-typedef struct {
- ngx_str_t staple;
- ngx_msec_t timeout;
-
- ngx_resolver_t *resolver;
- ngx_msec_t resolver_timeout;
-
- ngx_addr_t *addrs;
- ngx_str_t host;
- ngx_str_t uri;
- in_port_t port;
-
- SSL_CTX *ssl_ctx;
-
- X509 *cert;
- X509 *issuer;
-
- time_t valid;
-
- unsigned verify:1;
- unsigned loading:1;
-} ngx_ssl_stapling_t;
-
-
-typedef struct ngx_ssl_ocsp_ctx_s ngx_ssl_ocsp_ctx_t;
-
-struct ngx_ssl_ocsp_ctx_s {
- X509 *cert;
- X509 *issuer;
-
- ngx_uint_t naddrs;
-
- ngx_addr_t *addrs;
- ngx_str_t host;
- ngx_str_t uri;
- in_port_t port;
-
- ngx_resolver_t *resolver;
- ngx_msec_t resolver_timeout;
-
- ngx_msec_t timeout;
-
- void (*handler)(ngx_ssl_ocsp_ctx_t *r);
- void *data;
-
- ngx_buf_t *request;
- ngx_buf_t *response;
- ngx_peer_connection_t peer;
-
- ngx_int_t (*process)(ngx_ssl_ocsp_ctx_t *r);
-
- ngx_uint_t state;
-
- ngx_uint_t code;
- ngx_uint_t count;
-
- ngx_uint_t done;
-
- u_char *header_name_start;
- u_char *header_name_end;
- u_char *header_start;
- u_char *header_end;
-
- ngx_pool_t *pool;
- ngx_log_t *log;
-};
-
-
-static ngx_int_t ngx_ssl_stapling_file(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_str_t *file);
-static ngx_int_t ngx_ssl_stapling_issuer(ngx_conf_t *cf, ngx_ssl_t *ssl);
-static ngx_int_t ngx_ssl_stapling_responder(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_str_t *responder);
-
-static int ngx_ssl_certificate_status_callback(ngx_ssl_conn_t *ssl_conn,
- void *data);
-static void ngx_ssl_stapling_update(ngx_ssl_stapling_t *staple);
-static void ngx_ssl_stapling_ocsp_handler(ngx_ssl_ocsp_ctx_t *ctx);
-
-static void ngx_ssl_stapling_cleanup(void *data);
-
-static ngx_ssl_ocsp_ctx_t *ngx_ssl_ocsp_start(void);
-static void ngx_ssl_ocsp_done(ngx_ssl_ocsp_ctx_t *ctx);
-static void ngx_ssl_ocsp_request(ngx_ssl_ocsp_ctx_t *ctx);
-static void ngx_ssl_ocsp_resolve_handler(ngx_resolver_ctx_t *resolve);
-static void ngx_ssl_ocsp_connect(ngx_ssl_ocsp_ctx_t *ctx);
-static void ngx_ssl_ocsp_write_handler(ngx_event_t *wev);
-static void ngx_ssl_ocsp_read_handler(ngx_event_t *rev);
-static void ngx_ssl_ocsp_dummy_handler(ngx_event_t *ev);
-
-static ngx_int_t ngx_ssl_ocsp_create_request(ngx_ssl_ocsp_ctx_t *ctx);
-static ngx_int_t ngx_ssl_ocsp_process_status_line(ngx_ssl_ocsp_ctx_t *ctx);
-static ngx_int_t ngx_ssl_ocsp_parse_status_line(ngx_ssl_ocsp_ctx_t *ctx);
-static ngx_int_t ngx_ssl_ocsp_process_headers(ngx_ssl_ocsp_ctx_t *ctx);
-static ngx_int_t ngx_ssl_ocsp_parse_header_line(ngx_ssl_ocsp_ctx_t *ctx);
-static ngx_int_t ngx_ssl_ocsp_process_body(ngx_ssl_ocsp_ctx_t *ctx);
-
-static u_char *ngx_ssl_ocsp_log_error(ngx_log_t *log, u_char *buf, size_t len);
-
-
-ngx_int_t
-ngx_ssl_stapling(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *file,
- ngx_str_t *responder, ngx_uint_t verify)
-{
- ngx_int_t rc;
- ngx_pool_cleanup_t *cln;
- ngx_ssl_stapling_t *staple;
-
- staple = ngx_pcalloc(cf->pool, sizeof(ngx_ssl_stapling_t));
- if (staple == NULL) {
- return NGX_ERROR;
- }
-
- cln = ngx_pool_cleanup_add(cf->pool, 0);
- if (cln == NULL) {
- return NGX_ERROR;
- }
-
- cln->handler = ngx_ssl_stapling_cleanup;
- cln->data = staple;
-
- if (SSL_CTX_set_ex_data(ssl->ctx, ngx_ssl_stapling_index, staple)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_set_ex_data() failed");
- return NGX_ERROR;
- }
-
- staple->ssl_ctx = ssl->ctx;
- staple->timeout = 60000;
- staple->verify = verify;
-
- if (file->len) {
- /* use OCSP response from the file */
-
- if (ngx_ssl_stapling_file(cf, ssl, file) != NGX_OK) {
- return NGX_ERROR;
- }
-
- goto done;
- }
-
- rc = ngx_ssl_stapling_issuer(cf, ssl);
-
- if (rc == NGX_DECLINED) {
- return NGX_OK;
- }
-
- if (rc != NGX_OK) {
- return NGX_ERROR;
- }
-
- rc = ngx_ssl_stapling_responder(cf, ssl, responder);
-
- if (rc == NGX_DECLINED) {
- return NGX_OK;
- }
-
- if (rc != NGX_OK) {
- return NGX_ERROR;
- }
-
-done:
-
- SSL_CTX_set_tlsext_status_cb(ssl->ctx, ngx_ssl_certificate_status_callback);
- SSL_CTX_set_tlsext_status_arg(ssl->ctx, staple);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_ssl_stapling_file(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *file)
-{
- BIO *bio;
- int len;
- u_char *p, *buf;
- OCSP_RESPONSE *response;
- ngx_ssl_stapling_t *staple;
-
- staple = SSL_CTX_get_ex_data(ssl->ctx, ngx_ssl_stapling_index);
-
- if (ngx_conf_full_name(cf->cycle, file, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- bio = BIO_new_file((char *) file->data, "r");
- if (bio == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "BIO_new_file(\"%s\") failed", file->data);
- return NGX_ERROR;
- }
-
- response = d2i_OCSP_RESPONSE_bio(bio, NULL);
- if (response == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "d2i_OCSP_RESPONSE_bio(\"%s\") failed", file->data);
- BIO_free(bio);
- return NGX_ERROR;
- }
-
- len = i2d_OCSP_RESPONSE(response, NULL);
- if (len <= 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "i2d_OCSP_RESPONSE(\"%s\") failed", file->data);
- goto failed;
- }
-
- buf = ngx_alloc(len, ssl->log);
- if (buf == NULL) {
- goto failed;
- }
-
- p = buf;
- len = i2d_OCSP_RESPONSE(response, &p);
- if (len <= 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "i2d_OCSP_RESPONSE(\"%s\") failed", file->data);
- ngx_free(buf);
- goto failed;
- }
-
- OCSP_RESPONSE_free(response);
- BIO_free(bio);
-
- staple->staple.data = buf;
- staple->staple.len = len;
-
- return NGX_OK;
-
-failed:
-
- OCSP_RESPONSE_free(response);
- BIO_free(bio);
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_ssl_stapling_issuer(ngx_conf_t *cf, ngx_ssl_t *ssl)
-{
- int i, n, rc;
- X509 *cert, *issuer;
- X509_STORE *store;
- X509_STORE_CTX *store_ctx;
- STACK_OF(X509) *chain;
- ngx_ssl_stapling_t *staple;
-
- staple = SSL_CTX_get_ex_data(ssl->ctx, ngx_ssl_stapling_index);
- cert = SSL_CTX_get_ex_data(ssl->ctx, ngx_ssl_certificate_index);
-
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- SSL_CTX_get_extra_chain_certs(ssl->ctx, &chain);
-#else
- chain = ssl->ctx->extra_certs;
-#endif
-
- n = sk_X509_num(chain);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ssl->log, 0,
- "SSL get issuer: %d extra certs", n);
-
- for (i = 0; i < n; i++) {
- issuer = sk_X509_value(chain, i);
- if (X509_check_issued(issuer, cert) == X509_V_OK) {
- CRYPTO_add(&issuer->references, 1, CRYPTO_LOCK_X509);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ssl->log, 0,
- "SSL get issuer: found %p in extra certs", issuer);
-
- staple->cert = cert;
- staple->issuer = issuer;
-
- return NGX_OK;
- }
- }
-
- store = SSL_CTX_get_cert_store(ssl->ctx);
- if (store == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "SSL_CTX_get_cert_store() failed");
- return NGX_ERROR;
- }
-
- store_ctx = X509_STORE_CTX_new();
- if (store_ctx == NULL) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "X509_STORE_CTX_new() failed");
- return NGX_ERROR;
- }
-
- if (X509_STORE_CTX_init(store_ctx, store, NULL, NULL) == 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "X509_STORE_CTX_init() failed");
- return NGX_ERROR;
- }
-
- rc = X509_STORE_CTX_get1_issuer(&issuer, store_ctx, cert);
-
- if (rc == -1) {
- ngx_ssl_error(NGX_LOG_EMERG, ssl->log, 0,
- "X509_STORE_CTX_get1_issuer() failed");
- X509_STORE_CTX_free(store_ctx);
- return NGX_ERROR;
- }
-
- if (rc == 0) {
- ngx_log_error(NGX_LOG_WARN, ssl->log, 0,
- "\"ssl_stapling\" ignored, issuer certificate not found");
- X509_STORE_CTX_free(store_ctx);
- return NGX_DECLINED;
- }
-
- X509_STORE_CTX_free(store_ctx);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ssl->log, 0,
- "SSL get issuer: found %p in cert store", issuer);
-
- staple->cert = cert;
- staple->issuer = issuer;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_ssl_stapling_responder(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *responder)
-{
- ngx_url_t u;
- char *s;
- ngx_ssl_stapling_t *staple;
- STACK_OF(OPENSSL_STRING) *aia;
-
- staple = SSL_CTX_get_ex_data(ssl->ctx, ngx_ssl_stapling_index);
-
- if (responder->len == 0) {
-
- /* extract OCSP responder URL from certificate */
-
- aia = X509_get1_ocsp(staple->cert);
- if (aia == NULL) {
- ngx_log_error(NGX_LOG_WARN, ssl->log, 0,
- "\"ssl_stapling\" ignored, "
- "no OCSP responder URL in the certificate");
- return NGX_DECLINED;
- }
-
-#if OPENSSL_VERSION_NUMBER >= 0x10000000L
- s = sk_OPENSSL_STRING_value(aia, 0);
-#else
- s = sk_value(aia, 0);
-#endif
- if (s == NULL) {
- ngx_log_error(NGX_LOG_WARN, ssl->log, 0,
- "\"ssl_stapling\" ignored, "
- "no OCSP responder URL in the certificate");
- X509_email_free(aia);
- return NGX_DECLINED;
- }
-
- responder->len = ngx_strlen(s);
- responder->data = ngx_palloc(cf->pool, responder->len);
- if (responder->data == NULL) {
- X509_email_free(aia);
- return NGX_ERROR;
- }
-
- ngx_memcpy(responder->data, s, responder->len);
- X509_email_free(aia);
- }
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url = *responder;
- u.default_port = 80;
- u.uri_part = 1;
-
- if (u.url.len > 7
- && ngx_strncasecmp(u.url.data, (u_char *) "http://", 7) == 0)
- {
- u.url.len -= 7;
- u.url.data += 7;
-
- } else {
- ngx_log_error(NGX_LOG_WARN, ssl->log, 0,
- "\"ssl_stapling\" ignored, "
- "invalid URL prefix in OCSP responder \"%V\"", &u.url);
- return NGX_DECLINED;
- }
-
- if (ngx_parse_url(cf->pool, &u) != NGX_OK) {
- if (u.err) {
- ngx_log_error(NGX_LOG_WARN, ssl->log, 0,
- "\"ssl_stapling\" ignored, "
- "%s in OCSP responder \"%V\"", u.err, &u.url);
- return NGX_DECLINED;
- }
-
- return NGX_ERROR;
- }
-
- staple->addrs = u.addrs;
- staple->host = u.host;
- staple->uri = u.uri;
- staple->port = u.port;
-
- if (staple->uri.len == 0) {
- ngx_str_set(&staple->uri, "/");
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_ssl_stapling_resolver(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_resolver_t *resolver, ngx_msec_t resolver_timeout)
-{
- ngx_ssl_stapling_t *staple;
-
- staple = SSL_CTX_get_ex_data(ssl->ctx, ngx_ssl_stapling_index);
-
- staple->resolver = resolver;
- staple->resolver_timeout = resolver_timeout;
-
- return NGX_OK;
-}
-
-
-static int
-ngx_ssl_certificate_status_callback(ngx_ssl_conn_t *ssl_conn, void *data)
-{
- int rc;
- u_char *p;
- ngx_connection_t *c;
- ngx_ssl_stapling_t *staple;
-
- c = ngx_ssl_get_connection(ssl_conn);
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "SSL certificate status callback");
-
- staple = data;
- rc = SSL_TLSEXT_ERR_NOACK;
-
- if (staple->staple.len) {
- /* we have to copy ocsp response as OpenSSL will free it by itself */
-
- p = OPENSSL_malloc(staple->staple.len);
- if (p == NULL) {
- ngx_ssl_error(NGX_LOG_ALERT, c->log, 0, "OPENSSL_malloc() failed");
- return SSL_TLSEXT_ERR_NOACK;
- }
-
- ngx_memcpy(p, staple->staple.data, staple->staple.len);
-
- SSL_set_tlsext_status_ocsp_resp(ssl_conn, p, staple->staple.len);
-
- rc = SSL_TLSEXT_ERR_OK;
- }
-
- ngx_ssl_stapling_update(staple);
-
- return rc;
-}
-
-
-static void
-ngx_ssl_stapling_update(ngx_ssl_stapling_t *staple)
-{
- ngx_ssl_ocsp_ctx_t *ctx;
-
- if (staple->host.len == 0
- || staple->loading || staple->valid >= ngx_time())
- {
- return;
- }
-
- staple->loading = 1;
-
- ctx = ngx_ssl_ocsp_start();
- if (ctx == NULL) {
- return;
- }
-
- ctx->cert = staple->cert;
- ctx->issuer = staple->issuer;
-
- ctx->addrs = staple->addrs;
- ctx->host = staple->host;
- ctx->uri = staple->uri;
- ctx->port = staple->port;
- ctx->timeout = staple->timeout;
-
- ctx->resolver = staple->resolver;
- ctx->resolver_timeout = staple->resolver_timeout;
-
- ctx->handler = ngx_ssl_stapling_ocsp_handler;
- ctx->data = staple;
-
- ngx_ssl_ocsp_request(ctx);
-
- return;
-}
-
-
-static void
-ngx_ssl_stapling_ocsp_handler(ngx_ssl_ocsp_ctx_t *ctx)
-{
-#if OPENSSL_VERSION_NUMBER >= 0x0090707fL
- const
-#endif
- u_char *p;
- int n;
- size_t len;
- ngx_str_t response;
- X509_STORE *store;
- STACK_OF(X509) *chain;
- OCSP_CERTID *id;
- OCSP_RESPONSE *ocsp;
- OCSP_BASICRESP *basic;
- ngx_ssl_stapling_t *staple;
- ASN1_GENERALIZEDTIME *thisupdate, *nextupdate;
-
- staple = ctx->data;
- ocsp = NULL;
- basic = NULL;
- id = NULL;
-
- if (ctx->code != 200) {
- goto error;
- }
-
- /* check the response */
-
- len = ctx->response->last - ctx->response->pos;
- p = ctx->response->pos;
-
- ocsp = d2i_OCSP_RESPONSE(NULL, &p, len);
- if (ocsp == NULL) {
- ngx_ssl_error(NGX_LOG_ERR, ctx->log, 0,
- "d2i_OCSP_RESPONSE() failed");
- goto error;
- }
-
- n = OCSP_response_status(ocsp);
-
- if (n != OCSP_RESPONSE_STATUS_SUCCESSFUL) {
- ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
- "OCSP response not successful (%d: %s)",
- n, OCSP_response_status_str(n));
- goto error;
- }
-
- basic = OCSP_response_get1_basic(ocsp);
- if (basic == NULL) {
- ngx_ssl_error(NGX_LOG_ERR, ctx->log, 0,
- "OCSP_response_get1_basic() failed");
- goto error;
- }
-
- store = SSL_CTX_get_cert_store(staple->ssl_ctx);
- if (store == NULL) {
- ngx_ssl_error(NGX_LOG_CRIT, ctx->log, 0,
- "SSL_CTX_get_cert_store() failed");
- goto error;
- }
-
-#if OPENSSL_VERSION_NUMBER >= 0x10001000L
- SSL_CTX_get_extra_chain_certs(staple->ssl_ctx, &chain);
-#else
- chain = staple->ssl_ctx->extra_certs;
-#endif
-
- if (OCSP_basic_verify(basic, chain, store,
- staple->verify ? OCSP_TRUSTOTHER : OCSP_NOVERIFY)
- != 1)
- {
- ngx_ssl_error(NGX_LOG_ERR, ctx->log, 0,
- "OCSP_basic_verify() failed");
- goto error;
- }
-
- id = OCSP_cert_to_id(NULL, ctx->cert, ctx->issuer);
- if (id == NULL) {
- ngx_ssl_error(NGX_LOG_CRIT, ctx->log, 0,
- "OCSP_cert_to_id() failed");
- goto error;
- }
-
- if (OCSP_resp_find_status(basic, id, &n, NULL, NULL,
- &thisupdate, &nextupdate)
- != 1)
- {
- ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
- "certificate status not found in the OCSP response");
- goto error;
- }
-
- if (n != V_OCSP_CERTSTATUS_GOOD) {
- ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
- "certificate status \"%s\" in the OCSP response",
- OCSP_cert_status_str(n));
- goto error;
- }
-
- if (OCSP_check_validity(thisupdate, nextupdate, 300, -1) != 1) {
- ngx_ssl_error(NGX_LOG_ERR, ctx->log, 0,
- "OCSP_check_validity() failed");
- goto error;
- }
-
- OCSP_CERTID_free(id);
- OCSP_BASICRESP_free(basic);
- OCSP_RESPONSE_free(ocsp);
-
- /* copy the response to memory not in ctx->pool */
-
- response.len = len;
- response.data = ngx_alloc(response.len, ctx->log);
-
- if (response.data == NULL) {
- goto done;
- }
-
- ngx_memcpy(response.data, ctx->response->pos, response.len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp response, %s, %uz",
- OCSP_cert_status_str(n), response.len);
-
- if (staple->staple.data) {
- ngx_free(staple->staple.data);
- }
-
- staple->staple = response;
-
-done:
-
- staple->loading = 0;
- staple->valid = ngx_time() + 3600; /* ssl_stapling_valid */
-
- ngx_ssl_ocsp_done(ctx);
- return;
-
-error:
-
- staple->loading = 0;
- staple->valid = ngx_time() + 300; /* ssl_stapling_err_valid */
-
- if (id) {
- OCSP_CERTID_free(id);
- }
-
- if (basic) {
- OCSP_BASICRESP_free(basic);
- }
-
- if (ocsp) {
- OCSP_RESPONSE_free(ocsp);
- }
-
- ngx_ssl_ocsp_done(ctx);
-}
-
-
-static void
-ngx_ssl_stapling_cleanup(void *data)
-{
- ngx_ssl_stapling_t *staple = data;
-
- if (staple->issuer) {
- X509_free(staple->issuer);
- }
-
- if (staple->staple.data) {
- ngx_free(staple->staple.data);
- }
-}
-
-
-static ngx_ssl_ocsp_ctx_t *
-ngx_ssl_ocsp_start(void)
-{
- ngx_log_t *log;
- ngx_pool_t *pool;
- ngx_ssl_ocsp_ctx_t *ctx;
-
- pool = ngx_create_pool(2048, ngx_cycle->log);
- if (pool == NULL) {
- return NULL;
- }
-
- ctx = ngx_pcalloc(pool, sizeof(ngx_ssl_ocsp_ctx_t));
- if (ctx == NULL) {
- ngx_destroy_pool(pool);
- return NULL;
- }
-
- log = ngx_palloc(pool, sizeof(ngx_log_t));
- if (log == NULL) {
- ngx_destroy_pool(pool);
- return NULL;
- }
-
- ctx->pool = pool;
-
- *log = *ctx->pool->log;
-
- ctx->pool->log = log;
- ctx->log = log;
-
- log->handler = ngx_ssl_ocsp_log_error;
- log->data = ctx;
- log->action = "requesting certificate status";
-
- return ctx;
-}
-
-
-static void
-ngx_ssl_ocsp_done(ngx_ssl_ocsp_ctx_t *ctx)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp done");
-
- if (ctx->peer.connection) {
- ngx_close_connection(ctx->peer.connection);
- }
-
- ngx_destroy_pool(ctx->pool);
-}
-
-
-static void
-ngx_ssl_ocsp_error(ngx_ssl_ocsp_ctx_t *ctx)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp error");
-
- ctx->code = 0;
- ctx->handler(ctx);
-}
-
-
-static void
-ngx_ssl_ocsp_request(ngx_ssl_ocsp_ctx_t *ctx)
-{
- ngx_resolver_ctx_t *resolve, temp;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp request");
-
- if (ngx_ssl_ocsp_create_request(ctx) != NGX_OK) {
- ngx_ssl_ocsp_error(ctx);
- return;
- }
-
- if (ctx->resolver) {
- /* resolve OCSP responder hostname */
-
- temp.name = ctx->host;
-
- resolve = ngx_resolve_start(ctx->resolver, &temp);
- if (resolve == NULL) {
- ngx_ssl_ocsp_error(ctx);
- return;
- }
-
- if (resolve == NGX_NO_RESOLVER) {
- ngx_log_error(NGX_LOG_WARN, ctx->log, 0,
- "no resolver defined to resolve %V", &ctx->host);
- goto connect;
- }
-
- resolve->name = ctx->host;
- resolve->handler = ngx_ssl_ocsp_resolve_handler;
- resolve->data = ctx;
- resolve->timeout = ctx->resolver_timeout;
-
- if (ngx_resolve_name(resolve) != NGX_OK) {
- ngx_ssl_ocsp_error(ctx);
- return;
- }
-
- return;
- }
-
-connect:
-
- ngx_ssl_ocsp_connect(ctx);
-}
-
-
-static void
-ngx_ssl_ocsp_resolve_handler(ngx_resolver_ctx_t *resolve)
-{
- ngx_ssl_ocsp_ctx_t *ctx = resolve->data;
-
- u_char *p;
- size_t len;
- in_port_t port;
- socklen_t socklen;
- ngx_uint_t i;
- struct sockaddr *sockaddr;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp resolve handler");
-
- if (resolve->state) {
- ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
- "%V could not be resolved (%i: %s)",
- &resolve->name, resolve->state,
- ngx_resolver_strerror(resolve->state));
- goto failed;
- }
-
-#if (NGX_DEBUG)
- {
- u_char text[NGX_SOCKADDR_STRLEN];
- ngx_str_t addr;
-
- addr.data = text;
-
- for (i = 0; i < resolve->naddrs; i++) {
- addr.len = ngx_sock_ntop(resolve->addrs[i].sockaddr,
- resolve->addrs[i].socklen,
- text, NGX_SOCKADDR_STRLEN, 0);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "name was resolved to %V", &addr);
-
- }
- }
-#endif
-
- ctx->naddrs = resolve->naddrs;
- ctx->addrs = ngx_pcalloc(ctx->pool, ctx->naddrs * sizeof(ngx_addr_t));
-
- if (ctx->addrs == NULL) {
- goto failed;
- }
-
- port = htons(ctx->port);
-
- for (i = 0; i < resolve->naddrs; i++) {
-
- socklen = resolve->addrs[i].socklen;
-
- sockaddr = ngx_palloc(ctx->pool, socklen);
- if (sockaddr == NULL) {
- goto failed;
- }
-
- ngx_memcpy(sockaddr, resolve->addrs[i].sockaddr, socklen);
-
- switch (sockaddr->sa_family) {
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- ((struct sockaddr_in6 *) sockaddr)->sin6_port = port;
- break;
-#endif
- default: /* AF_INET */
- ((struct sockaddr_in *) sockaddr)->sin_port = port;
- }
-
- ctx->addrs[i].sockaddr = sockaddr;
- ctx->addrs[i].socklen = socklen;
-
- p = ngx_pnalloc(ctx->pool, NGX_SOCKADDR_STRLEN);
- if (p == NULL) {
- goto failed;
- }
-
- len = ngx_sock_ntop(sockaddr, socklen, p, NGX_SOCKADDR_STRLEN, 1);
-
- ctx->addrs[i].name.len = len;
- ctx->addrs[i].name.data = p;
- }
-
- ngx_resolve_name_done(resolve);
-
- ngx_ssl_ocsp_connect(ctx);
- return;
-
-failed:
-
- ngx_resolve_name_done(resolve);
- ngx_ssl_ocsp_error(ctx);
-}
-
-
-static void
-ngx_ssl_ocsp_connect(ngx_ssl_ocsp_ctx_t *ctx)
-{
- ngx_int_t rc;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp connect");
-
- /* TODO: use all ip addresses */
-
- ctx->peer.sockaddr = ctx->addrs[0].sockaddr;
- ctx->peer.socklen = ctx->addrs[0].socklen;
- ctx->peer.name = &ctx->addrs[0].name;
- ctx->peer.get = ngx_event_get_peer;
- ctx->peer.log = ctx->log;
- ctx->peer.log_error = NGX_ERROR_ERR;
-
- rc = ngx_event_connect_peer(&ctx->peer);
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp connect peer done");
-
- if (rc == NGX_ERROR || rc == NGX_BUSY || rc == NGX_DECLINED) {
- ngx_ssl_ocsp_error(ctx);
- return;
- }
-
- ctx->peer.connection->data = ctx;
- ctx->peer.connection->pool = ctx->pool;
-
- ctx->peer.connection->read->handler = ngx_ssl_ocsp_read_handler;
- ctx->peer.connection->write->handler = ngx_ssl_ocsp_write_handler;
-
- ctx->process = ngx_ssl_ocsp_process_status_line;
-
- ngx_add_timer(ctx->peer.connection->read, ctx->timeout);
- ngx_add_timer(ctx->peer.connection->write, ctx->timeout);
-
- if (rc == NGX_OK) {
- ngx_ssl_ocsp_write_handler(ctx->peer.connection->write);
- return;
- }
-}
-
-
-static void
-ngx_ssl_ocsp_write_handler(ngx_event_t *wev)
-{
- ssize_t n, size;
- ngx_connection_t *c;
- ngx_ssl_ocsp_ctx_t *ctx;
-
- c = wev->data;
- ctx = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, wev->log, 0,
- "ssl ocsp write handler");
-
- if (wev->timedout) {
- ngx_log_error(NGX_LOG_ERR, wev->log, NGX_ETIMEDOUT,
- "OCSP responder timed out");
- ngx_ssl_ocsp_error(ctx);
- return;
- }
-
- size = ctx->request->last - ctx->request->pos;
-
- n = ngx_send(c, ctx->request->pos, size);
-
- if (n == NGX_ERROR) {
- ngx_ssl_ocsp_error(ctx);
- return;
- }
-
- if (n > 0) {
- ctx->request->pos += n;
-
- if (n == size) {
- wev->handler = ngx_ssl_ocsp_dummy_handler;
-
- if (wev->timer_set) {
- ngx_del_timer(wev);
- }
-
- if (ngx_handle_write_event(wev, 0) != NGX_OK) {
- ngx_ssl_ocsp_error(ctx);
- }
-
- return;
- }
- }
-
- if (!wev->timer_set) {
- ngx_add_timer(wev, ctx->timeout);
- }
-}
-
-
-static void
-ngx_ssl_ocsp_read_handler(ngx_event_t *rev)
-{
- ssize_t n, size;
- ngx_int_t rc;
- ngx_ssl_ocsp_ctx_t *ctx;
- ngx_connection_t *c;
-
- c = rev->data;
- ctx = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, rev->log, 0,
- "ssl ocsp read handler");
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_ERR, rev->log, NGX_ETIMEDOUT,
- "OCSP responder timed out");
- ngx_ssl_ocsp_error(ctx);
- return;
- }
-
- if (ctx->response == NULL) {
- ctx->response = ngx_create_temp_buf(ctx->pool, 16384);
- if (ctx->response == NULL) {
- ngx_ssl_ocsp_error(ctx);
- return;
- }
- }
-
- for ( ;; ) {
-
- size = ctx->response->end - ctx->response->last;
-
- n = ngx_recv(c, ctx->response->last, size);
-
- if (n > 0) {
- ctx->response->last += n;
-
- rc = ctx->process(ctx);
-
- if (rc == NGX_ERROR) {
- ngx_ssl_ocsp_error(ctx);
- return;
- }
-
- continue;
- }
-
- if (n == NGX_AGAIN) {
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_ssl_ocsp_error(ctx);
- }
-
- return;
- }
-
- break;
- }
-
- ctx->done = 1;
-
- rc = ctx->process(ctx);
-
- if (rc == NGX_DONE) {
- /* ctx->handler() was called */
- return;
- }
-
- ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
- "OCSP responder prematurely closed connection");
-
- ngx_ssl_ocsp_error(ctx);
-}
-
-
-static void
-ngx_ssl_ocsp_dummy_handler(ngx_event_t *ev)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "ssl ocsp dummy handler");
-}
-
-
-static ngx_int_t
-ngx_ssl_ocsp_create_request(ngx_ssl_ocsp_ctx_t *ctx)
-{
- int len;
- u_char *p;
- uintptr_t escape;
- ngx_str_t binary, base64;
- ngx_buf_t *b;
- OCSP_CERTID *id;
- OCSP_REQUEST *ocsp;
-
- ocsp = OCSP_REQUEST_new();
- if (ocsp == NULL) {
- ngx_ssl_error(NGX_LOG_CRIT, ctx->log, 0,
- "OCSP_REQUEST_new() failed");
- return NGX_ERROR;
- }
-
- id = OCSP_cert_to_id(NULL, ctx->cert, ctx->issuer);
- if (id == NULL) {
- ngx_ssl_error(NGX_LOG_CRIT, ctx->log, 0,
- "OCSP_cert_to_id() failed");
- goto failed;
- }
-
- if (OCSP_request_add0_id(ocsp, id) == NULL) {
- ngx_ssl_error(NGX_LOG_CRIT, ctx->log, 0,
- "OCSP_request_add0_id() failed");
- goto failed;
- }
-
- len = i2d_OCSP_REQUEST(ocsp, NULL);
- if (len <= 0) {
- ngx_ssl_error(NGX_LOG_CRIT, ctx->log, 0,
- "i2d_OCSP_REQUEST() failed");
- goto failed;
- }
-
- binary.len = len;
- binary.data = ngx_palloc(ctx->pool, len);
- if (binary.data == NULL) {
- goto failed;
- }
-
- p = binary.data;
- len = i2d_OCSP_REQUEST(ocsp, &p);
- if (len <= 0) {
- ngx_ssl_error(NGX_LOG_EMERG, ctx->log, 0,
- "i2d_OCSP_REQUEST() failed");
- goto failed;
- }
-
- base64.len = ngx_base64_encoded_length(binary.len);
- base64.data = ngx_palloc(ctx->pool, base64.len);
- if (base64.data == NULL) {
- goto failed;
- }
-
- ngx_encode_base64(&base64, &binary);
-
- escape = ngx_escape_uri(NULL, base64.data, base64.len,
- NGX_ESCAPE_URI_COMPONENT);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp request length %z, escape %d",
- base64.len, escape);
-
- len = sizeof("GET ") - 1 + ctx->uri.len + sizeof("/") - 1
- + base64.len + 2 * escape + sizeof(" HTTP/1.0" CRLF) - 1
- + sizeof("Host: ") - 1 + ctx->host.len + sizeof(CRLF) - 1
- + sizeof(CRLF) - 1;
-
- b = ngx_create_temp_buf(ctx->pool, len);
- if (b == NULL) {
- goto failed;
- }
-
- p = b->last;
-
- p = ngx_cpymem(p, "GET ", sizeof("GET ") - 1);
- p = ngx_cpymem(p, ctx->uri.data, ctx->uri.len);
-
- if (ctx->uri.data[ctx->uri.len - 1] != '/') {
- *p++ = '/';
- }
-
- if (escape == 0) {
- p = ngx_cpymem(p, base64.data, base64.len);
-
- } else {
- p = (u_char *) ngx_escape_uri(p, base64.data, base64.len,
- NGX_ESCAPE_URI_COMPONENT);
- }
-
- p = ngx_cpymem(p, " HTTP/1.0" CRLF, sizeof(" HTTP/1.0" CRLF) - 1);
- p = ngx_cpymem(p, "Host: ", sizeof("Host: ") - 1);
- p = ngx_cpymem(p, ctx->host.data, ctx->host.len);
- *p++ = CR; *p++ = LF;
-
- /* add "\r\n" at the header end */
- *p++ = CR; *p++ = LF;
-
- b->last = p;
- ctx->request = b;
-
- OCSP_REQUEST_free(ocsp);
-
- return NGX_OK;
-
-failed:
-
- OCSP_REQUEST_free(ocsp);
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_ssl_ocsp_process_status_line(ngx_ssl_ocsp_ctx_t *ctx)
-{
- ngx_int_t rc;
-
- rc = ngx_ssl_ocsp_parse_status_line(ctx);
-
- if (rc == NGX_OK) {
-#if 0
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp status line \"%*s\"",
- ctx->response->pos - ctx->response->start,
- ctx->response->start);
-#endif
-
- ctx->process = ngx_ssl_ocsp_process_headers;
- return ctx->process(ctx);
- }
-
- if (rc == NGX_AGAIN) {
- return NGX_AGAIN;
- }
-
- /* rc == NGX_ERROR */
-
- ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
- "OCSP responder sent invalid response");
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_ssl_ocsp_parse_status_line(ngx_ssl_ocsp_ctx_t *ctx)
-{
- u_char ch;
- u_char *p;
- ngx_buf_t *b;
- enum {
- sw_start = 0,
- sw_H,
- sw_HT,
- sw_HTT,
- sw_HTTP,
- sw_first_major_digit,
- sw_major_digit,
- sw_first_minor_digit,
- sw_minor_digit,
- sw_status,
- sw_space_after_status,
- sw_status_text,
- sw_almost_done
- } state;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp process status line");
-
- state = ctx->state;
- b = ctx->response;
-
- for (p = b->pos; p < b->last; p++) {
- ch = *p;
-
- switch (state) {
-
- /* "HTTP/" */
- case sw_start:
- switch (ch) {
- case 'H':
- state = sw_H;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- case sw_H:
- switch (ch) {
- case 'T':
- state = sw_HT;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- case sw_HT:
- switch (ch) {
- case 'T':
- state = sw_HTT;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- case sw_HTT:
- switch (ch) {
- case 'P':
- state = sw_HTTP;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- case sw_HTTP:
- switch (ch) {
- case '/':
- state = sw_first_major_digit;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- /* the first digit of major HTTP version */
- case sw_first_major_digit:
- if (ch < '1' || ch > '9') {
- return NGX_ERROR;
- }
-
- state = sw_major_digit;
- break;
-
- /* the major HTTP version or dot */
- case sw_major_digit:
- if (ch == '.') {
- state = sw_first_minor_digit;
- break;
- }
-
- if (ch < '0' || ch > '9') {
- return NGX_ERROR;
- }
-
- break;
-
- /* the first digit of minor HTTP version */
- case sw_first_minor_digit:
- if (ch < '0' || ch > '9') {
- return NGX_ERROR;
- }
-
- state = sw_minor_digit;
- break;
-
- /* the minor HTTP version or the end of the request line */
- case sw_minor_digit:
- if (ch == ' ') {
- state = sw_status;
- break;
- }
-
- if (ch < '0' || ch > '9') {
- return NGX_ERROR;
- }
-
- break;
-
- /* HTTP status code */
- case sw_status:
- if (ch == ' ') {
- break;
- }
-
- if (ch < '0' || ch > '9') {
- return NGX_ERROR;
- }
-
- ctx->code = ctx->code * 10 + ch - '0';
-
- if (++ctx->count == 3) {
- state = sw_space_after_status;
- }
-
- break;
-
- /* space or end of line */
- case sw_space_after_status:
- switch (ch) {
- case ' ':
- state = sw_status_text;
- break;
- case '.': /* IIS may send 403.1, 403.2, etc */
- state = sw_status_text;
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- default:
- return NGX_ERROR;
- }
- break;
-
- /* any text until end of line */
- case sw_status_text:
- switch (ch) {
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- }
- break;
-
- /* end of status line */
- case sw_almost_done:
- switch (ch) {
- case LF:
- goto done;
- default:
- return NGX_ERROR;
- }
- }
- }
-
- b->pos = p;
- ctx->state = state;
-
- return NGX_AGAIN;
-
-done:
-
- b->pos = p + 1;
- ctx->state = sw_start;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_ssl_ocsp_process_headers(ngx_ssl_ocsp_ctx_t *ctx)
-{
- size_t len;
- ngx_int_t rc;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp process headers");
-
- for ( ;; ) {
- rc = ngx_ssl_ocsp_parse_header_line(ctx);
-
- if (rc == NGX_OK) {
-
- ngx_log_debug4(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp header \"%*s: %*s\"",
- ctx->header_name_end - ctx->header_name_start,
- ctx->header_name_start,
- ctx->header_end - ctx->header_start,
- ctx->header_start);
-
- len = ctx->header_name_end - ctx->header_name_start;
-
- if (len == sizeof("Content-Type") - 1
- && ngx_strncasecmp(ctx->header_name_start,
- (u_char *) "Content-Type",
- sizeof("Content-Type") - 1)
- == 0)
- {
- len = ctx->header_end - ctx->header_start;
-
- if (len != sizeof("application/ocsp-response") - 1
- || ngx_strncasecmp(ctx->header_start,
- (u_char *) "application/ocsp-response",
- sizeof("application/ocsp-response") - 1)
- != 0)
- {
- ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
- "OCSP responder sent invalid "
- "\"Content-Type\" header: \"%*s\"",
- ctx->header_end - ctx->header_start,
- ctx->header_start);
- return NGX_ERROR;
- }
-
- continue;
- }
-
- /* TODO: honor Content-Length */
-
- continue;
- }
-
- if (rc == NGX_DONE) {
- break;
- }
-
- if (rc == NGX_AGAIN) {
- return NGX_AGAIN;
- }
-
- /* rc == NGX_ERROR */
-
- ngx_log_error(NGX_LOG_ERR, ctx->log, 0,
- "OCSP responder sent invalid response");
-
- return NGX_ERROR;
- }
-
- ctx->process = ngx_ssl_ocsp_process_body;
- return ctx->process(ctx);
-}
-
-static ngx_int_t
-ngx_ssl_ocsp_parse_header_line(ngx_ssl_ocsp_ctx_t *ctx)
-{
- u_char c, ch, *p;
- enum {
- sw_start = 0,
- sw_name,
- sw_space_before_value,
- sw_value,
- sw_space_after_value,
- sw_almost_done,
- sw_header_almost_done
- } state;
-
- state = ctx->state;
-
- for (p = ctx->response->pos; p < ctx->response->last; p++) {
- ch = *p;
-
-#if 0
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "s:%d in:'%02Xd:%c'", state, ch, ch);
-#endif
-
- switch (state) {
-
- /* first char */
- case sw_start:
-
- switch (ch) {
- case CR:
- ctx->header_end = p;
- state = sw_header_almost_done;
- break;
- case LF:
- ctx->header_end = p;
- goto header_done;
- default:
- state = sw_name;
- ctx->header_name_start = p;
-
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'z') {
- break;
- }
-
- if (ch >= '0' && ch <= '9') {
- break;
- }
-
- return NGX_ERROR;
- }
- break;
-
- /* header name */
- case sw_name:
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'z') {
- break;
- }
-
- if (ch == ':') {
- ctx->header_name_end = p;
- state = sw_space_before_value;
- break;
- }
-
- if (ch == '-') {
- break;
- }
-
- if (ch >= '0' && ch <= '9') {
- break;
- }
-
- if (ch == CR) {
- ctx->header_name_end = p;
- ctx->header_start = p;
- ctx->header_end = p;
- state = sw_almost_done;
- break;
- }
-
- if (ch == LF) {
- ctx->header_name_end = p;
- ctx->header_start = p;
- ctx->header_end = p;
- goto done;
- }
-
- return NGX_ERROR;
-
- /* space* before header value */
- case sw_space_before_value:
- switch (ch) {
- case ' ':
- break;
- case CR:
- ctx->header_start = p;
- ctx->header_end = p;
- state = sw_almost_done;
- break;
- case LF:
- ctx->header_start = p;
- ctx->header_end = p;
- goto done;
- default:
- ctx->header_start = p;
- state = sw_value;
- break;
- }
- break;
-
- /* header value */
- case sw_value:
- switch (ch) {
- case ' ':
- ctx->header_end = p;
- state = sw_space_after_value;
- break;
- case CR:
- ctx->header_end = p;
- state = sw_almost_done;
- break;
- case LF:
- ctx->header_end = p;
- goto done;
- }
- break;
-
- /* space* before end of header line */
- case sw_space_after_value:
- switch (ch) {
- case ' ':
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- default:
- state = sw_value;
- break;
- }
- break;
-
- /* end of header line */
- case sw_almost_done:
- switch (ch) {
- case LF:
- goto done;
- default:
- return NGX_ERROR;
- }
-
- /* end of header */
- case sw_header_almost_done:
- switch (ch) {
- case LF:
- goto header_done;
- default:
- return NGX_ERROR;
- }
- }
- }
-
- ctx->response->pos = p;
- ctx->state = state;
-
- return NGX_AGAIN;
-
-done:
-
- ctx->response->pos = p + 1;
- ctx->state = sw_start;
-
- return NGX_OK;
-
-header_done:
-
- ctx->response->pos = p + 1;
- ctx->state = sw_start;
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_ssl_ocsp_process_body(ngx_ssl_ocsp_ctx_t *ctx)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ctx->log, 0,
- "ssl ocsp process body");
-
- if (ctx->done) {
- ctx->handler(ctx);
- return NGX_DONE;
- }
-
- return NGX_AGAIN;
-}
-
-
-static u_char *
-ngx_ssl_ocsp_log_error(ngx_log_t *log, u_char *buf, size_t len)
-{
- u_char *p;
- ngx_ssl_ocsp_ctx_t *ctx;
-
- p = buf;
-
- if (log->action) {
- p = ngx_snprintf(buf, len, " while %s", log->action);
- len -= p - buf;
- }
-
- ctx = log->data;
-
- if (ctx) {
- p = ngx_snprintf(p, len, ", responder: %V", &ctx->host);
- }
-
- return p;
-}
-
-
-#else
-
-
-ngx_int_t
-ngx_ssl_stapling(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *file,
- ngx_str_t *responder, ngx_uint_t verify)
-{
- ngx_log_error(NGX_LOG_WARN, ssl->log, 0,
- "\"ssl_stapling\" ignored, not supported");
-
- return NGX_OK;
-}
-
-ngx_int_t
-ngx_ssl_stapling_resolver(ngx_conf_t *cf, ngx_ssl_t *ssl,
- ngx_resolver_t *resolver, ngx_msec_t resolver_timeout)
-{
- return NGX_OK;
-}
-
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.c
deleted file mode 100644
index 64fb07bde42..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.c
+++ /dev/null
@@ -1,1006 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_event_pipe.h>
-
-
-static ngx_int_t ngx_event_pipe_read_upstream(ngx_event_pipe_t *p);
-static ngx_int_t ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p);
-
-static ngx_int_t ngx_event_pipe_write_chain_to_temp_file(ngx_event_pipe_t *p);
-static ngx_inline void ngx_event_pipe_remove_shadow_links(ngx_buf_t *buf);
-static ngx_int_t ngx_event_pipe_drain_chains(ngx_event_pipe_t *p);
-
-
-ngx_int_t
-ngx_event_pipe(ngx_event_pipe_t *p, ngx_int_t do_write)
-{
- u_int flags;
- ngx_int_t rc;
- ngx_event_t *rev, *wev;
-
- for ( ;; ) {
- if (do_write) {
- p->log->action = "sending to client";
-
- rc = ngx_event_pipe_write_to_downstream(p);
-
- if (rc == NGX_ABORT) {
- return NGX_ABORT;
- }
-
- if (rc == NGX_BUSY) {
- return NGX_OK;
- }
- }
-
- p->read = 0;
- p->upstream_blocked = 0;
-
- p->log->action = "reading upstream";
-
- if (ngx_event_pipe_read_upstream(p) == NGX_ABORT) {
- return NGX_ABORT;
- }
-
- if (!p->read && !p->upstream_blocked) {
- break;
- }
-
- do_write = 1;
- }
-
- if (p->upstream->fd != (ngx_socket_t) -1) {
- rev = p->upstream->read;
-
- flags = (rev->eof || rev->error) ? NGX_CLOSE_EVENT : 0;
-
- if (ngx_handle_read_event(rev, flags) != NGX_OK) {
- return NGX_ABORT;
- }
-
- if (rev->active && !rev->ready) {
- ngx_add_timer(rev, p->read_timeout);
-
- } else if (rev->timer_set) {
- ngx_del_timer(rev);
- }
- }
-
- if (p->downstream->fd != (ngx_socket_t) -1
- && p->downstream->data == p->output_ctx)
- {
- wev = p->downstream->write;
- if (ngx_handle_write_event(wev, p->send_lowat) != NGX_OK) {
- return NGX_ABORT;
- }
-
- if (!wev->delayed) {
- if (wev->active && !wev->ready) {
- ngx_add_timer(wev, p->send_timeout);
-
- } else if (wev->timer_set) {
- ngx_del_timer(wev);
- }
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_event_pipe_read_upstream(ngx_event_pipe_t *p)
-{
- ssize_t n, size;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t *chain, *cl, *ln;
-
- if (p->upstream_eof || p->upstream_error || p->upstream_done) {
- return NGX_OK;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe read upstream: %d", p->upstream->read->ready);
-
- for ( ;; ) {
-
- if (p->upstream_eof || p->upstream_error || p->upstream_done) {
- break;
- }
-
- if (p->preread_bufs == NULL && !p->upstream->read->ready) {
- break;
- }
-
- if (p->preread_bufs) {
-
- /* use the pre-read bufs if they exist */
-
- chain = p->preread_bufs;
- p->preread_bufs = NULL;
- n = p->preread_size;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe preread: %z", n);
-
- if (n) {
- p->read = 1;
- }
-
- } else {
-
-#if (NGX_HAVE_KQUEUE)
-
- /*
- * kqueue notifies about the end of file or a pending error.
- * This test allows not to allocate a buf on these conditions
- * and not to call c->recv_chain().
- */
-
- if (p->upstream->read->available == 0
- && p->upstream->read->pending_eof)
- {
- p->upstream->read->ready = 0;
- p->upstream->read->eof = 1;
- p->upstream_eof = 1;
- p->read = 1;
-
- if (p->upstream->read->kq_errno) {
- p->upstream->read->error = 1;
- p->upstream_error = 1;
- p->upstream_eof = 0;
-
- ngx_log_error(NGX_LOG_ERR, p->log,
- p->upstream->read->kq_errno,
- "kevent() reported that upstream "
- "closed connection");
- }
-
- break;
- }
-#endif
-
- if (p->free_raw_bufs) {
-
- /* use the free bufs if they exist */
-
- chain = p->free_raw_bufs;
- if (p->single_buf) {
- p->free_raw_bufs = p->free_raw_bufs->next;
- chain->next = NULL;
- } else {
- p->free_raw_bufs = NULL;
- }
-
- } else if (p->allocated < p->bufs.num) {
-
- /* allocate a new buf if it's still allowed */
-
- b = ngx_create_temp_buf(p->pool, p->bufs.size);
- if (b == NULL) {
- return NGX_ABORT;
- }
-
- p->allocated++;
-
- chain = ngx_alloc_chain_link(p->pool);
- if (chain == NULL) {
- return NGX_ABORT;
- }
-
- chain->buf = b;
- chain->next = NULL;
-
- } else if (!p->cacheable
- && p->downstream->data == p->output_ctx
- && p->downstream->write->ready
- && !p->downstream->write->delayed)
- {
- /*
- * if the bufs are not needed to be saved in a cache and
- * a downstream is ready then write the bufs to a downstream
- */
-
- p->upstream_blocked = 1;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe downstream ready");
-
- break;
-
- } else if (p->cacheable
- || p->temp_file->offset < p->max_temp_file_size)
- {
-
- /*
- * if it is allowed, then save some bufs from p->in
- * to a temporary file, and add them to a p->out chain
- */
-
- rc = ngx_event_pipe_write_chain_to_temp_file(p);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe temp offset: %O", p->temp_file->offset);
-
- if (rc == NGX_BUSY) {
- break;
- }
-
- if (rc == NGX_AGAIN) {
- if (ngx_event_flags & NGX_USE_LEVEL_EVENT
- && p->upstream->read->active
- && p->upstream->read->ready)
- {
- if (ngx_del_event(p->upstream->read, NGX_READ_EVENT, 0)
- == NGX_ERROR)
- {
- return NGX_ABORT;
- }
- }
- }
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- chain = p->free_raw_bufs;
- if (p->single_buf) {
- p->free_raw_bufs = p->free_raw_bufs->next;
- chain->next = NULL;
- } else {
- p->free_raw_bufs = NULL;
- }
-
- } else {
-
- /* there are no bufs to read in */
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "no pipe bufs to read in");
-
- break;
- }
-
- n = p->upstream->recv_chain(p->upstream, chain);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe recv chain: %z", n);
-
- if (p->free_raw_bufs) {
- chain->next = p->free_raw_bufs;
- }
- p->free_raw_bufs = chain;
-
- if (n == NGX_ERROR) {
- p->upstream_error = 1;
- return NGX_ERROR;
- }
-
- if (n == NGX_AGAIN) {
- if (p->single_buf) {
- ngx_event_pipe_remove_shadow_links(chain->buf);
- }
-
- break;
- }
-
- p->read = 1;
-
- if (n == 0) {
- p->upstream_eof = 1;
- break;
- }
- }
-
- p->read_length += n;
- cl = chain;
- p->free_raw_bufs = NULL;
-
- while (cl && n > 0) {
-
- ngx_event_pipe_remove_shadow_links(cl->buf);
-
- size = cl->buf->end - cl->buf->last;
-
- if (n >= size) {
- cl->buf->last = cl->buf->end;
-
- /* STUB */ cl->buf->num = p->num++;
-
- if (p->input_filter(p, cl->buf) == NGX_ERROR) {
- return NGX_ABORT;
- }
-
- n -= size;
- ln = cl;
- cl = cl->next;
- ngx_free_chain(p->pool, ln);
-
- } else {
- cl->buf->last += n;
- n = 0;
- }
- }
-
- if (cl) {
- for (ln = cl; ln->next; ln = ln->next) { /* void */ }
-
- ln->next = p->free_raw_bufs;
- p->free_raw_bufs = cl;
- }
- }
-
-#if (NGX_DEBUG)
-
- for (cl = p->busy; cl; cl = cl->next) {
- ngx_log_debug8(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe buf busy s:%d t:%d f:%d "
- "%p, pos %p, size: %z "
- "file: %O, size: %z",
- (cl->buf->shadow ? 1 : 0),
- cl->buf->temporary, cl->buf->in_file,
- cl->buf->start, cl->buf->pos,
- cl->buf->last - cl->buf->pos,
- cl->buf->file_pos,
- cl->buf->file_last - cl->buf->file_pos);
- }
-
- for (cl = p->out; cl; cl = cl->next) {
- ngx_log_debug8(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe buf out s:%d t:%d f:%d "
- "%p, pos %p, size: %z "
- "file: %O, size: %z",
- (cl->buf->shadow ? 1 : 0),
- cl->buf->temporary, cl->buf->in_file,
- cl->buf->start, cl->buf->pos,
- cl->buf->last - cl->buf->pos,
- cl->buf->file_pos,
- cl->buf->file_last - cl->buf->file_pos);
- }
-
- for (cl = p->in; cl; cl = cl->next) {
- ngx_log_debug8(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe buf in s:%d t:%d f:%d "
- "%p, pos %p, size: %z "
- "file: %O, size: %z",
- (cl->buf->shadow ? 1 : 0),
- cl->buf->temporary, cl->buf->in_file,
- cl->buf->start, cl->buf->pos,
- cl->buf->last - cl->buf->pos,
- cl->buf->file_pos,
- cl->buf->file_last - cl->buf->file_pos);
- }
-
- for (cl = p->free_raw_bufs; cl; cl = cl->next) {
- ngx_log_debug8(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe buf free s:%d t:%d f:%d "
- "%p, pos %p, size: %z "
- "file: %O, size: %z",
- (cl->buf->shadow ? 1 : 0),
- cl->buf->temporary, cl->buf->in_file,
- cl->buf->start, cl->buf->pos,
- cl->buf->last - cl->buf->pos,
- cl->buf->file_pos,
- cl->buf->file_last - cl->buf->file_pos);
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe length: %O", p->length);
-
-#endif
-
- if (p->free_raw_bufs && p->length != -1) {
- cl = p->free_raw_bufs;
-
- if (cl->buf->last - cl->buf->pos >= p->length) {
-
- p->free_raw_bufs = cl->next;
-
- /* STUB */ cl->buf->num = p->num++;
-
- if (p->input_filter(p, cl->buf) == NGX_ERROR) {
- return NGX_ABORT;
- }
-
- ngx_free_chain(p->pool, cl);
- }
- }
-
- if (p->length == 0) {
- p->upstream_done = 1;
- p->read = 1;
- }
-
- if ((p->upstream_eof || p->upstream_error) && p->free_raw_bufs) {
-
- /* STUB */ p->free_raw_bufs->buf->num = p->num++;
-
- if (p->input_filter(p, p->free_raw_bufs->buf) == NGX_ERROR) {
- return NGX_ABORT;
- }
-
- p->free_raw_bufs = p->free_raw_bufs->next;
-
- if (p->free_bufs && p->buf_to_file == NULL) {
- for (cl = p->free_raw_bufs; cl; cl = cl->next) {
- if (cl->buf->shadow == NULL) {
- ngx_pfree(p->pool, cl->buf->start);
- }
- }
- }
- }
-
- if (p->cacheable && (p->in || p->buf_to_file)) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe write chain");
-
- if (ngx_event_pipe_write_chain_to_temp_file(p) == NGX_ABORT) {
- return NGX_ABORT;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)
-{
- u_char *prev;
- size_t bsize;
- ngx_int_t rc;
- ngx_uint_t flush, flushed, prev_last_shadow;
- ngx_chain_t *out, **ll, *cl;
- ngx_connection_t *downstream;
-
- downstream = p->downstream;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe write downstream: %d", downstream->write->ready);
-
- flushed = 0;
-
- for ( ;; ) {
- if (p->downstream_error) {
- return ngx_event_pipe_drain_chains(p);
- }
-
- if (p->upstream_eof || p->upstream_error || p->upstream_done) {
-
- /* pass the p->out and p->in chains to the output filter */
-
- for (cl = p->busy; cl; cl = cl->next) {
- cl->buf->recycled = 0;
- }
-
- if (p->out) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe write downstream flush out");
-
- for (cl = p->out; cl; cl = cl->next) {
- cl->buf->recycled = 0;
- }
-
- rc = p->output_filter(p->output_ctx, p->out);
-
- if (rc == NGX_ERROR) {
- p->downstream_error = 1;
- return ngx_event_pipe_drain_chains(p);
- }
-
- p->out = NULL;
- }
-
- if (p->in) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe write downstream flush in");
-
- for (cl = p->in; cl; cl = cl->next) {
- cl->buf->recycled = 0;
- }
-
- rc = p->output_filter(p->output_ctx, p->in);
-
- if (rc == NGX_ERROR) {
- p->downstream_error = 1;
- return ngx_event_pipe_drain_chains(p);
- }
-
- p->in = NULL;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe write downstream done");
-
- /* TODO: free unused bufs */
-
- p->downstream_done = 1;
- break;
- }
-
- if (downstream->data != p->output_ctx
- || !downstream->write->ready
- || downstream->write->delayed)
- {
- break;
- }
-
- /* bsize is the size of the busy recycled bufs */
-
- prev = NULL;
- bsize = 0;
-
- for (cl = p->busy; cl; cl = cl->next) {
-
- if (cl->buf->recycled) {
- if (prev == cl->buf->start) {
- continue;
- }
-
- bsize += cl->buf->end - cl->buf->start;
- prev = cl->buf->start;
- }
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe write busy: %uz", bsize);
-
- out = NULL;
-
- if (bsize >= (size_t) p->busy_size) {
- flush = 1;
- goto flush;
- }
-
- flush = 0;
- ll = NULL;
- prev_last_shadow = 1;
-
- for ( ;; ) {
- if (p->out) {
- cl = p->out;
-
- if (cl->buf->recycled) {
- ngx_log_error(NGX_LOG_ALERT, p->log, 0,
- "recycled buffer in pipe out chain");
- }
-
- p->out = p->out->next;
-
- } else if (!p->cacheable && p->in) {
- cl = p->in;
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe write buf ls:%d %p %z",
- cl->buf->last_shadow,
- cl->buf->pos,
- cl->buf->last - cl->buf->pos);
-
- if (cl->buf->recycled && prev_last_shadow) {
- if (bsize + cl->buf->end - cl->buf->start > p->busy_size) {
- flush = 1;
- break;
- }
-
- bsize += cl->buf->end - cl->buf->start;
- }
-
- prev_last_shadow = cl->buf->last_shadow;
-
- p->in = p->in->next;
-
- } else {
- break;
- }
-
- cl->next = NULL;
-
- if (out) {
- *ll = cl;
- } else {
- out = cl;
- }
- ll = &cl->next;
- }
-
- flush:
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe write: out:%p, f:%d", out, flush);
-
- if (out == NULL) {
-
- if (!flush) {
- break;
- }
-
- /* a workaround for AIO */
- if (flushed++ > 10) {
- return NGX_BUSY;
- }
- }
-
- rc = p->output_filter(p->output_ctx, out);
-
- ngx_chain_update_chains(p->pool, &p->free, &p->busy, &out, p->tag);
-
- if (rc == NGX_ERROR) {
- p->downstream_error = 1;
- return ngx_event_pipe_drain_chains(p);
- }
-
- for (cl = p->free; cl; cl = cl->next) {
-
- if (cl->buf->temp_file) {
- if (p->cacheable || !p->cyclic_temp_file) {
- continue;
- }
-
- /* reset p->temp_offset if all bufs had been sent */
-
- if (cl->buf->file_last == p->temp_file->offset) {
- p->temp_file->offset = 0;
- }
- }
-
- /* TODO: free buf if p->free_bufs && upstream done */
-
- /* add the free shadow raw buf to p->free_raw_bufs */
-
- if (cl->buf->last_shadow) {
- if (ngx_event_pipe_add_free_buf(p, cl->buf->shadow) != NGX_OK) {
- return NGX_ABORT;
- }
-
- cl->buf->last_shadow = 0;
- }
-
- cl->buf->shadow = NULL;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_event_pipe_write_chain_to_temp_file(ngx_event_pipe_t *p)
-{
- ssize_t size, bsize, n;
- ngx_buf_t *b;
- ngx_uint_t prev_last_shadow;
- ngx_chain_t *cl, *tl, *next, *out, **ll, **last_out, **last_free, fl;
-
- if (p->buf_to_file) {
- fl.buf = p->buf_to_file;
- fl.next = p->in;
- out = &fl;
-
- } else {
- out = p->in;
- }
-
- if (!p->cacheable) {
-
- size = 0;
- cl = out;
- ll = NULL;
- prev_last_shadow = 1;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe offset: %O", p->temp_file->offset);
-
- do {
- bsize = cl->buf->last - cl->buf->pos;
-
- ngx_log_debug4(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "pipe buf ls:%d %p, pos %p, size: %z",
- cl->buf->last_shadow, cl->buf->start,
- cl->buf->pos, bsize);
-
- if (prev_last_shadow
- && ((size + bsize > p->temp_file_write_size)
- || (p->temp_file->offset + size + bsize
- > p->max_temp_file_size)))
- {
- break;
- }
-
- prev_last_shadow = cl->buf->last_shadow;
-
- size += bsize;
- ll = &cl->next;
- cl = cl->next;
-
- } while (cl);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, "size: %z", size);
-
- if (ll == NULL) {
- return NGX_BUSY;
- }
-
- if (cl) {
- p->in = cl;
- *ll = NULL;
-
- } else {
- p->in = NULL;
- p->last_in = &p->in;
- }
-
- } else {
- p->in = NULL;
- p->last_in = &p->in;
- }
-
- n = ngx_write_chain_to_temp_file(p->temp_file, out);
-
- if (n == NGX_ERROR) {
- return NGX_ABORT;
- }
-
- if (p->buf_to_file) {
- p->temp_file->offset = p->buf_to_file->last - p->buf_to_file->pos;
- n -= p->buf_to_file->last - p->buf_to_file->pos;
- p->buf_to_file = NULL;
- out = out->next;
- }
-
- if (n > 0) {
- /* update previous buffer or add new buffer */
-
- if (p->out) {
- for (cl = p->out; cl->next; cl = cl->next) { /* void */ }
-
- b = cl->buf;
-
- if (b->file_last == p->temp_file->offset) {
- p->temp_file->offset += n;
- b->file_last = p->temp_file->offset;
- goto free;
- }
-
- last_out = &cl->next;
-
- } else {
- last_out = &p->out;
- }
-
- cl = ngx_chain_get_free_buf(p->pool, &p->free);
- if (cl == NULL) {
- return NGX_ABORT;
- }
-
- b = cl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->tag = p->tag;
-
- b->file = &p->temp_file->file;
- b->file_pos = p->temp_file->offset;
- p->temp_file->offset += n;
- b->file_last = p->temp_file->offset;
-
- b->in_file = 1;
- b->temp_file = 1;
-
- *last_out = cl;
- }
-
-free:
-
- for (last_free = &p->free_raw_bufs;
- *last_free != NULL;
- last_free = &(*last_free)->next)
- {
- /* void */
- }
-
- for (cl = out; cl; cl = next) {
- next = cl->next;
-
- cl->next = p->free;
- p->free = cl;
-
- b = cl->buf;
-
- if (b->last_shadow) {
-
- tl = ngx_alloc_chain_link(p->pool);
- if (tl == NULL) {
- return NGX_ABORT;
- }
-
- tl->buf = b->shadow;
- tl->next = NULL;
-
- *last_free = tl;
- last_free = &tl->next;
-
- b->shadow->pos = b->shadow->start;
- b->shadow->last = b->shadow->start;
-
- ngx_event_pipe_remove_shadow_links(b->shadow);
- }
- }
-
- return NGX_OK;
-}
-
-
-/* the copy input filter */
-
-ngx_int_t
-ngx_event_pipe_copy_input_filter(ngx_event_pipe_t *p, ngx_buf_t *buf)
-{
- ngx_buf_t *b;
- ngx_chain_t *cl;
-
- if (buf->pos == buf->last) {
- return NGX_OK;
- }
-
- cl = ngx_chain_get_free_buf(p->pool, &p->free);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memcpy(b, buf, sizeof(ngx_buf_t));
- b->shadow = buf;
- b->tag = p->tag;
- b->last_shadow = 1;
- b->recycled = 1;
- buf->shadow = b;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, "input buf #%d", b->num);
-
- if (p->in) {
- *p->last_in = cl;
- } else {
- p->in = cl;
- }
- p->last_in = &cl->next;
-
- if (p->length == -1) {
- return NGX_OK;
- }
-
- p->length -= b->last - b->pos;
-
- return NGX_OK;
-}
-
-
-static ngx_inline void
-ngx_event_pipe_remove_shadow_links(ngx_buf_t *buf)
-{
- ngx_buf_t *b, *next;
-
- b = buf->shadow;
-
- if (b == NULL) {
- return;
- }
-
- while (!b->last_shadow) {
- next = b->shadow;
-
- b->temporary = 0;
- b->recycled = 0;
-
- b->shadow = NULL;
- b = next;
- }
-
- b->temporary = 0;
- b->recycled = 0;
- b->last_shadow = 0;
-
- b->shadow = NULL;
-
- buf->shadow = NULL;
-}
-
-
-ngx_int_t
-ngx_event_pipe_add_free_buf(ngx_event_pipe_t *p, ngx_buf_t *b)
-{
- ngx_chain_t *cl;
-
- cl = ngx_alloc_chain_link(p->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- if (p->buf_to_file && b->start == p->buf_to_file->start) {
- b->pos = p->buf_to_file->last;
- b->last = p->buf_to_file->last;
-
- } else {
- b->pos = b->start;
- b->last = b->start;
- }
-
- b->shadow = NULL;
-
- cl->buf = b;
-
- if (p->free_raw_bufs == NULL) {
- p->free_raw_bufs = cl;
- cl->next = NULL;
-
- return NGX_OK;
- }
-
- if (p->free_raw_bufs->buf->pos == p->free_raw_bufs->buf->last) {
-
- /* add the free buf to the list start */
-
- cl->next = p->free_raw_bufs;
- p->free_raw_bufs = cl;
-
- return NGX_OK;
- }
-
- /* the first free buf is partially filled, thus add the free buf after it */
-
- cl->next = p->free_raw_bufs->next;
- p->free_raw_bufs->next = cl;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_event_pipe_drain_chains(ngx_event_pipe_t *p)
-{
- ngx_chain_t *cl, *tl;
-
- for ( ;; ) {
- if (p->busy) {
- cl = p->busy;
- p->busy = NULL;
-
- } else if (p->out) {
- cl = p->out;
- p->out = NULL;
-
- } else if (p->in) {
- cl = p->in;
- p->in = NULL;
-
- } else {
- return NGX_OK;
- }
-
- while (cl) {
- if (cl->buf->last_shadow) {
- if (ngx_event_pipe_add_free_buf(p, cl->buf->shadow) != NGX_OK) {
- return NGX_ABORT;
- }
-
- cl->buf->last_shadow = 0;
- }
-
- cl->buf->shadow = NULL;
- tl = cl->next;
- cl->next = p->free;
- p->free = cl;
- cl = tl;
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.h
deleted file mode 100644
index f24e6d148f5..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_pipe.h
+++ /dev/null
@@ -1,94 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_EVENT_PIPE_H_INCLUDED_
-#define _NGX_EVENT_PIPE_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-typedef struct ngx_event_pipe_s ngx_event_pipe_t;
-
-typedef ngx_int_t (*ngx_event_pipe_input_filter_pt)(ngx_event_pipe_t *p,
- ngx_buf_t *buf);
-typedef ngx_int_t (*ngx_event_pipe_output_filter_pt)(void *data,
- ngx_chain_t *chain);
-
-
-struct ngx_event_pipe_s {
- ngx_connection_t *upstream;
- ngx_connection_t *downstream;
-
- ngx_chain_t *free_raw_bufs;
- ngx_chain_t *in;
- ngx_chain_t **last_in;
-
- ngx_chain_t *out;
- ngx_chain_t *free;
- ngx_chain_t *busy;
-
- /*
- * the input filter i.e. that moves HTTP/1.1 chunks
- * from the raw bufs to an incoming chain
- */
-
- ngx_event_pipe_input_filter_pt input_filter;
- void *input_ctx;
-
- ngx_event_pipe_output_filter_pt output_filter;
- void *output_ctx;
-
- unsigned read:1;
- unsigned cacheable:1;
- unsigned single_buf:1;
- unsigned free_bufs:1;
- unsigned upstream_done:1;
- unsigned upstream_error:1;
- unsigned upstream_eof:1;
- unsigned upstream_blocked:1;
- unsigned downstream_done:1;
- unsigned downstream_error:1;
- unsigned cyclic_temp_file:1;
-
- ngx_int_t allocated;
- ngx_bufs_t bufs;
- ngx_buf_tag_t tag;
-
- ssize_t busy_size;
-
- off_t read_length;
- off_t length;
-
- off_t max_temp_file_size;
- ssize_t temp_file_write_size;
-
- ngx_msec_t read_timeout;
- ngx_msec_t send_timeout;
- ssize_t send_lowat;
-
- ngx_pool_t *pool;
- ngx_log_t *log;
-
- ngx_chain_t *preread_bufs;
- size_t preread_size;
- ngx_buf_t *buf_to_file;
-
- ngx_temp_file_t *temp_file;
-
- /* STUB */ int num;
-};
-
-
-ngx_int_t ngx_event_pipe(ngx_event_pipe_t *p, ngx_int_t do_write);
-ngx_int_t ngx_event_pipe_copy_input_filter(ngx_event_pipe_t *p, ngx_buf_t *buf);
-ngx_int_t ngx_event_pipe_add_free_buf(ngx_event_pipe_t *p, ngx_buf_t *b);
-
-
-#endif /* _NGX_EVENT_PIPE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.c
deleted file mode 100644
index d851f3d14fc..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.c
+++ /dev/null
@@ -1,35 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-ngx_queue_t ngx_posted_accept_events;
-ngx_queue_t ngx_posted_events;
-
-
-void
-ngx_event_process_posted(ngx_cycle_t *cycle, ngx_queue_t *posted)
-{
- ngx_queue_t *q;
- ngx_event_t *ev;
-
- while (!ngx_queue_empty(posted)) {
-
- q = ngx_queue_head(posted);
- ev = ngx_queue_data(q, ngx_event_t, queue);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "posted event %p", ev);
-
- ngx_delete_posted_event(ev);
-
- ev->handler(ev);
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.h
deleted file mode 100644
index 40ba1c1e02b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_posted.h
+++ /dev/null
@@ -1,48 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_EVENT_POSTED_H_INCLUDED_
-#define _NGX_EVENT_POSTED_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#define ngx_post_event(ev, q) \
- \
- if (!ev->posted) { \
- ev->posted = 1; \
- ngx_queue_insert_tail(q, &ev->queue); \
- \
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "post event %p", ev); \
- \
- } else { \
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, \
- "update posted event %p", ev); \
- }
-
-
-#define ngx_delete_posted_event(ev) \
- \
- ev->posted = 0; \
- ngx_queue_remove(&ev->queue); \
- \
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, \
- "delete posted event %p", ev);
-
-
-
-void ngx_event_process_posted(ngx_cycle_t *cycle, ngx_queue_t *posted);
-
-
-extern ngx_queue_t ngx_posted_accept_events;
-extern ngx_queue_t ngx_posted_events;
-
-
-#endif /* _NGX_EVENT_POSTED_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.c
deleted file mode 100644
index 1075586497d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.c
+++ /dev/null
@@ -1,128 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#if (NGX_THREADS)
-ngx_mutex_t *ngx_event_timer_mutex;
-#endif
-
-
-ngx_thread_volatile ngx_rbtree_t ngx_event_timer_rbtree;
-static ngx_rbtree_node_t ngx_event_timer_sentinel;
-
-/*
- * the event timer rbtree may contain the duplicate keys, however,
- * it should not be a problem, because we use the rbtree to find
- * a minimum timer value only
- */
-
-ngx_int_t
-ngx_event_timer_init(ngx_log_t *log)
-{
- ngx_rbtree_init(&ngx_event_timer_rbtree, &ngx_event_timer_sentinel,
- ngx_rbtree_insert_timer_value);
-
-#if (NGX_THREADS)
-
- if (ngx_event_timer_mutex) {
- ngx_event_timer_mutex->log = log;
- return NGX_OK;
- }
-
- ngx_event_timer_mutex = ngx_mutex_init(log, 0);
- if (ngx_event_timer_mutex == NULL) {
- return NGX_ERROR;
- }
-
-#endif
-
- return NGX_OK;
-}
-
-
-ngx_msec_t
-ngx_event_find_timer(void)
-{
- ngx_msec_int_t timer;
- ngx_rbtree_node_t *node, *root, *sentinel;
-
- if (ngx_event_timer_rbtree.root == &ngx_event_timer_sentinel) {
- return NGX_TIMER_INFINITE;
- }
-
- ngx_mutex_lock(ngx_event_timer_mutex);
-
- root = ngx_event_timer_rbtree.root;
- sentinel = ngx_event_timer_rbtree.sentinel;
-
- node = ngx_rbtree_min(root, sentinel);
-
- ngx_mutex_unlock(ngx_event_timer_mutex);
-
- timer = (ngx_msec_int_t) (node->key - ngx_current_msec);
-
- return (ngx_msec_t) (timer > 0 ? timer : 0);
-}
-
-
-void
-ngx_event_expire_timers(void)
-{
- ngx_event_t *ev;
- ngx_rbtree_node_t *node, *root, *sentinel;
-
- sentinel = ngx_event_timer_rbtree.sentinel;
-
- for ( ;; ) {
-
- ngx_mutex_lock(ngx_event_timer_mutex);
-
- root = ngx_event_timer_rbtree.root;
-
- if (root == sentinel) {
- return;
- }
-
- node = ngx_rbtree_min(root, sentinel);
-
- /* node->key <= ngx_current_time */
-
- if ((ngx_msec_int_t) (node->key - ngx_current_msec) <= 0) {
- ev = (ngx_event_t *) ((char *) node - offsetof(ngx_event_t, timer));
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "event timer del: %d: %M",
- ngx_event_ident(ev->data), ev->timer.key);
-
- ngx_rbtree_delete(&ngx_event_timer_rbtree, &ev->timer);
-
- ngx_mutex_unlock(ngx_event_timer_mutex);
-
-#if (NGX_DEBUG)
- ev->timer.left = NULL;
- ev->timer.right = NULL;
- ev->timer.parent = NULL;
-#endif
-
- ev->timer_set = 0;
-
- ev->timedout = 1;
-
- ev->handler(ev);
-
- continue;
- }
-
- break;
- }
-
- ngx_mutex_unlock(ngx_event_timer_mutex);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.h
deleted file mode 100644
index ec9b316bdc8..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/event/ngx_event_timer.h
+++ /dev/null
@@ -1,102 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_EVENT_TIMER_H_INCLUDED_
-#define _NGX_EVENT_TIMER_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#define NGX_TIMER_INFINITE (ngx_msec_t) -1
-
-#define NGX_TIMER_LAZY_DELAY 300
-
-
-ngx_int_t ngx_event_timer_init(ngx_log_t *log);
-ngx_msec_t ngx_event_find_timer(void);
-void ngx_event_expire_timers(void);
-
-
-#if (NGX_THREADS)
-extern ngx_mutex_t *ngx_event_timer_mutex;
-#endif
-
-
-extern ngx_thread_volatile ngx_rbtree_t ngx_event_timer_rbtree;
-
-
-static ngx_inline void
-ngx_event_del_timer(ngx_event_t *ev)
-{
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "event timer del: %d: %M",
- ngx_event_ident(ev->data), ev->timer.key);
-
- ngx_mutex_lock(ngx_event_timer_mutex);
-
- ngx_rbtree_delete(&ngx_event_timer_rbtree, &ev->timer);
-
- ngx_mutex_unlock(ngx_event_timer_mutex);
-
-#if (NGX_DEBUG)
- ev->timer.left = NULL;
- ev->timer.right = NULL;
- ev->timer.parent = NULL;
-#endif
-
- ev->timer_set = 0;
-}
-
-
-static ngx_inline void
-ngx_event_add_timer(ngx_event_t *ev, ngx_msec_t timer)
-{
- ngx_msec_t key;
- ngx_msec_int_t diff;
-
- key = ngx_current_msec + timer;
-
- if (ev->timer_set) {
-
- /*
- * Use a previous timer value if difference between it and a new
- * value is less than NGX_TIMER_LAZY_DELAY milliseconds: this allows
- * to minimize the rbtree operations for fast connections.
- */
-
- diff = (ngx_msec_int_t) (key - ev->timer.key);
-
- if (ngx_abs(diff) < NGX_TIMER_LAZY_DELAY) {
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "event timer: %d, old: %M, new: %M",
- ngx_event_ident(ev->data), ev->timer.key, key);
- return;
- }
-
- ngx_del_timer(ev);
- }
-
- ev->timer.key = key;
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "event timer add: %d: %M:%M",
- ngx_event_ident(ev->data), timer, ev->timer.key);
-
- ngx_mutex_lock(ngx_event_timer_mutex);
-
- ngx_rbtree_insert(&ngx_event_timer_rbtree, &ev->timer);
-
- ngx_mutex_unlock(ngx_event_timer_mutex);
-
- ev->timer_set = 1;
-}
-
-
-#endif /* _NGX_EVENT_TIMER_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_access_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_access_module.c
deleted file mode 100644
index c553e46106b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_access_module.c
+++ /dev/null
@@ -1,469 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- in_addr_t mask;
- in_addr_t addr;
- ngx_uint_t deny; /* unsigned deny:1; */
-} ngx_http_access_rule_t;
-
-#if (NGX_HAVE_INET6)
-
-typedef struct {
- struct in6_addr addr;
- struct in6_addr mask;
- ngx_uint_t deny; /* unsigned deny:1; */
-} ngx_http_access_rule6_t;
-
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
-
-typedef struct {
- ngx_uint_t deny; /* unsigned deny:1; */
-} ngx_http_access_rule_un_t;
-
-#endif
-
-typedef struct {
- ngx_array_t *rules; /* array of ngx_http_access_rule_t */
-#if (NGX_HAVE_INET6)
- ngx_array_t *rules6; /* array of ngx_http_access_rule6_t */
-#endif
-#if (NGX_HAVE_UNIX_DOMAIN)
- ngx_array_t *rules_un; /* array of ngx_http_access_rule_un_t */
-#endif
-} ngx_http_access_loc_conf_t;
-
-
-static ngx_int_t ngx_http_access_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_access_inet(ngx_http_request_t *r,
- ngx_http_access_loc_conf_t *alcf, in_addr_t addr);
-#if (NGX_HAVE_INET6)
-static ngx_int_t ngx_http_access_inet6(ngx_http_request_t *r,
- ngx_http_access_loc_conf_t *alcf, u_char *p);
-#endif
-#if (NGX_HAVE_UNIX_DOMAIN)
-static ngx_int_t ngx_http_access_unix(ngx_http_request_t *r,
- ngx_http_access_loc_conf_t *alcf);
-#endif
-static ngx_int_t ngx_http_access_found(ngx_http_request_t *r, ngx_uint_t deny);
-static char *ngx_http_access_rule(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static void *ngx_http_access_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_access_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_access_init(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_access_commands[] = {
-
- { ngx_string("allow"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF
- |NGX_CONF_TAKE1,
- ngx_http_access_rule,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("deny"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF
- |NGX_CONF_TAKE1,
- ngx_http_access_rule,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-
-static ngx_http_module_t ngx_http_access_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_access_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_access_create_loc_conf, /* create location configuration */
- ngx_http_access_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_access_module = {
- NGX_MODULE_V1,
- &ngx_http_access_module_ctx, /* module context */
- ngx_http_access_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_access_handler(ngx_http_request_t *r)
-{
- struct sockaddr_in *sin;
- ngx_http_access_loc_conf_t *alcf;
-#if (NGX_HAVE_INET6)
- u_char *p;
- in_addr_t addr;
- struct sockaddr_in6 *sin6;
-#endif
-
- alcf = ngx_http_get_module_loc_conf(r, ngx_http_access_module);
-
- switch (r->connection->sockaddr->sa_family) {
-
- case AF_INET:
- if (alcf->rules) {
- sin = (struct sockaddr_in *) r->connection->sockaddr;
- return ngx_http_access_inet(r, alcf, sin->sin_addr.s_addr);
- }
- break;
-
-#if (NGX_HAVE_INET6)
-
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) r->connection->sockaddr;
- p = sin6->sin6_addr.s6_addr;
-
- if (alcf->rules && IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
- addr = p[12] << 24;
- addr += p[13] << 16;
- addr += p[14] << 8;
- addr += p[15];
- return ngx_http_access_inet(r, alcf, htonl(addr));
- }
-
- if (alcf->rules6) {
- return ngx_http_access_inet6(r, alcf, p);
- }
-
- break;
-
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
-
- case AF_UNIX:
- if (alcf->rules_un) {
- return ngx_http_access_unix(r, alcf);
- }
-
- break;
-
-#endif
- }
-
- return NGX_DECLINED;
-}
-
-
-static ngx_int_t
-ngx_http_access_inet(ngx_http_request_t *r, ngx_http_access_loc_conf_t *alcf,
- in_addr_t addr)
-{
- ngx_uint_t i;
- ngx_http_access_rule_t *rule;
-
- rule = alcf->rules->elts;
- for (i = 0; i < alcf->rules->nelts; i++) {
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "access: %08XD %08XD %08XD",
- addr, rule[i].mask, rule[i].addr);
-
- if ((addr & rule[i].mask) == rule[i].addr) {
- return ngx_http_access_found(r, rule[i].deny);
- }
- }
-
- return NGX_DECLINED;
-}
-
-
-#if (NGX_HAVE_INET6)
-
-static ngx_int_t
-ngx_http_access_inet6(ngx_http_request_t *r, ngx_http_access_loc_conf_t *alcf,
- u_char *p)
-{
- ngx_uint_t n;
- ngx_uint_t i;
- ngx_http_access_rule6_t *rule6;
-
- rule6 = alcf->rules6->elts;
- for (i = 0; i < alcf->rules6->nelts; i++) {
-
-#if (NGX_DEBUG)
- {
- size_t cl, ml, al;
- u_char ct[NGX_INET6_ADDRSTRLEN];
- u_char mt[NGX_INET6_ADDRSTRLEN];
- u_char at[NGX_INET6_ADDRSTRLEN];
-
- cl = ngx_inet6_ntop(p, ct, NGX_INET6_ADDRSTRLEN);
- ml = ngx_inet6_ntop(rule6[i].mask.s6_addr, mt, NGX_INET6_ADDRSTRLEN);
- al = ngx_inet6_ntop(rule6[i].addr.s6_addr, at, NGX_INET6_ADDRSTRLEN);
-
- ngx_log_debug6(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "access: %*s %*s %*s", cl, ct, ml, mt, al, at);
- }
-#endif
-
- for (n = 0; n < 16; n++) {
- if ((p[n] & rule6[i].mask.s6_addr[n]) != rule6[i].addr.s6_addr[n]) {
- goto next;
- }
- }
-
- return ngx_http_access_found(r, rule6[i].deny);
-
- next:
- continue;
- }
-
- return NGX_DECLINED;
-}
-
-#endif
-
-
-#if (NGX_HAVE_UNIX_DOMAIN)
-
-static ngx_int_t
-ngx_http_access_unix(ngx_http_request_t *r, ngx_http_access_loc_conf_t *alcf)
-{
- ngx_uint_t i;
- ngx_http_access_rule_un_t *rule_un;
-
- rule_un = alcf->rules_un->elts;
- for (i = 0; i < alcf->rules_un->nelts; i++) {
-
- /* TODO: check path */
- if (1) {
- return ngx_http_access_found(r, rule_un[i].deny);
- }
- }
-
- return NGX_DECLINED;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_access_found(ngx_http_request_t *r, ngx_uint_t deny)
-{
- ngx_http_core_loc_conf_t *clcf;
-
- if (deny) {
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->satisfy == NGX_HTTP_SATISFY_ALL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "access forbidden by rule");
- }
-
- return NGX_HTTP_FORBIDDEN;
- }
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_access_rule(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_access_loc_conf_t *alcf = conf;
-
- ngx_int_t rc;
- ngx_uint_t all;
- ngx_str_t *value;
- ngx_cidr_t cidr;
- ngx_http_access_rule_t *rule;
-#if (NGX_HAVE_INET6)
- ngx_http_access_rule6_t *rule6;
-#endif
-#if (NGX_HAVE_UNIX_DOMAIN)
- ngx_http_access_rule_un_t *rule_un;
-#endif
-
- ngx_memzero(&cidr, sizeof(ngx_cidr_t));
-
- value = cf->args->elts;
-
- all = (value[1].len == 3 && ngx_strcmp(value[1].data, "all") == 0);
-
- if (!all) {
-
-#if (NGX_HAVE_UNIX_DOMAIN)
-
- if (value[1].len == 5 && ngx_strcmp(value[1].data, "unix:") == 0) {
- cidr.family = AF_UNIX;
- rc = NGX_OK;
-
- } else {
- rc = ngx_ptocidr(&value[1], &cidr);
- }
-
-#else
- rc = ngx_ptocidr(&value[1], &cidr);
-#endif
-
- if (rc == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- if (rc == NGX_DONE) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "low address bits of %V are meaningless", &value[1]);
- }
- }
-
- if (cidr.family == AF_INET || all) {
-
- if (alcf->rules == NULL) {
- alcf->rules = ngx_array_create(cf->pool, 4,
- sizeof(ngx_http_access_rule_t));
- if (alcf->rules == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- rule = ngx_array_push(alcf->rules);
- if (rule == NULL) {
- return NGX_CONF_ERROR;
- }
-
- rule->mask = cidr.u.in.mask;
- rule->addr = cidr.u.in.addr;
- rule->deny = (value[0].data[0] == 'd') ? 1 : 0;
- }
-
-#if (NGX_HAVE_INET6)
- if (cidr.family == AF_INET6 || all) {
-
- if (alcf->rules6 == NULL) {
- alcf->rules6 = ngx_array_create(cf->pool, 4,
- sizeof(ngx_http_access_rule6_t));
- if (alcf->rules6 == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- rule6 = ngx_array_push(alcf->rules6);
- if (rule6 == NULL) {
- return NGX_CONF_ERROR;
- }
-
- rule6->mask = cidr.u.in6.mask;
- rule6->addr = cidr.u.in6.addr;
- rule6->deny = (value[0].data[0] == 'd') ? 1 : 0;
- }
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- if (cidr.family == AF_UNIX || all) {
-
- if (alcf->rules_un == NULL) {
- alcf->rules_un = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_access_rule_un_t));
- if (alcf->rules_un == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- rule_un = ngx_array_push(alcf->rules_un);
- if (rule_un == NULL) {
- return NGX_CONF_ERROR;
- }
-
- rule_un->deny = (value[0].data[0] == 'd') ? 1 : 0;
- }
-#endif
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_http_access_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_access_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_access_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- return conf;
-}
-
-
-static char *
-ngx_http_access_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_access_loc_conf_t *prev = parent;
- ngx_http_access_loc_conf_t *conf = child;
-
- if (conf->rules == NULL
-#if (NGX_HAVE_INET6)
- && conf->rules6 == NULL
-#endif
-#if (NGX_HAVE_UNIX_DOMAIN)
- && conf->rules_un == NULL
-#endif
- ) {
- conf->rules = prev->rules;
-#if (NGX_HAVE_INET6)
- conf->rules6 = prev->rules6;
-#endif
-#if (NGX_HAVE_UNIX_DOMAIN)
- conf->rules_un = prev->rules_un;
-#endif
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_access_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_access_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_addition_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_addition_filter_module.c
deleted file mode 100644
index db4970bf1d6..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_addition_filter_module.c
+++ /dev/null
@@ -1,251 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_str_t before_body;
- ngx_str_t after_body;
-
- ngx_hash_t types;
- ngx_array_t *types_keys;
-} ngx_http_addition_conf_t;
-
-
-typedef struct {
- ngx_uint_t before_body_sent;
-} ngx_http_addition_ctx_t;
-
-
-static void *ngx_http_addition_create_conf(ngx_conf_t *cf);
-static char *ngx_http_addition_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static ngx_int_t ngx_http_addition_filter_init(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_addition_commands[] = {
-
- { ngx_string("add_before_body"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_addition_conf_t, before_body),
- NULL },
-
- { ngx_string("add_after_body"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_addition_conf_t, after_body),
- NULL },
-
- { ngx_string("addition_types"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_types_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_addition_conf_t, types_keys),
- &ngx_http_html_default_types[0] },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_addition_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_addition_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_addition_create_conf, /* create location configuration */
- ngx_http_addition_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_addition_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_addition_filter_module_ctx, /* module context */
- ngx_http_addition_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_addition_header_filter(ngx_http_request_t *r)
-{
- ngx_http_addition_ctx_t *ctx;
- ngx_http_addition_conf_t *conf;
-
- if (r->headers_out.status != NGX_HTTP_OK || r != r->main) {
- return ngx_http_next_header_filter(r);
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_addition_filter_module);
-
- if (conf->before_body.len == 0 && conf->after_body.len == 0) {
- return ngx_http_next_header_filter(r);
- }
-
- if (ngx_http_test_content_type(r, &conf->types) == NULL) {
- return ngx_http_next_header_filter(r);
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_addition_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_addition_filter_module);
-
- ngx_http_clear_content_length(r);
- ngx_http_clear_accept_ranges(r);
- ngx_http_weak_etag(r);
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_addition_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- ngx_int_t rc;
- ngx_uint_t last;
- ngx_chain_t *cl;
- ngx_http_request_t *sr;
- ngx_http_addition_ctx_t *ctx;
- ngx_http_addition_conf_t *conf;
-
- if (in == NULL || r->header_only) {
- return ngx_http_next_body_filter(r, in);
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_addition_filter_module);
-
- if (ctx == NULL) {
- return ngx_http_next_body_filter(r, in);
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_addition_filter_module);
-
- if (!ctx->before_body_sent) {
- ctx->before_body_sent = 1;
-
- if (conf->before_body.len) {
- if (ngx_http_subrequest(r, &conf->before_body, NULL, &sr, NULL, 0)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
- }
-
- if (conf->after_body.len == 0) {
- ngx_http_set_ctx(r, NULL, ngx_http_addition_filter_module);
- return ngx_http_next_body_filter(r, in);
- }
-
- last = 0;
-
- for (cl = in; cl; cl = cl->next) {
- if (cl->buf->last_buf) {
- cl->buf->last_buf = 0;
- cl->buf->sync = 1;
- last = 1;
- }
- }
-
- rc = ngx_http_next_body_filter(r, in);
-
- if (rc == NGX_ERROR || !last || conf->after_body.len == 0) {
- return rc;
- }
-
- if (ngx_http_subrequest(r, &conf->after_body, NULL, &sr, NULL, 0)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, NULL, ngx_http_addition_filter_module);
-
- return ngx_http_send_special(r, NGX_HTTP_LAST);
-}
-
-
-static ngx_int_t
-ngx_http_addition_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_addition_header_filter;
-
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_addition_body_filter;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_addition_create_conf(ngx_conf_t *cf)
-{
- ngx_http_addition_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_addition_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->before_body = { 0, NULL };
- * conf->after_body = { 0, NULL };
- * conf->types = { NULL };
- * conf->types_keys = NULL;
- */
-
- return conf;
-}
-
-
-static char *
-ngx_http_addition_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_addition_conf_t *prev = parent;
- ngx_http_addition_conf_t *conf = child;
-
- ngx_conf_merge_str_value(conf->before_body, prev->before_body, "");
- ngx_conf_merge_str_value(conf->after_body, prev->after_body, "");
-
- if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
- &prev->types_keys, &prev->types,
- ngx_http_html_default_types)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_basic_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_basic_module.c
deleted file mode 100644
index 8ec53295fba..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_basic_module.c
+++ /dev/null
@@ -1,467 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <ngx_crypt.h>
-
-
-#define NGX_HTTP_AUTH_BUF_SIZE 2048
-
-
-typedef struct {
- ngx_str_t passwd;
-} ngx_http_auth_basic_ctx_t;
-
-
-typedef struct {
- ngx_http_complex_value_t *realm;
- ngx_http_complex_value_t user_file;
-} ngx_http_auth_basic_loc_conf_t;
-
-
-static ngx_int_t ngx_http_auth_basic_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_auth_basic_crypt_handler(ngx_http_request_t *r,
- ngx_http_auth_basic_ctx_t *ctx, ngx_str_t *passwd, ngx_str_t *realm);
-static ngx_int_t ngx_http_auth_basic_set_realm(ngx_http_request_t *r,
- ngx_str_t *realm);
-static void ngx_http_auth_basic_close(ngx_file_t *file);
-static void *ngx_http_auth_basic_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_auth_basic_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_auth_basic_init(ngx_conf_t *cf);
-static char *ngx_http_auth_basic_user_file(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_http_auth_basic_commands[] = {
-
- { ngx_string("auth_basic"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF
- |NGX_CONF_TAKE1,
- ngx_http_set_complex_value_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_auth_basic_loc_conf_t, realm),
- NULL },
-
- { ngx_string("auth_basic_user_file"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF
- |NGX_CONF_TAKE1,
- ngx_http_auth_basic_user_file,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_auth_basic_loc_conf_t, user_file),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_auth_basic_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_auth_basic_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_auth_basic_create_loc_conf, /* create location configuration */
- ngx_http_auth_basic_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_auth_basic_module = {
- NGX_MODULE_V1,
- &ngx_http_auth_basic_module_ctx, /* module context */
- ngx_http_auth_basic_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_auth_basic_handler(ngx_http_request_t *r)
-{
- off_t offset;
- ssize_t n;
- ngx_fd_t fd;
- ngx_int_t rc;
- ngx_err_t err;
- ngx_str_t pwd, realm, user_file;
- ngx_uint_t i, level, login, left, passwd;
- ngx_file_t file;
- ngx_http_auth_basic_ctx_t *ctx;
- ngx_http_auth_basic_loc_conf_t *alcf;
- u_char buf[NGX_HTTP_AUTH_BUF_SIZE];
- enum {
- sw_login,
- sw_passwd,
- sw_skip
- } state;
-
- alcf = ngx_http_get_module_loc_conf(r, ngx_http_auth_basic_module);
-
- if (alcf->realm == NULL || alcf->user_file.value.data == NULL) {
- return NGX_DECLINED;
- }
-
- if (ngx_http_complex_value(r, alcf->realm, &realm) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (realm.len == 3 && ngx_strncmp(realm.data, "off", 3) == 0) {
- return NGX_DECLINED;
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_auth_basic_module);
-
- if (ctx) {
- return ngx_http_auth_basic_crypt_handler(r, ctx, &ctx->passwd,
- &realm);
- }
-
- rc = ngx_http_auth_basic_user(r);
-
- if (rc == NGX_DECLINED) {
-
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "no user/password was provided for basic authentication");
-
- return ngx_http_auth_basic_set_realm(r, &realm);
- }
-
- if (rc == NGX_ERROR) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_http_complex_value(r, &alcf->user_file, &user_file) != NGX_OK) {
- return NGX_ERROR;
- }
-
- fd = ngx_open_file(user_file.data, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
-
- if (fd == NGX_INVALID_FILE) {
- err = ngx_errno;
-
- if (err == NGX_ENOENT) {
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_FORBIDDEN;
-
- } else {
- level = NGX_LOG_CRIT;
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_log_error(level, r->connection->log, err,
- ngx_open_file_n " \"%s\" failed", user_file.data);
-
- return rc;
- }
-
- ngx_memzero(&file, sizeof(ngx_file_t));
-
- file.fd = fd;
- file.name = user_file;
- file.log = r->connection->log;
-
- state = sw_login;
- passwd = 0;
- login = 0;
- left = 0;
- offset = 0;
-
- for ( ;; ) {
- i = left;
-
- n = ngx_read_file(&file, buf + left, NGX_HTTP_AUTH_BUF_SIZE - left,
- offset);
-
- if (n == NGX_ERROR) {
- ngx_http_auth_basic_close(&file);
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (n == 0) {
- break;
- }
-
- for (i = left; i < left + n; i++) {
- switch (state) {
-
- case sw_login:
- if (login == 0) {
-
- if (buf[i] == '#' || buf[i] == CR) {
- state = sw_skip;
- break;
- }
-
- if (buf[i] == LF) {
- break;
- }
- }
-
- if (buf[i] != r->headers_in.user.data[login]) {
- state = sw_skip;
- break;
- }
-
- if (login == r->headers_in.user.len) {
- state = sw_passwd;
- passwd = i + 1;
- }
-
- login++;
-
- break;
-
- case sw_passwd:
- if (buf[i] == LF || buf[i] == CR || buf[i] == ':') {
- buf[i] = '\0';
-
- ngx_http_auth_basic_close(&file);
-
- pwd.len = i - passwd;
- pwd.data = &buf[passwd];
-
- return ngx_http_auth_basic_crypt_handler(r, NULL, &pwd,
- &realm);
- }
-
- break;
-
- case sw_skip:
- if (buf[i] == LF) {
- state = sw_login;
- login = 0;
- }
-
- break;
- }
- }
-
- if (state == sw_passwd) {
- left = left + n - passwd;
- ngx_memmove(buf, &buf[passwd], left);
- passwd = 0;
-
- } else {
- left = 0;
- }
-
- offset += n;
- }
-
- ngx_http_auth_basic_close(&file);
-
- if (state == sw_passwd) {
- pwd.len = i - passwd;
- pwd.data = ngx_pnalloc(r->pool, pwd.len + 1);
- if (pwd.data == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_cpystrn(pwd.data, &buf[passwd], pwd.len + 1);
-
- return ngx_http_auth_basic_crypt_handler(r, NULL, &pwd, &realm);
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "user \"%V\" was not found in \"%V\"",
- &r->headers_in.user, &user_file);
-
- return ngx_http_auth_basic_set_realm(r, &realm);
-}
-
-
-static ngx_int_t
-ngx_http_auth_basic_crypt_handler(ngx_http_request_t *r,
- ngx_http_auth_basic_ctx_t *ctx, ngx_str_t *passwd, ngx_str_t *realm)
-{
- ngx_int_t rc;
- u_char *encrypted;
-
- rc = ngx_crypt(r->pool, r->headers_in.passwd.data, passwd->data,
- &encrypted);
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "rc: %d user: \"%V\" salt: \"%s\"",
- rc, &r->headers_in.user, passwd->data);
-
- if (rc == NGX_OK) {
- if (ngx_strcmp(encrypted, passwd->data) == 0) {
- return NGX_OK;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "encrypted: \"%s\"", encrypted);
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "user \"%V\": password mismatch",
- &r->headers_in.user);
-
- return ngx_http_auth_basic_set_realm(r, realm);
- }
-
- if (rc == NGX_ERROR) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* rc == NGX_AGAIN */
-
- if (ctx == NULL) {
- ctx = ngx_palloc(r->pool, sizeof(ngx_http_auth_basic_ctx_t));
- if (ctx == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_auth_basic_module);
-
- ctx->passwd.len = passwd->len;
- passwd->len++;
-
- ctx->passwd.data = ngx_pstrdup(r->pool, passwd);
- if (ctx->passwd.data == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- }
-
- /* TODO: add mutex event */
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_auth_basic_set_realm(ngx_http_request_t *r, ngx_str_t *realm)
-{
- size_t len;
- u_char *basic, *p;
-
- r->headers_out.www_authenticate = ngx_list_push(&r->headers_out.headers);
- if (r->headers_out.www_authenticate == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- len = sizeof("Basic realm=\"\"") - 1 + realm->len;
-
- basic = ngx_pnalloc(r->pool, len);
- if (basic == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- p = ngx_cpymem(basic, "Basic realm=\"", sizeof("Basic realm=\"") - 1);
- p = ngx_cpymem(p, realm->data, realm->len);
- *p = '"';
-
- r->headers_out.www_authenticate->hash = 1;
- ngx_str_set(&r->headers_out.www_authenticate->key, "WWW-Authenticate");
- r->headers_out.www_authenticate->value.data = basic;
- r->headers_out.www_authenticate->value.len = len;
-
- return NGX_HTTP_UNAUTHORIZED;
-}
-
-static void
-ngx_http_auth_basic_close(ngx_file_t *file)
-{
- if (ngx_close_file(file->fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, file->log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", file->name.data);
- }
-}
-
-
-static void *
-ngx_http_auth_basic_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_auth_basic_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_auth_basic_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- return conf;
-}
-
-
-static char *
-ngx_http_auth_basic_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_auth_basic_loc_conf_t *prev = parent;
- ngx_http_auth_basic_loc_conf_t *conf = child;
-
- if (conf->realm == NULL) {
- conf->realm = prev->realm;
- }
-
- if (conf->user_file.value.data == NULL) {
- conf->user_file = prev->user_file;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_auth_basic_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_auth_basic_handler;
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_auth_basic_user_file(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_auth_basic_loc_conf_t *alcf = conf;
-
- ngx_str_t *value;
- ngx_http_compile_complex_value_t ccv;
-
- if (alcf->user_file.value.data) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &alcf->user_file;
- ccv.zero = 1;
- ccv.conf_prefix = 1;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_request_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_request_module.c
deleted file mode 100644
index b4307be2e7d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_auth_request_module.c
+++ /dev/null
@@ -1,444 +0,0 @@
-
-/*
- * Copyright (C) Maxim Dounin
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_str_t uri;
- ngx_array_t *vars;
-} ngx_http_auth_request_conf_t;
-
-
-typedef struct {
- ngx_uint_t done;
- ngx_uint_t status;
- ngx_http_request_t *subrequest;
-} ngx_http_auth_request_ctx_t;
-
-
-typedef struct {
- ngx_int_t index;
- ngx_http_complex_value_t value;
- ngx_http_set_variable_pt set_handler;
-} ngx_http_auth_request_variable_t;
-
-
-static ngx_int_t ngx_http_auth_request_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_auth_request_done(ngx_http_request_t *r,
- void *data, ngx_int_t rc);
-static ngx_int_t ngx_http_auth_request_set_variables(ngx_http_request_t *r,
- ngx_http_auth_request_conf_t *arcf, ngx_http_auth_request_ctx_t *ctx);
-static ngx_int_t ngx_http_auth_request_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static void *ngx_http_auth_request_create_conf(ngx_conf_t *cf);
-static char *ngx_http_auth_request_merge_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_auth_request_init(ngx_conf_t *cf);
-static char *ngx_http_auth_request(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_auth_request_set(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_http_auth_request_commands[] = {
-
- { ngx_string("auth_request"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_auth_request,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("auth_request_set"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_http_auth_request_set,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_auth_request_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_auth_request_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_auth_request_create_conf, /* create location configuration */
- ngx_http_auth_request_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_auth_request_module = {
- NGX_MODULE_V1,
- &ngx_http_auth_request_module_ctx, /* module context */
- ngx_http_auth_request_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_auth_request_handler(ngx_http_request_t *r)
-{
- ngx_table_elt_t *h, *ho;
- ngx_http_request_t *sr;
- ngx_http_post_subrequest_t *ps;
- ngx_http_auth_request_ctx_t *ctx;
- ngx_http_auth_request_conf_t *arcf;
-
- arcf = ngx_http_get_module_loc_conf(r, ngx_http_auth_request_module);
-
- if (arcf->uri.len == 0) {
- return NGX_DECLINED;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "auth request handler");
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_auth_request_module);
-
- if (ctx != NULL) {
- if (!ctx->done) {
- return NGX_AGAIN;
- }
-
- /*
- * as soon as we are done - explicitly set variables to make
- * sure they will be available after internal redirects
- */
-
- if (ngx_http_auth_request_set_variables(r, arcf, ctx) != NGX_OK) {
- return NGX_ERROR;
- }
-
- /* return appropriate status */
-
- if (ctx->status == NGX_HTTP_FORBIDDEN) {
- return ctx->status;
- }
-
- if (ctx->status == NGX_HTTP_UNAUTHORIZED) {
- sr = ctx->subrequest;
-
- h = sr->headers_out.www_authenticate;
-
- if (!h && sr->upstream) {
- h = sr->upstream->headers_in.www_authenticate;
- }
-
- if (h) {
- ho = ngx_list_push(&r->headers_out.headers);
- if (ho == NULL) {
- return NGX_ERROR;
- }
-
- *ho = *h;
-
- r->headers_out.www_authenticate = ho;
- }
-
- return ctx->status;
- }
-
- if (ctx->status >= NGX_HTTP_OK
- && ctx->status < NGX_HTTP_SPECIAL_RESPONSE)
- {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "auth request unexpected status: %d", ctx->status);
-
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_auth_request_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ps = ngx_palloc(r->pool, sizeof(ngx_http_post_subrequest_t));
- if (ps == NULL) {
- return NGX_ERROR;
- }
-
- ps->handler = ngx_http_auth_request_done;
- ps->data = ctx;
-
- if (ngx_http_subrequest(r, &arcf->uri, NULL, &sr, ps,
- NGX_HTTP_SUBREQUEST_WAITED)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- /*
- * allocate fake request body to avoid attempts to read it and to make
- * sure real body file (if already read) won't be closed by upstream
- */
-
- sr->request_body = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t));
- if (sr->request_body == NULL) {
- return NGX_ERROR;
- }
-
- sr->header_only = 1;
-
- ctx->subrequest = sr;
-
- ngx_http_set_ctx(r, ctx, ngx_http_auth_request_module);
-
- return NGX_AGAIN;
-}
-
-
-static ngx_int_t
-ngx_http_auth_request_done(ngx_http_request_t *r, void *data, ngx_int_t rc)
-{
- ngx_http_auth_request_ctx_t *ctx = data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "auth request done s:%d", r->headers_out.status);
-
- ctx->done = 1;
- ctx->status = r->headers_out.status;
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_auth_request_set_variables(ngx_http_request_t *r,
- ngx_http_auth_request_conf_t *arcf, ngx_http_auth_request_ctx_t *ctx)
-{
- ngx_str_t val;
- ngx_http_variable_t *v;
- ngx_http_variable_value_t *vv;
- ngx_http_auth_request_variable_t *av, *last;
- ngx_http_core_main_conf_t *cmcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "auth request set variables");
-
- if (arcf->vars == NULL) {
- return NGX_OK;
- }
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
- v = cmcf->variables.elts;
-
- av = arcf->vars->elts;
- last = av + arcf->vars->nelts;
-
- while (av < last) {
- /*
- * explicitly set new value to make sure it will be available after
- * internal redirects
- */
-
- vv = &r->variables[av->index];
-
- if (ngx_http_complex_value(ctx->subrequest, &av->value, &val)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- vv->valid = 1;
- vv->not_found = 0;
- vv->data = val.data;
- vv->len = val.len;
-
- if (av->set_handler) {
- /*
- * set_handler only available in cmcf->variables_keys, so we store
- * it explicitly
- */
-
- av->set_handler(r, vv, v[av->index].data);
- }
-
- av++;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_auth_request_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "auth request variable");
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_auth_request_create_conf(ngx_conf_t *cf)
-{
- ngx_http_auth_request_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_auth_request_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->uri = { 0, NULL };
- */
-
- conf->vars = NGX_CONF_UNSET_PTR;
-
- return conf;
-}
-
-
-static char *
-ngx_http_auth_request_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_auth_request_conf_t *prev = parent;
- ngx_http_auth_request_conf_t *conf = child;
-
- ngx_conf_merge_str_value(conf->uri, prev->uri, "");
- ngx_conf_merge_ptr_value(conf->vars, prev->vars, NULL);
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_auth_request_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_auth_request_handler;
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_auth_request(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_auth_request_conf_t *arcf = conf;
-
- ngx_str_t *value;
-
- if (arcf->uri.data != NULL) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- arcf->uri.len = 0;
- arcf->uri.data = (u_char *) "";
-
- return NGX_CONF_OK;
- }
-
- arcf->uri = value[1];
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_auth_request_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_auth_request_conf_t *arcf = conf;
-
- ngx_str_t *value;
- ngx_http_variable_t *v;
- ngx_http_auth_request_variable_t *av;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- if (value[1].data[0] != '$') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- value[1].len--;
- value[1].data++;
-
- if (arcf->vars == NGX_CONF_UNSET_PTR) {
- arcf->vars = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_auth_request_variable_t));
- if (arcf->vars == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- av = ngx_array_push(arcf->vars);
- if (av == NULL) {
- return NGX_CONF_ERROR;
- }
-
- v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGEABLE);
- if (v == NULL) {
- return NGX_CONF_ERROR;
- }
-
- av->index = ngx_http_get_variable_index(cf, &value[1]);
- if (av->index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- if (v->get_handler == NULL) {
- v->get_handler = ngx_http_auth_request_variable;
- v->data = (uintptr_t) av;
- }
-
- av->set_handler = v->set_handler;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[2];
- ccv.complex_value = &av->value;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_autoindex_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_autoindex_module.c
deleted file mode 100644
index f694df075db..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_autoindex_module.c
+++ /dev/null
@@ -1,705 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#if 0
-
-typedef struct {
- ngx_buf_t *buf;
- size_t size;
- ngx_pool_t *pool;
- size_t alloc_size;
- ngx_chain_t **last_out;
-} ngx_http_autoindex_ctx_t;
-
-#endif
-
-
-typedef struct {
- ngx_str_t name;
- size_t utf_len;
- size_t escape;
- size_t escape_html;
-
- unsigned dir:1;
-
- time_t mtime;
- off_t size;
-} ngx_http_autoindex_entry_t;
-
-
-typedef struct {
- ngx_flag_t enable;
- ngx_flag_t localtime;
- ngx_flag_t exact_size;
-} ngx_http_autoindex_loc_conf_t;
-
-
-#define NGX_HTTP_AUTOINDEX_PREALLOCATE 50
-
-#define NGX_HTTP_AUTOINDEX_NAME_LEN 50
-
-
-static int ngx_libc_cdecl ngx_http_autoindex_cmp_entries(const void *one,
- const void *two);
-static ngx_int_t ngx_http_autoindex_error(ngx_http_request_t *r,
- ngx_dir_t *dir, ngx_str_t *name);
-static ngx_int_t ngx_http_autoindex_init(ngx_conf_t *cf);
-static void *ngx_http_autoindex_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_autoindex_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-
-
-static ngx_command_t ngx_http_autoindex_commands[] = {
-
- { ngx_string("autoindex"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_autoindex_loc_conf_t, enable),
- NULL },
-
- { ngx_string("autoindex_localtime"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_autoindex_loc_conf_t, localtime),
- NULL },
-
- { ngx_string("autoindex_exact_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_autoindex_loc_conf_t, exact_size),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_autoindex_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_autoindex_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_autoindex_create_loc_conf, /* create location configuration */
- ngx_http_autoindex_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_autoindex_module = {
- NGX_MODULE_V1,
- &ngx_http_autoindex_module_ctx, /* module context */
- ngx_http_autoindex_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static u_char title[] =
-"<html>" CRLF
-"<head><title>Index of "
-;
-
-
-static u_char header[] =
-"</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<h1>Index of "
-;
-
-static u_char tail[] =
-"</body>" CRLF
-"</html>" CRLF
-;
-
-
-static ngx_int_t
-ngx_http_autoindex_handler(ngx_http_request_t *r)
-{
- u_char *last, *filename, scale;
- off_t length;
- size_t len, char_len, escape_html, allocated, root;
- ngx_tm_t tm;
- ngx_err_t err;
- ngx_buf_t *b;
- ngx_int_t rc, size;
- ngx_str_t path;
- ngx_dir_t dir;
- ngx_uint_t i, level, utf8;
- ngx_pool_t *pool;
- ngx_time_t *tp;
- ngx_chain_t out;
- ngx_array_t entries;
- ngx_http_autoindex_entry_t *entry;
- ngx_http_autoindex_loc_conf_t *alcf;
-
- static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-
- if (r->uri.data[r->uri.len - 1] != '/') {
- return NGX_DECLINED;
- }
-
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
- return NGX_DECLINED;
- }
-
- alcf = ngx_http_get_module_loc_conf(r, ngx_http_autoindex_module);
-
- if (!alcf->enable) {
- return NGX_DECLINED;
- }
-
- /* NGX_DIR_MASK_LEN is lesser than NGX_HTTP_AUTOINDEX_PREALLOCATE */
-
- last = ngx_http_map_uri_to_path(r, &path, &root,
- NGX_HTTP_AUTOINDEX_PREALLOCATE);
- if (last == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- allocated = path.len;
- path.len = last - path.data;
- if (path.len > 1) {
- path.len--;
- }
- path.data[path.len] = '\0';
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http autoindex: \"%s\"", path.data);
-
- if (ngx_open_dir(&path, &dir) == NGX_ERROR) {
- err = ngx_errno;
-
- if (err == NGX_ENOENT
- || err == NGX_ENOTDIR
- || err == NGX_ENAMETOOLONG)
- {
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_NOT_FOUND;
-
- } else if (err == NGX_EACCES) {
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_FORBIDDEN;
-
- } else {
- level = NGX_LOG_CRIT;
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_log_error(level, r->connection->log, err,
- ngx_open_dir_n " \"%s\" failed", path.data);
-
- return rc;
- }
-
-#if (NGX_SUPPRESS_WARN)
-
- /* MSVC thinks 'entries' may be used without having been initialized */
- ngx_memzero(&entries, sizeof(ngx_array_t));
-
-#endif
-
- /* TODO: pool should be temporary pool */
- pool = r->pool;
-
- if (ngx_array_init(&entries, pool, 40, sizeof(ngx_http_autoindex_entry_t))
- != NGX_OK)
- {
- return ngx_http_autoindex_error(r, &dir, &path);
- }
-
- r->headers_out.status = NGX_HTTP_OK;
- r->headers_out.content_type_len = sizeof("text/html") - 1;
- ngx_str_set(&r->headers_out.content_type, "text/html");
- r->headers_out.content_type_lowcase = NULL;
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- if (ngx_close_dir(&dir) == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
- ngx_close_dir_n " \"%V\" failed", &path);
- }
-
- return rc;
- }
-
- filename = path.data;
- filename[path.len] = '/';
-
- if (r->headers_out.charset.len == 5
- && ngx_strncasecmp(r->headers_out.charset.data, (u_char *) "utf-8", 5)
- == 0)
- {
- utf8 = 1;
-
- } else {
- utf8 = 0;
- }
-
- for ( ;; ) {
- ngx_set_errno(0);
-
- if (ngx_read_dir(&dir) == NGX_ERROR) {
- err = ngx_errno;
-
- if (err != NGX_ENOMOREFILES) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
- ngx_read_dir_n " \"%V\" failed", &path);
- return ngx_http_autoindex_error(r, &dir, &path);
- }
-
- break;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http autoindex file: \"%s\"", ngx_de_name(&dir));
-
- len = ngx_de_namelen(&dir);
-
- if (ngx_de_name(&dir)[0] == '.') {
- continue;
- }
-
- if (!dir.valid_info) {
-
- /* 1 byte for '/' and 1 byte for terminating '\0' */
-
- if (path.len + 1 + len + 1 > allocated) {
- allocated = path.len + 1 + len + 1
- + NGX_HTTP_AUTOINDEX_PREALLOCATE;
-
- filename = ngx_pnalloc(pool, allocated);
- if (filename == NULL) {
- return ngx_http_autoindex_error(r, &dir, &path);
- }
-
- last = ngx_cpystrn(filename, path.data, path.len + 1);
- *last++ = '/';
- }
-
- ngx_cpystrn(last, ngx_de_name(&dir), len + 1);
-
- if (ngx_de_info(filename, &dir) == NGX_FILE_ERROR) {
- err = ngx_errno;
-
- if (err != NGX_ENOENT && err != NGX_ELOOP) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
- ngx_de_info_n " \"%s\" failed", filename);
-
- if (err == NGX_EACCES) {
- continue;
- }
-
- return ngx_http_autoindex_error(r, &dir, &path);
- }
-
- if (ngx_de_link_info(filename, &dir) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- ngx_de_link_info_n " \"%s\" failed",
- filename);
- return ngx_http_autoindex_error(r, &dir, &path);
- }
- }
- }
-
- entry = ngx_array_push(&entries);
- if (entry == NULL) {
- return ngx_http_autoindex_error(r, &dir, &path);
- }
-
- entry->name.len = len;
-
- entry->name.data = ngx_pnalloc(pool, len + 1);
- if (entry->name.data == NULL) {
- return ngx_http_autoindex_error(r, &dir, &path);
- }
-
- ngx_cpystrn(entry->name.data, ngx_de_name(&dir), len + 1);
-
- entry->escape = 2 * ngx_escape_uri(NULL, ngx_de_name(&dir), len,
- NGX_ESCAPE_URI_COMPONENT);
-
- entry->escape_html = ngx_escape_html(NULL, entry->name.data,
- entry->name.len);
-
- if (utf8) {
- entry->utf_len = ngx_utf8_length(entry->name.data, entry->name.len);
- } else {
- entry->utf_len = len;
- }
-
- entry->dir = ngx_de_is_dir(&dir);
- entry->mtime = ngx_de_mtime(&dir);
- entry->size = ngx_de_size(&dir);
- }
-
- if (ngx_close_dir(&dir) == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
- ngx_close_dir_n " \"%V\" failed", &path);
- }
-
- escape_html = ngx_escape_html(NULL, r->uri.data, r->uri.len);
-
- len = sizeof(title) - 1
- + r->uri.len + escape_html
- + sizeof(header) - 1
- + r->uri.len + escape_html
- + sizeof("</h1>") - 1
- + sizeof("<hr><pre><a href=\"../\">../</a>" CRLF) - 1
- + sizeof("</pre><hr>") - 1
- + sizeof(tail) - 1;
-
- entry = entries.elts;
- for (i = 0; i < entries.nelts; i++) {
- len += sizeof("<a href=\"") - 1
- + entry[i].name.len + entry[i].escape
- + 1 /* 1 is for "/" */
- + sizeof("\">") - 1
- + entry[i].name.len - entry[i].utf_len
- + entry[i].escape_html
- + NGX_HTTP_AUTOINDEX_NAME_LEN + sizeof("&gt;") - 2
- + sizeof("</a>") - 1
- + sizeof(" 28-Sep-1970 12:00 ") - 1
- + 20 /* the file size */
- + 2;
- }
-
- b = ngx_create_temp_buf(r->pool, len);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- if (entries.nelts > 1) {
- ngx_qsort(entry, (size_t) entries.nelts,
- sizeof(ngx_http_autoindex_entry_t),
- ngx_http_autoindex_cmp_entries);
- }
-
- b->last = ngx_cpymem(b->last, title, sizeof(title) - 1);
-
- if (escape_html) {
- b->last = (u_char *) ngx_escape_html(b->last, r->uri.data, r->uri.len);
- b->last = ngx_cpymem(b->last, header, sizeof(header) - 1);
- b->last = (u_char *) ngx_escape_html(b->last, r->uri.data, r->uri.len);
-
- } else {
- b->last = ngx_cpymem(b->last, r->uri.data, r->uri.len);
- b->last = ngx_cpymem(b->last, header, sizeof(header) - 1);
- b->last = ngx_cpymem(b->last, r->uri.data, r->uri.len);
- }
-
- b->last = ngx_cpymem(b->last, "</h1>", sizeof("</h1>") - 1);
-
- b->last = ngx_cpymem(b->last, "<hr><pre><a href=\"../\">../</a>" CRLF,
- sizeof("<hr><pre><a href=\"../\">../</a>" CRLF) - 1);
-
- tp = ngx_timeofday();
-
- for (i = 0; i < entries.nelts; i++) {
- b->last = ngx_cpymem(b->last, "<a href=\"", sizeof("<a href=\"") - 1);
-
- if (entry[i].escape) {
- ngx_escape_uri(b->last, entry[i].name.data, entry[i].name.len,
- NGX_ESCAPE_URI_COMPONENT);
-
- b->last += entry[i].name.len + entry[i].escape;
-
- } else {
- b->last = ngx_cpymem(b->last, entry[i].name.data,
- entry[i].name.len);
- }
-
- if (entry[i].dir) {
- *b->last++ = '/';
- }
-
- *b->last++ = '"';
- *b->last++ = '>';
-
- len = entry[i].utf_len;
-
- if (entry[i].name.len != len) {
- if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) {
- char_len = NGX_HTTP_AUTOINDEX_NAME_LEN - 3 + 1;
-
- } else {
- char_len = NGX_HTTP_AUTOINDEX_NAME_LEN + 1;
- }
-
- last = b->last;
- b->last = ngx_utf8_cpystrn(b->last, entry[i].name.data,
- char_len, entry[i].name.len + 1);
-
- if (entry[i].escape_html) {
- b->last = (u_char *) ngx_escape_html(last, entry[i].name.data,
- b->last - last);
- }
-
- last = b->last;
-
- } else {
- if (entry[i].escape_html) {
- if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) {
- char_len = NGX_HTTP_AUTOINDEX_NAME_LEN - 3;
-
- } else {
- char_len = len;
- }
-
- b->last = (u_char *) ngx_escape_html(b->last,
- entry[i].name.data, char_len);
- last = b->last;
-
- } else {
- b->last = ngx_cpystrn(b->last, entry[i].name.data,
- NGX_HTTP_AUTOINDEX_NAME_LEN + 1);
- last = b->last - 3;
- }
- }
-
- if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) {
- b->last = ngx_cpymem(last, "..&gt;</a>", sizeof("..&gt;</a>") - 1);
-
- } else {
- if (entry[i].dir && NGX_HTTP_AUTOINDEX_NAME_LEN - len > 0) {
- *b->last++ = '/';
- len++;
- }
-
- b->last = ngx_cpymem(b->last, "</a>", sizeof("</a>") - 1);
-
- if (NGX_HTTP_AUTOINDEX_NAME_LEN - len > 0) {
- ngx_memset(b->last, ' ', NGX_HTTP_AUTOINDEX_NAME_LEN - len);
- b->last += NGX_HTTP_AUTOINDEX_NAME_LEN - len;
- }
- }
-
- *b->last++ = ' ';
-
- ngx_gmtime(entry[i].mtime + tp->gmtoff * 60 * alcf->localtime, &tm);
-
- b->last = ngx_sprintf(b->last, "%02d-%s-%d %02d:%02d ",
- tm.ngx_tm_mday,
- months[tm.ngx_tm_mon - 1],
- tm.ngx_tm_year,
- tm.ngx_tm_hour,
- tm.ngx_tm_min);
-
- if (alcf->exact_size) {
- if (entry[i].dir) {
- b->last = ngx_cpymem(b->last, " -",
- sizeof(" -") - 1);
- } else {
- b->last = ngx_sprintf(b->last, "%19O", entry[i].size);
- }
-
- } else {
- if (entry[i].dir) {
- b->last = ngx_cpymem(b->last, " -",
- sizeof(" -") - 1);
-
- } else {
- length = entry[i].size;
-
- if (length > 1024 * 1024 * 1024 - 1) {
- size = (ngx_int_t) (length / (1024 * 1024 * 1024));
- if ((length % (1024 * 1024 * 1024))
- > (1024 * 1024 * 1024 / 2 - 1))
- {
- size++;
- }
- scale = 'G';
-
- } else if (length > 1024 * 1024 - 1) {
- size = (ngx_int_t) (length / (1024 * 1024));
- if ((length % (1024 * 1024)) > (1024 * 1024 / 2 - 1)) {
- size++;
- }
- scale = 'M';
-
- } else if (length > 9999) {
- size = (ngx_int_t) (length / 1024);
- if (length % 1024 > 511) {
- size++;
- }
- scale = 'K';
-
- } else {
- size = (ngx_int_t) length;
- scale = '\0';
- }
-
- if (scale) {
- b->last = ngx_sprintf(b->last, "%6i%c", size, scale);
-
- } else {
- b->last = ngx_sprintf(b->last, " %6i", size);
- }
- }
- }
-
- *b->last++ = CR;
- *b->last++ = LF;
- }
-
- /* TODO: free temporary pool */
-
- b->last = ngx_cpymem(b->last, "</pre><hr>", sizeof("</pre><hr>") - 1);
-
- b->last = ngx_cpymem(b->last, tail, sizeof(tail) - 1);
-
- if (r == r->main) {
- b->last_buf = 1;
- }
-
- b->last_in_chain = 1;
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_output_filter(r, &out);
-}
-
-
-static int ngx_libc_cdecl
-ngx_http_autoindex_cmp_entries(const void *one, const void *two)
-{
- ngx_http_autoindex_entry_t *first = (ngx_http_autoindex_entry_t *) one;
- ngx_http_autoindex_entry_t *second = (ngx_http_autoindex_entry_t *) two;
-
- if (first->dir && !second->dir) {
- /* move the directories to the start */
- return -1;
- }
-
- if (!first->dir && second->dir) {
- /* move the directories to the start */
- return 1;
- }
-
- return (int) ngx_strcmp(first->name.data, second->name.data);
-}
-
-
-#if 0
-
-static ngx_buf_t *
-ngx_http_autoindex_alloc(ngx_http_autoindex_ctx_t *ctx, size_t size)
-{
- ngx_chain_t *cl;
-
- if (ctx->buf) {
-
- if ((size_t) (ctx->buf->end - ctx->buf->last) >= size) {
- return ctx->buf;
- }
-
- ctx->size += ctx->buf->last - ctx->buf->pos;
- }
-
- ctx->buf = ngx_create_temp_buf(ctx->pool, ctx->alloc_size);
- if (ctx->buf == NULL) {
- return NULL;
- }
-
- cl = ngx_alloc_chain_link(ctx->pool);
- if (cl == NULL) {
- return NULL;
- }
-
- cl->buf = ctx->buf;
- cl->next = NULL;
-
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- return ctx->buf;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_autoindex_error(ngx_http_request_t *r, ngx_dir_t *dir, ngx_str_t *name)
-{
- if (ngx_close_dir(dir) == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
- ngx_close_dir_n " \"%V\" failed", name);
- }
-
- return r->header_sent ? NGX_ERROR : NGX_HTTP_INTERNAL_SERVER_ERROR;
-}
-
-
-static void *
-ngx_http_autoindex_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_autoindex_loc_conf_t *conf;
-
- conf = ngx_palloc(cf->pool, sizeof(ngx_http_autoindex_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->enable = NGX_CONF_UNSET;
- conf->localtime = NGX_CONF_UNSET;
- conf->exact_size = NGX_CONF_UNSET;
-
- return conf;
-}
-
-
-static char *
-ngx_http_autoindex_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_autoindex_loc_conf_t *prev = parent;
- ngx_http_autoindex_loc_conf_t *conf = child;
-
- ngx_conf_merge_value(conf->enable, prev->enable, 0);
- ngx_conf_merge_value(conf->localtime, prev->localtime, 0);
- ngx_conf_merge_value(conf->exact_size, prev->exact_size, 1);
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_autoindex_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_CONTENT_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_autoindex_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_browser_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_browser_module.c
deleted file mode 100644
index 80da0d8fa86..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_browser_module.c
+++ /dev/null
@@ -1,715 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-/*
- * The module can check browser versions conforming to the following formats:
- * X, X.X, X.X.X, and X.X.X.X. The maximum values of each format may be
- * 4000, 4000.99, 4000.99.99, and 4000.99.99.99.
- */
-
-
-#define NGX_HTTP_MODERN_BROWSER 0
-#define NGX_HTTP_ANCIENT_BROWSER 1
-
-
-typedef struct {
- u_char browser[12];
- size_t skip;
- size_t add;
- u_char name[12];
-} ngx_http_modern_browser_mask_t;
-
-
-typedef struct {
- ngx_uint_t version;
- size_t skip;
- size_t add;
- u_char name[12];
-} ngx_http_modern_browser_t;
-
-
-typedef struct {
- ngx_str_t name;
- ngx_http_get_variable_pt handler;
- uintptr_t data;
-} ngx_http_browser_variable_t;
-
-
-typedef struct {
- ngx_array_t *modern_browsers;
- ngx_array_t *ancient_browsers;
- ngx_http_variable_value_t *modern_browser_value;
- ngx_http_variable_value_t *ancient_browser_value;
-
- unsigned modern_unlisted_browsers:1;
- unsigned netscape4:1;
-} ngx_http_browser_conf_t;
-
-
-static ngx_int_t ngx_http_msie_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_browser_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-static ngx_uint_t ngx_http_browser(ngx_http_request_t *r,
- ngx_http_browser_conf_t *cf);
-
-static ngx_int_t ngx_http_browser_add_variable(ngx_conf_t *cf);
-static void *ngx_http_browser_create_conf(ngx_conf_t *cf);
-static char *ngx_http_browser_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static int ngx_libc_cdecl ngx_http_modern_browser_sort(const void *one,
- const void *two);
-static char *ngx_http_modern_browser(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_ancient_browser(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_modern_browser_value(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_ancient_browser_value(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_http_browser_commands[] = {
-
- { ngx_string("modern_browser"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
- ngx_http_modern_browser,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("ancient_browser"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_ancient_browser,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("modern_browser_value"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_modern_browser_value,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("ancient_browser_value"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_ancient_browser_value,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_browser_module_ctx = {
- ngx_http_browser_add_variable, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_browser_create_conf, /* create location configuration */
- ngx_http_browser_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_browser_module = {
- NGX_MODULE_V1,
- &ngx_http_browser_module_ctx, /* module context */
- ngx_http_browser_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_modern_browser_mask_t ngx_http_modern_browser_masks[] = {
-
- /* Opera must be the first browser to check */
-
- /*
- * "Opera/7.50 (X11; FreeBSD i386; U) [en]"
- * "Mozilla/5.0 (X11; FreeBSD i386; U) Opera 7.50 [en]"
- * "Mozilla/4.0 (compatible; MSIE 6.0; X11; FreeBSD i386) Opera 7.50 [en]"
- * "Opera/8.0 (Windows NT 5.1; U; ru)"
- * "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; en) Opera 8.0"
- * "Opera/9.01 (X11; FreeBSD 6 i386; U; en)"
- */
-
- { "opera",
- 0,
- sizeof("Opera ") - 1,
- "Opera"},
-
- /* "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" */
-
- { "msie",
- sizeof("Mozilla/4.0 (compatible; ") - 1,
- sizeof("MSIE ") - 1,
- "MSIE "},
-
- /*
- * "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610"
- * "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.5) Gecko/20031006"
- * "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.6) Gecko/20040206
- * Firefox/0.8"
- * "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.7.8)
- * Gecko/20050511 Firefox/1.0.4"
- * "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8.0.5) Gecko/20060729
- * Firefox/1.5.0.5"
- */
-
- { "gecko",
- sizeof("Mozilla/5.0 (") - 1,
- sizeof("rv:") - 1,
- "rv:"},
-
- /*
- * "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ru-ru) AppleWebKit/125.2
- * (KHTML, like Gecko) Safari/125.7"
- * "Mozilla/5.0 (SymbianOS/9.1; U; en-us) AppleWebKit/413
- * (KHTML, like Gecko) Safari/413"
- * "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418
- * (KHTML, like Gecko) Safari/417.9.3"
- * "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; ru-ru) AppleWebKit/418.8
- * (KHTML, like Gecko) Safari/419.3"
- */
-
- { "safari",
- sizeof("Mozilla/5.0 (") - 1,
- sizeof("Safari/") - 1,
- "Safari/"},
-
- /*
- * "Mozilla/5.0 (compatible; Konqueror/3.1; Linux)"
- * "Mozilla/5.0 (compatible; Konqueror/3.4; Linux) KHTML/3.4.2 (like Gecko)"
- * "Mozilla/5.0 (compatible; Konqueror/3.5; FreeBSD) KHTML/3.5.1
- * (like Gecko)"
- */
-
- { "konqueror",
- sizeof("Mozilla/5.0 (compatible; ") - 1,
- sizeof("Konqueror/") - 1,
- "Konqueror/"},
-
- { "", 0, 0, "" }
-
-};
-
-
-static ngx_http_browser_variable_t ngx_http_browsers[] = {
- { ngx_string("msie"), ngx_http_msie_variable, 0 },
- { ngx_string("modern_browser"), ngx_http_browser_variable,
- NGX_HTTP_MODERN_BROWSER },
- { ngx_string("ancient_browser"), ngx_http_browser_variable,
- NGX_HTTP_ANCIENT_BROWSER },
- { ngx_null_string, NULL, 0 }
-};
-
-
-static ngx_int_t
-ngx_http_browser_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_uint_t rc;
- ngx_http_browser_conf_t *cf;
-
- cf = ngx_http_get_module_loc_conf(r, ngx_http_browser_module);
-
- rc = ngx_http_browser(r, cf);
-
- if (data == NGX_HTTP_MODERN_BROWSER && rc == NGX_HTTP_MODERN_BROWSER) {
- *v = *cf->modern_browser_value;
- return NGX_OK;
- }
-
- if (data == NGX_HTTP_ANCIENT_BROWSER && rc == NGX_HTTP_ANCIENT_BROWSER) {
- *v = *cf->ancient_browser_value;
- return NGX_OK;
- }
-
- *v = ngx_http_variable_null_value;
- return NGX_OK;
-}
-
-
-static ngx_uint_t
-ngx_http_browser(ngx_http_request_t *r, ngx_http_browser_conf_t *cf)
-{
- size_t len;
- u_char *name, *ua, *last, c;
- ngx_str_t *ancient;
- ngx_uint_t i, version, ver, scale;
- ngx_http_modern_browser_t *modern;
-
- if (r->headers_in.user_agent == NULL) {
- if (cf->modern_unlisted_browsers) {
- return NGX_HTTP_MODERN_BROWSER;
- }
-
- return NGX_HTTP_ANCIENT_BROWSER;
- }
-
- ua = r->headers_in.user_agent->value.data;
- len = r->headers_in.user_agent->value.len;
- last = ua + len;
-
- if (cf->modern_browsers) {
- modern = cf->modern_browsers->elts;
-
- for (i = 0; i < cf->modern_browsers->nelts; i++) {
- name = ua + modern[i].skip;
-
- if (name >= last) {
- continue;
- }
-
- name = (u_char *) ngx_strstr(name, modern[i].name);
-
- if (name == NULL) {
- continue;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "browser: \"%s\"", name);
-
- name += modern[i].add;
-
- if (name >= last) {
- continue;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "version: \"%ui\" \"%s\"", modern[i].version, name);
-
- version = 0;
- ver = 0;
- scale = 1000000;
-
- while (name < last) {
-
- c = *name++;
-
- if (c >= '0' && c <= '9') {
- ver = ver * 10 + (c - '0');
- continue;
- }
-
- if (c == '.') {
- version += ver * scale;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "version: \"%ui\" \"%ui\"",
- modern[i].version, version);
-
- if (version > modern[i].version) {
- return NGX_HTTP_MODERN_BROWSER;
- }
-
- ver = 0;
- scale /= 100;
- continue;
- }
-
- break;
- }
-
- version += ver * scale;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "version: \"%ui\" \"%ui\"",
- modern[i].version, version);
-
- if (version >= modern[i].version) {
- return NGX_HTTP_MODERN_BROWSER;
- }
-
- return NGX_HTTP_ANCIENT_BROWSER;
- }
-
- if (!cf->modern_unlisted_browsers) {
- return NGX_HTTP_ANCIENT_BROWSER;
- }
- }
-
- if (cf->netscape4) {
- if (len > sizeof("Mozilla/4.72 ") - 1
- && ngx_strncmp(ua, "Mozilla/", sizeof("Mozilla/") - 1) == 0
- && ua[8] > '0' && ua[8] < '5')
- {
- return NGX_HTTP_ANCIENT_BROWSER;
- }
- }
-
- if (cf->ancient_browsers) {
- ancient = cf->ancient_browsers->elts;
-
- for (i = 0; i < cf->ancient_browsers->nelts; i++) {
- if (len >= ancient[i].len
- && ngx_strstr(ua, ancient[i].data) != NULL)
- {
- return NGX_HTTP_ANCIENT_BROWSER;
- }
- }
- }
-
- if (cf->modern_unlisted_browsers) {
- return NGX_HTTP_MODERN_BROWSER;
- }
-
- return NGX_HTTP_ANCIENT_BROWSER;
-}
-
-
-static ngx_int_t
-ngx_http_msie_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- if (r->headers_in.msie) {
- *v = ngx_http_variable_true_value;
- return NGX_OK;
- }
-
- *v = ngx_http_variable_null_value;
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_browser_add_variable(ngx_conf_t *cf)
-{
- ngx_http_browser_variable_t *var;
- ngx_http_variable_t *v;
-
- for (var = ngx_http_browsers; var->name.len; var++) {
-
- v = ngx_http_add_variable(cf, &var->name, NGX_HTTP_VAR_CHANGEABLE);
- if (v == NULL) {
- return NGX_ERROR;
- }
-
- v->get_handler = var->handler;
- v->data = var->data;
- }
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_browser_create_conf(ngx_conf_t *cf)
-{
- ngx_http_browser_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_browser_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->modern_browsers = NULL;
- * conf->ancient_browsers = NULL;
- * conf->modern_browser_value = NULL;
- * conf->ancient_browser_value = NULL;
- *
- * conf->modern_unlisted_browsers = 0;
- * conf->netscape4 = 0;
- */
-
- return conf;
-}
-
-
-static char *
-ngx_http_browser_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_browser_conf_t *prev = parent;
- ngx_http_browser_conf_t *conf = child;
-
- ngx_uint_t i, n;
- ngx_http_modern_browser_t *browsers, *opera;
-
- /*
- * At the merge the skip field is used to store the browser slot,
- * it will be used in sorting and then will overwritten
- * with a real skip value. The zero value means Opera.
- */
-
- if (conf->modern_browsers == NULL && conf->modern_unlisted_browsers == 0) {
- conf->modern_browsers = prev->modern_browsers;
- conf->modern_unlisted_browsers = prev->modern_unlisted_browsers;
-
- } else if (conf->modern_browsers != NULL) {
- browsers = conf->modern_browsers->elts;
-
- for (i = 0; i < conf->modern_browsers->nelts; i++) {
- if (browsers[i].skip == 0) {
- goto found;
- }
- }
-
- /*
- * Opera may contain MSIE string, so if Opera was not enumerated
- * as modern browsers, then add it and set a unreachable version
- */
-
- opera = ngx_array_push(conf->modern_browsers);
- if (opera == NULL) {
- return NGX_CONF_ERROR;
- }
-
- opera->skip = 0;
- opera->version = 4001000000U;
-
- browsers = conf->modern_browsers->elts;
-
-found:
-
- ngx_qsort(browsers, (size_t) conf->modern_browsers->nelts,
- sizeof(ngx_http_modern_browser_t),
- ngx_http_modern_browser_sort);
-
- for (i = 0; i < conf->modern_browsers->nelts; i++) {
- n = browsers[i].skip;
-
- browsers[i].skip = ngx_http_modern_browser_masks[n].skip;
- browsers[i].add = ngx_http_modern_browser_masks[n].add;
- (void) ngx_cpystrn(browsers[i].name,
- ngx_http_modern_browser_masks[n].name, 12);
- }
- }
-
- if (conf->ancient_browsers == NULL && conf->netscape4 == 0) {
- conf->ancient_browsers = prev->ancient_browsers;
- conf->netscape4 = prev->netscape4;
- }
-
- if (conf->modern_browser_value == NULL) {
- conf->modern_browser_value = prev->modern_browser_value;
- }
-
- if (conf->modern_browser_value == NULL) {
- conf->modern_browser_value = &ngx_http_variable_true_value;
- }
-
- if (conf->ancient_browser_value == NULL) {
- conf->ancient_browser_value = prev->ancient_browser_value;
- }
-
- if (conf->ancient_browser_value == NULL) {
- conf->ancient_browser_value = &ngx_http_variable_true_value;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static int ngx_libc_cdecl
-ngx_http_modern_browser_sort(const void *one, const void *two)
-{
- ngx_http_modern_browser_t *first = (ngx_http_modern_browser_t *) one;
- ngx_http_modern_browser_t *second = (ngx_http_modern_browser_t *) two;
-
- return (first->skip - second->skip);
-}
-
-
-static char *
-ngx_http_modern_browser(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_browser_conf_t *bcf = conf;
-
- u_char c;
- ngx_str_t *value;
- ngx_uint_t i, n, version, ver, scale;
- ngx_http_modern_browser_t *browser;
- ngx_http_modern_browser_mask_t *mask;
-
- value = cf->args->elts;
-
- if (cf->args->nelts == 2) {
- if (ngx_strcmp(value[1].data, "unlisted") == 0) {
- bcf->modern_unlisted_browsers = 1;
- return NGX_CONF_OK;
- }
-
- return NGX_CONF_ERROR;
- }
-
- if (bcf->modern_browsers == NULL) {
- bcf->modern_browsers = ngx_array_create(cf->pool, 5,
- sizeof(ngx_http_modern_browser_t));
- if (bcf->modern_browsers == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- browser = ngx_array_push(bcf->modern_browsers);
- if (browser == NULL) {
- return NGX_CONF_ERROR;
- }
-
- mask = ngx_http_modern_browser_masks;
-
- for (n = 0; mask[n].browser[0] != '\0'; n++) {
- if (ngx_strcasecmp(mask[n].browser, value[1].data) == 0) {
- goto found;
- }
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "unknown browser name \"%V\"", &value[1]);
-
- return NGX_CONF_ERROR;
-
-found:
-
- /*
- * at this stage the skip field is used to store the browser slot,
- * it will be used in sorting in merge stage and then will overwritten
- * with a real value
- */
-
- browser->skip = n;
-
- version = 0;
- ver = 0;
- scale = 1000000;
-
- for (i = 0; i < value[2].len; i++) {
-
- c = value[2].data[i];
-
- if (c >= '0' && c <= '9') {
- ver = ver * 10 + (c - '0');
- continue;
- }
-
- if (c == '.') {
- version += ver * scale;
- ver = 0;
- scale /= 100;
- continue;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid browser version \"%V\"", &value[2]);
-
- return NGX_CONF_ERROR;
- }
-
- version += ver * scale;
-
- browser->version = version;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_ancient_browser(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_browser_conf_t *bcf = conf;
-
- ngx_str_t *value, *browser;
- ngx_uint_t i;
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
- if (ngx_strcmp(value[i].data, "netscape4") == 0) {
- bcf->netscape4 = 1;
- continue;
- }
-
- if (bcf->ancient_browsers == NULL) {
- bcf->ancient_browsers = ngx_array_create(cf->pool, 4,
- sizeof(ngx_str_t));
- if (bcf->ancient_browsers == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- browser = ngx_array_push(bcf->ancient_browsers);
- if (browser == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *browser = value[i];
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_modern_browser_value(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_browser_conf_t *bcf = conf;
-
- ngx_str_t *value;
-
- bcf->modern_browser_value = ngx_palloc(cf->pool,
- sizeof(ngx_http_variable_value_t));
- if (bcf->modern_browser_value == NULL) {
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- bcf->modern_browser_value->len = value[1].len;
- bcf->modern_browser_value->valid = 1;
- bcf->modern_browser_value->no_cacheable = 0;
- bcf->modern_browser_value->not_found = 0;
- bcf->modern_browser_value->data = value[1].data;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_ancient_browser_value(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_browser_conf_t *bcf = conf;
-
- ngx_str_t *value;
-
- bcf->ancient_browser_value = ngx_palloc(cf->pool,
- sizeof(ngx_http_variable_value_t));
- if (bcf->ancient_browser_value == NULL) {
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- bcf->ancient_browser_value->len = value[1].len;
- bcf->ancient_browser_value->valid = 1;
- bcf->ancient_browser_value->no_cacheable = 0;
- bcf->ancient_browser_value->not_found = 0;
- bcf->ancient_browser_value->data = value[1].data;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_charset_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_charset_filter_module.c
deleted file mode 100644
index 4ea98184b26..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_charset_filter_module.c
+++ /dev/null
@@ -1,1685 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_CHARSET_OFF -2
-#define NGX_HTTP_NO_CHARSET -3
-#define NGX_HTTP_CHARSET_VAR 0x10000
-
-/* 1 byte length and up to 3 bytes for the UTF-8 encoding of the UCS-2 */
-#define NGX_UTF_LEN 4
-
-#define NGX_HTML_ENTITY_LEN (sizeof("&#1114111;") - 1)
-
-
-typedef struct {
- u_char **tables;
- ngx_str_t name;
-
- unsigned length:16;
- unsigned utf8:1;
-} ngx_http_charset_t;
-
-
-typedef struct {
- ngx_int_t src;
- ngx_int_t dst;
-} ngx_http_charset_recode_t;
-
-
-typedef struct {
- ngx_int_t src;
- ngx_int_t dst;
- u_char *src2dst;
- u_char *dst2src;
-} ngx_http_charset_tables_t;
-
-
-typedef struct {
- ngx_array_t charsets; /* ngx_http_charset_t */
- ngx_array_t tables; /* ngx_http_charset_tables_t */
- ngx_array_t recodes; /* ngx_http_charset_recode_t */
-} ngx_http_charset_main_conf_t;
-
-
-typedef struct {
- ngx_int_t charset;
- ngx_int_t source_charset;
- ngx_flag_t override_charset;
-
- ngx_hash_t types;
- ngx_array_t *types_keys;
-} ngx_http_charset_loc_conf_t;
-
-
-typedef struct {
- u_char *table;
- ngx_int_t charset;
- ngx_str_t charset_name;
-
- ngx_chain_t *busy;
- ngx_chain_t *free_bufs;
- ngx_chain_t *free_buffers;
-
- size_t saved_len;
- u_char saved[NGX_UTF_LEN];
-
- unsigned length:16;
- unsigned from_utf8:1;
- unsigned to_utf8:1;
-} ngx_http_charset_ctx_t;
-
-
-typedef struct {
- ngx_http_charset_tables_t *table;
- ngx_http_charset_t *charset;
- ngx_uint_t characters;
-} ngx_http_charset_conf_ctx_t;
-
-
-static ngx_int_t ngx_http_destination_charset(ngx_http_request_t *r,
- ngx_str_t *name);
-static ngx_int_t ngx_http_main_request_charset(ngx_http_request_t *r,
- ngx_str_t *name);
-static ngx_int_t ngx_http_source_charset(ngx_http_request_t *r,
- ngx_str_t *name);
-static ngx_int_t ngx_http_get_charset(ngx_http_request_t *r, ngx_str_t *name);
-static ngx_inline void ngx_http_set_charset(ngx_http_request_t *r,
- ngx_str_t *charset);
-static ngx_int_t ngx_http_charset_ctx(ngx_http_request_t *r,
- ngx_http_charset_t *charsets, ngx_int_t charset, ngx_int_t source_charset);
-static ngx_uint_t ngx_http_charset_recode(ngx_buf_t *b, u_char *table);
-static ngx_chain_t *ngx_http_charset_recode_from_utf8(ngx_pool_t *pool,
- ngx_buf_t *buf, ngx_http_charset_ctx_t *ctx);
-static ngx_chain_t *ngx_http_charset_recode_to_utf8(ngx_pool_t *pool,
- ngx_buf_t *buf, ngx_http_charset_ctx_t *ctx);
-
-static ngx_chain_t *ngx_http_charset_get_buf(ngx_pool_t *pool,
- ngx_http_charset_ctx_t *ctx);
-static ngx_chain_t *ngx_http_charset_get_buffer(ngx_pool_t *pool,
- ngx_http_charset_ctx_t *ctx, size_t size);
-
-static char *ngx_http_charset_map_block(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_charset_map(ngx_conf_t *cf, ngx_command_t *dummy,
- void *conf);
-
-static char *ngx_http_set_charset_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static ngx_int_t ngx_http_add_charset(ngx_array_t *charsets, ngx_str_t *name);
-
-static void *ngx_http_charset_create_main_conf(ngx_conf_t *cf);
-static void *ngx_http_charset_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_charset_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_charset_postconfiguration(ngx_conf_t *cf);
-
-
-ngx_str_t ngx_http_charset_default_types[] = {
- ngx_string("text/html"),
- ngx_string("text/xml"),
- ngx_string("text/plain"),
- ngx_string("text/vnd.wap.wml"),
- ngx_string("application/javascript"),
- ngx_string("application/rss+xml"),
- ngx_null_string
-};
-
-
-static ngx_command_t ngx_http_charset_filter_commands[] = {
-
- { ngx_string("charset"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
- |NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
- ngx_http_set_charset_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_charset_loc_conf_t, charset),
- NULL },
-
- { ngx_string("source_charset"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
- |NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
- ngx_http_set_charset_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_charset_loc_conf_t, source_charset),
- NULL },
-
- { ngx_string("override_charset"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
- |NGX_HTTP_LIF_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_charset_loc_conf_t, override_charset),
- NULL },
-
- { ngx_string("charset_types"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_types_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_charset_loc_conf_t, types_keys),
- &ngx_http_charset_default_types[0] },
-
- { ngx_string("charset_map"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE2,
- ngx_http_charset_map_block,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_charset_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_charset_postconfiguration, /* postconfiguration */
-
- ngx_http_charset_create_main_conf, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_charset_create_loc_conf, /* create location configuration */
- ngx_http_charset_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_charset_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_charset_filter_module_ctx, /* module context */
- ngx_http_charset_filter_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_charset_header_filter(ngx_http_request_t *r)
-{
- ngx_int_t charset, source_charset;
- ngx_str_t dst, src;
- ngx_http_charset_t *charsets;
- ngx_http_charset_main_conf_t *mcf;
-
- if (r == r->main) {
- charset = ngx_http_destination_charset(r, &dst);
-
- } else {
- charset = ngx_http_main_request_charset(r, &dst);
- }
-
- if (charset == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if (charset == NGX_DECLINED) {
- return ngx_http_next_header_filter(r);
- }
-
- /* charset: charset index or NGX_HTTP_NO_CHARSET */
-
- source_charset = ngx_http_source_charset(r, &src);
-
- if (source_charset == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- /*
- * source_charset: charset index, NGX_HTTP_NO_CHARSET,
- * or NGX_HTTP_CHARSET_OFF
- */
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "charset: \"%V\" > \"%V\"", &src, &dst);
-
- if (source_charset == NGX_HTTP_CHARSET_OFF) {
- ngx_http_set_charset(r, &dst);
-
- return ngx_http_next_header_filter(r);
- }
-
- if (charset == NGX_HTTP_NO_CHARSET
- || source_charset == NGX_HTTP_NO_CHARSET)
- {
- if (source_charset != charset
- || ngx_strncasecmp(dst.data, src.data, dst.len) != 0)
- {
- goto no_charset_map;
- }
-
- ngx_http_set_charset(r, &dst);
-
- return ngx_http_next_header_filter(r);
- }
-
- if (source_charset == charset) {
- r->headers_out.content_type.len = r->headers_out.content_type_len;
-
- ngx_http_set_charset(r, &dst);
-
- return ngx_http_next_header_filter(r);
- }
-
- /* source_charset != charset */
-
- if (r->headers_out.content_encoding
- && r->headers_out.content_encoding->value.len)
- {
- return ngx_http_next_header_filter(r);
- }
-
- mcf = ngx_http_get_module_main_conf(r, ngx_http_charset_filter_module);
- charsets = mcf->charsets.elts;
-
- if (charsets[source_charset].tables == NULL
- || charsets[source_charset].tables[charset] == NULL)
- {
- goto no_charset_map;
- }
-
- r->headers_out.content_type.len = r->headers_out.content_type_len;
-
- ngx_http_set_charset(r, &dst);
-
- return ngx_http_charset_ctx(r, charsets, charset, source_charset);
-
-no_charset_map:
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "no \"charset_map\" between the charsets \"%V\" and \"%V\"",
- &src, &dst);
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_destination_charset(ngx_http_request_t *r, ngx_str_t *name)
-{
- ngx_int_t charset;
- ngx_http_charset_t *charsets;
- ngx_http_variable_value_t *vv;
- ngx_http_charset_loc_conf_t *mlcf;
- ngx_http_charset_main_conf_t *mcf;
-
- if (r->headers_out.content_type.len == 0) {
- return NGX_DECLINED;
- }
-
- if (r->headers_out.override_charset
- && r->headers_out.override_charset->len)
- {
- *name = *r->headers_out.override_charset;
-
- charset = ngx_http_get_charset(r, name);
-
- if (charset != NGX_HTTP_NO_CHARSET) {
- return charset;
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "unknown charset \"%V\" to override", name);
-
- return NGX_DECLINED;
- }
-
- mlcf = ngx_http_get_module_loc_conf(r, ngx_http_charset_filter_module);
- charset = mlcf->charset;
-
- if (charset == NGX_HTTP_CHARSET_OFF) {
- return NGX_DECLINED;
- }
-
- if (r->headers_out.charset.len) {
- if (mlcf->override_charset == 0) {
- return NGX_DECLINED;
- }
-
- } else {
- if (ngx_http_test_content_type(r, &mlcf->types) == NULL) {
- return NGX_DECLINED;
- }
- }
-
- if (charset < NGX_HTTP_CHARSET_VAR) {
- mcf = ngx_http_get_module_main_conf(r, ngx_http_charset_filter_module);
- charsets = mcf->charsets.elts;
- *name = charsets[charset].name;
- return charset;
- }
-
- vv = ngx_http_get_indexed_variable(r, charset - NGX_HTTP_CHARSET_VAR);
-
- if (vv == NULL || vv->not_found) {
- return NGX_ERROR;
- }
-
- name->len = vv->len;
- name->data = vv->data;
-
- return ngx_http_get_charset(r, name);
-}
-
-
-static ngx_int_t
-ngx_http_main_request_charset(ngx_http_request_t *r, ngx_str_t *src)
-{
- ngx_int_t charset;
- ngx_str_t *main_charset;
- ngx_http_charset_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r->main, ngx_http_charset_filter_module);
-
- if (ctx) {
- *src = ctx->charset_name;
- return ctx->charset;
- }
-
- main_charset = &r->main->headers_out.charset;
-
- if (main_charset->len == 0) {
- return NGX_DECLINED;
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_charset_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r->main, ctx, ngx_http_charset_filter_module);
-
- charset = ngx_http_get_charset(r, main_charset);
-
- ctx->charset = charset;
- ctx->charset_name = *main_charset;
- *src = *main_charset;
-
- return charset;
-}
-
-
-static ngx_int_t
-ngx_http_source_charset(ngx_http_request_t *r, ngx_str_t *name)
-{
- ngx_int_t charset;
- ngx_http_charset_t *charsets;
- ngx_http_variable_value_t *vv;
- ngx_http_charset_loc_conf_t *lcf;
- ngx_http_charset_main_conf_t *mcf;
-
- if (r->headers_out.charset.len) {
- *name = r->headers_out.charset;
- return ngx_http_get_charset(r, name);
- }
-
- lcf = ngx_http_get_module_loc_conf(r, ngx_http_charset_filter_module);
-
- charset = lcf->source_charset;
-
- if (charset == NGX_HTTP_CHARSET_OFF) {
- name->len = 0;
- return charset;
- }
-
- if (charset < NGX_HTTP_CHARSET_VAR) {
- mcf = ngx_http_get_module_main_conf(r, ngx_http_charset_filter_module);
- charsets = mcf->charsets.elts;
- *name = charsets[charset].name;
- return charset;
- }
-
- vv = ngx_http_get_indexed_variable(r, charset - NGX_HTTP_CHARSET_VAR);
-
- if (vv == NULL || vv->not_found) {
- return NGX_ERROR;
- }
-
- name->len = vv->len;
- name->data = vv->data;
-
- return ngx_http_get_charset(r, name);
-}
-
-
-static ngx_int_t
-ngx_http_get_charset(ngx_http_request_t *r, ngx_str_t *name)
-{
- ngx_uint_t i, n;
- ngx_http_charset_t *charset;
- ngx_http_charset_main_conf_t *mcf;
-
- mcf = ngx_http_get_module_main_conf(r, ngx_http_charset_filter_module);
-
- charset = mcf->charsets.elts;
- n = mcf->charsets.nelts;
-
- for (i = 0; i < n; i++) {
- if (charset[i].name.len != name->len) {
- continue;
- }
-
- if (ngx_strncasecmp(charset[i].name.data, name->data, name->len) == 0) {
- return i;
- }
- }
-
- return NGX_HTTP_NO_CHARSET;
-}
-
-
-static ngx_inline void
-ngx_http_set_charset(ngx_http_request_t *r, ngx_str_t *charset)
-{
- if (r != r->main) {
- return;
- }
-
- if (r->headers_out.status == NGX_HTTP_MOVED_PERMANENTLY
- || r->headers_out.status == NGX_HTTP_MOVED_TEMPORARILY)
- {
- /*
- * do not set charset for the redirect because NN 4.x
- * use this charset instead of the next page charset
- */
-
- r->headers_out.charset.len = 0;
- return;
- }
-
- r->headers_out.charset = *charset;
-}
-
-
-static ngx_int_t
-ngx_http_charset_ctx(ngx_http_request_t *r, ngx_http_charset_t *charsets,
- ngx_int_t charset, ngx_int_t source_charset)
-{
- ngx_http_charset_ctx_t *ctx;
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_charset_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_charset_filter_module);
-
- ctx->table = charsets[source_charset].tables[charset];
- ctx->charset = charset;
- ctx->charset_name = charsets[charset].name;
- ctx->length = charsets[charset].length;
- ctx->from_utf8 = charsets[source_charset].utf8;
- ctx->to_utf8 = charsets[charset].utf8;
-
- r->filter_need_in_memory = 1;
-
- if ((ctx->to_utf8 || ctx->from_utf8) && r == r->main) {
- ngx_http_clear_content_length(r);
-
- } else {
- r->filter_need_temporary = 1;
- }
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_charset_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t *cl, *out, **ll;
- ngx_http_charset_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_charset_filter_module);
-
- if (ctx == NULL || ctx->table == NULL) {
- return ngx_http_next_body_filter(r, in);
- }
-
- if ((ctx->to_utf8 || ctx->from_utf8) || ctx->busy) {
-
- out = NULL;
- ll = &out;
-
- for (cl = in; cl; cl = cl->next) {
- b = cl->buf;
-
- if (ngx_buf_size(b) == 0) {
-
- *ll = ngx_alloc_chain_link(r->pool);
- if (*ll == NULL) {
- return NGX_ERROR;
- }
-
- (*ll)->buf = b;
- (*ll)->next = NULL;
-
- ll = &(*ll)->next;
-
- continue;
- }
-
- if (ctx->to_utf8) {
- *ll = ngx_http_charset_recode_to_utf8(r->pool, b, ctx);
-
- } else {
- *ll = ngx_http_charset_recode_from_utf8(r->pool, b, ctx);
- }
-
- if (*ll == NULL) {
- return NGX_ERROR;
- }
-
- while (*ll) {
- ll = &(*ll)->next;
- }
- }
-
- rc = ngx_http_next_body_filter(r, out);
-
- if (out) {
- if (ctx->busy == NULL) {
- ctx->busy = out;
-
- } else {
- for (cl = ctx->busy; cl->next; cl = cl->next) { /* void */ }
- cl->next = out;
- }
- }
-
- while (ctx->busy) {
-
- cl = ctx->busy;
- b = cl->buf;
-
- if (ngx_buf_size(b) != 0) {
- break;
- }
-
- ctx->busy = cl->next;
-
- if (b->tag != (ngx_buf_tag_t) &ngx_http_charset_filter_module) {
- continue;
- }
-
- if (b->shadow) {
- b->shadow->pos = b->shadow->last;
- }
-
- if (b->pos) {
- cl->next = ctx->free_buffers;
- ctx->free_buffers = cl;
- continue;
- }
-
- cl->next = ctx->free_bufs;
- ctx->free_bufs = cl;
- }
-
- return rc;
- }
-
- for (cl = in; cl; cl = cl->next) {
- (void) ngx_http_charset_recode(cl->buf, ctx->table);
- }
-
- return ngx_http_next_body_filter(r, in);
-}
-
-
-static ngx_uint_t
-ngx_http_charset_recode(ngx_buf_t *b, u_char *table)
-{
- u_char *p, *last;
-
- last = b->last;
-
- for (p = b->pos; p < last; p++) {
-
- if (*p != table[*p]) {
- goto recode;
- }
- }
-
- return 0;
-
-recode:
-
- do {
- if (*p != table[*p]) {
- *p = table[*p];
- }
-
- p++;
-
- } while (p < last);
-
- b->in_file = 0;
-
- return 1;
-}
-
-
-static ngx_chain_t *
-ngx_http_charset_recode_from_utf8(ngx_pool_t *pool, ngx_buf_t *buf,
- ngx_http_charset_ctx_t *ctx)
-{
- size_t len, size;
- u_char c, *p, *src, *dst, *saved, **table;
- uint32_t n;
- ngx_buf_t *b;
- ngx_uint_t i;
- ngx_chain_t *out, *cl, **ll;
-
- src = buf->pos;
-
- if (ctx->saved_len == 0) {
-
- for ( /* void */ ; src < buf->last; src++) {
-
- if (*src < 0x80) {
- continue;
- }
-
- len = src - buf->pos;
-
- if (len > 512) {
- out = ngx_http_charset_get_buf(pool, ctx);
- if (out == NULL) {
- return NULL;
- }
-
- b = out->buf;
-
- b->temporary = buf->temporary;
- b->memory = buf->memory;
- b->mmap = buf->mmap;
- b->flush = buf->flush;
-
- b->pos = buf->pos;
- b->last = src;
-
- out->buf = b;
- out->next = NULL;
-
- size = buf->last - src;
-
- saved = src;
- n = ngx_utf8_decode(&saved, size);
-
- if (n == 0xfffffffe) {
- /* incomplete UTF-8 symbol */
-
- ngx_memcpy(ctx->saved, src, size);
- ctx->saved_len = size;
-
- b->shadow = buf;
-
- return out;
- }
-
- } else {
- out = NULL;
- size = len + buf->last - src;
- src = buf->pos;
- }
-
- if (size < NGX_HTML_ENTITY_LEN) {
- size += NGX_HTML_ENTITY_LEN;
- }
-
- cl = ngx_http_charset_get_buffer(pool, ctx, size);
- if (cl == NULL) {
- return NULL;
- }
-
- if (out) {
- out->next = cl;
-
- } else {
- out = cl;
- }
-
- b = cl->buf;
- dst = b->pos;
-
- goto recode;
- }
-
- out = ngx_alloc_chain_link(pool);
- if (out == NULL) {
- return NULL;
- }
-
- out->buf = buf;
- out->next = NULL;
-
- return out;
- }
-
- /* process incomplete UTF sequence from previous buffer */
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pool->log, 0,
- "http charset utf saved: %z", ctx->saved_len);
-
- p = src;
-
- for (i = ctx->saved_len; i < NGX_UTF_LEN; i++) {
- ctx->saved[i] = *p++;
-
- if (p == buf->last) {
- break;
- }
- }
-
- saved = ctx->saved;
- n = ngx_utf8_decode(&saved, i);
-
- c = '\0';
-
- if (n < 0x10000) {
- table = (u_char **) ctx->table;
- p = table[n >> 8];
-
- if (p) {
- c = p[n & 0xff];
- }
-
- } else if (n == 0xfffffffe) {
-
- /* incomplete UTF-8 symbol */
-
- if (i < NGX_UTF_LEN) {
- out = ngx_http_charset_get_buf(pool, ctx);
- if (out == NULL) {
- return NULL;
- }
-
- b = out->buf;
-
- b->pos = buf->pos;
- b->last = buf->last;
- b->sync = 1;
- b->shadow = buf;
-
- ngx_memcpy(&ctx->saved[ctx->saved_len], src, i);
- ctx->saved_len += i;
-
- return out;
- }
- }
-
- size = buf->last - buf->pos;
-
- if (size < NGX_HTML_ENTITY_LEN) {
- size += NGX_HTML_ENTITY_LEN;
- }
-
- cl = ngx_http_charset_get_buffer(pool, ctx, size);
- if (cl == NULL) {
- return NULL;
- }
-
- out = cl;
-
- b = cl->buf;
- dst = b->pos;
-
- if (c) {
- *dst++ = c;
-
- } else if (n == 0xfffffffe) {
- *dst++ = '?';
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pool->log, 0,
- "http charset invalid utf 0");
-
- saved = &ctx->saved[NGX_UTF_LEN];
-
- } else if (n > 0x10ffff) {
- *dst++ = '?';
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pool->log, 0,
- "http charset invalid utf 1");
-
- } else {
- dst = ngx_sprintf(dst, "&#%uD;", n);
- }
-
- src += (saved - ctx->saved) - ctx->saved_len;
- ctx->saved_len = 0;
-
-recode:
-
- ll = &cl->next;
-
- table = (u_char **) ctx->table;
-
- while (src < buf->last) {
-
- if ((size_t) (b->end - dst) < NGX_HTML_ENTITY_LEN) {
- b->last = dst;
-
- size = buf->last - src + NGX_HTML_ENTITY_LEN;
-
- cl = ngx_http_charset_get_buffer(pool, ctx, size);
- if (cl == NULL) {
- return NULL;
- }
-
- *ll = cl;
- ll = &cl->next;
-
- b = cl->buf;
- dst = b->pos;
- }
-
- if (*src < 0x80) {
- *dst++ = *src++;
- continue;
- }
-
- len = buf->last - src;
-
- n = ngx_utf8_decode(&src, len);
-
- if (n < 0x10000) {
-
- p = table[n >> 8];
-
- if (p) {
- c = p[n & 0xff];
-
- if (c) {
- *dst++ = c;
- continue;
- }
- }
-
- dst = ngx_sprintf(dst, "&#%uD;", n);
-
- continue;
- }
-
- if (n == 0xfffffffe) {
- /* incomplete UTF-8 symbol */
-
- ngx_memcpy(ctx->saved, src, len);
- ctx->saved_len = len;
-
- if (b->pos == dst) {
- b->sync = 1;
- b->temporary = 0;
- }
-
- break;
- }
-
- if (n > 0x10ffff) {
- *dst++ = '?';
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pool->log, 0,
- "http charset invalid utf 2");
-
- continue;
- }
-
- /* n > 0xffff */
-
- dst = ngx_sprintf(dst, "&#%uD;", n);
- }
-
- b->last = dst;
-
- b->last_buf = buf->last_buf;
- b->last_in_chain = buf->last_in_chain;
- b->flush = buf->flush;
-
- b->shadow = buf;
-
- return out;
-}
-
-
-static ngx_chain_t *
-ngx_http_charset_recode_to_utf8(ngx_pool_t *pool, ngx_buf_t *buf,
- ngx_http_charset_ctx_t *ctx)
-{
- size_t len, size;
- u_char *p, *src, *dst, *table;
- ngx_buf_t *b;
- ngx_chain_t *out, *cl, **ll;
-
- table = ctx->table;
-
- for (src = buf->pos; src < buf->last; src++) {
- if (table[*src * NGX_UTF_LEN] == '\1') {
- continue;
- }
-
- goto recode;
- }
-
- out = ngx_alloc_chain_link(pool);
- if (out == NULL) {
- return NULL;
- }
-
- out->buf = buf;
- out->next = NULL;
-
- return out;
-
-recode:
-
- /*
- * we assume that there are about half of characters to be recoded,
- * so we preallocate "size / 2 + size / 2 * ctx->length"
- */
-
- len = src - buf->pos;
-
- if (len > 512) {
- out = ngx_http_charset_get_buf(pool, ctx);
- if (out == NULL) {
- return NULL;
- }
-
- b = out->buf;
-
- b->temporary = buf->temporary;
- b->memory = buf->memory;
- b->mmap = buf->mmap;
- b->flush = buf->flush;
-
- b->pos = buf->pos;
- b->last = src;
-
- out->buf = b;
- out->next = NULL;
-
- size = buf->last - src;
- size = size / 2 + size / 2 * ctx->length;
-
- } else {
- out = NULL;
-
- size = buf->last - src;
- size = len + size / 2 + size / 2 * ctx->length;
-
- src = buf->pos;
- }
-
- cl = ngx_http_charset_get_buffer(pool, ctx, size);
- if (cl == NULL) {
- return NULL;
- }
-
- if (out) {
- out->next = cl;
-
- } else {
- out = cl;
- }
-
- ll = &cl->next;
-
- b = cl->buf;
- dst = b->pos;
-
- while (src < buf->last) {
-
- p = &table[*src++ * NGX_UTF_LEN];
- len = *p++;
-
- if ((size_t) (b->end - dst) < len) {
- b->last = dst;
-
- size = buf->last - src;
- size = len + size / 2 + size / 2 * ctx->length;
-
- cl = ngx_http_charset_get_buffer(pool, ctx, size);
- if (cl == NULL) {
- return NULL;
- }
-
- *ll = cl;
- ll = &cl->next;
-
- b = cl->buf;
- dst = b->pos;
- }
-
- while (len) {
- *dst++ = *p++;
- len--;
- }
- }
-
- b->last = dst;
-
- b->last_buf = buf->last_buf;
- b->last_in_chain = buf->last_in_chain;
- b->flush = buf->flush;
-
- b->shadow = buf;
-
- return out;
-}
-
-
-static ngx_chain_t *
-ngx_http_charset_get_buf(ngx_pool_t *pool, ngx_http_charset_ctx_t *ctx)
-{
- ngx_chain_t *cl;
-
- cl = ctx->free_bufs;
-
- if (cl) {
- ctx->free_bufs = cl->next;
-
- cl->buf->shadow = NULL;
- cl->next = NULL;
-
- return cl;
- }
-
- cl = ngx_alloc_chain_link(pool);
- if (cl == NULL) {
- return NULL;
- }
-
- cl->buf = ngx_calloc_buf(pool);
- if (cl->buf == NULL) {
- return NULL;
- }
-
- cl->next = NULL;
-
- cl->buf->tag = (ngx_buf_tag_t) &ngx_http_charset_filter_module;
-
- return cl;
-}
-
-
-static ngx_chain_t *
-ngx_http_charset_get_buffer(ngx_pool_t *pool, ngx_http_charset_ctx_t *ctx,
- size_t size)
-{
- ngx_buf_t *b;
- ngx_chain_t *cl, **ll;
-
- for (ll = &ctx->free_buffers, cl = ctx->free_buffers;
- cl;
- ll = &cl->next, cl = cl->next)
- {
- b = cl->buf;
-
- if ((size_t) (b->end - b->start) >= size) {
- *ll = cl->next;
- cl->next = NULL;
-
- b->pos = b->start;
- b->temporary = 1;
- b->shadow = NULL;
-
- return cl;
- }
- }
-
- cl = ngx_alloc_chain_link(pool);
- if (cl == NULL) {
- return NULL;
- }
-
- cl->buf = ngx_create_temp_buf(pool, size);
- if (cl->buf == NULL) {
- return NULL;
- }
-
- cl->next = NULL;
-
- cl->buf->temporary = 1;
- cl->buf->tag = (ngx_buf_tag_t) &ngx_http_charset_filter_module;
-
- return cl;
-}
-
-
-static char *
-ngx_http_charset_map_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_charset_main_conf_t *mcf = conf;
-
- char *rv;
- u_char *p, *dst2src, **pp;
- ngx_int_t src, dst;
- ngx_uint_t i, n;
- ngx_str_t *value;
- ngx_conf_t pvcf;
- ngx_http_charset_t *charset;
- ngx_http_charset_tables_t *table;
- ngx_http_charset_conf_ctx_t ctx;
-
- value = cf->args->elts;
-
- src = ngx_http_add_charset(&mcf->charsets, &value[1]);
- if (src == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- dst = ngx_http_add_charset(&mcf->charsets, &value[2]);
- if (dst == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- if (src == dst) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"charset_map\" between the same charsets "
- "\"%V\" and \"%V\"", &value[1], &value[2]);
- return NGX_CONF_ERROR;
- }
-
- table = mcf->tables.elts;
- for (i = 0; i < mcf->tables.nelts; i++) {
- if ((src == table->src && dst == table->dst)
- || (src == table->dst && dst == table->src))
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate \"charset_map\" between "
- "\"%V\" and \"%V\"", &value[1], &value[2]);
- return NGX_CONF_ERROR;
- }
- }
-
- table = ngx_array_push(&mcf->tables);
- if (table == NULL) {
- return NGX_CONF_ERROR;
- }
-
- table->src = src;
- table->dst = dst;
-
- if (ngx_strcasecmp(value[2].data, (u_char *) "utf-8") == 0) {
- table->src2dst = ngx_pcalloc(cf->pool, 256 * NGX_UTF_LEN);
- if (table->src2dst == NULL) {
- return NGX_CONF_ERROR;
- }
-
- table->dst2src = ngx_pcalloc(cf->pool, 256 * sizeof(void *));
- if (table->dst2src == NULL) {
- return NGX_CONF_ERROR;
- }
-
- dst2src = ngx_pcalloc(cf->pool, 256);
- if (dst2src == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pp = (u_char **) &table->dst2src[0];
- pp[0] = dst2src;
-
- for (i = 0; i < 128; i++) {
- p = &table->src2dst[i * NGX_UTF_LEN];
- p[0] = '\1';
- p[1] = (u_char) i;
- dst2src[i] = (u_char) i;
- }
-
- for (/* void */; i < 256; i++) {
- p = &table->src2dst[i * NGX_UTF_LEN];
- p[0] = '\1';
- p[1] = '?';
- }
-
- } else {
- table->src2dst = ngx_palloc(cf->pool, 256);
- if (table->src2dst == NULL) {
- return NGX_CONF_ERROR;
- }
-
- table->dst2src = ngx_palloc(cf->pool, 256);
- if (table->dst2src == NULL) {
- return NGX_CONF_ERROR;
- }
-
- for (i = 0; i < 128; i++) {
- table->src2dst[i] = (u_char) i;
- table->dst2src[i] = (u_char) i;
- }
-
- for (/* void */; i < 256; i++) {
- table->src2dst[i] = '?';
- table->dst2src[i] = '?';
- }
- }
-
- charset = mcf->charsets.elts;
-
- ctx.table = table;
- ctx.charset = &charset[dst];
- ctx.characters = 0;
-
- pvcf = *cf;
- cf->ctx = &ctx;
- cf->handler = ngx_http_charset_map;
- cf->handler_conf = conf;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = pvcf;
-
- if (ctx.characters) {
- n = ctx.charset->length;
- ctx.charset->length /= ctx.characters;
-
- if (((n * 10) / ctx.characters) % 10 > 4) {
- ctx.charset->length++;
- }
- }
-
- return rv;
-}
-
-
-static char *
-ngx_http_charset_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
-{
- u_char *p, *dst2src, **pp;
- uint32_t n;
- ngx_int_t src, dst;
- ngx_str_t *value;
- ngx_uint_t i;
- ngx_http_charset_tables_t *table;
- ngx_http_charset_conf_ctx_t *ctx;
-
- if (cf->args->nelts != 2) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameters number");
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- src = ngx_hextoi(value[0].data, value[0].len);
- if (src == NGX_ERROR || src > 255) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\"", &value[0]);
- return NGX_CONF_ERROR;
- }
-
- ctx = cf->ctx;
- table = ctx->table;
-
- if (ctx->charset->utf8) {
- p = &table->src2dst[src * NGX_UTF_LEN];
-
- *p++ = (u_char) (value[1].len / 2);
-
- for (i = 0; i < value[1].len; i += 2) {
- dst = ngx_hextoi(&value[1].data[i], 2);
- if (dst == NGX_ERROR || dst > 255) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- *p++ = (u_char) dst;
- }
-
- i /= 2;
-
- ctx->charset->length += i;
- ctx->characters++;
-
- p = &table->src2dst[src * NGX_UTF_LEN] + 1;
-
- n = ngx_utf8_decode(&p, i);
-
- if (n > 0xffff) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- pp = (u_char **) &table->dst2src[0];
-
- dst2src = pp[n >> 8];
-
- if (dst2src == NULL) {
- dst2src = ngx_pcalloc(cf->pool, 256);
- if (dst2src == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pp[n >> 8] = dst2src;
- }
-
- dst2src[n & 0xff] = (u_char) src;
-
- } else {
- dst = ngx_hextoi(value[1].data, value[1].len);
- if (dst == NGX_ERROR || dst > 255) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- table->src2dst[src] = (u_char) dst;
- table->dst2src[dst] = (u_char) src;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_set_charset_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *p = conf;
-
- ngx_int_t *cp;
- ngx_str_t *value, var;
- ngx_http_charset_main_conf_t *mcf;
-
- cp = (ngx_int_t *) (p + cmd->offset);
-
- if (*cp != NGX_CONF_UNSET) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (cmd->offset == offsetof(ngx_http_charset_loc_conf_t, charset)
- && ngx_strcmp(value[1].data, "off") == 0)
- {
- *cp = NGX_HTTP_CHARSET_OFF;
- return NGX_CONF_OK;
- }
-
-
- if (value[1].data[0] == '$') {
- var.len = value[1].len - 1;
- var.data = value[1].data + 1;
-
- *cp = ngx_http_get_variable_index(cf, &var);
-
- if (*cp == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- *cp += NGX_HTTP_CHARSET_VAR;
-
- return NGX_CONF_OK;
- }
-
- mcf = ngx_http_conf_get_module_main_conf(cf,
- ngx_http_charset_filter_module);
-
- *cp = ngx_http_add_charset(&mcf->charsets, &value[1]);
- if (*cp == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_add_charset(ngx_array_t *charsets, ngx_str_t *name)
-{
- ngx_uint_t i;
- ngx_http_charset_t *c;
-
- c = charsets->elts;
- for (i = 0; i < charsets->nelts; i++) {
- if (name->len != c[i].name.len) {
- continue;
- }
-
- if (ngx_strcasecmp(name->data, c[i].name.data) == 0) {
- break;
- }
- }
-
- if (i < charsets->nelts) {
- return i;
- }
-
- c = ngx_array_push(charsets);
- if (c == NULL) {
- return NGX_ERROR;
- }
-
- c->tables = NULL;
- c->name = *name;
- c->length = 0;
-
- if (ngx_strcasecmp(name->data, (u_char *) "utf-8") == 0) {
- c->utf8 = 1;
-
- } else {
- c->utf8 = 0;
- }
-
- return i;
-}
-
-
-static void *
-ngx_http_charset_create_main_conf(ngx_conf_t *cf)
-{
- ngx_http_charset_main_conf_t *mcf;
-
- mcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_charset_main_conf_t));
- if (mcf == NULL) {
- return NULL;
- }
-
- if (ngx_array_init(&mcf->charsets, cf->pool, 2, sizeof(ngx_http_charset_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- if (ngx_array_init(&mcf->tables, cf->pool, 1,
- sizeof(ngx_http_charset_tables_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- if (ngx_array_init(&mcf->recodes, cf->pool, 2,
- sizeof(ngx_http_charset_recode_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- return mcf;
-}
-
-
-static void *
-ngx_http_charset_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_charset_loc_conf_t *lcf;
-
- lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_charset_loc_conf_t));
- if (lcf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * lcf->types = { NULL };
- * lcf->types_keys = NULL;
- */
-
- lcf->charset = NGX_CONF_UNSET;
- lcf->source_charset = NGX_CONF_UNSET;
- lcf->override_charset = NGX_CONF_UNSET;
-
- return lcf;
-}
-
-
-static char *
-ngx_http_charset_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_charset_loc_conf_t *prev = parent;
- ngx_http_charset_loc_conf_t *conf = child;
-
- ngx_uint_t i;
- ngx_http_charset_recode_t *recode;
- ngx_http_charset_main_conf_t *mcf;
-
- if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
- &prev->types_keys, &prev->types,
- ngx_http_charset_default_types)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_value(conf->override_charset, prev->override_charset, 0);
- ngx_conf_merge_value(conf->charset, prev->charset, NGX_HTTP_CHARSET_OFF);
- ngx_conf_merge_value(conf->source_charset, prev->source_charset,
- NGX_HTTP_CHARSET_OFF);
-
- if (conf->charset == NGX_HTTP_CHARSET_OFF
- || conf->source_charset == NGX_HTTP_CHARSET_OFF
- || conf->charset == conf->source_charset)
- {
- return NGX_CONF_OK;
- }
-
- if (conf->source_charset >= NGX_HTTP_CHARSET_VAR
- || conf->charset >= NGX_HTTP_CHARSET_VAR)
- {
- return NGX_CONF_OK;
- }
-
- mcf = ngx_http_conf_get_module_main_conf(cf,
- ngx_http_charset_filter_module);
- recode = mcf->recodes.elts;
- for (i = 0; i < mcf->recodes.nelts; i++) {
- if (conf->source_charset == recode[i].src
- && conf->charset == recode[i].dst)
- {
- return NGX_CONF_OK;
- }
- }
-
- recode = ngx_array_push(&mcf->recodes);
- if (recode == NULL) {
- return NGX_CONF_ERROR;
- }
-
- recode->src = conf->source_charset;
- recode->dst = conf->charset;
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_charset_postconfiguration(ngx_conf_t *cf)
-{
- u_char **src, **dst;
- ngx_int_t c;
- ngx_uint_t i, t;
- ngx_http_charset_t *charset;
- ngx_http_charset_recode_t *recode;
- ngx_http_charset_tables_t *tables;
- ngx_http_charset_main_conf_t *mcf;
-
- mcf = ngx_http_conf_get_module_main_conf(cf,
- ngx_http_charset_filter_module);
-
- recode = mcf->recodes.elts;
- tables = mcf->tables.elts;
- charset = mcf->charsets.elts;
-
- for (i = 0; i < mcf->recodes.nelts; i++) {
-
- c = recode[i].src;
-
- for (t = 0; t < mcf->tables.nelts; t++) {
-
- if (c == tables[t].src && recode[i].dst == tables[t].dst) {
- goto next;
- }
-
- if (c == tables[t].dst && recode[i].dst == tables[t].src) {
- goto next;
- }
- }
-
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no \"charset_map\" between the charsets \"%V\" and \"%V\"",
- &charset[c].name, &charset[recode[i].dst].name);
- return NGX_ERROR;
-
- next:
- continue;
- }
-
-
- for (t = 0; t < mcf->tables.nelts; t++) {
-
- src = charset[tables[t].src].tables;
-
- if (src == NULL) {
- src = ngx_pcalloc(cf->pool, sizeof(u_char *) * mcf->charsets.nelts);
- if (src == NULL) {
- return NGX_ERROR;
- }
-
- charset[tables[t].src].tables = src;
- }
-
- dst = charset[tables[t].dst].tables;
-
- if (dst == NULL) {
- dst = ngx_pcalloc(cf->pool, sizeof(u_char *) * mcf->charsets.nelts);
- if (dst == NULL) {
- return NGX_ERROR;
- }
-
- charset[tables[t].dst].tables = dst;
- }
-
- src[tables[t].dst] = tables[t].src2dst;
- dst[tables[t].src] = tables[t].dst2src;
- }
-
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_charset_header_filter;
-
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_charset_body_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_chunked_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_chunked_filter_module.c
deleted file mode 100644
index a7dc5bf4d4b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_chunked_filter_module.c
+++ /dev/null
@@ -1,243 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_chain_t *free;
- ngx_chain_t *busy;
-} ngx_http_chunked_filter_ctx_t;
-
-
-static ngx_int_t ngx_http_chunked_filter_init(ngx_conf_t *cf);
-
-
-static ngx_http_module_t ngx_http_chunked_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_chunked_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_chunked_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_chunked_filter_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_chunked_header_filter(ngx_http_request_t *r)
-{
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_chunked_filter_ctx_t *ctx;
-
- if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED
- || r->headers_out.status == NGX_HTTP_NO_CONTENT
- || r->headers_out.status < NGX_HTTP_OK
- || r != r->main
- || (r->method & NGX_HTTP_HEAD))
- {
- return ngx_http_next_header_filter(r);
- }
-
- if (r->headers_out.content_length_n == -1) {
- if (r->http_version < NGX_HTTP_VERSION_11) {
- r->keepalive = 0;
-
- } else {
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->chunked_transfer_encoding) {
- r->chunked = 1;
-
- ctx = ngx_pcalloc(r->pool,
- sizeof(ngx_http_chunked_filter_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_chunked_filter_module);
-
- } else {
- r->keepalive = 0;
- }
- }
- }
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_chunked_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- u_char *chunk;
- off_t size;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t *out, *cl, *tl, **ll;
- ngx_http_chunked_filter_ctx_t *ctx;
-
- if (in == NULL || !r->chunked || r->header_only) {
- return ngx_http_next_body_filter(r, in);
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_chunked_filter_module);
-
- out = NULL;
- ll = &out;
-
- size = 0;
- cl = in;
-
- for ( ;; ) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http chunk: %d", ngx_buf_size(cl->buf));
-
- size += ngx_buf_size(cl->buf);
-
- if (cl->buf->flush
- || cl->buf->sync
- || ngx_buf_in_memory(cl->buf)
- || cl->buf->in_file)
- {
- tl = ngx_alloc_chain_link(r->pool);
- if (tl == NULL) {
- return NGX_ERROR;
- }
-
- tl->buf = cl->buf;
- *ll = tl;
- ll = &tl->next;
- }
-
- if (cl->next == NULL) {
- break;
- }
-
- cl = cl->next;
- }
-
- if (size) {
- tl = ngx_chain_get_free_buf(r->pool, &ctx->free);
- if (tl == NULL) {
- return NGX_ERROR;
- }
-
- b = tl->buf;
- chunk = b->start;
-
- if (chunk == NULL) {
- /* the "0000000000000000" is 64-bit hexadecimal string */
-
- chunk = ngx_palloc(r->pool, sizeof("0000000000000000" CRLF) - 1);
- if (chunk == NULL) {
- return NGX_ERROR;
- }
-
- b->start = chunk;
- b->end = chunk + sizeof("0000000000000000" CRLF) - 1;
- }
-
- b->tag = (ngx_buf_tag_t) &ngx_http_chunked_filter_module;
- b->memory = 0;
- b->temporary = 1;
- b->pos = chunk;
- b->last = ngx_sprintf(chunk, "%xO" CRLF, size);
-
- tl->next = out;
- out = tl;
- }
-
- if (cl->buf->last_buf) {
- tl = ngx_chain_get_free_buf(r->pool, &ctx->free);
- if (tl == NULL) {
- return NGX_ERROR;
- }
-
- b = tl->buf;
-
- b->tag = (ngx_buf_tag_t) &ngx_http_chunked_filter_module;
- b->temporary = 0;
- b->memory = 1;
- b->last_buf = 1;
- b->pos = (u_char *) CRLF "0" CRLF CRLF;
- b->last = b->pos + 7;
-
- cl->buf->last_buf = 0;
-
- *ll = tl;
-
- if (size == 0) {
- b->pos += 2;
- }
-
- } else if (size > 0) {
- tl = ngx_chain_get_free_buf(r->pool, &ctx->free);
- if (tl == NULL) {
- return NGX_ERROR;
- }
-
- b = tl->buf;
-
- b->tag = (ngx_buf_tag_t) &ngx_http_chunked_filter_module;
- b->temporary = 0;
- b->memory = 1;
- b->pos = (u_char *) CRLF;
- b->last = b->pos + 2;
-
- *ll = tl;
-
- } else {
- *ll = NULL;
- }
-
- rc = ngx_http_next_body_filter(r, out);
-
- ngx_chain_update_chains(r->pool, &ctx->free, &ctx->busy, &out,
- (ngx_buf_tag_t) &ngx_http_chunked_filter_module);
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_chunked_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_chunked_header_filter;
-
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_chunked_body_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_dav_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_dav_module.c
deleted file mode 100644
index 529aba53341..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_dav_module.c
+++ /dev/null
@@ -1,1156 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_DAV_OFF 2
-
-
-#define NGX_HTTP_DAV_NO_DEPTH -3
-#define NGX_HTTP_DAV_INVALID_DEPTH -2
-#define NGX_HTTP_DAV_INFINITY_DEPTH -1
-
-
-typedef struct {
- ngx_uint_t methods;
- ngx_uint_t access;
- ngx_uint_t min_delete_depth;
- ngx_flag_t create_full_put_path;
-} ngx_http_dav_loc_conf_t;
-
-
-typedef struct {
- ngx_str_t path;
- size_t len;
-} ngx_http_dav_copy_ctx_t;
-
-
-static ngx_int_t ngx_http_dav_handler(ngx_http_request_t *r);
-
-static void ngx_http_dav_put_handler(ngx_http_request_t *r);
-
-static ngx_int_t ngx_http_dav_delete_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_dav_delete_path(ngx_http_request_t *r,
- ngx_str_t *path, ngx_uint_t dir);
-static ngx_int_t ngx_http_dav_delete_dir(ngx_tree_ctx_t *ctx, ngx_str_t *path);
-static ngx_int_t ngx_http_dav_delete_file(ngx_tree_ctx_t *ctx, ngx_str_t *path);
-static ngx_int_t ngx_http_dav_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path);
-
-static ngx_int_t ngx_http_dav_mkcol_handler(ngx_http_request_t *r,
- ngx_http_dav_loc_conf_t *dlcf);
-
-static ngx_int_t ngx_http_dav_copy_move_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_dav_copy_dir(ngx_tree_ctx_t *ctx, ngx_str_t *path);
-static ngx_int_t ngx_http_dav_copy_dir_time(ngx_tree_ctx_t *ctx,
- ngx_str_t *path);
-static ngx_int_t ngx_http_dav_copy_tree_file(ngx_tree_ctx_t *ctx,
- ngx_str_t *path);
-
-static ngx_int_t ngx_http_dav_depth(ngx_http_request_t *r, ngx_int_t dflt);
-static ngx_int_t ngx_http_dav_error(ngx_log_t *log, ngx_err_t err,
- ngx_int_t not_found, char *failed, u_char *path);
-static ngx_int_t ngx_http_dav_location(ngx_http_request_t *r, u_char *path);
-static void *ngx_http_dav_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_dav_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_dav_init(ngx_conf_t *cf);
-
-
-static ngx_conf_bitmask_t ngx_http_dav_methods_mask[] = {
- { ngx_string("off"), NGX_HTTP_DAV_OFF },
- { ngx_string("put"), NGX_HTTP_PUT },
- { ngx_string("delete"), NGX_HTTP_DELETE },
- { ngx_string("mkcol"), NGX_HTTP_MKCOL },
- { ngx_string("copy"), NGX_HTTP_COPY },
- { ngx_string("move"), NGX_HTTP_MOVE },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_command_t ngx_http_dav_commands[] = {
-
- { ngx_string("dav_methods"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_dav_loc_conf_t, methods),
- &ngx_http_dav_methods_mask },
-
- { ngx_string("create_full_put_path"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_dav_loc_conf_t, create_full_put_path),
- NULL },
-
- { ngx_string("min_delete_depth"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_dav_loc_conf_t, min_delete_depth),
- NULL },
-
- { ngx_string("dav_access"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE123,
- ngx_conf_set_access_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_dav_loc_conf_t, access),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_dav_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_dav_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_dav_create_loc_conf, /* create location configuration */
- ngx_http_dav_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_dav_module = {
- NGX_MODULE_V1,
- &ngx_http_dav_module_ctx, /* module context */
- ngx_http_dav_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_dav_handler(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_http_dav_loc_conf_t *dlcf;
-
- dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module);
-
- if (!(r->method & dlcf->methods)) {
- return NGX_DECLINED;
- }
-
- switch (r->method) {
-
- case NGX_HTTP_PUT:
-
- if (r->uri.data[r->uri.len - 1] == '/') {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "cannot PUT to a collection");
- return NGX_HTTP_CONFLICT;
- }
-
- r->request_body_in_file_only = 1;
- r->request_body_in_persistent_file = 1;
- r->request_body_in_clean_file = 1;
- r->request_body_file_group_access = 1;
- r->request_body_file_log_level = 0;
-
- rc = ngx_http_read_client_request_body(r, ngx_http_dav_put_handler);
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- return rc;
- }
-
- return NGX_DONE;
-
- case NGX_HTTP_DELETE:
-
- return ngx_http_dav_delete_handler(r);
-
- case NGX_HTTP_MKCOL:
-
- return ngx_http_dav_mkcol_handler(r, dlcf);
-
- case NGX_HTTP_COPY:
-
- return ngx_http_dav_copy_move_handler(r);
-
- case NGX_HTTP_MOVE:
-
- return ngx_http_dav_copy_move_handler(r);
- }
-
- return NGX_DECLINED;
-}
-
-
-static void
-ngx_http_dav_put_handler(ngx_http_request_t *r)
-{
- size_t root;
- time_t date;
- ngx_str_t *temp, path;
- ngx_uint_t status;
- ngx_file_info_t fi;
- ngx_ext_rename_file_t ext;
- ngx_http_dav_loc_conf_t *dlcf;
-
- if (r->request_body == NULL || r->request_body->temp_file == NULL) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- path.len--;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http put filename: \"%s\"", path.data);
-
- temp = &r->request_body->temp_file->file.name;
-
- if (ngx_file_info(path.data, &fi) == NGX_FILE_ERROR) {
- status = NGX_HTTP_CREATED;
-
- } else {
- status = NGX_HTTP_NO_CONTENT;
-
- if (ngx_is_dir(&fi)) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_EISDIR,
- "\"%s\" could not be created", path.data);
-
- if (ngx_delete_file(temp->data) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- ngx_delete_file_n " \"%s\" failed",
- temp->data);
- }
-
- ngx_http_finalize_request(r, NGX_HTTP_CONFLICT);
- return;
- }
- }
-
- dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module);
-
- ext.access = dlcf->access;
- ext.path_access = dlcf->access;
- ext.time = -1;
- ext.create_path = dlcf->create_full_put_path;
- ext.delete_file = 1;
- ext.log = r->connection->log;
-
- if (r->headers_in.date) {
- date = ngx_http_parse_time(r->headers_in.date->value.data,
- r->headers_in.date->value.len);
-
- if (date != NGX_ERROR) {
- ext.time = date;
- ext.fd = r->request_body->temp_file->file.fd;
- }
- }
-
- if (ngx_ext_rename_file(temp, &path, &ext) != NGX_OK) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- if (status == NGX_HTTP_CREATED) {
- if (ngx_http_dav_location(r, path.data) != NGX_OK) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- r->headers_out.content_length_n = 0;
- }
-
- r->headers_out.status = status;
- r->header_only = 1;
-
- ngx_http_finalize_request(r, ngx_http_send_header(r));
- return;
-}
-
-
-static ngx_int_t
-ngx_http_dav_delete_handler(ngx_http_request_t *r)
-{
- size_t root;
- ngx_err_t err;
- ngx_int_t rc, depth;
- ngx_uint_t i, d, dir;
- ngx_str_t path;
- ngx_file_info_t fi;
- ngx_http_dav_loc_conf_t *dlcf;
-
- if (r->headers_in.content_length_n > 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "DELETE with body is unsupported");
- return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
- }
-
- dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module);
-
- if (dlcf->min_delete_depth) {
- d = 0;
-
- for (i = 0; i < r->uri.len; /* void */) {
- if (r->uri.data[i++] == '/') {
- if (++d >= dlcf->min_delete_depth && i < r->uri.len) {
- goto ok;
- }
- }
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "insufficient URI depth:%i to DELETE", d);
- return NGX_HTTP_CONFLICT;
- }
-
-ok:
-
- if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http delete filename: \"%s\"", path.data);
-
- if (ngx_link_info(path.data, &fi) == NGX_FILE_ERROR) {
- err = ngx_errno;
-
- rc = (err == NGX_ENOTDIR) ? NGX_HTTP_CONFLICT : NGX_HTTP_NOT_FOUND;
-
- return ngx_http_dav_error(r->connection->log, err,
- rc, ngx_link_info_n, path.data);
- }
-
- if (ngx_is_dir(&fi)) {
-
- if (r->uri.data[r->uri.len - 1] != '/') {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_EISDIR,
- "DELETE \"%s\" failed", path.data);
- return NGX_HTTP_CONFLICT;
- }
-
- depth = ngx_http_dav_depth(r, NGX_HTTP_DAV_INFINITY_DEPTH);
-
- if (depth != NGX_HTTP_DAV_INFINITY_DEPTH) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"Depth\" header must be infinity");
- return NGX_HTTP_BAD_REQUEST;
- }
-
- path.len -= 2; /* omit "/\0" */
-
- dir = 1;
-
- } else {
-
- /*
- * we do not need to test (r->uri.data[r->uri.len - 1] == '/')
- * because ngx_link_info("/file/") returned NGX_ENOTDIR above
- */
-
- depth = ngx_http_dav_depth(r, 0);
-
- if (depth != 0 && depth != NGX_HTTP_DAV_INFINITY_DEPTH) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"Depth\" header must be 0 or infinity");
- return NGX_HTTP_BAD_REQUEST;
- }
-
- dir = 0;
- }
-
- rc = ngx_http_dav_delete_path(r, &path, dir);
-
- if (rc == NGX_OK) {
- return NGX_HTTP_NO_CONTENT;
- }
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_dav_delete_path(ngx_http_request_t *r, ngx_str_t *path, ngx_uint_t dir)
-{
- char *failed;
- ngx_tree_ctx_t tree;
-
- if (dir) {
-
- tree.init_handler = NULL;
- tree.file_handler = ngx_http_dav_delete_file;
- tree.pre_tree_handler = ngx_http_dav_noop;
- tree.post_tree_handler = ngx_http_dav_delete_dir;
- tree.spec_handler = ngx_http_dav_delete_file;
- tree.data = NULL;
- tree.alloc = 0;
- tree.log = r->connection->log;
-
- /* TODO: 207 */
-
- if (ngx_walk_tree(&tree, path) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_delete_dir(path->data) != NGX_FILE_ERROR) {
- return NGX_OK;
- }
-
- failed = ngx_delete_dir_n;
-
- } else {
-
- if (ngx_delete_file(path->data) != NGX_FILE_ERROR) {
- return NGX_OK;
- }
-
- failed = ngx_delete_file_n;
- }
-
- return ngx_http_dav_error(r->connection->log, ngx_errno,
- NGX_HTTP_NOT_FOUND, failed, path->data);
-}
-
-
-static ngx_int_t
-ngx_http_dav_delete_dir(ngx_tree_ctx_t *ctx, ngx_str_t *path)
-{
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
- "http delete dir: \"%s\"", path->data);
-
- if (ngx_delete_dir(path->data) == NGX_FILE_ERROR) {
-
- /* TODO: add to 207 */
-
- (void) ngx_http_dav_error(ctx->log, ngx_errno, 0, ngx_delete_dir_n,
- path->data);
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_dav_delete_file(ngx_tree_ctx_t *ctx, ngx_str_t *path)
-{
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
- "http delete file: \"%s\"", path->data);
-
- if (ngx_delete_file(path->data) == NGX_FILE_ERROR) {
-
- /* TODO: add to 207 */
-
- (void) ngx_http_dav_error(ctx->log, ngx_errno, 0, ngx_delete_file_n,
- path->data);
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_dav_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path)
-{
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_dav_mkcol_handler(ngx_http_request_t *r, ngx_http_dav_loc_conf_t *dlcf)
-{
- u_char *p;
- size_t root;
- ngx_str_t path;
-
- if (r->headers_in.content_length_n > 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "MKCOL with body is unsupported");
- return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
- }
-
- if (r->uri.data[r->uri.len - 1] != '/') {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "MKCOL can create a collection only");
- return NGX_HTTP_CONFLICT;
- }
-
- p = ngx_http_map_uri_to_path(r, &path, &root, 0);
- if (p == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- *(p - 1) = '\0';
- r->uri.len--;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http mkcol path: \"%s\"", path.data);
-
- if (ngx_create_dir(path.data, ngx_dir_access(dlcf->access))
- != NGX_FILE_ERROR)
- {
- if (ngx_http_dav_location(r, path.data) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- return NGX_HTTP_CREATED;
- }
-
- return ngx_http_dav_error(r->connection->log, ngx_errno,
- NGX_HTTP_CONFLICT, ngx_create_dir_n, path.data);
-}
-
-
-static ngx_int_t
-ngx_http_dav_copy_move_handler(ngx_http_request_t *r)
-{
- u_char *p, *host, *last, ch;
- size_t len, root;
- ngx_err_t err;
- ngx_int_t rc, depth;
- ngx_uint_t overwrite, slash, dir, flags;
- ngx_str_t path, uri, duri, args;
- ngx_tree_ctx_t tree;
- ngx_copy_file_t cf;
- ngx_file_info_t fi;
- ngx_table_elt_t *dest, *over;
- ngx_ext_rename_file_t ext;
- ngx_http_dav_copy_ctx_t copy;
- ngx_http_dav_loc_conf_t *dlcf;
-
- if (r->headers_in.content_length_n > 0) {
- return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
- }
-
- dest = r->headers_in.destination;
-
- if (dest == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client sent no \"Destination\" header");
- return NGX_HTTP_BAD_REQUEST;
- }
-
- p = dest->value.data;
- /* there is always '\0' even after empty header value */
- if (p[0] == '/') {
- last = p + dest->value.len;
- goto destination_done;
- }
-
- len = r->headers_in.server.len;
-
- if (len == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client sent no \"Host\" header");
- return NGX_HTTP_BAD_REQUEST;
- }
-
-#if (NGX_HTTP_SSL)
-
- if (r->connection->ssl) {
- if (ngx_strncmp(dest->value.data, "https://", sizeof("https://") - 1)
- != 0)
- {
- goto invalid_destination;
- }
-
- host = dest->value.data + sizeof("https://") - 1;
-
- } else
-#endif
- {
- if (ngx_strncmp(dest->value.data, "http://", sizeof("http://") - 1)
- != 0)
- {
- goto invalid_destination;
- }
-
- host = dest->value.data + sizeof("http://") - 1;
- }
-
- if (ngx_strncmp(host, r->headers_in.server.data, len) != 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"Destination\" URI \"%V\" is handled by "
- "different repository than the source URI",
- &dest->value);
- return NGX_HTTP_BAD_REQUEST;
- }
-
- last = dest->value.data + dest->value.len;
-
- for (p = host + len; p < last; p++) {
- if (*p == '/') {
- goto destination_done;
- }
- }
-
-invalid_destination:
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client sent invalid \"Destination\" header: \"%V\"",
- &dest->value);
- return NGX_HTTP_BAD_REQUEST;
-
-destination_done:
-
- duri.len = last - p;
- duri.data = p;
- flags = NGX_HTTP_LOG_UNSAFE;
-
- if (ngx_http_parse_unsafe_uri(r, &duri, &args, &flags) != NGX_OK) {
- goto invalid_destination;
- }
-
- if ((r->uri.data[r->uri.len - 1] == '/' && *(last - 1) != '/')
- || (r->uri.data[r->uri.len - 1] != '/' && *(last - 1) == '/'))
- {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "both URI \"%V\" and \"Destination\" URI \"%V\" "
- "should be either collections or non-collections",
- &r->uri, &dest->value);
- return NGX_HTTP_CONFLICT;
- }
-
- depth = ngx_http_dav_depth(r, NGX_HTTP_DAV_INFINITY_DEPTH);
-
- if (depth != NGX_HTTP_DAV_INFINITY_DEPTH) {
-
- if (r->method == NGX_HTTP_COPY) {
- if (depth != 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"Depth\" header must be 0 or infinity");
- return NGX_HTTP_BAD_REQUEST;
- }
-
- } else {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"Depth\" header must be infinity");
- return NGX_HTTP_BAD_REQUEST;
- }
- }
-
- over = r->headers_in.overwrite;
-
- if (over) {
- if (over->value.len == 1) {
- ch = over->value.data[0];
-
- if (ch == 'T' || ch == 't') {
- overwrite = 1;
- goto overwrite_done;
- }
-
- if (ch == 'F' || ch == 'f') {
- overwrite = 0;
- goto overwrite_done;
- }
-
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client sent invalid \"Overwrite\" header: \"%V\"",
- &over->value);
- return NGX_HTTP_BAD_REQUEST;
- }
-
- overwrite = 1;
-
-overwrite_done:
-
- if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http copy from: \"%s\"", path.data);
-
- uri = r->uri;
- r->uri = duri;
-
- if (ngx_http_map_uri_to_path(r, &copy.path, &root, 0) == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- r->uri = uri;
-
- copy.path.len--; /* omit "\0" */
-
- if (copy.path.data[copy.path.len - 1] == '/') {
- slash = 1;
- copy.path.len--;
- copy.path.data[copy.path.len] = '\0';
-
- } else {
- slash = 0;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http copy to: \"%s\"", copy.path.data);
-
- if (ngx_link_info(copy.path.data, &fi) == NGX_FILE_ERROR) {
- err = ngx_errno;
-
- if (err != NGX_ENOENT) {
- return ngx_http_dav_error(r->connection->log, err,
- NGX_HTTP_NOT_FOUND, ngx_link_info_n,
- copy.path.data);
- }
-
- /* destination does not exist */
-
- overwrite = 0;
- dir = 0;
-
- } else {
-
- /* destination exists */
-
- if (ngx_is_dir(&fi) && !slash) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"%V\" could not be %Ved to collection \"%V\"",
- &r->uri, &r->method_name, &dest->value);
- return NGX_HTTP_CONFLICT;
- }
-
- if (!overwrite) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_EEXIST,
- "\"%s\" could not be created", copy.path.data);
- return NGX_HTTP_PRECONDITION_FAILED;
- }
-
- dir = ngx_is_dir(&fi);
- }
-
- if (ngx_link_info(path.data, &fi) == NGX_FILE_ERROR) {
- return ngx_http_dav_error(r->connection->log, ngx_errno,
- NGX_HTTP_NOT_FOUND, ngx_link_info_n,
- path.data);
- }
-
- if (ngx_is_dir(&fi)) {
-
- if (r->uri.data[r->uri.len - 1] != '/') {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"%V\" is collection", &r->uri);
- return NGX_HTTP_BAD_REQUEST;
- }
-
- if (overwrite) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http delete: \"%s\"", copy.path.data);
-
- rc = ngx_http_dav_delete_path(r, &copy.path, dir);
-
- if (rc != NGX_OK) {
- return rc;
- }
- }
- }
-
- if (ngx_is_dir(&fi)) {
-
- path.len -= 2; /* omit "/\0" */
-
- if (r->method == NGX_HTTP_MOVE) {
- if (ngx_rename_file(path.data, copy.path.data) != NGX_FILE_ERROR) {
- return NGX_HTTP_CREATED;
- }
- }
-
- if (ngx_create_dir(copy.path.data, ngx_file_access(&fi))
- == NGX_FILE_ERROR)
- {
- return ngx_http_dav_error(r->connection->log, ngx_errno,
- NGX_HTTP_NOT_FOUND,
- ngx_create_dir_n, copy.path.data);
- }
-
- copy.len = path.len;
-
- tree.init_handler = NULL;
- tree.file_handler = ngx_http_dav_copy_tree_file;
- tree.pre_tree_handler = ngx_http_dav_copy_dir;
- tree.post_tree_handler = ngx_http_dav_copy_dir_time;
- tree.spec_handler = ngx_http_dav_noop;
- tree.data = &copy;
- tree.alloc = 0;
- tree.log = r->connection->log;
-
- if (ngx_walk_tree(&tree, &path) == NGX_OK) {
-
- if (r->method == NGX_HTTP_MOVE) {
- rc = ngx_http_dav_delete_path(r, &path, 1);
-
- if (rc != NGX_OK) {
- return rc;
- }
- }
-
- return NGX_HTTP_CREATED;
- }
-
- } else {
-
- if (r->method == NGX_HTTP_MOVE) {
-
- dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module);
-
- ext.access = 0;
- ext.path_access = dlcf->access;
- ext.time = -1;
- ext.create_path = 1;
- ext.delete_file = 0;
- ext.log = r->connection->log;
-
- if (ngx_ext_rename_file(&path, &copy.path, &ext) == NGX_OK) {
- return NGX_HTTP_NO_CONTENT;
- }
-
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- dlcf = ngx_http_get_module_loc_conf(r, ngx_http_dav_module);
-
- cf.size = ngx_file_size(&fi);
- cf.buf_size = 0;
- cf.access = dlcf->access;
- cf.time = ngx_file_mtime(&fi);
- cf.log = r->connection->log;
-
- if (ngx_copy_file(path.data, copy.path.data, &cf) == NGX_OK) {
- return NGX_HTTP_NO_CONTENT;
- }
- }
-
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_dav_copy_dir(ngx_tree_ctx_t *ctx, ngx_str_t *path)
-{
- u_char *p, *dir;
- size_t len;
- ngx_http_dav_copy_ctx_t *copy;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
- "http copy dir: \"%s\"", path->data);
-
- copy = ctx->data;
-
- len = copy->path.len + path->len;
-
- dir = ngx_alloc(len + 1, ctx->log);
- if (dir == NULL) {
- return NGX_ABORT;
- }
-
- p = ngx_cpymem(dir, copy->path.data, copy->path.len);
- (void) ngx_cpystrn(p, path->data + copy->len, path->len - copy->len + 1);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
- "http copy dir to: \"%s\"", dir);
-
- if (ngx_create_dir(dir, ngx_dir_access(ctx->access)) == NGX_FILE_ERROR) {
- (void) ngx_http_dav_error(ctx->log, ngx_errno, 0, ngx_create_dir_n,
- dir);
- }
-
- ngx_free(dir);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_dav_copy_dir_time(ngx_tree_ctx_t *ctx, ngx_str_t *path)
-{
- u_char *p, *dir;
- size_t len;
- ngx_http_dav_copy_ctx_t *copy;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
- "http copy dir time: \"%s\"", path->data);
-
- copy = ctx->data;
-
- len = copy->path.len + path->len;
-
- dir = ngx_alloc(len + 1, ctx->log);
- if (dir == NULL) {
- return NGX_ABORT;
- }
-
- p = ngx_cpymem(dir, copy->path.data, copy->path.len);
- (void) ngx_cpystrn(p, path->data + copy->len, path->len - copy->len + 1);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
- "http copy dir time to: \"%s\"", dir);
-
-#if (NGX_WIN32)
- {
- ngx_fd_t fd;
-
- fd = ngx_open_file(dir, NGX_FILE_RDWR, NGX_FILE_OPEN, 0);
-
- if (fd == NGX_INVALID_FILE) {
- (void) ngx_http_dav_error(ctx->log, ngx_errno, 0, ngx_open_file_n, dir);
- goto failed;
- }
-
- if (ngx_set_file_time(NULL, fd, ctx->mtime) != NGX_OK) {
- ngx_log_error(NGX_LOG_ALERT, ctx->log, ngx_errno,
- ngx_set_file_time_n " \"%s\" failed", dir);
- }
-
- if (ngx_close_file(fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, ctx->log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", dir);
- }
- }
-
-failed:
-
-#else
-
- if (ngx_set_file_time(dir, 0, ctx->mtime) != NGX_OK) {
- ngx_log_error(NGX_LOG_ALERT, ctx->log, ngx_errno,
- ngx_set_file_time_n " \"%s\" failed", dir);
- }
-
-#endif
-
- ngx_free(dir);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_dav_copy_tree_file(ngx_tree_ctx_t *ctx, ngx_str_t *path)
-{
- u_char *p, *file;
- size_t len;
- ngx_copy_file_t cf;
- ngx_http_dav_copy_ctx_t *copy;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
- "http copy file: \"%s\"", path->data);
-
- copy = ctx->data;
-
- len = copy->path.len + path->len;
-
- file = ngx_alloc(len + 1, ctx->log);
- if (file == NULL) {
- return NGX_ABORT;
- }
-
- p = ngx_cpymem(file, copy->path.data, copy->path.len);
- (void) ngx_cpystrn(p, path->data + copy->len, path->len - copy->len + 1);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
- "http copy file to: \"%s\"", file);
-
- cf.size = ctx->size;
- cf.buf_size = 0;
- cf.access = ctx->access;
- cf.time = ctx->mtime;
- cf.log = ctx->log;
-
- (void) ngx_copy_file(path->data, file, &cf);
-
- ngx_free(file);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_dav_depth(ngx_http_request_t *r, ngx_int_t dflt)
-{
- ngx_table_elt_t *depth;
-
- depth = r->headers_in.depth;
-
- if (depth == NULL) {
- return dflt;
- }
-
- if (depth->value.len == 1) {
-
- if (depth->value.data[0] == '0') {
- return 0;
- }
-
- if (depth->value.data[0] == '1') {
- return 1;
- }
-
- } else {
-
- if (depth->value.len == sizeof("infinity") - 1
- && ngx_strcmp(depth->value.data, "infinity") == 0)
- {
- return NGX_HTTP_DAV_INFINITY_DEPTH;
- }
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client sent invalid \"Depth\" header: \"%V\"",
- &depth->value);
-
- return NGX_HTTP_DAV_INVALID_DEPTH;
-}
-
-
-static ngx_int_t
-ngx_http_dav_error(ngx_log_t *log, ngx_err_t err, ngx_int_t not_found,
- char *failed, u_char *path)
-{
- ngx_int_t rc;
- ngx_uint_t level;
-
- if (err == NGX_ENOENT || err == NGX_ENOTDIR || err == NGX_ENAMETOOLONG) {
- level = NGX_LOG_ERR;
- rc = not_found;
-
- } else if (err == NGX_EACCES || err == NGX_EPERM) {
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_FORBIDDEN;
-
- } else if (err == NGX_EEXIST) {
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_NOT_ALLOWED;
-
- } else if (err == NGX_ENOSPC) {
- level = NGX_LOG_CRIT;
- rc = NGX_HTTP_INSUFFICIENT_STORAGE;
-
- } else {
- level = NGX_LOG_CRIT;
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_log_error(level, log, err, "%s \"%s\" failed", failed, path);
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_dav_location(ngx_http_request_t *r, u_char *path)
-{
- u_char *location;
- ngx_http_core_loc_conf_t *clcf;
-
- r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t));
- if (r->headers_out.location == NULL) {
- return NGX_ERROR;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (!clcf->alias && clcf->root_lengths == NULL) {
- location = path + clcf->root.len;
-
- } else {
- location = ngx_pnalloc(r->pool, r->uri.len);
- if (location == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(location, r->uri.data, r->uri.len);
- }
-
- /*
- * we do not need to set the r->headers_out.location->hash and
- * r->headers_out.location->key fields
- */
-
- r->headers_out.location->value.len = r->uri.len;
- r->headers_out.location->value.data = location;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_dav_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_dav_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_dav_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->methods = 0;
- */
-
- conf->min_delete_depth = NGX_CONF_UNSET_UINT;
- conf->access = NGX_CONF_UNSET_UINT;
- conf->create_full_put_path = NGX_CONF_UNSET;
-
- return conf;
-}
-
-
-static char *
-ngx_http_dav_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_dav_loc_conf_t *prev = parent;
- ngx_http_dav_loc_conf_t *conf = child;
-
- ngx_conf_merge_bitmask_value(conf->methods, prev->methods,
- (NGX_CONF_BITMASK_SET|NGX_HTTP_DAV_OFF));
-
- ngx_conf_merge_uint_value(conf->min_delete_depth,
- prev->min_delete_depth, 0);
-
- ngx_conf_merge_uint_value(conf->access, prev->access, 0600);
-
- ngx_conf_merge_value(conf->create_full_put_path,
- prev->create_full_put_path, 0);
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_dav_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_CONTENT_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_dav_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_degradation_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_degradation_module.c
deleted file mode 100644
index b9c65cdc9e0..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_degradation_module.c
+++ /dev/null
@@ -1,243 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- size_t sbrk_size;
-} ngx_http_degradation_main_conf_t;
-
-
-typedef struct {
- ngx_uint_t degrade;
-} ngx_http_degradation_loc_conf_t;
-
-
-static ngx_conf_enum_t ngx_http_degrade[] = {
- { ngx_string("204"), 204 },
- { ngx_string("444"), 444 },
- { ngx_null_string, 0 }
-};
-
-
-static void *ngx_http_degradation_create_main_conf(ngx_conf_t *cf);
-static void *ngx_http_degradation_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_degradation_merge_loc_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_http_degradation(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static ngx_int_t ngx_http_degradation_init(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_degradation_commands[] = {
-
- { ngx_string("degradation"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_http_degradation,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("degrade"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_degradation_loc_conf_t, degrade),
- &ngx_http_degrade },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_degradation_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_degradation_init, /* postconfiguration */
-
- ngx_http_degradation_create_main_conf, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_degradation_create_loc_conf, /* create location configuration */
- ngx_http_degradation_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_degradation_module = {
- NGX_MODULE_V1,
- &ngx_http_degradation_module_ctx, /* module context */
- ngx_http_degradation_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_degradation_handler(ngx_http_request_t *r)
-{
- ngx_http_degradation_loc_conf_t *dlcf;
-
- dlcf = ngx_http_get_module_loc_conf(r, ngx_http_degradation_module);
-
- if (dlcf->degrade && ngx_http_degraded(r)) {
- return dlcf->degrade;
- }
-
- return NGX_DECLINED;
-}
-
-
-ngx_uint_t
-ngx_http_degraded(ngx_http_request_t *r)
-{
- time_t now;
- ngx_uint_t log;
- static size_t sbrk_size;
- static time_t sbrk_time;
- ngx_http_degradation_main_conf_t *dmcf;
-
- dmcf = ngx_http_get_module_main_conf(r, ngx_http_degradation_module);
-
- if (dmcf->sbrk_size) {
-
- log = 0;
- now = ngx_time();
-
- /* lock mutex */
-
- if (now != sbrk_time) {
-
- /*
- * ELF/i386 is loaded at 0x08000000, 128M
- * ELF/amd64 is loaded at 0x00400000, 4M
- *
- * use a function address to subtract the loading address
- */
-
- sbrk_size = (size_t) sbrk(0) - ((uintptr_t) ngx_palloc & ~0x3FFFFF);
- sbrk_time = now;
- log = 1;
- }
-
- /* unlock mutex */
-
- if (sbrk_size >= dmcf->sbrk_size) {
- if (log) {
- ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
- "degradation sbrk:%uzM",
- sbrk_size / (1024 * 1024));
- }
-
- return 1;
- }
- }
-
- return 0;
-}
-
-
-static void *
-ngx_http_degradation_create_main_conf(ngx_conf_t *cf)
-{
- ngx_http_degradation_main_conf_t *dmcf;
-
- dmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_degradation_main_conf_t));
- if (dmcf == NULL) {
- return NULL;
- }
-
- return dmcf;
-}
-
-
-static void *
-ngx_http_degradation_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_degradation_loc_conf_t *conf;
-
- conf = ngx_palloc(cf->pool, sizeof(ngx_http_degradation_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->degrade = NGX_CONF_UNSET_UINT;
-
- return conf;
-}
-
-
-static char *
-ngx_http_degradation_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_degradation_loc_conf_t *prev = parent;
- ngx_http_degradation_loc_conf_t *conf = child;
-
- ngx_conf_merge_uint_value(conf->degrade, prev->degrade, 0);
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_degradation(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_degradation_main_conf_t *dmcf = conf;
-
- ngx_str_t *value, s;
-
- value = cf->args->elts;
-
- if (ngx_strncmp(value[1].data, "sbrk=", 5) == 0) {
-
- s.len = value[1].len - 5;
- s.data = value[1].data + 5;
-
- dmcf->sbrk_size = ngx_parse_size(&s);
- if (dmcf->sbrk_size == (size_t) NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid sbrk size \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[1]);
-
- return NGX_CONF_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_degradation_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_PREACCESS_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_degradation_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_empty_gif_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_empty_gif_module.c
deleted file mode 100644
index 04114dc3f41..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_empty_gif_module.c
+++ /dev/null
@@ -1,140 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static char *ngx_http_empty_gif(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-static ngx_command_t ngx_http_empty_gif_commands[] = {
-
- { ngx_string("empty_gif"),
- NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS,
- ngx_http_empty_gif,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-/* the minimal single pixel transparent GIF, 43 bytes */
-
-static u_char ngx_empty_gif[] = {
-
- 'G', 'I', 'F', '8', '9', 'a', /* header */
-
- /* logical screen descriptor */
- 0x01, 0x00, /* logical screen width */
- 0x01, 0x00, /* logical screen height */
- 0x80, /* global 1-bit color table */
- 0x01, /* background color #1 */
- 0x00, /* no aspect ratio */
-
- /* global color table */
- 0x00, 0x00, 0x00, /* #0: black */
- 0xff, 0xff, 0xff, /* #1: white */
-
- /* graphic control extension */
- 0x21, /* extension introducer */
- 0xf9, /* graphic control label */
- 0x04, /* block size */
- 0x01, /* transparent color is given, */
- /* no disposal specified, */
- /* user input is not expected */
- 0x00, 0x00, /* delay time */
- 0x01, /* transparent color #1 */
- 0x00, /* block terminator */
-
- /* image descriptor */
- 0x2c, /* image separator */
- 0x00, 0x00, /* image left position */
- 0x00, 0x00, /* image top position */
- 0x01, 0x00, /* image width */
- 0x01, 0x00, /* image height */
- 0x00, /* no local color table, no interlaced */
-
- /* table based image data */
- 0x02, /* LZW minimum code size, */
- /* must be at least 2-bit */
- 0x02, /* block size */
- 0x4c, 0x01, /* compressed bytes 01_001_100, 0000000_1 */
- /* 100: clear code */
- /* 001: 1 */
- /* 101: end of information code */
- 0x00, /* block terminator */
-
- 0x3B /* trailer */
-};
-
-
-static ngx_http_module_t ngx_http_empty_gif_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_empty_gif_module = {
- NGX_MODULE_V1,
- &ngx_http_empty_gif_module_ctx, /* module context */
- ngx_http_empty_gif_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_http_gif_type = ngx_string("image/gif");
-
-
-static ngx_int_t
-ngx_http_empty_gif_handler(ngx_http_request_t *r)
-{
- ngx_http_complex_value_t cv;
-
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
- return NGX_HTTP_NOT_ALLOWED;
- }
-
- ngx_memzero(&cv, sizeof(ngx_http_complex_value_t));
-
- cv.value.len = sizeof(ngx_empty_gif);
- cv.value.data = ngx_empty_gif;
- r->headers_out.last_modified_time = 23349600;
-
- return ngx_http_send_response(r, NGX_HTTP_OK, &ngx_http_gif_type, &cv);
-}
-
-
-static char *
-ngx_http_empty_gif(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- clcf->handler = ngx_http_empty_gif_handler;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_fastcgi_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_fastcgi_module.c
deleted file mode 100644
index a49c93ca21e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_fastcgi_module.c
+++ /dev/null
@@ -1,3307 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_http_upstream_conf_t upstream;
-
- ngx_str_t index;
-
- ngx_array_t *flushes;
- ngx_array_t *params_len;
- ngx_array_t *params;
- ngx_array_t *params_source;
- ngx_array_t *catch_stderr;
-
- ngx_array_t *fastcgi_lengths;
- ngx_array_t *fastcgi_values;
-
- ngx_hash_t headers_hash;
- ngx_uint_t header_params;
-
- ngx_flag_t keep_conn;
-
-#if (NGX_HTTP_CACHE)
- ngx_http_complex_value_t cache_key;
-#endif
-
-#if (NGX_PCRE)
- ngx_regex_t *split_regex;
- ngx_str_t split_name;
-#endif
-} ngx_http_fastcgi_loc_conf_t;
-
-
-typedef enum {
- ngx_http_fastcgi_st_version = 0,
- ngx_http_fastcgi_st_type,
- ngx_http_fastcgi_st_request_id_hi,
- ngx_http_fastcgi_st_request_id_lo,
- ngx_http_fastcgi_st_content_length_hi,
- ngx_http_fastcgi_st_content_length_lo,
- ngx_http_fastcgi_st_padding_length,
- ngx_http_fastcgi_st_reserved,
- ngx_http_fastcgi_st_data,
- ngx_http_fastcgi_st_padding
-} ngx_http_fastcgi_state_e;
-
-
-typedef struct {
- u_char *start;
- u_char *end;
-} ngx_http_fastcgi_split_part_t;
-
-
-typedef struct {
- ngx_http_fastcgi_state_e state;
- u_char *pos;
- u_char *last;
- ngx_uint_t type;
- size_t length;
- size_t padding;
-
- unsigned fastcgi_stdout:1;
- unsigned large_stderr:1;
-
- ngx_array_t *split_parts;
-
- ngx_str_t script_name;
- ngx_str_t path_info;
-} ngx_http_fastcgi_ctx_t;
-
-
-#define NGX_HTTP_FASTCGI_RESPONDER 1
-
-#define NGX_HTTP_FASTCGI_KEEP_CONN 1
-
-#define NGX_HTTP_FASTCGI_BEGIN_REQUEST 1
-#define NGX_HTTP_FASTCGI_ABORT_REQUEST 2
-#define NGX_HTTP_FASTCGI_END_REQUEST 3
-#define NGX_HTTP_FASTCGI_PARAMS 4
-#define NGX_HTTP_FASTCGI_STDIN 5
-#define NGX_HTTP_FASTCGI_STDOUT 6
-#define NGX_HTTP_FASTCGI_STDERR 7
-#define NGX_HTTP_FASTCGI_DATA 8
-
-
-typedef struct {
- u_char version;
- u_char type;
- u_char request_id_hi;
- u_char request_id_lo;
- u_char content_length_hi;
- u_char content_length_lo;
- u_char padding_length;
- u_char reserved;
-} ngx_http_fastcgi_header_t;
-
-
-typedef struct {
- u_char role_hi;
- u_char role_lo;
- u_char flags;
- u_char reserved[5];
-} ngx_http_fastcgi_begin_request_t;
-
-
-typedef struct {
- u_char version;
- u_char type;
- u_char request_id_hi;
- u_char request_id_lo;
-} ngx_http_fastcgi_header_small_t;
-
-
-typedef struct {
- ngx_http_fastcgi_header_t h0;
- ngx_http_fastcgi_begin_request_t br;
- ngx_http_fastcgi_header_small_t h1;
-} ngx_http_fastcgi_request_start_t;
-
-
-static ngx_int_t ngx_http_fastcgi_eval(ngx_http_request_t *r,
- ngx_http_fastcgi_loc_conf_t *flcf);
-#if (NGX_HTTP_CACHE)
-static ngx_int_t ngx_http_fastcgi_create_key(ngx_http_request_t *r);
-#endif
-static ngx_int_t ngx_http_fastcgi_create_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_fastcgi_reinit_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_fastcgi_process_header(ngx_http_request_t *r);
-static ngx_int_t ngx_http_fastcgi_input_filter_init(void *data);
-static ngx_int_t ngx_http_fastcgi_input_filter(ngx_event_pipe_t *p,
- ngx_buf_t *buf);
-static ngx_int_t ngx_http_fastcgi_non_buffered_filter(void *data,
- ssize_t bytes);
-static ngx_int_t ngx_http_fastcgi_process_record(ngx_http_request_t *r,
- ngx_http_fastcgi_ctx_t *f);
-static void ngx_http_fastcgi_abort_request(ngx_http_request_t *r);
-static void ngx_http_fastcgi_finalize_request(ngx_http_request_t *r,
- ngx_int_t rc);
-
-static ngx_int_t ngx_http_fastcgi_add_variables(ngx_conf_t *cf);
-static void *ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_fastcgi_merge_params(ngx_conf_t *cf,
- ngx_http_fastcgi_loc_conf_t *conf, ngx_http_fastcgi_loc_conf_t *prev);
-
-static ngx_int_t ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_fastcgi_path_info_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_http_fastcgi_ctx_t *ngx_http_fastcgi_split(ngx_http_request_t *r,
- ngx_http_fastcgi_loc_conf_t *flcf);
-
-static char *ngx_http_fastcgi_pass(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_fastcgi_split_path_info(ngx_conf_t *cf,
- ngx_command_t *cmd, void *conf);
-static char *ngx_http_fastcgi_store(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-#if (NGX_HTTP_CACHE)
-static char *ngx_http_fastcgi_cache(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_fastcgi_cache_key(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-#endif
-
-static char *ngx_http_fastcgi_lowat_check(ngx_conf_t *cf, void *post,
- void *data);
-
-
-static ngx_conf_post_t ngx_http_fastcgi_lowat_post =
- { ngx_http_fastcgi_lowat_check };
-
-
-static ngx_conf_bitmask_t ngx_http_fastcgi_next_upstream_masks[] = {
- { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR },
- { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT },
- { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER },
- { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 },
- { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
- { ngx_string("http_403"), NGX_HTTP_UPSTREAM_FT_HTTP_403 },
- { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
- { ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
- { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
- { ngx_null_string, 0 }
-};
-
-
-ngx_module_t ngx_http_fastcgi_module;
-
-
-static ngx_command_t ngx_http_fastcgi_commands[] = {
-
- { ngx_string("fastcgi_pass"),
- NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
- ngx_http_fastcgi_pass,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("fastcgi_index"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, index),
- NULL },
-
- { ngx_string("fastcgi_split_path_info"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_fastcgi_split_path_info,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("fastcgi_store"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_fastcgi_store,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("fastcgi_store_access"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE123,
- ngx_conf_set_access_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.store_access),
- NULL },
-
- { ngx_string("fastcgi_buffering"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.buffering),
- NULL },
-
- { ngx_string("fastcgi_ignore_client_abort"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.ignore_client_abort),
- NULL },
-
- { ngx_string("fastcgi_bind"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_upstream_bind_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.local),
- NULL },
-
- { ngx_string("fastcgi_connect_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.connect_timeout),
- NULL },
-
- { ngx_string("fastcgi_send_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.send_timeout),
- NULL },
-
- { ngx_string("fastcgi_send_lowat"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.send_lowat),
- &ngx_http_fastcgi_lowat_post },
-
- { ngx_string("fastcgi_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.buffer_size),
- NULL },
-
- { ngx_string("fastcgi_pass_request_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.pass_request_headers),
- NULL },
-
- { ngx_string("fastcgi_pass_request_body"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.pass_request_body),
- NULL },
-
- { ngx_string("fastcgi_intercept_errors"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.intercept_errors),
- NULL },
-
- { ngx_string("fastcgi_read_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.read_timeout),
- NULL },
-
- { ngx_string("fastcgi_buffers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_conf_set_bufs_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.bufs),
- NULL },
-
- { ngx_string("fastcgi_busy_buffers_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.busy_buffers_size_conf),
- NULL },
-
-#if (NGX_HTTP_CACHE)
-
- { ngx_string("fastcgi_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_fastcgi_cache,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("fastcgi_cache_key"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_fastcgi_cache_key,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("fastcgi_cache_path"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_2MORE,
- ngx_http_file_cache_set_slot,
- 0,
- 0,
- &ngx_http_fastcgi_module },
-
- { ngx_string("fastcgi_cache_bypass"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_set_predicate_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_bypass),
- NULL },
-
- { ngx_string("fastcgi_no_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_set_predicate_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.no_cache),
- NULL },
-
- { ngx_string("fastcgi_cache_valid"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_file_cache_valid_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_valid),
- NULL },
-
- { ngx_string("fastcgi_cache_min_uses"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_min_uses),
- NULL },
-
- { ngx_string("fastcgi_cache_use_stale"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_use_stale),
- &ngx_http_fastcgi_next_upstream_masks },
-
- { ngx_string("fastcgi_cache_methods"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_methods),
- &ngx_http_upstream_cache_method_mask },
-
- { ngx_string("fastcgi_cache_lock"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_lock),
- NULL },
-
- { ngx_string("fastcgi_cache_lock_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_lock_timeout),
- NULL },
-
- { ngx_string("fastcgi_cache_revalidate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.cache_revalidate),
- NULL },
-
-#endif
-
- { ngx_string("fastcgi_temp_path"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
- ngx_conf_set_path_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.temp_path),
- NULL },
-
- { ngx_string("fastcgi_max_temp_file_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.max_temp_file_size_conf),
- NULL },
-
- { ngx_string("fastcgi_temp_file_write_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.temp_file_write_size_conf),
- NULL },
-
- { ngx_string("fastcgi_next_upstream"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream),
- &ngx_http_fastcgi_next_upstream_masks },
-
- { ngx_string("fastcgi_next_upstream_tries"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream_tries),
- NULL },
-
- { ngx_string("fastcgi_next_upstream_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.next_upstream_timeout),
- NULL },
-
- { ngx_string("fastcgi_param"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE23,
- ngx_http_upstream_param_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, params_source),
- NULL },
-
- { ngx_string("fastcgi_pass_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.pass_headers),
- NULL },
-
- { ngx_string("fastcgi_hide_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.hide_headers),
- NULL },
-
- { ngx_string("fastcgi_ignore_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, upstream.ignore_headers),
- &ngx_http_upstream_ignore_headers_masks },
-
- { ngx_string("fastcgi_catch_stderr"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, catch_stderr),
- NULL },
-
- { ngx_string("fastcgi_keep_conn"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_fastcgi_loc_conf_t, keep_conn),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_fastcgi_module_ctx = {
- ngx_http_fastcgi_add_variables, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_fastcgi_create_loc_conf, /* create location configuration */
- ngx_http_fastcgi_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_fastcgi_module = {
- NGX_MODULE_V1,
- &ngx_http_fastcgi_module_ctx, /* module context */
- ngx_http_fastcgi_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_fastcgi_request_start_t ngx_http_fastcgi_request_start = {
- { 1, /* version */
- NGX_HTTP_FASTCGI_BEGIN_REQUEST, /* type */
- 0, /* request_id_hi */
- 1, /* request_id_lo */
- 0, /* content_length_hi */
- sizeof(ngx_http_fastcgi_begin_request_t), /* content_length_lo */
- 0, /* padding_length */
- 0 }, /* reserved */
-
- { 0, /* role_hi */
- NGX_HTTP_FASTCGI_RESPONDER, /* role_lo */
- 0, /* NGX_HTTP_FASTCGI_KEEP_CONN */ /* flags */
- { 0, 0, 0, 0, 0 } }, /* reserved[5] */
-
- { 1, /* version */
- NGX_HTTP_FASTCGI_PARAMS, /* type */
- 0, /* request_id_hi */
- 1 }, /* request_id_lo */
-
-};
-
-
-static ngx_http_variable_t ngx_http_fastcgi_vars[] = {
-
- { ngx_string("fastcgi_script_name"), NULL,
- ngx_http_fastcgi_script_name_variable, 0,
- NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-
- { ngx_string("fastcgi_path_info"), NULL,
- ngx_http_fastcgi_path_info_variable, 0,
- NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-static ngx_str_t ngx_http_fastcgi_hide_headers[] = {
- ngx_string("Status"),
- ngx_string("X-Accel-Expires"),
- ngx_string("X-Accel-Redirect"),
- ngx_string("X-Accel-Limit-Rate"),
- ngx_string("X-Accel-Buffering"),
- ngx_string("X-Accel-Charset"),
- ngx_null_string
-};
-
-
-#if (NGX_HTTP_CACHE)
-
-static ngx_keyval_t ngx_http_fastcgi_cache_headers[] = {
- { ngx_string("HTTP_IF_MODIFIED_SINCE"),
- ngx_string("$upstream_cache_last_modified") },
- { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") },
- { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("$upstream_cache_etag") },
- { ngx_string("HTTP_IF_MATCH"), ngx_string("") },
- { ngx_string("HTTP_RANGE"), ngx_string("") },
- { ngx_string("HTTP_IF_RANGE"), ngx_string("") },
- { ngx_null_string, ngx_null_string }
-};
-
-#endif
-
-
-static ngx_path_init_t ngx_http_fastcgi_temp_path = {
- ngx_string(NGX_HTTP_FASTCGI_TEMP_PATH), { 1, 2, 0 }
-};
-
-
-static ngx_int_t
-ngx_http_fastcgi_handler(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_http_upstream_t *u;
- ngx_http_fastcgi_ctx_t *f;
- ngx_http_fastcgi_loc_conf_t *flcf;
-
- if (ngx_http_upstream_create(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- f = ngx_pcalloc(r->pool, sizeof(ngx_http_fastcgi_ctx_t));
- if (f == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_http_set_ctx(r, f, ngx_http_fastcgi_module);
-
- flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
-
- if (flcf->fastcgi_lengths) {
- if (ngx_http_fastcgi_eval(r, flcf) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
- }
-
- u = r->upstream;
-
- ngx_str_set(&u->schema, "fastcgi://");
- u->output.tag = (ngx_buf_tag_t) &ngx_http_fastcgi_module;
-
- u->conf = &flcf->upstream;
-
-#if (NGX_HTTP_CACHE)
- u->create_key = ngx_http_fastcgi_create_key;
-#endif
- u->create_request = ngx_http_fastcgi_create_request;
- u->reinit_request = ngx_http_fastcgi_reinit_request;
- u->process_header = ngx_http_fastcgi_process_header;
- u->abort_request = ngx_http_fastcgi_abort_request;
- u->finalize_request = ngx_http_fastcgi_finalize_request;
- r->state = 0;
-
- u->buffering = flcf->upstream.buffering;
-
- u->pipe = ngx_pcalloc(r->pool, sizeof(ngx_event_pipe_t));
- if (u->pipe == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- u->pipe->input_filter = ngx_http_fastcgi_input_filter;
- u->pipe->input_ctx = r;
-
- u->input_filter_init = ngx_http_fastcgi_input_filter_init;
- u->input_filter = ngx_http_fastcgi_non_buffered_filter;
- u->input_filter_ctx = r;
-
- rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init);
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- return rc;
- }
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_eval(ngx_http_request_t *r, ngx_http_fastcgi_loc_conf_t *flcf)
-{
- ngx_url_t url;
- ngx_http_upstream_t *u;
-
- ngx_memzero(&url, sizeof(ngx_url_t));
-
- if (ngx_http_script_run(r, &url.url, flcf->fastcgi_lengths->elts, 0,
- flcf->fastcgi_values->elts)
- == NULL)
- {
- return NGX_ERROR;
- }
-
- url.no_resolve = 1;
-
- if (ngx_parse_url(r->pool, &url) != NGX_OK) {
- if (url.err) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "%s in upstream \"%V\"", url.err, &url.url);
- }
-
- return NGX_ERROR;
- }
-
- u = r->upstream;
-
- u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
- if (u->resolved == NULL) {
- return NGX_ERROR;
- }
-
- if (url.addrs && url.addrs[0].sockaddr) {
- u->resolved->sockaddr = url.addrs[0].sockaddr;
- u->resolved->socklen = url.addrs[0].socklen;
- u->resolved->naddrs = 1;
- u->resolved->host = url.addrs[0].name;
-
- } else {
- u->resolved->host = url.host;
- u->resolved->port = url.port;
- u->resolved->no_port = url.no_port;
- }
-
- return NGX_OK;
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-static ngx_int_t
-ngx_http_fastcgi_create_key(ngx_http_request_t *r)
-{
- ngx_str_t *key;
- ngx_http_fastcgi_loc_conf_t *flcf;
-
- key = ngx_array_push(&r->cache->keys);
- if (key == NULL) {
- return NGX_ERROR;
- }
-
- flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
-
- if (ngx_http_complex_value(r, &flcf->cache_key, key) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_fastcgi_create_request(ngx_http_request_t *r)
-{
- off_t file_pos;
- u_char ch, *pos, *lowcase_key;
- size_t size, len, key_len, val_len, padding,
- allocated;
- ngx_uint_t i, n, next, hash, skip_empty, header_params;
- ngx_buf_t *b;
- ngx_chain_t *cl, *body;
- ngx_list_part_t *part;
- ngx_table_elt_t *header, **ignored;
- ngx_http_script_code_pt code;
- ngx_http_script_engine_t e, le;
- ngx_http_fastcgi_header_t *h;
- ngx_http_fastcgi_loc_conf_t *flcf;
- ngx_http_script_len_code_pt lcode;
-
- len = 0;
- header_params = 0;
- ignored = NULL;
-
- flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
-
- if (flcf->params_len) {
- ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
-
- ngx_http_script_flush_no_cacheable_variables(r, flcf->flushes);
- le.flushed = 1;
-
- le.ip = flcf->params_len->elts;
- le.request = r;
-
- while (*(uintptr_t *) le.ip) {
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- key_len = lcode(&le);
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- skip_empty = lcode(&le);
-
- for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode(&le)) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- }
- le.ip += sizeof(uintptr_t);
-
- if (skip_empty && val_len == 0) {
- continue;
- }
-
- len += 1 + key_len + ((val_len > 127) ? 4 : 1) + val_len;
- }
- }
-
- if (flcf->upstream.pass_request_headers) {
-
- allocated = 0;
- lowcase_key = NULL;
-
- if (flcf->header_params) {
- n = 0;
- part = &r->headers_in.headers.part;
-
- while (part) {
- n += part->nelts;
- part = part->next;
- }
-
- ignored = ngx_palloc(r->pool, n * sizeof(void *));
- if (ignored == NULL) {
- return NGX_ERROR;
- }
- }
-
- part = &r->headers_in.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (flcf->header_params) {
- if (allocated < header[i].key.len) {
- allocated = header[i].key.len + 16;
- lowcase_key = ngx_pnalloc(r->pool, allocated);
- if (lowcase_key == NULL) {
- return NGX_ERROR;
- }
- }
-
- hash = 0;
-
- for (n = 0; n < header[i].key.len; n++) {
- ch = header[i].key.data[n];
-
- if (ch >= 'A' && ch <= 'Z') {
- ch |= 0x20;
-
- } else if (ch == '-') {
- ch = '_';
- }
-
- hash = ngx_hash(hash, ch);
- lowcase_key[n] = ch;
- }
-
- if (ngx_hash_find(&flcf->headers_hash, hash, lowcase_key, n)) {
- ignored[header_params++] = &header[i];
- continue;
- }
-
- n += sizeof("HTTP_") - 1;
-
- } else {
- n = sizeof("HTTP_") - 1 + header[i].key.len;
- }
-
- len += ((n > 127) ? 4 : 1) + ((header[i].value.len > 127) ? 4 : 1)
- + n + header[i].value.len;
- }
- }
-
-
- if (len > 65535) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "fastcgi request record is too big: %uz", len);
- return NGX_ERROR;
- }
-
-
- padding = 8 - len % 8;
- padding = (padding == 8) ? 0 : padding;
-
-
- size = sizeof(ngx_http_fastcgi_header_t)
- + sizeof(ngx_http_fastcgi_begin_request_t)
-
- + sizeof(ngx_http_fastcgi_header_t) /* NGX_HTTP_FASTCGI_PARAMS */
- + len + padding
- + sizeof(ngx_http_fastcgi_header_t) /* NGX_HTTP_FASTCGI_PARAMS */
-
- + sizeof(ngx_http_fastcgi_header_t); /* NGX_HTTP_FASTCGI_STDIN */
-
-
- b = ngx_create_temp_buf(r->pool, size);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
-
- ngx_http_fastcgi_request_start.br.flags =
- flcf->keep_conn ? NGX_HTTP_FASTCGI_KEEP_CONN : 0;
-
- ngx_memcpy(b->pos, &ngx_http_fastcgi_request_start,
- sizeof(ngx_http_fastcgi_request_start_t));
-
- h = (ngx_http_fastcgi_header_t *)
- (b->pos + sizeof(ngx_http_fastcgi_header_t)
- + sizeof(ngx_http_fastcgi_begin_request_t));
-
- h->content_length_hi = (u_char) ((len >> 8) & 0xff);
- h->content_length_lo = (u_char) (len & 0xff);
- h->padding_length = (u_char) padding;
- h->reserved = 0;
-
- b->last = b->pos + sizeof(ngx_http_fastcgi_header_t)
- + sizeof(ngx_http_fastcgi_begin_request_t)
- + sizeof(ngx_http_fastcgi_header_t);
-
-
- if (flcf->params_len) {
- ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
-
- e.ip = flcf->params->elts;
- e.pos = b->last;
- e.request = r;
- e.flushed = 1;
-
- le.ip = flcf->params_len->elts;
-
- while (*(uintptr_t *) le.ip) {
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- key_len = (u_char) lcode(&le);
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- skip_empty = lcode(&le);
-
- for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode(&le)) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- }
- le.ip += sizeof(uintptr_t);
-
- if (skip_empty && val_len == 0) {
- e.skip = 1;
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
- e.ip += sizeof(uintptr_t);
-
- e.skip = 0;
-
- continue;
- }
-
- *e.pos++ = (u_char) key_len;
-
- if (val_len > 127) {
- *e.pos++ = (u_char) (((val_len >> 24) & 0x7f) | 0x80);
- *e.pos++ = (u_char) ((val_len >> 16) & 0xff);
- *e.pos++ = (u_char) ((val_len >> 8) & 0xff);
- *e.pos++ = (u_char) (val_len & 0xff);
-
- } else {
- *e.pos++ = (u_char) val_len;
- }
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
- e.ip += sizeof(uintptr_t);
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "fastcgi param: \"%*s: %*s\"",
- key_len, e.pos - (key_len + val_len),
- val_len, e.pos - val_len);
- }
-
- b->last = e.pos;
- }
-
-
- if (flcf->upstream.pass_request_headers) {
-
- part = &r->headers_in.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- for (n = 0; n < header_params; n++) {
- if (&header[i] == ignored[n]) {
- goto next;
- }
- }
-
- key_len = sizeof("HTTP_") - 1 + header[i].key.len;
- if (key_len > 127) {
- *b->last++ = (u_char) (((key_len >> 24) & 0x7f) | 0x80);
- *b->last++ = (u_char) ((key_len >> 16) & 0xff);
- *b->last++ = (u_char) ((key_len >> 8) & 0xff);
- *b->last++ = (u_char) (key_len & 0xff);
-
- } else {
- *b->last++ = (u_char) key_len;
- }
-
- val_len = header[i].value.len;
- if (val_len > 127) {
- *b->last++ = (u_char) (((val_len >> 24) & 0x7f) | 0x80);
- *b->last++ = (u_char) ((val_len >> 16) & 0xff);
- *b->last++ = (u_char) ((val_len >> 8) & 0xff);
- *b->last++ = (u_char) (val_len & 0xff);
-
- } else {
- *b->last++ = (u_char) val_len;
- }
-
- b->last = ngx_cpymem(b->last, "HTTP_", sizeof("HTTP_") - 1);
-
- for (n = 0; n < header[i].key.len; n++) {
- ch = header[i].key.data[n];
-
- if (ch >= 'a' && ch <= 'z') {
- ch &= ~0x20;
-
- } else if (ch == '-') {
- ch = '_';
- }
-
- *b->last++ = ch;
- }
-
- b->last = ngx_copy(b->last, header[i].value.data, val_len);
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "fastcgi param: \"%*s: %*s\"",
- key_len, b->last - (key_len + val_len),
- val_len, b->last - val_len);
- next:
-
- continue;
- }
- }
-
-
- if (padding) {
- ngx_memzero(b->last, padding);
- b->last += padding;
- }
-
-
- h = (ngx_http_fastcgi_header_t *) b->last;
- b->last += sizeof(ngx_http_fastcgi_header_t);
-
- h->version = 1;
- h->type = NGX_HTTP_FASTCGI_PARAMS;
- h->request_id_hi = 0;
- h->request_id_lo = 1;
- h->content_length_hi = 0;
- h->content_length_lo = 0;
- h->padding_length = 0;
- h->reserved = 0;
-
- h = (ngx_http_fastcgi_header_t *) b->last;
- b->last += sizeof(ngx_http_fastcgi_header_t);
-
- if (flcf->upstream.pass_request_body) {
- body = r->upstream->request_bufs;
- r->upstream->request_bufs = cl;
-
-#if (NGX_SUPPRESS_WARN)
- file_pos = 0;
- pos = NULL;
-#endif
-
- while (body) {
-
- if (body->buf->in_file) {
- file_pos = body->buf->file_pos;
-
- } else {
- pos = body->buf->pos;
- }
-
- next = 0;
-
- do {
- b = ngx_alloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(b, body->buf, sizeof(ngx_buf_t));
-
- if (body->buf->in_file) {
- b->file_pos = file_pos;
- file_pos += 32 * 1024;
-
- if (file_pos >= body->buf->file_last) {
- file_pos = body->buf->file_last;
- next = 1;
- }
-
- b->file_last = file_pos;
- len = (ngx_uint_t) (file_pos - b->file_pos);
-
- } else {
- b->pos = pos;
- b->start = pos;
- pos += 32 * 1024;
-
- if (pos >= body->buf->last) {
- pos = body->buf->last;
- next = 1;
- }
-
- b->last = pos;
- len = (ngx_uint_t) (pos - b->pos);
- }
-
- padding = 8 - len % 8;
- padding = (padding == 8) ? 0 : padding;
-
- h->version = 1;
- h->type = NGX_HTTP_FASTCGI_STDIN;
- h->request_id_hi = 0;
- h->request_id_lo = 1;
- h->content_length_hi = (u_char) ((len >> 8) & 0xff);
- h->content_length_lo = (u_char) (len & 0xff);
- h->padding_length = (u_char) padding;
- h->reserved = 0;
-
- cl->next = ngx_alloc_chain_link(r->pool);
- if (cl->next == NULL) {
- return NGX_ERROR;
- }
-
- cl = cl->next;
- cl->buf = b;
-
- b = ngx_create_temp_buf(r->pool,
- sizeof(ngx_http_fastcgi_header_t)
- + padding);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- if (padding) {
- ngx_memzero(b->last, padding);
- b->last += padding;
- }
-
- h = (ngx_http_fastcgi_header_t *) b->last;
- b->last += sizeof(ngx_http_fastcgi_header_t);
-
- cl->next = ngx_alloc_chain_link(r->pool);
- if (cl->next == NULL) {
- return NGX_ERROR;
- }
-
- cl = cl->next;
- cl->buf = b;
-
- } while (!next);
-
- body = body->next;
- }
-
- } else {
- r->upstream->request_bufs = cl;
- }
-
- h->version = 1;
- h->type = NGX_HTTP_FASTCGI_STDIN;
- h->request_id_hi = 0;
- h->request_id_lo = 1;
- h->content_length_hi = 0;
- h->content_length_lo = 0;
- h->padding_length = 0;
- h->reserved = 0;
-
- cl->next = NULL;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_reinit_request(ngx_http_request_t *r)
-{
- ngx_http_fastcgi_ctx_t *f;
-
- f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);
-
- if (f == NULL) {
- return NGX_OK;
- }
-
- f->state = ngx_http_fastcgi_st_version;
- f->fastcgi_stdout = 0;
- f->large_stderr = 0;
-
- if (f->split_parts) {
- f->split_parts->nelts = 0;
- }
-
- r->state = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_process_header(ngx_http_request_t *r)
-{
- u_char *p, *msg, *start, *last,
- *part_start, *part_end;
- size_t size;
- ngx_str_t *status_line, *pattern;
- ngx_int_t rc, status;
- ngx_buf_t buf;
- ngx_uint_t i;
- ngx_table_elt_t *h;
- ngx_http_upstream_t *u;
- ngx_http_fastcgi_ctx_t *f;
- ngx_http_upstream_header_t *hh;
- ngx_http_fastcgi_loc_conf_t *flcf;
- ngx_http_fastcgi_split_part_t *part;
- ngx_http_upstream_main_conf_t *umcf;
-
- f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);
-
- umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
-
- u = r->upstream;
-
- for ( ;; ) {
-
- if (f->state < ngx_http_fastcgi_st_data) {
-
- f->pos = u->buffer.pos;
- f->last = u->buffer.last;
-
- rc = ngx_http_fastcgi_process_record(r, f);
-
- u->buffer.pos = f->pos;
- u->buffer.last = f->last;
-
- if (rc == NGX_AGAIN) {
- return NGX_AGAIN;
- }
-
- if (rc == NGX_ERROR) {
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-
- if (f->type != NGX_HTTP_FASTCGI_STDOUT
- && f->type != NGX_HTTP_FASTCGI_STDERR)
- {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent unexpected FastCGI record: %d",
- f->type);
-
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-
- if (f->type == NGX_HTTP_FASTCGI_STDOUT && f->length == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream prematurely closed FastCGI stdout");
-
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
- }
-
- if (f->state == ngx_http_fastcgi_st_padding) {
-
- if (u->buffer.pos + f->padding < u->buffer.last) {
- f->state = ngx_http_fastcgi_st_version;
- u->buffer.pos += f->padding;
-
- continue;
- }
-
- if (u->buffer.pos + f->padding == u->buffer.last) {
- f->state = ngx_http_fastcgi_st_version;
- u->buffer.pos = u->buffer.last;
-
- return NGX_AGAIN;
- }
-
- f->padding -= u->buffer.last - u->buffer.pos;
- u->buffer.pos = u->buffer.last;
-
- return NGX_AGAIN;
- }
-
-
- /* f->state == ngx_http_fastcgi_st_data */
-
- if (f->type == NGX_HTTP_FASTCGI_STDERR) {
-
- if (f->length) {
- msg = u->buffer.pos;
-
- if (u->buffer.pos + f->length <= u->buffer.last) {
- u->buffer.pos += f->length;
- f->length = 0;
- f->state = ngx_http_fastcgi_st_padding;
-
- } else {
- f->length -= u->buffer.last - u->buffer.pos;
- u->buffer.pos = u->buffer.last;
- }
-
- for (p = u->buffer.pos - 1; msg < p; p--) {
- if (*p != LF && *p != CR && *p != '.' && *p != ' ') {
- break;
- }
- }
-
- p++;
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "FastCGI sent in stderr: \"%*s\"", p - msg, msg);
-
- flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
-
- if (flcf->catch_stderr) {
- pattern = flcf->catch_stderr->elts;
-
- for (i = 0; i < flcf->catch_stderr->nelts; i++) {
- if (ngx_strnstr(msg, (char *) pattern[i].data,
- p - msg)
- != NULL)
- {
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
- }
- }
-
- if (u->buffer.pos == u->buffer.last) {
-
- if (!f->fastcgi_stdout) {
-
- /*
- * the special handling the large number
- * of the PHP warnings to not allocate memory
- */
-
-#if (NGX_HTTP_CACHE)
- if (r->cache) {
- u->buffer.pos = u->buffer.start
- + r->cache->header_start;
- } else {
- u->buffer.pos = u->buffer.start;
- }
-#else
- u->buffer.pos = u->buffer.start;
-#endif
- u->buffer.last = u->buffer.pos;
- f->large_stderr = 1;
- }
-
- return NGX_AGAIN;
- }
-
- } else {
- f->state = ngx_http_fastcgi_st_padding;
- }
-
- continue;
- }
-
-
- /* f->type == NGX_HTTP_FASTCGI_STDOUT */
-
-#if (NGX_HTTP_CACHE)
-
- if (f->large_stderr && r->cache) {
- u_char *start;
- ssize_t len;
- ngx_http_fastcgi_header_t *fh;
-
- start = u->buffer.start + r->cache->header_start;
-
- len = u->buffer.pos - start - 2 * sizeof(ngx_http_fastcgi_header_t);
-
- /*
- * A tail of large stderr output before HTTP header is placed
- * in a cache file without a FastCGI record header.
- * To workaround it we put a dummy FastCGI record header at the
- * start of the stderr output or update r->cache_header_start,
- * if there is no enough place for the record header.
- */
-
- if (len >= 0) {
- fh = (ngx_http_fastcgi_header_t *) start;
- fh->version = 1;
- fh->type = NGX_HTTP_FASTCGI_STDERR;
- fh->request_id_hi = 0;
- fh->request_id_lo = 1;
- fh->content_length_hi = (u_char) ((len >> 8) & 0xff);
- fh->content_length_lo = (u_char) (len & 0xff);
- fh->padding_length = 0;
- fh->reserved = 0;
-
- } else {
- r->cache->header_start += u->buffer.pos - start
- - sizeof(ngx_http_fastcgi_header_t);
- }
-
- f->large_stderr = 0;
- }
-
-#endif
-
- f->fastcgi_stdout = 1;
-
- start = u->buffer.pos;
-
- if (u->buffer.pos + f->length < u->buffer.last) {
-
- /*
- * set u->buffer.last to the end of the FastCGI record data
- * for ngx_http_parse_header_line()
- */
-
- last = u->buffer.last;
- u->buffer.last = u->buffer.pos + f->length;
-
- } else {
- last = NULL;
- }
-
- for ( ;; ) {
-
- part_start = u->buffer.pos;
- part_end = u->buffer.last;
-
- rc = ngx_http_parse_header_line(r, &u->buffer, 1);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http fastcgi parser: %d", rc);
-
- if (rc == NGX_AGAIN) {
- break;
- }
-
- if (rc == NGX_OK) {
-
- /* a header line has been parsed successfully */
-
- h = ngx_list_push(&u->headers_in.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- if (f->split_parts && f->split_parts->nelts) {
-
- part = f->split_parts->elts;
- size = u->buffer.pos - part_start;
-
- for (i = 0; i < f->split_parts->nelts; i++) {
- size += part[i].end - part[i].start;
- }
-
- p = ngx_pnalloc(r->pool, size);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- buf.pos = p;
-
- for (i = 0; i < f->split_parts->nelts; i++) {
- p = ngx_cpymem(p, part[i].start,
- part[i].end - part[i].start);
- }
-
- p = ngx_cpymem(p, part_start, u->buffer.pos - part_start);
-
- buf.last = p;
-
- f->split_parts->nelts = 0;
-
- rc = ngx_http_parse_header_line(r, &buf, 1);
-
- if (rc != NGX_OK) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "invalid header after joining "
- "FastCGI records");
- return NGX_ERROR;
- }
-
- h->key.len = r->header_name_end - r->header_name_start;
- h->key.data = r->header_name_start;
- h->key.data[h->key.len] = '\0';
-
- h->value.len = r->header_end - r->header_start;
- h->value.data = r->header_start;
- h->value.data[h->value.len] = '\0';
-
- h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
- if (h->lowcase_key == NULL) {
- return NGX_ERROR;
- }
-
- } else {
-
- h->key.len = r->header_name_end - r->header_name_start;
- h->value.len = r->header_end - r->header_start;
-
- h->key.data = ngx_pnalloc(r->pool,
- h->key.len + 1 + h->value.len + 1
- + h->key.len);
- if (h->key.data == NULL) {
- return NGX_ERROR;
- }
-
- h->value.data = h->key.data + h->key.len + 1;
- h->lowcase_key = h->key.data + h->key.len + 1
- + h->value.len + 1;
-
- ngx_memcpy(h->key.data, r->header_name_start, h->key.len);
- h->key.data[h->key.len] = '\0';
- ngx_memcpy(h->value.data, r->header_start, h->value.len);
- h->value.data[h->value.len] = '\0';
- }
-
- h->hash = r->header_hash;
-
- if (h->key.len == r->lowcase_index) {
- ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
-
- } else {
- ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
- }
-
- hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
- h->lowcase_key, h->key.len);
-
- if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http fastcgi header: \"%V: %V\"",
- &h->key, &h->value);
-
- if (u->buffer.pos < u->buffer.last) {
- continue;
- }
-
- /* the end of the FastCGI record */
-
- break;
- }
-
- if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
-
- /* a whole header has been parsed successfully */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http fastcgi header done");
-
- if (u->headers_in.status) {
- status_line = &u->headers_in.status->value;
-
- status = ngx_atoi(status_line->data, 3);
-
- if (status == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid status \"%V\"",
- status_line);
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-
- u->headers_in.status_n = status;
- u->headers_in.status_line = *status_line;
-
- } else if (u->headers_in.location) {
- u->headers_in.status_n = 302;
- ngx_str_set(&u->headers_in.status_line,
- "302 Moved Temporarily");
-
- } else {
- u->headers_in.status_n = 200;
- ngx_str_set(&u->headers_in.status_line, "200 OK");
- }
-
- if (u->state && u->state->status == 0) {
- u->state->status = u->headers_in.status_n;
- }
-
- break;
- }
-
- /* there was error while a header line parsing */
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid header");
-
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-
- if (last) {
- u->buffer.last = last;
- }
-
- f->length -= u->buffer.pos - start;
-
- if (f->length == 0) {
- f->state = ngx_http_fastcgi_st_padding;
- }
-
- if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
- return NGX_OK;
- }
-
- if (rc == NGX_OK) {
- continue;
- }
-
- /* rc == NGX_AGAIN */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "upstream split a header line in FastCGI records");
-
- if (f->split_parts == NULL) {
- f->split_parts = ngx_array_create(r->pool, 1,
- sizeof(ngx_http_fastcgi_split_part_t));
- if (f->split_parts == NULL) {
- return NGX_ERROR;
- }
- }
-
- part = ngx_array_push(f->split_parts);
- if (part == NULL) {
- return NGX_ERROR;
- }
-
- part->start = part_start;
- part->end = part_end;
-
- if (u->buffer.pos < u->buffer.last) {
- continue;
- }
-
- return NGX_AGAIN;
- }
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_input_filter_init(void *data)
-{
- ngx_http_request_t *r = data;
- ngx_http_fastcgi_loc_conf_t *flcf;
-
- flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
-
- r->upstream->pipe->length = flcf->keep_conn ?
- (off_t) sizeof(ngx_http_fastcgi_header_t) : -1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_input_filter(ngx_event_pipe_t *p, ngx_buf_t *buf)
-{
- u_char *m, *msg;
- ngx_int_t rc;
- ngx_buf_t *b, **prev;
- ngx_chain_t *cl;
- ngx_http_request_t *r;
- ngx_http_fastcgi_ctx_t *f;
- ngx_http_fastcgi_loc_conf_t *flcf;
-
- if (buf->pos == buf->last) {
- return NGX_OK;
- }
-
- r = p->input_ctx;
- f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);
- flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
-
- b = NULL;
- prev = &buf->shadow;
-
- f->pos = buf->pos;
- f->last = buf->last;
-
- for ( ;; ) {
- if (f->state < ngx_http_fastcgi_st_data) {
-
- rc = ngx_http_fastcgi_process_record(r, f);
-
- if (rc == NGX_AGAIN) {
- break;
- }
-
- if (rc == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if (f->type == NGX_HTTP_FASTCGI_STDOUT && f->length == 0) {
- f->state = ngx_http_fastcgi_st_padding;
-
- if (!flcf->keep_conn) {
- p->upstream_done = 1;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, p->log, 0,
- "http fastcgi closed stdout");
-
- continue;
- }
-
- if (f->type == NGX_HTTP_FASTCGI_END_REQUEST) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, p->log, 0,
- "http fastcgi sent end request");
-
- if (!flcf->keep_conn) {
- p->upstream_done = 1;
- break;
- }
-
- continue;
- }
- }
-
-
- if (f->state == ngx_http_fastcgi_st_padding) {
-
- if (f->type == NGX_HTTP_FASTCGI_END_REQUEST) {
-
- if (f->pos + f->padding < f->last) {
- p->upstream_done = 1;
- break;
- }
-
- if (f->pos + f->padding == f->last) {
- p->upstream_done = 1;
- r->upstream->keepalive = 1;
- break;
- }
-
- f->padding -= f->last - f->pos;
-
- break;
- }
-
- if (f->pos + f->padding < f->last) {
- f->state = ngx_http_fastcgi_st_version;
- f->pos += f->padding;
-
- continue;
- }
-
- if (f->pos + f->padding == f->last) {
- f->state = ngx_http_fastcgi_st_version;
-
- break;
- }
-
- f->padding -= f->last - f->pos;
-
- break;
- }
-
-
- /* f->state == ngx_http_fastcgi_st_data */
-
- if (f->type == NGX_HTTP_FASTCGI_STDERR) {
-
- if (f->length) {
-
- if (f->pos == f->last) {
- break;
- }
-
- msg = f->pos;
-
- if (f->pos + f->length <= f->last) {
- f->pos += f->length;
- f->length = 0;
- f->state = ngx_http_fastcgi_st_padding;
-
- } else {
- f->length -= f->last - f->pos;
- f->pos = f->last;
- }
-
- for (m = f->pos - 1; msg < m; m--) {
- if (*m != LF && *m != CR && *m != '.' && *m != ' ') {
- break;
- }
- }
-
- ngx_log_error(NGX_LOG_ERR, p->log, 0,
- "FastCGI sent in stderr: \"%*s\"",
- m + 1 - msg, msg);
-
- } else {
- f->state = ngx_http_fastcgi_st_padding;
- }
-
- continue;
- }
-
- if (f->type == NGX_HTTP_FASTCGI_END_REQUEST) {
-
- if (f->pos + f->length <= f->last) {
- f->state = ngx_http_fastcgi_st_padding;
- f->pos += f->length;
-
- continue;
- }
-
- f->length -= f->last - f->pos;
-
- break;
- }
-
-
- /* f->type == NGX_HTTP_FASTCGI_STDOUT */
-
- if (f->pos == f->last) {
- break;
- }
-
- cl = ngx_chain_get_free_buf(p->pool, &p->free);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->pos = f->pos;
- b->start = buf->start;
- b->end = buf->end;
- b->tag = p->tag;
- b->temporary = 1;
- b->recycled = 1;
-
- *prev = b;
- prev = &b->shadow;
-
- if (p->in) {
- *p->last_in = cl;
- } else {
- p->in = cl;
- }
- p->last_in = &cl->next;
-
-
- /* STUB */ b->num = buf->num;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "input buf #%d %p", b->num, b->pos);
-
- if (f->pos + f->length <= f->last) {
- f->state = ngx_http_fastcgi_st_padding;
- f->pos += f->length;
- b->last = f->pos;
-
- continue;
- }
-
- f->length -= f->last - f->pos;
-
- b->last = f->last;
-
- break;
-
- }
-
- if (flcf->keep_conn) {
-
- /* set p->length, minimal amount of data we want to see */
-
- if (f->state < ngx_http_fastcgi_st_data) {
- p->length = 1;
-
- } else if (f->state == ngx_http_fastcgi_st_padding) {
- p->length = f->padding;
-
- } else {
- /* ngx_http_fastcgi_st_data */
-
- p->length = f->length;
- }
- }
-
- if (b) {
- b->shadow = buf;
- b->last_shadow = 1;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "input buf %p %z", b->pos, b->last - b->pos);
-
- return NGX_OK;
- }
-
- /* there is no data record in the buf, add it to free chain */
-
- if (ngx_event_pipe_add_free_buf(p, buf) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_non_buffered_filter(void *data, ssize_t bytes)
-{
- u_char *m, *msg;
- ngx_int_t rc;
- ngx_buf_t *b, *buf;
- ngx_chain_t *cl, **ll;
- ngx_http_request_t *r;
- ngx_http_upstream_t *u;
- ngx_http_fastcgi_ctx_t *f;
-
- r = data;
- f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);
-
- u = r->upstream;
- buf = &u->buffer;
-
- buf->pos = buf->last;
- buf->last += bytes;
-
- for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) {
- ll = &cl->next;
- }
-
- f->pos = buf->pos;
- f->last = buf->last;
-
- for ( ;; ) {
- if (f->state < ngx_http_fastcgi_st_data) {
-
- rc = ngx_http_fastcgi_process_record(r, f);
-
- if (rc == NGX_AGAIN) {
- break;
- }
-
- if (rc == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if (f->type == NGX_HTTP_FASTCGI_STDOUT && f->length == 0) {
- f->state = ngx_http_fastcgi_st_padding;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http fastcgi closed stdout");
-
- continue;
- }
- }
-
- if (f->state == ngx_http_fastcgi_st_padding) {
-
- if (f->type == NGX_HTTP_FASTCGI_END_REQUEST) {
-
- if (f->pos + f->padding < f->last) {
- u->length = 0;
- break;
- }
-
- if (f->pos + f->padding == f->last) {
- u->length = 0;
- u->keepalive = 1;
- break;
- }
-
- f->padding -= f->last - f->pos;
-
- break;
- }
-
- if (f->pos + f->padding < f->last) {
- f->state = ngx_http_fastcgi_st_version;
- f->pos += f->padding;
-
- continue;
- }
-
- if (f->pos + f->padding == f->last) {
- f->state = ngx_http_fastcgi_st_version;
-
- break;
- }
-
- f->padding -= f->last - f->pos;
-
- break;
- }
-
-
- /* f->state == ngx_http_fastcgi_st_data */
-
- if (f->type == NGX_HTTP_FASTCGI_STDERR) {
-
- if (f->length) {
-
- if (f->pos == f->last) {
- break;
- }
-
- msg = f->pos;
-
- if (f->pos + f->length <= f->last) {
- f->pos += f->length;
- f->length = 0;
- f->state = ngx_http_fastcgi_st_padding;
-
- } else {
- f->length -= f->last - f->pos;
- f->pos = f->last;
- }
-
- for (m = f->pos - 1; msg < m; m--) {
- if (*m != LF && *m != CR && *m != '.' && *m != ' ') {
- break;
- }
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "FastCGI sent in stderr: \"%*s\"",
- m + 1 - msg, msg);
-
- } else {
- f->state = ngx_http_fastcgi_st_padding;
- }
-
- continue;
- }
-
- if (f->type == NGX_HTTP_FASTCGI_END_REQUEST) {
-
- if (f->pos + f->length <= f->last) {
- f->state = ngx_http_fastcgi_st_padding;
- f->pos += f->length;
-
- continue;
- }
-
- f->length -= f->last - f->pos;
-
- break;
- }
-
-
- /* f->type == NGX_HTTP_FASTCGI_STDOUT */
-
- if (f->pos == f->last) {
- break;
- }
-
- cl = ngx_chain_get_free_buf(r->pool, &u->free_bufs);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- *ll = cl;
- ll = &cl->next;
-
- b = cl->buf;
-
- b->flush = 1;
- b->memory = 1;
-
- b->pos = f->pos;
- b->tag = u->output.tag;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http fastcgi output buf %p", b->pos);
-
- if (f->pos + f->length <= f->last) {
- f->state = ngx_http_fastcgi_st_padding;
- f->pos += f->length;
- b->last = f->pos;
-
- continue;
- }
-
- f->length -= f->last - f->pos;
- b->last = f->last;
-
- break;
- }
-
- /* provide continuous buffer for subrequests in memory */
-
- if (r->subrequest_in_memory) {
-
- cl = u->out_bufs;
-
- if (cl) {
- buf->pos = cl->buf->pos;
- }
-
- buf->last = buf->pos;
-
- for (cl = u->out_bufs; cl; cl = cl->next) {
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http fastcgi in memory %p-%p %uz",
- cl->buf->pos, cl->buf->last, ngx_buf_size(cl->buf));
-
- if (buf->last == cl->buf->pos) {
- buf->last = cl->buf->last;
- continue;
- }
-
- buf->last = ngx_movemem(buf->last, cl->buf->pos,
- cl->buf->last - cl->buf->pos);
-
- cl->buf->pos = buf->last - (cl->buf->last - cl->buf->pos);
- cl->buf->last = buf->last;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_process_record(ngx_http_request_t *r,
- ngx_http_fastcgi_ctx_t *f)
-{
- u_char ch, *p;
- ngx_http_fastcgi_state_e state;
-
- state = f->state;
-
- for (p = f->pos; p < f->last; p++) {
-
- ch = *p;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http fastcgi record byte: %02Xd", ch);
-
- switch (state) {
-
- case ngx_http_fastcgi_st_version:
- if (ch != 1) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent unsupported FastCGI "
- "protocol version: %d", ch);
- return NGX_ERROR;
- }
- state = ngx_http_fastcgi_st_type;
- break;
-
- case ngx_http_fastcgi_st_type:
- switch (ch) {
- case NGX_HTTP_FASTCGI_STDOUT:
- case NGX_HTTP_FASTCGI_STDERR:
- case NGX_HTTP_FASTCGI_END_REQUEST:
- f->type = (ngx_uint_t) ch;
- break;
- default:
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid FastCGI "
- "record type: %d", ch);
- return NGX_ERROR;
-
- }
- state = ngx_http_fastcgi_st_request_id_hi;
- break;
-
- /* we support the single request per connection */
-
- case ngx_http_fastcgi_st_request_id_hi:
- if (ch != 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent unexpected FastCGI "
- "request id high byte: %d", ch);
- return NGX_ERROR;
- }
- state = ngx_http_fastcgi_st_request_id_lo;
- break;
-
- case ngx_http_fastcgi_st_request_id_lo:
- if (ch != 1) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent unexpected FastCGI "
- "request id low byte: %d", ch);
- return NGX_ERROR;
- }
- state = ngx_http_fastcgi_st_content_length_hi;
- break;
-
- case ngx_http_fastcgi_st_content_length_hi:
- f->length = ch << 8;
- state = ngx_http_fastcgi_st_content_length_lo;
- break;
-
- case ngx_http_fastcgi_st_content_length_lo:
- f->length |= (size_t) ch;
- state = ngx_http_fastcgi_st_padding_length;
- break;
-
- case ngx_http_fastcgi_st_padding_length:
- f->padding = (size_t) ch;
- state = ngx_http_fastcgi_st_reserved;
- break;
-
- case ngx_http_fastcgi_st_reserved:
- state = ngx_http_fastcgi_st_data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http fastcgi record length: %z", f->length);
-
- f->pos = p + 1;
- f->state = state;
-
- return NGX_OK;
-
- /* suppress warning */
- case ngx_http_fastcgi_st_data:
- case ngx_http_fastcgi_st_padding:
- break;
- }
- }
-
- f->state = state;
-
- return NGX_AGAIN;
-}
-
-
-static void
-ngx_http_fastcgi_abort_request(ngx_http_request_t *r)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "abort http fastcgi request");
-
- return;
-}
-
-
-static void
-ngx_http_fastcgi_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "finalize http fastcgi request");
-
- return;
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_add_variables(ngx_conf_t *cf)
-{
- ngx_http_variable_t *var, *v;
-
- for (v = ngx_http_fastcgi_vars; v->name.len; v++) {
- var = ngx_http_add_variable(cf, &v->name, v->flags);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = v->get_handler;
- var->data = v->data;
- }
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_fastcgi_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_fastcgi_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->upstream.bufs.num = 0;
- * conf->upstream.ignore_headers = 0;
- * conf->upstream.next_upstream = 0;
- * conf->upstream.cache_use_stale = 0;
- * conf->upstream.cache_methods = 0;
- * conf->upstream.temp_path = NULL;
- * conf->upstream.hide_headers_hash = { NULL, 0 };
- * conf->upstream.uri = { 0, NULL };
- * conf->upstream.location = NULL;
- * conf->upstream.store_lengths = NULL;
- * conf->upstream.store_values = NULL;
- *
- * conf->index.len = { 0, NULL };
- */
-
- conf->upstream.store = NGX_CONF_UNSET;
- conf->upstream.store_access = NGX_CONF_UNSET_UINT;
- conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
- conf->upstream.buffering = NGX_CONF_UNSET;
- conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
-
- conf->upstream.local = NGX_CONF_UNSET_PTR;
-
- conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
-
- conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
- conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
-
- conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE;
- conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE;
- conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE;
-
- conf->upstream.pass_request_headers = NGX_CONF_UNSET;
- conf->upstream.pass_request_body = NGX_CONF_UNSET;
-
-#if (NGX_HTTP_CACHE)
- conf->upstream.cache = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
- conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
- conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_lock = NGX_CONF_UNSET;
- conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.cache_revalidate = NGX_CONF_UNSET;
-#endif
-
- conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
- conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
-
- conf->upstream.intercept_errors = NGX_CONF_UNSET;
-
- /* "fastcgi_cyclic_temp_file" is disabled */
- conf->upstream.cyclic_temp_file = 0;
-
- conf->upstream.change_buffering = 1;
-
- conf->catch_stderr = NGX_CONF_UNSET_PTR;
-
- conf->keep_conn = NGX_CONF_UNSET;
-
- ngx_str_set(&conf->upstream.module, "fastcgi");
-
- return conf;
-}
-
-
-static char *
-ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_fastcgi_loc_conf_t *prev = parent;
- ngx_http_fastcgi_loc_conf_t *conf = child;
-
- size_t size;
- ngx_hash_init_t hash;
- ngx_http_core_loc_conf_t *clcf;
-
- if (conf->upstream.store != 0) {
- ngx_conf_merge_value(conf->upstream.store,
- prev->upstream.store, 0);
-
- if (conf->upstream.store_lengths == NULL) {
- conf->upstream.store_lengths = prev->upstream.store_lengths;
- conf->upstream.store_values = prev->upstream.store_values;
- }
- }
-
- ngx_conf_merge_uint_value(conf->upstream.store_access,
- prev->upstream.store_access, 0600);
-
- ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
- prev->upstream.next_upstream_tries, 0);
-
- ngx_conf_merge_value(conf->upstream.buffering,
- prev->upstream.buffering, 1);
-
- ngx_conf_merge_value(conf->upstream.ignore_client_abort,
- prev->upstream.ignore_client_abort, 0);
-
- ngx_conf_merge_ptr_value(conf->upstream.local,
- prev->upstream.local, NULL);
-
- ngx_conf_merge_msec_value(conf->upstream.connect_timeout,
- prev->upstream.connect_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.send_timeout,
- prev->upstream.send_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.read_timeout,
- prev->upstream.read_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
- prev->upstream.next_upstream_timeout, 0);
-
- ngx_conf_merge_size_value(conf->upstream.send_lowat,
- prev->upstream.send_lowat, 0);
-
- ngx_conf_merge_size_value(conf->upstream.buffer_size,
- prev->upstream.buffer_size,
- (size_t) ngx_pagesize);
-
-
- ngx_conf_merge_bufs_value(conf->upstream.bufs, prev->upstream.bufs,
- 8, ngx_pagesize);
-
- if (conf->upstream.bufs.num < 2) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "there must be at least 2 \"fastcgi_buffers\"");
- return NGX_CONF_ERROR;
- }
-
-
- size = conf->upstream.buffer_size;
- if (size < conf->upstream.bufs.size) {
- size = conf->upstream.bufs.size;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.busy_buffers_size_conf,
- prev->upstream.busy_buffers_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.busy_buffers_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.busy_buffers_size = 2 * size;
- } else {
- conf->upstream.busy_buffers_size =
- conf->upstream.busy_buffers_size_conf;
- }
-
- if (conf->upstream.busy_buffers_size < size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"fastcgi_busy_buffers_size\" must be equal to or greater than "
- "the maximum of the value of \"fastcgi_buffer_size\" and "
- "one of the \"fastcgi_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
- if (conf->upstream.busy_buffers_size
- > (conf->upstream.bufs.num - 1) * conf->upstream.bufs.size)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"fastcgi_busy_buffers_size\" must be less than "
- "the size of all \"fastcgi_buffers\" minus one buffer");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.temp_file_write_size_conf,
- prev->upstream.temp_file_write_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.temp_file_write_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.temp_file_write_size = 2 * size;
- } else {
- conf->upstream.temp_file_write_size =
- conf->upstream.temp_file_write_size_conf;
- }
-
- if (conf->upstream.temp_file_write_size < size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"fastcgi_temp_file_write_size\" must be equal to or greater "
- "than the maximum of the value of \"fastcgi_buffer_size\" and "
- "one of the \"fastcgi_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.max_temp_file_size_conf,
- prev->upstream.max_temp_file_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.max_temp_file_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.max_temp_file_size = 1024 * 1024 * 1024;
- } else {
- conf->upstream.max_temp_file_size =
- conf->upstream.max_temp_file_size_conf;
- }
-
- if (conf->upstream.max_temp_file_size != 0
- && conf->upstream.max_temp_file_size < size)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"fastcgi_max_temp_file_size\" must be equal to zero to disable "
- "temporary files usage or must be equal to or greater than "
- "the maximum of the value of \"fastcgi_buffer_size\" and "
- "one of the \"fastcgi_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_bitmask_value(conf->upstream.ignore_headers,
- prev->upstream.ignore_headers,
- NGX_CONF_BITMASK_SET);
-
-
- ngx_conf_merge_bitmask_value(conf->upstream.next_upstream,
- prev->upstream.next_upstream,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_ERROR
- |NGX_HTTP_UPSTREAM_FT_TIMEOUT));
-
- if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) {
- conf->upstream.next_upstream = NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF;
- }
-
- if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path,
- prev->upstream.temp_path,
- &ngx_http_fastcgi_temp_path)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
-#if (NGX_HTTP_CACHE)
-
- ngx_conf_merge_ptr_value(conf->upstream.cache,
- prev->upstream.cache, NULL);
-
- if (conf->upstream.cache && conf->upstream.cache->data == NULL) {
- ngx_shm_zone_t *shm_zone;
-
- shm_zone = conf->upstream.cache;
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"fastcgi_cache\" zone \"%V\" is unknown",
- &shm_zone->shm.name);
-
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_uint_value(conf->upstream.cache_min_uses,
- prev->upstream.cache_min_uses, 1);
-
- ngx_conf_merge_bitmask_value(conf->upstream.cache_use_stale,
- prev->upstream.cache_use_stale,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF));
-
- if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
- conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF;
- }
-
- if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) {
- conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE;
- }
-
- if (conf->upstream.cache_methods == 0) {
- conf->upstream.cache_methods = prev->upstream.cache_methods;
- }
-
- conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD;
-
- ngx_conf_merge_ptr_value(conf->upstream.cache_bypass,
- prev->upstream.cache_bypass, NULL);
-
- ngx_conf_merge_ptr_value(conf->upstream.no_cache,
- prev->upstream.no_cache, NULL);
-
- ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
- prev->upstream.cache_valid, NULL);
-
- if (conf->cache_key.value.data == NULL) {
- conf->cache_key = prev->cache_key;
- }
-
- if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "no \"fastcgi_cache_key\" for \"fastcgi_cache\"");
- }
-
- ngx_conf_merge_value(conf->upstream.cache_lock,
- prev->upstream.cache_lock, 0);
-
- ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout,
- prev->upstream.cache_lock_timeout, 5000);
-
- ngx_conf_merge_value(conf->upstream.cache_revalidate,
- prev->upstream.cache_revalidate, 0);
-
-#endif
-
- ngx_conf_merge_value(conf->upstream.pass_request_headers,
- prev->upstream.pass_request_headers, 1);
- ngx_conf_merge_value(conf->upstream.pass_request_body,
- prev->upstream.pass_request_body, 1);
-
- ngx_conf_merge_value(conf->upstream.intercept_errors,
- prev->upstream.intercept_errors, 0);
-
- ngx_conf_merge_ptr_value(conf->catch_stderr, prev->catch_stderr, NULL);
-
- ngx_conf_merge_value(conf->keep_conn, prev->keep_conn, 0);
-
-
- ngx_conf_merge_str_value(conf->index, prev->index, "");
-
- hash.max_size = 512;
- hash.bucket_size = ngx_align(64, ngx_cacheline_size);
- hash.name = "fastcgi_hide_headers_hash";
-
- if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream,
- &prev->upstream, ngx_http_fastcgi_hide_headers, &hash)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- if (conf->upstream.upstream == NULL) {
- conf->upstream.upstream = prev->upstream.upstream;
- }
-
- if (conf->fastcgi_lengths == NULL) {
- conf->fastcgi_lengths = prev->fastcgi_lengths;
- conf->fastcgi_values = prev->fastcgi_values;
- }
-
- if (conf->upstream.upstream || conf->fastcgi_lengths) {
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- if (clcf->handler == NULL && clcf->lmt_excpt) {
- clcf->handler = ngx_http_fastcgi_handler;
- }
- }
-
-#if (NGX_PCRE)
- if (conf->split_regex == NULL) {
- conf->split_regex = prev->split_regex;
- conf->split_name = prev->split_name;
- }
-#endif
-
- if (ngx_http_fastcgi_merge_params(cf, conf, prev) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_merge_params(ngx_conf_t *cf,
- ngx_http_fastcgi_loc_conf_t *conf, ngx_http_fastcgi_loc_conf_t *prev)
-{
- u_char *p;
- size_t size;
- uintptr_t *code;
- ngx_uint_t i, nsrc;
- ngx_array_t headers_names;
-#if (NGX_HTTP_CACHE)
- ngx_array_t params_merged;
-#endif
- ngx_hash_key_t *hk;
- ngx_hash_init_t hash;
- ngx_http_upstream_param_t *src;
- ngx_http_script_compile_t sc;
- ngx_http_script_copy_code_t *copy;
-
- if (conf->params_source == NULL) {
- conf->params_source = prev->params_source;
-
- if (prev->headers_hash.buckets
-#if (NGX_HTTP_CACHE)
- && ((conf->upstream.cache == NULL)
- == (prev->upstream.cache == NULL))
-#endif
- )
- {
- conf->flushes = prev->flushes;
- conf->params_len = prev->params_len;
- conf->params = prev->params;
- conf->headers_hash = prev->headers_hash;
- conf->header_params = prev->header_params;
-
- return NGX_OK;
- }
- }
-
- if (conf->params_source == NULL
-#if (NGX_HTTP_CACHE)
- && (conf->upstream.cache == NULL)
-#endif
- )
- {
- conf->headers_hash.buckets = (void *) 1;
- return NGX_OK;
- }
-
- conf->params_len = ngx_array_create(cf->pool, 64, 1);
- if (conf->params_len == NULL) {
- return NGX_ERROR;
- }
-
- conf->params = ngx_array_create(cf->pool, 512, 1);
- if (conf->params == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&headers_names, cf->temp_pool, 4, sizeof(ngx_hash_key_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (conf->params_source) {
- src = conf->params_source->elts;
- nsrc = conf->params_source->nelts;
-
- } else {
- src = NULL;
- nsrc = 0;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (conf->upstream.cache) {
- ngx_keyval_t *h;
- ngx_http_upstream_param_t *s;
-
- if (ngx_array_init(&params_merged, cf->temp_pool, 4,
- sizeof(ngx_http_upstream_param_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- for (i = 0; i < nsrc; i++) {
-
- s = ngx_array_push(&params_merged);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = src[i];
- }
-
- h = ngx_http_fastcgi_cache_headers;
-
- while (h->key.len) {
-
- src = params_merged.elts;
- nsrc = params_merged.nelts;
-
- for (i = 0; i < nsrc; i++) {
- if (ngx_strcasecmp(h->key.data, src[i].key.data) == 0) {
- goto next;
- }
- }
-
- s = ngx_array_push(&params_merged);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- s->key = h->key;
- s->value = h->value;
- s->skip_empty = 1;
-
- next:
-
- h++;
- }
-
- src = params_merged.elts;
- nsrc = params_merged.nelts;
- }
-
-#endif
-
- for (i = 0; i < nsrc; i++) {
-
- if (src[i].key.len > sizeof("HTTP_") - 1
- && ngx_strncmp(src[i].key.data, "HTTP_", sizeof("HTTP_") - 1) == 0)
- {
- hk = ngx_array_push(&headers_names);
- if (hk == NULL) {
- return NGX_ERROR;
- }
-
- hk->key.len = src[i].key.len - 5;
- hk->key.data = src[i].key.data + 5;
- hk->key_hash = ngx_hash_key_lc(hk->key.data, hk->key.len);
- hk->value = (void *) 1;
-
- if (src[i].value.len == 0) {
- continue;
- }
- }
-
- copy = ngx_array_push_n(conf->params_len,
- sizeof(ngx_http_script_copy_code_t));
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
- copy->len = src[i].key.len;
-
- copy = ngx_array_push_n(conf->params_len,
- sizeof(ngx_http_script_copy_code_t));
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
- copy->len = src[i].skip_empty;
-
-
- size = (sizeof(ngx_http_script_copy_code_t)
- + src[i].key.len + sizeof(uintptr_t) - 1)
- & ~(sizeof(uintptr_t) - 1);
-
- copy = ngx_array_push_n(conf->params, size);
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = ngx_http_script_copy_code;
- copy->len = src[i].key.len;
-
- p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
- ngx_memcpy(p, src[i].key.data, src[i].key.len);
-
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &src[i].value;
- sc.flushes = &conf->flushes;
- sc.lengths = &conf->params_len;
- sc.values = &conf->params;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_ERROR;
- }
-
- code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
-
- code = ngx_array_push_n(conf->params, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
- }
-
- code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
- conf->header_params = headers_names.nelts;
-
- hash.hash = &conf->headers_hash;
- hash.key = ngx_hash_key_lc;
- hash.max_size = 512;
- hash.bucket_size = 64;
- hash.name = "fastcgi_params_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- return ngx_hash_init(&hash, headers_names.elts, headers_names.nelts);
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- ngx_http_fastcgi_ctx_t *f;
- ngx_http_fastcgi_loc_conf_t *flcf;
-
- flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
-
- f = ngx_http_fastcgi_split(r, flcf);
-
- if (f == NULL) {
- return NGX_ERROR;
- }
-
- if (f->script_name.len == 0
- || f->script_name.data[f->script_name.len - 1] != '/')
- {
- v->len = f->script_name.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = f->script_name.data;
-
- return NGX_OK;
- }
-
- v->len = f->script_name.len + flcf->index.len;
-
- v->data = ngx_pnalloc(r->pool, v->len);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- p = ngx_copy(v->data, f->script_name.data, f->script_name.len);
- ngx_memcpy(p, flcf->index.data, flcf->index.len);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_fastcgi_path_info_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_fastcgi_ctx_t *f;
- ngx_http_fastcgi_loc_conf_t *flcf;
-
- flcf = ngx_http_get_module_loc_conf(r, ngx_http_fastcgi_module);
-
- f = ngx_http_fastcgi_split(r, flcf);
-
- if (f == NULL) {
- return NGX_ERROR;
- }
-
- v->len = f->path_info.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = f->path_info.data;
-
- return NGX_OK;
-}
-
-
-static ngx_http_fastcgi_ctx_t *
-ngx_http_fastcgi_split(ngx_http_request_t *r, ngx_http_fastcgi_loc_conf_t *flcf)
-{
- ngx_http_fastcgi_ctx_t *f;
-#if (NGX_PCRE)
- ngx_int_t n;
- int captures[(1 + 2) * 3];
-
- f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);
-
- if (f == NULL) {
- f = ngx_pcalloc(r->pool, sizeof(ngx_http_fastcgi_ctx_t));
- if (f == NULL) {
- return NULL;
- }
-
- ngx_http_set_ctx(r, f, ngx_http_fastcgi_module);
- }
-
- if (f->script_name.len) {
- return f;
- }
-
- if (flcf->split_regex == NULL) {
- f->script_name = r->uri;
- return f;
- }
-
- n = ngx_regex_exec(flcf->split_regex, &r->uri, captures, (1 + 2) * 3);
-
- if (n >= 0) { /* match */
- f->script_name.len = captures[3] - captures[2];
- f->script_name.data = r->uri.data + captures[2];
-
- f->path_info.len = captures[5] - captures[4];
- f->path_info.data = r->uri.data + captures[4];
-
- return f;
- }
-
- if (n == NGX_REGEX_NO_MATCHED) {
- f->script_name = r->uri;
- return f;
- }
-
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- ngx_regex_exec_n " failed: %i on \"%V\" using \"%V\"",
- n, &r->uri, &flcf->split_name);
- return NULL;
-
-#else
-
- f = ngx_http_get_module_ctx(r, ngx_http_fastcgi_module);
-
- if (f == NULL) {
- f = ngx_pcalloc(r->pool, sizeof(ngx_http_fastcgi_ctx_t));
- if (f == NULL) {
- return NULL;
- }
-
- ngx_http_set_ctx(r, f, ngx_http_fastcgi_module);
- }
-
- f->script_name = r->uri;
-
- return f;
-
-#endif
-}
-
-
-static char *
-ngx_http_fastcgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_fastcgi_loc_conf_t *flcf = conf;
-
- ngx_url_t u;
- ngx_str_t *value, *url;
- ngx_uint_t n;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_script_compile_t sc;
-
- if (flcf->upstream.upstream || flcf->fastcgi_lengths) {
- return "is duplicate";
- }
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
-
- clcf->handler = ngx_http_fastcgi_handler;
-
- if (clcf->name.data[clcf->name.len - 1] == '/') {
- clcf->auto_redirect = 1;
- }
-
- value = cf->args->elts;
-
- url = &value[1];
-
- n = ngx_http_script_variables_count(url);
-
- if (n) {
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = url;
- sc.lengths = &flcf->fastcgi_lengths;
- sc.values = &flcf->fastcgi_values;
- sc.variables = n;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
- }
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url = value[1];
- u.no_resolve = 1;
-
- flcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0);
- if (flcf->upstream.upstream == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_fastcgi_split_path_info(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
-#if (NGX_PCRE)
- ngx_http_fastcgi_loc_conf_t *flcf = conf;
-
- ngx_str_t *value;
- ngx_regex_compile_t rc;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
-
- value = cf->args->elts;
-
- flcf->split_name = value[1];
-
- ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
-
- rc.pattern = value[1];
- rc.pool = cf->pool;
- rc.err.len = NGX_MAX_CONF_ERRSTR;
- rc.err.data = errstr;
-
- if (ngx_regex_compile(&rc) != NGX_OK) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V", &rc.err);
- return NGX_CONF_ERROR;
- }
-
- if (rc.captures != 2) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "pattern \"%V\" must have 2 captures", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- flcf->split_regex = rc.regex;
-
- return NGX_CONF_OK;
-
-#else
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"%V\" requires PCRE library", &cmd->name);
- return NGX_CONF_ERROR;
-
-#endif
-}
-
-
-static char *
-ngx_http_fastcgi_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_fastcgi_loc_conf_t *flcf = conf;
-
- ngx_str_t *value;
- ngx_http_script_compile_t sc;
-
- if (flcf->upstream.store != NGX_CONF_UNSET
- || flcf->upstream.store_lengths)
- {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- flcf->upstream.store = 0;
- return NGX_CONF_OK;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (flcf->upstream.cache != NGX_CONF_UNSET_PTR
- && flcf->upstream.cache != NULL)
- {
- return "is incompatible with \"fastcgi_cache\"";
- }
-
-#endif
-
- if (ngx_strcmp(value[1].data, "on") == 0) {
- flcf->upstream.store = 1;
- return NGX_CONF_OK;
- }
-
- /* include the terminating '\0' into script */
- value[1].len++;
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &value[1];
- sc.lengths = &flcf->upstream.store_lengths;
- sc.values = &flcf->upstream.store_values;
- sc.variables = ngx_http_script_variables_count(&value[1]);
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-static char *
-ngx_http_fastcgi_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_fastcgi_loc_conf_t *flcf = conf;
-
- ngx_str_t *value;
-
- value = cf->args->elts;
-
- if (flcf->upstream.cache != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- flcf->upstream.cache = NULL;
- return NGX_CONF_OK;
- }
-
- if (flcf->upstream.store > 0 || flcf->upstream.store_lengths) {
- return "is incompatible with \"fastcgi_store\"";
- }
-
- flcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0,
- &ngx_http_fastcgi_module);
- if (flcf->upstream.cache == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_fastcgi_cache_key(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_fastcgi_loc_conf_t *flcf = conf;
-
- ngx_str_t *value;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- if (flcf->cache_key.value.data) {
- return "is duplicate";
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &flcf->cache_key;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-#endif
-
-
-static char *
-ngx_http_fastcgi_lowat_check(ngx_conf_t *cf, void *post, void *data)
-{
-#if (NGX_FREEBSD)
- ssize_t *np = data;
-
- if ((u_long) *np >= ngx_freebsd_net_inet_tcp_sendspace) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"fastcgi_send_lowat\" must be less than %d "
- "(sysctl net.inet.tcp.sendspace)",
- ngx_freebsd_net_inet_tcp_sendspace);
-
- return NGX_CONF_ERROR;
- }
-
-#elif !(NGX_HAVE_SO_SNDLOWAT)
- ssize_t *np = data;
-
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "\"fastcgi_send_lowat\" is not supported, ignored");
-
- *np = 0;
-
-#endif
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_flv_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_flv_module.c
deleted file mode 100644
index cc2532027cc..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_flv_module.c
+++ /dev/null
@@ -1,266 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static char *ngx_http_flv(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-
-static ngx_command_t ngx_http_flv_commands[] = {
-
- { ngx_string("flv"),
- NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS,
- ngx_http_flv,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static u_char ngx_flv_header[] = "FLV\x1\x5\0\0\0\x9\0\0\0\0";
-
-
-static ngx_http_module_t ngx_http_flv_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_flv_module = {
- NGX_MODULE_V1,
- &ngx_http_flv_module_ctx, /* module context */
- ngx_http_flv_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_flv_handler(ngx_http_request_t *r)
-{
- u_char *last;
- off_t start, len;
- size_t root;
- ngx_int_t rc;
- ngx_uint_t level, i;
- ngx_str_t path, value;
- ngx_log_t *log;
- ngx_buf_t *b;
- ngx_chain_t out[2];
- ngx_open_file_info_t of;
- ngx_http_core_loc_conf_t *clcf;
-
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
- return NGX_HTTP_NOT_ALLOWED;
- }
-
- if (r->uri.data[r->uri.len - 1] == '/') {
- return NGX_DECLINED;
- }
-
- rc = ngx_http_discard_request_body(r);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- last = ngx_http_map_uri_to_path(r, &path, &root, 0);
- if (last == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- log = r->connection->log;
-
- path.len = last - path.data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
- "http flv filename: \"%V\"", &path);
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.read_ahead = clcf->read_ahead;
- of.directio = clcf->directio;
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.errors = clcf->open_file_cache_errors;
- of.events = clcf->open_file_cache_events;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- != NGX_OK)
- {
- switch (of.err) {
-
- case 0:
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
-
- case NGX_ENOENT:
- case NGX_ENOTDIR:
- case NGX_ENAMETOOLONG:
-
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_NOT_FOUND;
- break;
-
- case NGX_EACCES:
-#if (NGX_HAVE_OPENAT)
- case NGX_EMLINK:
- case NGX_ELOOP:
-#endif
-
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_FORBIDDEN;
- break;
-
- default:
-
- level = NGX_LOG_CRIT;
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- break;
- }
-
- if (rc != NGX_HTTP_NOT_FOUND || clcf->log_not_found) {
- ngx_log_error(level, log, of.err,
- "%s \"%s\" failed", of.failed, path.data);
- }
-
- return rc;
- }
-
- if (!of.is_file) {
-
- if (ngx_close_file(of.fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", path.data);
- }
-
- return NGX_DECLINED;
- }
-
- r->root_tested = !r->error_page;
-
- start = 0;
- len = of.size;
- i = 1;
-
- if (r->args.len) {
-
- if (ngx_http_arg(r, (u_char *) "start", 5, &value) == NGX_OK) {
-
- start = ngx_atoof(value.data, value.len);
-
- if (start == NGX_ERROR || start >= len) {
- start = 0;
- }
-
- if (start) {
- len = sizeof(ngx_flv_header) - 1 + len - start;
- i = 0;
- }
- }
- }
-
- log->action = "sending flv to client";
-
- r->headers_out.status = NGX_HTTP_OK;
- r->headers_out.content_length_n = len;
- r->headers_out.last_modified_time = of.mtime;
-
- if (ngx_http_set_etag(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_http_set_content_type(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (i == 0) {
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b->pos = ngx_flv_header;
- b->last = ngx_flv_header + sizeof(ngx_flv_header) - 1;
- b->memory = 1;
-
- out[0].buf = b;
- out[0].next = &out[1];
- }
-
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t));
- if (b->file == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- r->allow_ranges = 1;
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- return rc;
- }
-
- b->file_pos = start;
- b->file_last = of.size;
-
- b->in_file = b->file_last ? 1: 0;
- b->last_buf = (r == r->main) ? 1 : 0;
- b->last_in_chain = 1;
-
- b->file->fd = of.fd;
- b->file->name = path;
- b->file->log = log;
- b->file->directio = of.is_directio;
-
- out[1].buf = b;
- out[1].next = NULL;
-
- return ngx_http_output_filter(r, &out[i]);
-}
-
-
-static char *
-ngx_http_flv(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- clcf->handler = ngx_http_flv_handler;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geo_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geo_module.c
deleted file mode 100644
index 9b3c6cb9cea..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geo_module.c
+++ /dev/null
@@ -1,1644 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_http_variable_value_t *value;
- u_short start;
- u_short end;
-} ngx_http_geo_range_t;
-
-
-typedef struct {
- ngx_radix_tree_t *tree;
-#if (NGX_HAVE_INET6)
- ngx_radix_tree_t *tree6;
-#endif
-} ngx_http_geo_trees_t;
-
-
-typedef struct {
- ngx_http_geo_range_t **low;
- ngx_http_variable_value_t *default_value;
-} ngx_http_geo_high_ranges_t;
-
-
-typedef struct {
- ngx_str_node_t sn;
- ngx_http_variable_value_t *value;
- size_t offset;
-} ngx_http_geo_variable_value_node_t;
-
-
-typedef struct {
- ngx_http_variable_value_t *value;
- ngx_str_t *net;
- ngx_http_geo_high_ranges_t high;
- ngx_radix_tree_t *tree;
-#if (NGX_HAVE_INET6)
- ngx_radix_tree_t *tree6;
-#endif
- ngx_rbtree_t rbtree;
- ngx_rbtree_node_t sentinel;
- ngx_array_t *proxies;
- ngx_pool_t *pool;
- ngx_pool_t *temp_pool;
-
- size_t data_size;
-
- ngx_str_t include_name;
- ngx_uint_t includes;
- ngx_uint_t entries;
-
- unsigned ranges:1;
- unsigned outside_entries:1;
- unsigned allow_binary_include:1;
- unsigned binary_include:1;
- unsigned proxy_recursive:1;
-} ngx_http_geo_conf_ctx_t;
-
-
-typedef struct {
- union {
- ngx_http_geo_trees_t trees;
- ngx_http_geo_high_ranges_t high;
- } u;
-
- ngx_array_t *proxies;
- unsigned proxy_recursive:1;
-
- ngx_int_t index;
-} ngx_http_geo_ctx_t;
-
-
-static ngx_int_t ngx_http_geo_addr(ngx_http_request_t *r,
- ngx_http_geo_ctx_t *ctx, ngx_addr_t *addr);
-static ngx_int_t ngx_http_geo_real_addr(ngx_http_request_t *r,
- ngx_http_geo_ctx_t *ctx, ngx_addr_t *addr);
-static char *ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static char *ngx_http_geo(ngx_conf_t *cf, ngx_command_t *dummy, void *conf);
-static char *ngx_http_geo_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_str_t *value);
-static char *ngx_http_geo_add_range(ngx_conf_t *cf,
- ngx_http_geo_conf_ctx_t *ctx, in_addr_t start, in_addr_t end);
-static ngx_uint_t ngx_http_geo_delete_range(ngx_conf_t *cf,
- ngx_http_geo_conf_ctx_t *ctx, in_addr_t start, in_addr_t end);
-static char *ngx_http_geo_cidr(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_str_t *value);
-static char *ngx_http_geo_cidr_add(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_cidr_t *cidr, ngx_str_t *value, ngx_str_t *net);
-static ngx_http_variable_value_t *ngx_http_geo_value(ngx_conf_t *cf,
- ngx_http_geo_conf_ctx_t *ctx, ngx_str_t *value);
-static char *ngx_http_geo_add_proxy(ngx_conf_t *cf,
- ngx_http_geo_conf_ctx_t *ctx, ngx_cidr_t *cidr);
-static ngx_int_t ngx_http_geo_cidr_value(ngx_conf_t *cf, ngx_str_t *net,
- ngx_cidr_t *cidr);
-static char *ngx_http_geo_include(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_str_t *name);
-static ngx_int_t ngx_http_geo_include_binary_base(ngx_conf_t *cf,
- ngx_http_geo_conf_ctx_t *ctx, ngx_str_t *name);
-static void ngx_http_geo_create_binary_base(ngx_http_geo_conf_ctx_t *ctx);
-static u_char *ngx_http_geo_copy_values(u_char *base, u_char *p,
- ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel);
-
-
-static ngx_command_t ngx_http_geo_commands[] = {
-
- { ngx_string("geo"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE12,
- ngx_http_geo_block,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_geo_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_geo_module = {
- NGX_MODULE_V1,
- &ngx_http_geo_module_ctx, /* module context */
- ngx_http_geo_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-typedef struct {
- u_char GEORNG[6];
- u_char version;
- u_char ptr_size;
- uint32_t endianness;
- uint32_t crc32;
-} ngx_http_geo_header_t;
-
-
-static ngx_http_geo_header_t ngx_http_geo_header = {
- { 'G', 'E', 'O', 'R', 'N', 'G' }, 0, sizeof(void *), 0x12345678, 0
-};
-
-
-/* geo range is AF_INET only */
-
-static ngx_int_t
-ngx_http_geo_cidr_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_http_geo_ctx_t *ctx = (ngx_http_geo_ctx_t *) data;
-
- in_addr_t inaddr;
- ngx_addr_t addr;
- struct sockaddr_in *sin;
- ngx_http_variable_value_t *vv;
-#if (NGX_HAVE_INET6)
- u_char *p;
- struct in6_addr *inaddr6;
-#endif
-
- if (ngx_http_geo_addr(r, ctx, &addr) != NGX_OK) {
- vv = (ngx_http_variable_value_t *)
- ngx_radix32tree_find(ctx->u.trees.tree, INADDR_NONE);
- goto done;
- }
-
- switch (addr.sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- inaddr6 = &((struct sockaddr_in6 *) addr.sockaddr)->sin6_addr;
- p = inaddr6->s6_addr;
-
- if (IN6_IS_ADDR_V4MAPPED(inaddr6)) {
- inaddr = p[12] << 24;
- inaddr += p[13] << 16;
- inaddr += p[14] << 8;
- inaddr += p[15];
-
- vv = (ngx_http_variable_value_t *)
- ngx_radix32tree_find(ctx->u.trees.tree, inaddr);
-
- } else {
- vv = (ngx_http_variable_value_t *)
- ngx_radix128tree_find(ctx->u.trees.tree6, p);
- }
-
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) addr.sockaddr;
- inaddr = ntohl(sin->sin_addr.s_addr);
-
- vv = (ngx_http_variable_value_t *)
- ngx_radix32tree_find(ctx->u.trees.tree, inaddr);
-
- break;
- }
-
-done:
-
- *v = *vv;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http geo: %v", v);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_geo_range_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_http_geo_ctx_t *ctx = (ngx_http_geo_ctx_t *) data;
-
- in_addr_t inaddr;
- ngx_addr_t addr;
- ngx_uint_t n;
- struct sockaddr_in *sin;
- ngx_http_geo_range_t *range;
-#if (NGX_HAVE_INET6)
- u_char *p;
- struct in6_addr *inaddr6;
-#endif
-
- *v = *ctx->u.high.default_value;
-
- if (ngx_http_geo_addr(r, ctx, &addr) == NGX_OK) {
-
- switch (addr.sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- inaddr6 = &((struct sockaddr_in6 *) addr.sockaddr)->sin6_addr;
-
- if (IN6_IS_ADDR_V4MAPPED(inaddr6)) {
- p = inaddr6->s6_addr;
-
- inaddr = p[12] << 24;
- inaddr += p[13] << 16;
- inaddr += p[14] << 8;
- inaddr += p[15];
-
- } else {
- inaddr = INADDR_NONE;
- }
-
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) addr.sockaddr;
- inaddr = ntohl(sin->sin_addr.s_addr);
- break;
- }
-
- } else {
- inaddr = INADDR_NONE;
- }
-
- if (ctx->u.high.low) {
- range = ctx->u.high.low[inaddr >> 16];
-
- if (range) {
- n = inaddr & 0xffff;
- do {
- if (n >= (ngx_uint_t) range->start
- && n <= (ngx_uint_t) range->end)
- {
- *v = *range->value;
- break;
- }
- } while ((++range)->value);
- }
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http geo: %v", v);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_geo_addr(ngx_http_request_t *r, ngx_http_geo_ctx_t *ctx,
- ngx_addr_t *addr)
-{
- ngx_array_t *xfwd;
-
- if (ngx_http_geo_real_addr(r, ctx, addr) != NGX_OK) {
- return NGX_ERROR;
- }
-
- xfwd = &r->headers_in.x_forwarded_for;
-
- if (xfwd->nelts > 0 && ctx->proxies != NULL) {
- (void) ngx_http_get_forwarded_addr(r, addr, xfwd, NULL,
- ctx->proxies, ctx->proxy_recursive);
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_geo_real_addr(ngx_http_request_t *r, ngx_http_geo_ctx_t *ctx,
- ngx_addr_t *addr)
-{
- ngx_http_variable_value_t *v;
-
- if (ctx->index == -1) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http geo started: %V", &r->connection->addr_text);
-
- addr->sockaddr = r->connection->sockaddr;
- addr->socklen = r->connection->socklen;
- /* addr->name = r->connection->addr_text; */
-
- return NGX_OK;
- }
-
- v = ngx_http_get_flushed_variable(r, ctx->index);
-
- if (v == NULL || v->not_found) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http geo not found");
-
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http geo started: %v", v);
-
- if (ngx_parse_addr(r->pool, addr, v->data, v->len) == NGX_OK) {
- return NGX_OK;
- }
-
- return NGX_ERROR;
-}
-
-
-static char *
-ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *rv;
- size_t len;
- ngx_str_t *value, name;
- ngx_uint_t i;
- ngx_conf_t save;
- ngx_pool_t *pool;
- ngx_array_t *a;
- ngx_http_variable_t *var;
- ngx_http_geo_ctx_t *geo;
- ngx_http_geo_conf_ctx_t ctx;
-#if (NGX_HAVE_INET6)
- static struct in6_addr zero;
-#endif
-
- value = cf->args->elts;
-
- geo = ngx_palloc(cf->pool, sizeof(ngx_http_geo_ctx_t));
- if (geo == NULL) {
- return NGX_CONF_ERROR;
- }
-
- name = value[1];
-
- if (name.data[0] != '$') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"%V\"", &name);
- return NGX_CONF_ERROR;
- }
-
- name.len--;
- name.data++;
-
- if (cf->args->nelts == 3) {
-
- geo->index = ngx_http_get_variable_index(cf, &name);
- if (geo->index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- name = value[2];
-
- if (name.data[0] != '$') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"%V\"", &name);
- return NGX_CONF_ERROR;
- }
-
- name.len--;
- name.data++;
-
- } else {
- geo->index = -1;
- }
-
- var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
- if (var == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, cf->log);
- if (pool == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(&ctx, sizeof(ngx_http_geo_conf_ctx_t));
-
- ctx.temp_pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, cf->log);
- if (ctx.temp_pool == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_rbtree_init(&ctx.rbtree, &ctx.sentinel, ngx_str_rbtree_insert_value);
-
- ctx.pool = cf->pool;
- ctx.data_size = sizeof(ngx_http_geo_header_t)
- + sizeof(ngx_http_variable_value_t)
- + 0x10000 * sizeof(ngx_http_geo_range_t *);
- ctx.allow_binary_include = 1;
-
- save = *cf;
- cf->pool = pool;
- cf->ctx = &ctx;
- cf->handler = ngx_http_geo;
- cf->handler_conf = conf;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = save;
-
- geo->proxies = ctx.proxies;
- geo->proxy_recursive = ctx.proxy_recursive;
-
- if (ctx.ranges) {
-
- if (ctx.high.low && !ctx.binary_include) {
- for (i = 0; i < 0x10000; i++) {
- a = (ngx_array_t *) ctx.high.low[i];
-
- if (a == NULL || a->nelts == 0) {
- continue;
- }
-
- len = a->nelts * sizeof(ngx_http_geo_range_t);
-
- ctx.high.low[i] = ngx_palloc(cf->pool, len + sizeof(void *));
- if (ctx.high.low[i] == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memcpy(ctx.high.low[i], a->elts, len);
- ctx.high.low[i][a->nelts].value = NULL;
- ctx.data_size += len + sizeof(void *);
- }
-
- if (ctx.allow_binary_include
- && !ctx.outside_entries
- && ctx.entries > 100000
- && ctx.includes == 1)
- {
- ngx_http_geo_create_binary_base(&ctx);
- }
- }
-
- if (ctx.high.default_value == NULL) {
- ctx.high.default_value = &ngx_http_variable_null_value;
- }
-
- geo->u.high = ctx.high;
-
- var->get_handler = ngx_http_geo_range_variable;
- var->data = (uintptr_t) geo;
-
- ngx_destroy_pool(ctx.temp_pool);
- ngx_destroy_pool(pool);
-
- } else {
- if (ctx.tree == NULL) {
- ctx.tree = ngx_radix_tree_create(cf->pool, -1);
- if (ctx.tree == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- geo->u.trees.tree = ctx.tree;
-
-#if (NGX_HAVE_INET6)
- if (ctx.tree6 == NULL) {
- ctx.tree6 = ngx_radix_tree_create(cf->pool, -1);
- if (ctx.tree6 == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- geo->u.trees.tree6 = ctx.tree6;
-#endif
-
- var->get_handler = ngx_http_geo_cidr_variable;
- var->data = (uintptr_t) geo;
-
- ngx_destroy_pool(ctx.temp_pool);
- ngx_destroy_pool(pool);
-
- if (ngx_radix32tree_insert(ctx.tree, 0, 0,
- (uintptr_t) &ngx_http_variable_null_value)
- == NGX_ERROR)
- {
- return NGX_CONF_ERROR;
- }
-
- /* NGX_BUSY is okay (default was set explicitly) */
-
-#if (NGX_HAVE_INET6)
- if (ngx_radix128tree_insert(ctx.tree6, zero.s6_addr, zero.s6_addr,
- (uintptr_t) &ngx_http_variable_null_value)
- == NGX_ERROR)
- {
- return NGX_CONF_ERROR;
- }
-#endif
- }
-
- return rv;
-}
-
-
-static char *
-ngx_http_geo(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
-{
- char *rv;
- ngx_str_t *value;
- ngx_cidr_t cidr;
- ngx_http_geo_conf_ctx_t *ctx;
-
- ctx = cf->ctx;
-
- value = cf->args->elts;
-
- if (cf->args->nelts == 1) {
-
- if (ngx_strcmp(value[0].data, "ranges") == 0) {
-
- if (ctx->tree
-#if (NGX_HAVE_INET6)
- || ctx->tree6
-#endif
- )
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the \"ranges\" directive must be "
- "the first directive inside \"geo\" block");
- goto failed;
- }
-
- ctx->ranges = 1;
-
- rv = NGX_CONF_OK;
-
- goto done;
- }
-
- else if (ngx_strcmp(value[0].data, "proxy_recursive") == 0) {
- ctx->proxy_recursive = 1;
- rv = NGX_CONF_OK;
- goto done;
- }
- }
-
- if (cf->args->nelts != 2) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid number of the geo parameters");
- goto failed;
- }
-
- if (ngx_strcmp(value[0].data, "include") == 0) {
-
- rv = ngx_http_geo_include(cf, ctx, &value[1]);
-
- goto done;
-
- } else if (ngx_strcmp(value[0].data, "proxy") == 0) {
-
- if (ngx_http_geo_cidr_value(cf, &value[1], &cidr) != NGX_OK) {
- goto failed;
- }
-
- rv = ngx_http_geo_add_proxy(cf, ctx, &cidr);
-
- goto done;
- }
-
- if (ctx->ranges) {
- rv = ngx_http_geo_range(cf, ctx, value);
-
- } else {
- rv = ngx_http_geo_cidr(cf, ctx, value);
- }
-
-done:
-
- ngx_reset_pool(cf->pool);
-
- return rv;
-
-failed:
-
- ngx_reset_pool(cf->pool);
-
- return NGX_CONF_ERROR;
-}
-
-
-static char *
-ngx_http_geo_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_str_t *value)
-{
- u_char *p, *last;
- in_addr_t start, end;
- ngx_str_t *net;
- ngx_uint_t del;
-
- if (ngx_strcmp(value[0].data, "default") == 0) {
-
- if (ctx->high.default_value) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "duplicate default geo range value: \"%V\", old value: \"%v\"",
- &value[1], ctx->high.default_value);
- }
-
- ctx->high.default_value = ngx_http_geo_value(cf, ctx, &value[1]);
- if (ctx->high.default_value == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
- }
-
- if (ctx->binary_include) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "binary geo range base \"%s\" cannot be mixed with usual entries",
- ctx->include_name.data);
- return NGX_CONF_ERROR;
- }
-
- if (ctx->high.low == NULL) {
- ctx->high.low = ngx_pcalloc(ctx->pool,
- 0x10000 * sizeof(ngx_http_geo_range_t *));
- if (ctx->high.low == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- ctx->entries++;
- ctx->outside_entries = 1;
-
- if (ngx_strcmp(value[0].data, "delete") == 0) {
- net = &value[1];
- del = 1;
-
- } else {
- net = &value[0];
- del = 0;
- }
-
- last = net->data + net->len;
-
- p = ngx_strlchr(net->data, last, '-');
-
- if (p == NULL) {
- goto invalid;
- }
-
- start = ngx_inet_addr(net->data, p - net->data);
-
- if (start == INADDR_NONE) {
- goto invalid;
- }
-
- start = ntohl(start);
-
- p++;
-
- end = ngx_inet_addr(p, last - p);
-
- if (end == INADDR_NONE) {
- goto invalid;
- }
-
- end = ntohl(end);
-
- if (start > end) {
- goto invalid;
- }
-
- if (del) {
- if (ngx_http_geo_delete_range(cf, ctx, start, end)) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "no address range \"%V\" to delete", net);
- }
-
- return NGX_CONF_OK;
- }
-
- ctx->value = ngx_http_geo_value(cf, ctx, &value[1]);
-
- if (ctx->value == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->net = net;
-
- return ngx_http_geo_add_range(cf, ctx, start, end);
-
-invalid:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid range \"%V\"", net);
-
- return NGX_CONF_ERROR;
-}
-
-
-/* the add procedure is optimized to add a growing up sequence */
-
-static char *
-ngx_http_geo_add_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- in_addr_t start, in_addr_t end)
-{
- in_addr_t n;
- ngx_uint_t h, i, s, e;
- ngx_array_t *a;
- ngx_http_geo_range_t *range;
-
- for (n = start; n <= end; n = (n + 0x10000) & 0xffff0000) {
-
- h = n >> 16;
-
- if (n == start) {
- s = n & 0xffff;
- } else {
- s = 0;
- }
-
- if ((n | 0xffff) > end) {
- e = end & 0xffff;
-
- } else {
- e = 0xffff;
- }
-
- a = (ngx_array_t *) ctx->high.low[h];
-
- if (a == NULL) {
- a = ngx_array_create(ctx->temp_pool, 64,
- sizeof(ngx_http_geo_range_t));
- if (a == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->high.low[h] = (ngx_http_geo_range_t *) a;
- }
-
- i = a->nelts;
- range = a->elts;
-
- while (i) {
-
- i--;
-
- if (e < (ngx_uint_t) range[i].start) {
- continue;
- }
-
- if (s > (ngx_uint_t) range[i].end) {
-
- /* add after the range */
-
- range = ngx_array_push(a);
- if (range == NULL) {
- return NGX_CONF_ERROR;
- }
-
- range = a->elts;
-
- ngx_memmove(&range[i + 2], &range[i + 1],
- (a->nelts - 2 - i) * sizeof(ngx_http_geo_range_t));
-
- range[i + 1].start = (u_short) s;
- range[i + 1].end = (u_short) e;
- range[i + 1].value = ctx->value;
-
- goto next;
- }
-
- if (s == (ngx_uint_t) range[i].start
- && e == (ngx_uint_t) range[i].end)
- {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "duplicate range \"%V\", value: \"%v\", old value: \"%v\"",
- ctx->net, ctx->value, range[i].value);
-
- range[i].value = ctx->value;
-
- goto next;
- }
-
- if (s > (ngx_uint_t) range[i].start
- && e < (ngx_uint_t) range[i].end)
- {
- /* split the range and insert the new one */
-
- range = ngx_array_push(a);
- if (range == NULL) {
- return NGX_CONF_ERROR;
- }
-
- range = ngx_array_push(a);
- if (range == NULL) {
- return NGX_CONF_ERROR;
- }
-
- range = a->elts;
-
- ngx_memmove(&range[i + 3], &range[i + 1],
- (a->nelts - 3 - i) * sizeof(ngx_http_geo_range_t));
-
- range[i + 2].start = (u_short) (e + 1);
- range[i + 2].end = range[i].end;
- range[i + 2].value = range[i].value;
-
- range[i + 1].start = (u_short) s;
- range[i + 1].end = (u_short) e;
- range[i + 1].value = ctx->value;
-
- range[i].end = (u_short) (s - 1);
-
- goto next;
- }
-
- if (s == (ngx_uint_t) range[i].start
- && e < (ngx_uint_t) range[i].end)
- {
- /* shift the range start and insert the new range */
-
- range = ngx_array_push(a);
- if (range == NULL) {
- return NGX_CONF_ERROR;
- }
-
- range = a->elts;
-
- ngx_memmove(&range[i + 1], &range[i],
- (a->nelts - 1 - i) * sizeof(ngx_http_geo_range_t));
-
- range[i + 1].start = (u_short) (e + 1);
-
- range[i].start = (u_short) s;
- range[i].end = (u_short) e;
- range[i].value = ctx->value;
-
- goto next;
- }
-
- if (s > (ngx_uint_t) range[i].start
- && e == (ngx_uint_t) range[i].end)
- {
- /* shift the range end and insert the new range */
-
- range = ngx_array_push(a);
- if (range == NULL) {
- return NGX_CONF_ERROR;
- }
-
- range = a->elts;
-
- ngx_memmove(&range[i + 2], &range[i + 1],
- (a->nelts - 2 - i) * sizeof(ngx_http_geo_range_t));
-
- range[i + 1].start = (u_short) s;
- range[i + 1].end = (u_short) e;
- range[i + 1].value = ctx->value;
-
- range[i].end = (u_short) (s - 1);
-
- goto next;
- }
-
- s = (ngx_uint_t) range[i].start;
- e = (ngx_uint_t) range[i].end;
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "range \"%V\" overlaps \"%d.%d.%d.%d-%d.%d.%d.%d\"",
- ctx->net,
- h >> 8, h & 0xff, s >> 8, s & 0xff,
- h >> 8, h & 0xff, e >> 8, e & 0xff);
-
- return NGX_CONF_ERROR;
- }
-
- /* add the first range */
-
- range = ngx_array_push(a);
- if (range == NULL) {
- return NGX_CONF_ERROR;
- }
-
- range->start = (u_short) s;
- range->end = (u_short) e;
- range->value = ctx->value;
-
- next:
-
- continue;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_uint_t
-ngx_http_geo_delete_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- in_addr_t start, in_addr_t end)
-{
- in_addr_t n;
- ngx_uint_t h, i, s, e, warn;
- ngx_array_t *a;
- ngx_http_geo_range_t *range;
-
- warn = 0;
-
- for (n = start; n <= end; n += 0x10000) {
-
- h = n >> 16;
-
- if (n == start) {
- s = n & 0xffff;
- } else {
- s = 0;
- }
-
- if ((n | 0xffff) > end) {
- e = end & 0xffff;
-
- } else {
- e = 0xffff;
- }
-
- a = (ngx_array_t *) ctx->high.low[h];
-
- if (a == NULL) {
- warn = 1;
- continue;
- }
-
- range = a->elts;
- for (i = 0; i < a->nelts; i++) {
-
- if (s == (ngx_uint_t) range[i].start
- && e == (ngx_uint_t) range[i].end)
- {
- ngx_memmove(&range[i], &range[i + 1],
- (a->nelts - 1 - i) * sizeof(ngx_http_geo_range_t));
-
- a->nelts--;
-
- break;
- }
-
- if (s != (ngx_uint_t) range[i].start
- && e != (ngx_uint_t) range[i].end)
- {
- continue;
- }
-
- warn = 1;
- }
- }
-
- return warn;
-}
-
-
-static char *
-ngx_http_geo_cidr(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_str_t *value)
-{
- char *rv;
- ngx_int_t rc, del;
- ngx_str_t *net;
- ngx_cidr_t cidr;
-
- if (ctx->tree == NULL) {
- ctx->tree = ngx_radix_tree_create(ctx->pool, -1);
- if (ctx->tree == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
-#if (NGX_HAVE_INET6)
- if (ctx->tree6 == NULL) {
- ctx->tree6 = ngx_radix_tree_create(ctx->pool, -1);
- if (ctx->tree6 == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-#endif
-
- if (ngx_strcmp(value[0].data, "default") == 0) {
- cidr.family = AF_INET;
- cidr.u.in.addr = 0;
- cidr.u.in.mask = 0;
-
- rv = ngx_http_geo_cidr_add(cf, ctx, &cidr, &value[1], &value[0]);
-
- if (rv != NGX_CONF_OK) {
- return rv;
- }
-
-#if (NGX_HAVE_INET6)
- cidr.family = AF_INET6;
- ngx_memzero(&cidr.u.in6, sizeof(ngx_in6_cidr_t));
-
- rv = ngx_http_geo_cidr_add(cf, ctx, &cidr, &value[1], &value[0]);
-
- if (rv != NGX_CONF_OK) {
- return rv;
- }
-#endif
-
- return NGX_CONF_OK;
- }
-
- if (ngx_strcmp(value[0].data, "delete") == 0) {
- net = &value[1];
- del = 1;
-
- } else {
- net = &value[0];
- del = 0;
- }
-
- if (ngx_http_geo_cidr_value(cf, net, &cidr) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (cidr.family == AF_INET) {
- cidr.u.in.addr = ntohl(cidr.u.in.addr);
- cidr.u.in.mask = ntohl(cidr.u.in.mask);
- }
-
- if (del) {
- switch (cidr.family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- rc = ngx_radix128tree_delete(ctx->tree6,
- cidr.u.in6.addr.s6_addr,
- cidr.u.in6.mask.s6_addr);
- break;
-#endif
-
- default: /* AF_INET */
- rc = ngx_radix32tree_delete(ctx->tree, cidr.u.in.addr,
- cidr.u.in.mask);
- break;
- }
-
- if (rc != NGX_OK) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "no network \"%V\" to delete", net);
- }
-
- return NGX_CONF_OK;
- }
-
- return ngx_http_geo_cidr_add(cf, ctx, &cidr, &value[1], net);
-}
-
-
-static char *
-ngx_http_geo_cidr_add(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_cidr_t *cidr, ngx_str_t *value, ngx_str_t *net)
-{
- ngx_int_t rc;
- ngx_http_variable_value_t *val, *old;
-
- val = ngx_http_geo_value(cf, ctx, value);
-
- if (val == NULL) {
- return NGX_CONF_ERROR;
- }
-
- switch (cidr->family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- rc = ngx_radix128tree_insert(ctx->tree6, cidr->u.in6.addr.s6_addr,
- cidr->u.in6.mask.s6_addr,
- (uintptr_t) val);
-
- if (rc == NGX_OK) {
- return NGX_CONF_OK;
- }
-
- if (rc == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- /* rc == NGX_BUSY */
-
- old = (ngx_http_variable_value_t *)
- ngx_radix128tree_find(ctx->tree6,
- cidr->u.in6.addr.s6_addr);
-
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "duplicate network \"%V\", value: \"%v\", old value: \"%v\"",
- net, val, old);
-
- rc = ngx_radix128tree_delete(ctx->tree6,
- cidr->u.in6.addr.s6_addr,
- cidr->u.in6.mask.s6_addr);
-
- if (rc == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid radix tree");
- return NGX_CONF_ERROR;
- }
-
- rc = ngx_radix128tree_insert(ctx->tree6, cidr->u.in6.addr.s6_addr,
- cidr->u.in6.mask.s6_addr,
- (uintptr_t) val);
-
- break;
-#endif
-
- default: /* AF_INET */
- rc = ngx_radix32tree_insert(ctx->tree, cidr->u.in.addr,
- cidr->u.in.mask, (uintptr_t) val);
-
- if (rc == NGX_OK) {
- return NGX_CONF_OK;
- }
-
- if (rc == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- /* rc == NGX_BUSY */
-
- old = (ngx_http_variable_value_t *)
- ngx_radix32tree_find(ctx->tree, cidr->u.in.addr);
-
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "duplicate network \"%V\", value: \"%v\", old value: \"%v\"",
- net, val, old);
-
- rc = ngx_radix32tree_delete(ctx->tree,
- cidr->u.in.addr, cidr->u.in.mask);
-
- if (rc == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid radix tree");
- return NGX_CONF_ERROR;
- }
-
- rc = ngx_radix32tree_insert(ctx->tree, cidr->u.in.addr,
- cidr->u.in.mask, (uintptr_t) val);
-
- break;
- }
-
- if (rc == NGX_OK) {
- return NGX_CONF_OK;
- }
-
- return NGX_CONF_ERROR;
-}
-
-
-static ngx_http_variable_value_t *
-ngx_http_geo_value(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_str_t *value)
-{
- uint32_t hash;
- ngx_http_variable_value_t *val;
- ngx_http_geo_variable_value_node_t *gvvn;
-
- hash = ngx_crc32_long(value->data, value->len);
-
- gvvn = (ngx_http_geo_variable_value_node_t *)
- ngx_str_rbtree_lookup(&ctx->rbtree, value, hash);
-
- if (gvvn) {
- return gvvn->value;
- }
-
- val = ngx_palloc(ctx->pool, sizeof(ngx_http_variable_value_t));
- if (val == NULL) {
- return NULL;
- }
-
- val->len = value->len;
- val->data = ngx_pstrdup(ctx->pool, value);
- if (val->data == NULL) {
- return NULL;
- }
-
- val->valid = 1;
- val->no_cacheable = 0;
- val->not_found = 0;
-
- gvvn = ngx_palloc(ctx->temp_pool,
- sizeof(ngx_http_geo_variable_value_node_t));
- if (gvvn == NULL) {
- return NULL;
- }
-
- gvvn->sn.node.key = hash;
- gvvn->sn.str.len = val->len;
- gvvn->sn.str.data = val->data;
- gvvn->value = val;
- gvvn->offset = 0;
-
- ngx_rbtree_insert(&ctx->rbtree, &gvvn->sn.node);
-
- ctx->data_size += ngx_align(sizeof(ngx_http_variable_value_t) + value->len,
- sizeof(void *));
-
- return val;
-}
-
-
-static char *
-ngx_http_geo_add_proxy(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_cidr_t *cidr)
-{
- ngx_cidr_t *c;
-
- if (ctx->proxies == NULL) {
- ctx->proxies = ngx_array_create(ctx->pool, 4, sizeof(ngx_cidr_t));
- if (ctx->proxies == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- c = ngx_array_push(ctx->proxies);
- if (c == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *c = *cidr;
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_geo_cidr_value(ngx_conf_t *cf, ngx_str_t *net, ngx_cidr_t *cidr)
-{
- ngx_int_t rc;
-
- if (ngx_strcmp(net->data, "255.255.255.255") == 0) {
- cidr->family = AF_INET;
- cidr->u.in.addr = 0xffffffff;
- cidr->u.in.mask = 0xffffffff;
-
- return NGX_OK;
- }
-
- rc = ngx_ptocidr(net, cidr);
-
- if (rc == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid network \"%V\"", net);
- return NGX_ERROR;
- }
-
- if (rc == NGX_DONE) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "low address bits of %V are meaningless", net);
- }
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_geo_include(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_str_t *name)
-{
- char *rv;
- ngx_str_t file;
-
- file.len = name->len + 4;
- file.data = ngx_pnalloc(ctx->temp_pool, name->len + 5);
- if (file.data == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_sprintf(file.data, "%V.bin%Z", name);
-
- if (ngx_conf_full_name(cf->cycle, &file, 1) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (ctx->ranges) {
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);
-
- switch (ngx_http_geo_include_binary_base(cf, ctx, &file)) {
- case NGX_OK:
- return NGX_CONF_OK;
- case NGX_ERROR:
- return NGX_CONF_ERROR;
- default:
- break;
- }
- }
-
- file.len -= 4;
- file.data[file.len] = '\0';
-
- ctx->include_name = file;
-
- if (ctx->outside_entries) {
- ctx->allow_binary_include = 0;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cf->log, 0, "include %s", file.data);
-
- rv = ngx_conf_parse(cf, &file);
-
- ctx->includes++;
- ctx->outside_entries = 0;
-
- return rv;
-}
-
-
-static ngx_int_t
-ngx_http_geo_include_binary_base(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
- ngx_str_t *name)
-{
- u_char *base, ch;
- time_t mtime;
- size_t size, len;
- ssize_t n;
- uint32_t crc32;
- ngx_err_t err;
- ngx_int_t rc;
- ngx_uint_t i;
- ngx_file_t file;
- ngx_file_info_t fi;
- ngx_http_geo_range_t *range, **ranges;
- ngx_http_geo_header_t *header;
- ngx_http_variable_value_t *vv;
-
- ngx_memzero(&file, sizeof(ngx_file_t));
- file.name = *name;
- file.log = cf->log;
-
- file.fd = ngx_open_file(name->data, NGX_FILE_RDONLY, 0, 0);
- if (file.fd == NGX_INVALID_FILE) {
- err = ngx_errno;
- if (err != NGX_ENOENT) {
- ngx_conf_log_error(NGX_LOG_CRIT, cf, err,
- ngx_open_file_n " \"%s\" failed", name->data);
- }
- return NGX_DECLINED;
- }
-
- if (ctx->outside_entries) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "binary geo range base \"%s\" cannot be mixed with usual entries",
- name->data);
- rc = NGX_ERROR;
- goto done;
- }
-
- if (ctx->binary_include) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "second binary geo range base \"%s\" cannot be mixed with \"%s\"",
- name->data, ctx->include_name.data);
- rc = NGX_ERROR;
- goto done;
- }
-
- if (ngx_fd_info(file.fd, &fi) == NGX_FILE_ERROR) {
- ngx_conf_log_error(NGX_LOG_CRIT, cf, ngx_errno,
- ngx_fd_info_n " \"%s\" failed", name->data);
- goto failed;
- }
-
- size = (size_t) ngx_file_size(&fi);
- mtime = ngx_file_mtime(&fi);
-
- ch = name->data[name->len - 4];
- name->data[name->len - 4] = '\0';
-
- if (ngx_file_info(name->data, &fi) == NGX_FILE_ERROR) {
- ngx_conf_log_error(NGX_LOG_CRIT, cf, ngx_errno,
- ngx_file_info_n " \"%s\" failed", name->data);
- goto failed;
- }
-
- name->data[name->len - 4] = ch;
-
- if (mtime < ngx_file_mtime(&fi)) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "stale binary geo range base \"%s\"", name->data);
- goto failed;
- }
-
- base = ngx_palloc(ctx->pool, size);
- if (base == NULL) {
- goto failed;
- }
-
- n = ngx_read_file(&file, base, size, 0);
-
- if (n == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_CRIT, cf, ngx_errno,
- ngx_read_file_n " \"%s\" failed", name->data);
- goto failed;
- }
-
- if ((size_t) n != size) {
- ngx_conf_log_error(NGX_LOG_CRIT, cf, 0,
- ngx_read_file_n " \"%s\" returned only %z bytes instead of %z",
- name->data, n, size);
- goto failed;
- }
-
- header = (ngx_http_geo_header_t *) base;
-
- if (size < 16 || ngx_memcmp(&ngx_http_geo_header, header, 12) != 0) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "incompatible binary geo range base \"%s\"", name->data);
- goto failed;
- }
-
- ngx_crc32_init(crc32);
-
- vv = (ngx_http_variable_value_t *) (base + sizeof(ngx_http_geo_header_t));
-
- while (vv->data) {
- len = ngx_align(sizeof(ngx_http_variable_value_t) + vv->len,
- sizeof(void *));
- ngx_crc32_update(&crc32, (u_char *) vv, len);
- vv->data += (size_t) base;
- vv = (ngx_http_variable_value_t *) ((u_char *) vv + len);
- }
- ngx_crc32_update(&crc32, (u_char *) vv, sizeof(ngx_http_variable_value_t));
- vv++;
-
- ranges = (ngx_http_geo_range_t **) vv;
-
- for (i = 0; i < 0x10000; i++) {
- ngx_crc32_update(&crc32, (u_char *) &ranges[i], sizeof(void *));
- if (ranges[i]) {
- ranges[i] = (ngx_http_geo_range_t *)
- ((u_char *) ranges[i] + (size_t) base);
- }
- }
-
- range = (ngx_http_geo_range_t *) &ranges[0x10000];
-
- while ((u_char *) range < base + size) {
- while (range->value) {
- ngx_crc32_update(&crc32, (u_char *) range,
- sizeof(ngx_http_geo_range_t));
- range->value = (ngx_http_variable_value_t *)
- ((u_char *) range->value + (size_t) base);
- range++;
- }
- ngx_crc32_update(&crc32, (u_char *) range, sizeof(void *));
- range = (ngx_http_geo_range_t *) ((u_char *) range + sizeof(void *));
- }
-
- ngx_crc32_final(crc32);
-
- if (crc32 != header->crc32) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "CRC32 mismatch in binary geo range base \"%s\"", name->data);
- goto failed;
- }
-
- ngx_conf_log_error(NGX_LOG_NOTICE, cf, 0,
- "using binary geo range base \"%s\"", name->data);
-
- ctx->include_name = *name;
- ctx->binary_include = 1;
- ctx->high.low = ranges;
- rc = NGX_OK;
-
- goto done;
-
-failed:
-
- rc = NGX_DECLINED;
-
-done:
-
- if (ngx_close_file(file.fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", name->data);
- }
-
- return rc;
-}
-
-
-static void
-ngx_http_geo_create_binary_base(ngx_http_geo_conf_ctx_t *ctx)
-{
- u_char *p;
- uint32_t hash;
- ngx_str_t s;
- ngx_uint_t i;
- ngx_file_mapping_t fm;
- ngx_http_geo_range_t *r, *range, **ranges;
- ngx_http_geo_header_t *header;
- ngx_http_geo_variable_value_node_t *gvvn;
-
- fm.name = ngx_pnalloc(ctx->temp_pool, ctx->include_name.len + 5);
- if (fm.name == NULL) {
- return;
- }
-
- ngx_sprintf(fm.name, "%V.bin%Z", &ctx->include_name);
-
- fm.size = ctx->data_size;
- fm.log = ctx->pool->log;
-
- ngx_log_error(NGX_LOG_NOTICE, fm.log, 0,
- "creating binary geo range base \"%s\"", fm.name);
-
- if (ngx_create_file_mapping(&fm) != NGX_OK) {
- return;
- }
-
- p = ngx_cpymem(fm.addr, &ngx_http_geo_header,
- sizeof(ngx_http_geo_header_t));
-
- p = ngx_http_geo_copy_values(fm.addr, p, ctx->rbtree.root,
- ctx->rbtree.sentinel);
-
- p += sizeof(ngx_http_variable_value_t);
-
- ranges = (ngx_http_geo_range_t **) p;
-
- p += 0x10000 * sizeof(ngx_http_geo_range_t *);
-
- for (i = 0; i < 0x10000; i++) {
- r = ctx->high.low[i];
- if (r == NULL) {
- continue;
- }
-
- range = (ngx_http_geo_range_t *) p;
- ranges[i] = (ngx_http_geo_range_t *) (p - (u_char *) fm.addr);
-
- do {
- s.len = r->value->len;
- s.data = r->value->data;
- hash = ngx_crc32_long(s.data, s.len);
- gvvn = (ngx_http_geo_variable_value_node_t *)
- ngx_str_rbtree_lookup(&ctx->rbtree, &s, hash);
-
- range->value = (ngx_http_variable_value_t *) gvvn->offset;
- range->start = r->start;
- range->end = r->end;
- range++;
-
- } while ((++r)->value);
-
- range->value = NULL;
-
- p = (u_char *) range + sizeof(void *);
- }
-
- header = fm.addr;
- header->crc32 = ngx_crc32_long((u_char *) fm.addr
- + sizeof(ngx_http_geo_header_t),
- fm.size - sizeof(ngx_http_geo_header_t));
-
- ngx_close_file_mapping(&fm);
-}
-
-
-static u_char *
-ngx_http_geo_copy_values(u_char *base, u_char *p, ngx_rbtree_node_t *node,
- ngx_rbtree_node_t *sentinel)
-{
- ngx_http_variable_value_t *vv;
- ngx_http_geo_variable_value_node_t *gvvn;
-
- if (node == sentinel) {
- return p;
- }
-
- gvvn = (ngx_http_geo_variable_value_node_t *) node;
- gvvn->offset = p - base;
-
- vv = (ngx_http_variable_value_t *) p;
- *vv = *gvvn->value;
- p += sizeof(ngx_http_variable_value_t);
- vv->data = (u_char *) (p - base);
-
- p = ngx_cpymem(p, gvvn->sn.str.data, gvvn->sn.str.len);
-
- p = ngx_align_ptr(p, sizeof(void *));
-
- p = ngx_http_geo_copy_values(base, p, node->left, sentinel);
-
- return ngx_http_geo_copy_values(base, p, node->right, sentinel);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geoip_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geoip_module.c
deleted file mode 100644
index 8e151aa8f20..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_geoip_module.c
+++ /dev/null
@@ -1,925 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-#include <GeoIP.h>
-#include <GeoIPCity.h>
-
-
-#define NGX_GEOIP_COUNTRY_CODE 0
-#define NGX_GEOIP_COUNTRY_CODE3 1
-#define NGX_GEOIP_COUNTRY_NAME 2
-
-
-typedef struct {
- GeoIP *country;
- GeoIP *org;
- GeoIP *city;
- ngx_array_t *proxies; /* array of ngx_cidr_t */
- ngx_flag_t proxy_recursive;
-#if (NGX_HAVE_GEOIP_V6)
- unsigned country_v6:1;
- unsigned org_v6:1;
- unsigned city_v6:1;
-#endif
-} ngx_http_geoip_conf_t;
-
-
-typedef struct {
- ngx_str_t *name;
- uintptr_t data;
-} ngx_http_geoip_var_t;
-
-
-typedef const char *(*ngx_http_geoip_variable_handler_pt)(GeoIP *,
- u_long addr);
-
-
-ngx_http_geoip_variable_handler_pt ngx_http_geoip_country_functions[] = {
- GeoIP_country_code_by_ipnum,
- GeoIP_country_code3_by_ipnum,
- GeoIP_country_name_by_ipnum,
-};
-
-
-#if (NGX_HAVE_GEOIP_V6)
-
-typedef const char *(*ngx_http_geoip_variable_handler_v6_pt)(GeoIP *,
- geoipv6_t addr);
-
-
-ngx_http_geoip_variable_handler_v6_pt ngx_http_geoip_country_v6_functions[] = {
- GeoIP_country_code_by_ipnum_v6,
- GeoIP_country_code3_by_ipnum_v6,
- GeoIP_country_name_by_ipnum_v6,
-};
-
-#endif
-
-
-static ngx_int_t ngx_http_geoip_country_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_geoip_org_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_geoip_city_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_geoip_region_name_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_geoip_city_float_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_geoip_city_int_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static GeoIPRecord *ngx_http_geoip_get_city_record(ngx_http_request_t *r);
-
-static ngx_int_t ngx_http_geoip_add_variables(ngx_conf_t *cf);
-static void *ngx_http_geoip_create_conf(ngx_conf_t *cf);
-static char *ngx_http_geoip_init_conf(ngx_conf_t *cf, void *conf);
-static char *ngx_http_geoip_country(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_geoip_org(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_geoip_city(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_geoip_proxy(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static ngx_int_t ngx_http_geoip_cidr_value(ngx_conf_t *cf, ngx_str_t *net,
- ngx_cidr_t *cidr);
-static void ngx_http_geoip_cleanup(void *data);
-
-
-static ngx_command_t ngx_http_geoip_commands[] = {
-
- { ngx_string("geoip_country"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE12,
- ngx_http_geoip_country,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("geoip_org"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE12,
- ngx_http_geoip_org,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("geoip_city"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE12,
- ngx_http_geoip_city,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("geoip_proxy"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_http_geoip_proxy,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("geoip_proxy_recursive"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_geoip_conf_t, proxy_recursive),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_geoip_module_ctx = {
- ngx_http_geoip_add_variables, /* preconfiguration */
- NULL, /* postconfiguration */
-
- ngx_http_geoip_create_conf, /* create main configuration */
- ngx_http_geoip_init_conf, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_geoip_module = {
- NGX_MODULE_V1,
- &ngx_http_geoip_module_ctx, /* module context */
- ngx_http_geoip_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_variable_t ngx_http_geoip_vars[] = {
-
- { ngx_string("geoip_country_code"), NULL,
- ngx_http_geoip_country_variable,
- NGX_GEOIP_COUNTRY_CODE, 0, 0 },
-
- { ngx_string("geoip_country_code3"), NULL,
- ngx_http_geoip_country_variable,
- NGX_GEOIP_COUNTRY_CODE3, 0, 0 },
-
- { ngx_string("geoip_country_name"), NULL,
- ngx_http_geoip_country_variable,
- NGX_GEOIP_COUNTRY_NAME, 0, 0 },
-
- { ngx_string("geoip_org"), NULL,
- ngx_http_geoip_org_variable,
- 0, 0, 0 },
-
- { ngx_string("geoip_city_continent_code"), NULL,
- ngx_http_geoip_city_variable,
- offsetof(GeoIPRecord, continent_code), 0, 0 },
-
- { ngx_string("geoip_city_country_code"), NULL,
- ngx_http_geoip_city_variable,
- offsetof(GeoIPRecord, country_code), 0, 0 },
-
- { ngx_string("geoip_city_country_code3"), NULL,
- ngx_http_geoip_city_variable,
- offsetof(GeoIPRecord, country_code3), 0, 0 },
-
- { ngx_string("geoip_city_country_name"), NULL,
- ngx_http_geoip_city_variable,
- offsetof(GeoIPRecord, country_name), 0, 0 },
-
- { ngx_string("geoip_region"), NULL,
- ngx_http_geoip_city_variable,
- offsetof(GeoIPRecord, region), 0, 0 },
-
- { ngx_string("geoip_region_name"), NULL,
- ngx_http_geoip_region_name_variable,
- 0, 0, 0 },
-
- { ngx_string("geoip_city"), NULL,
- ngx_http_geoip_city_variable,
- offsetof(GeoIPRecord, city), 0, 0 },
-
- { ngx_string("geoip_postal_code"), NULL,
- ngx_http_geoip_city_variable,
- offsetof(GeoIPRecord, postal_code), 0, 0 },
-
- { ngx_string("geoip_latitude"), NULL,
- ngx_http_geoip_city_float_variable,
- offsetof(GeoIPRecord, latitude), 0, 0 },
-
- { ngx_string("geoip_longitude"), NULL,
- ngx_http_geoip_city_float_variable,
- offsetof(GeoIPRecord, longitude), 0, 0 },
-
- { ngx_string("geoip_dma_code"), NULL,
- ngx_http_geoip_city_int_variable,
- offsetof(GeoIPRecord, dma_code), 0, 0 },
-
- { ngx_string("geoip_area_code"), NULL,
- ngx_http_geoip_city_int_variable,
- offsetof(GeoIPRecord, area_code), 0, 0 },
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-static u_long
-ngx_http_geoip_addr(ngx_http_request_t *r, ngx_http_geoip_conf_t *gcf)
-{
- ngx_addr_t addr;
- ngx_array_t *xfwd;
- struct sockaddr_in *sin;
-
- addr.sockaddr = r->connection->sockaddr;
- addr.socklen = r->connection->socklen;
- /* addr.name = r->connection->addr_text; */
-
- xfwd = &r->headers_in.x_forwarded_for;
-
- if (xfwd->nelts > 0 && gcf->proxies != NULL) {
- (void) ngx_http_get_forwarded_addr(r, &addr, xfwd, NULL,
- gcf->proxies, gcf->proxy_recursive);
- }
-
-#if (NGX_HAVE_INET6)
-
- if (addr.sockaddr->sa_family == AF_INET6) {
- u_char *p;
- in_addr_t inaddr;
- struct in6_addr *inaddr6;
-
- inaddr6 = &((struct sockaddr_in6 *) addr.sockaddr)->sin6_addr;
-
- if (IN6_IS_ADDR_V4MAPPED(inaddr6)) {
- p = inaddr6->s6_addr;
-
- inaddr = p[12] << 24;
- inaddr += p[13] << 16;
- inaddr += p[14] << 8;
- inaddr += p[15];
-
- return inaddr;
- }
- }
-
-#endif
-
- if (addr.sockaddr->sa_family != AF_INET) {
- return INADDR_NONE;
- }
-
- sin = (struct sockaddr_in *) addr.sockaddr;
- return ntohl(sin->sin_addr.s_addr);
-}
-
-
-#if (NGX_HAVE_GEOIP_V6)
-
-static geoipv6_t
-ngx_http_geoip_addr_v6(ngx_http_request_t *r, ngx_http_geoip_conf_t *gcf)
-{
- ngx_addr_t addr;
- ngx_array_t *xfwd;
- in_addr_t addr4;
- struct in6_addr addr6;
- struct sockaddr_in *sin;
- struct sockaddr_in6 *sin6;
-
- addr.sockaddr = r->connection->sockaddr;
- addr.socklen = r->connection->socklen;
- /* addr.name = r->connection->addr_text; */
-
- xfwd = &r->headers_in.x_forwarded_for;
-
- if (xfwd->nelts > 0 && gcf->proxies != NULL) {
- (void) ngx_http_get_forwarded_addr(r, &addr, xfwd, NULL,
- gcf->proxies, gcf->proxy_recursive);
- }
-
- switch (addr.sockaddr->sa_family) {
-
- case AF_INET:
- /* Produce IPv4-mapped IPv6 address. */
- sin = (struct sockaddr_in *) addr.sockaddr;
- addr4 = ntohl(sin->sin_addr.s_addr);
-
- ngx_memzero(&addr6, sizeof(struct in6_addr));
- addr6.s6_addr[10] = 0xff;
- addr6.s6_addr[11] = 0xff;
- addr6.s6_addr[12] = addr4 >> 24;
- addr6.s6_addr[13] = addr4 >> 16;
- addr6.s6_addr[14] = addr4 >> 8;
- addr6.s6_addr[15] = addr4;
- return addr6;
-
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) addr.sockaddr;
- return sin6->sin6_addr;
-
- default:
- return in6addr_any;
- }
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_geoip_country_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_geoip_variable_handler_pt handler =
- ngx_http_geoip_country_functions[data];
-#if (NGX_HAVE_GEOIP_V6)
- ngx_http_geoip_variable_handler_v6_pt handler_v6 =
- ngx_http_geoip_country_v6_functions[data];
-#endif
-
- const char *val;
- ngx_http_geoip_conf_t *gcf;
-
- gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module);
-
- if (gcf->country == NULL) {
- goto not_found;
- }
-
-#if (NGX_HAVE_GEOIP_V6)
- val = gcf->country_v6
- ? handler_v6(gcf->country, ngx_http_geoip_addr_v6(r, gcf))
- : handler(gcf->country, ngx_http_geoip_addr(r, gcf));
-#else
- val = handler(gcf->country, ngx_http_geoip_addr(r, gcf));
-#endif
-
- if (val == NULL) {
- goto not_found;
- }
-
- v->len = ngx_strlen(val);
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) val;
-
- return NGX_OK;
-
-not_found:
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_geoip_org_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- size_t len;
- char *val;
- ngx_http_geoip_conf_t *gcf;
-
- gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module);
-
- if (gcf->org == NULL) {
- goto not_found;
- }
-
-#if (NGX_HAVE_GEOIP_V6)
- val = gcf->org_v6
- ? GeoIP_name_by_ipnum_v6(gcf->org,
- ngx_http_geoip_addr_v6(r, gcf))
- : GeoIP_name_by_ipnum(gcf->org,
- ngx_http_geoip_addr(r, gcf));
-#else
- val = GeoIP_name_by_ipnum(gcf->org, ngx_http_geoip_addr(r, gcf));
-#endif
-
- if (val == NULL) {
- goto not_found;
- }
-
- len = ngx_strlen(val);
- v->data = ngx_pnalloc(r->pool, len);
- if (v->data == NULL) {
- ngx_free(val);
- return NGX_ERROR;
- }
-
- ngx_memcpy(v->data, val, len);
-
- v->len = len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- ngx_free(val);
-
- return NGX_OK;
-
-not_found:
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_geoip_city_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- char *val;
- size_t len;
- GeoIPRecord *gr;
-
- gr = ngx_http_geoip_get_city_record(r);
- if (gr == NULL) {
- goto not_found;
- }
-
- val = *(char **) ((char *) gr + data);
- if (val == NULL) {
- goto no_value;
- }
-
- len = ngx_strlen(val);
- v->data = ngx_pnalloc(r->pool, len);
- if (v->data == NULL) {
- GeoIPRecord_delete(gr);
- return NGX_ERROR;
- }
-
- ngx_memcpy(v->data, val, len);
-
- v->len = len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- GeoIPRecord_delete(gr);
-
- return NGX_OK;
-
-no_value:
-
- GeoIPRecord_delete(gr);
-
-not_found:
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_geoip_region_name_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- size_t len;
- const char *val;
- GeoIPRecord *gr;
-
- gr = ngx_http_geoip_get_city_record(r);
- if (gr == NULL) {
- goto not_found;
- }
-
- val = GeoIP_region_name_by_code(gr->country_code, gr->region);
-
- GeoIPRecord_delete(gr);
-
- if (val == NULL) {
- goto not_found;
- }
-
- len = ngx_strlen(val);
- v->data = ngx_pnalloc(r->pool, len);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(v->data, val, len);
-
- v->len = len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
-
-not_found:
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_geoip_city_float_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- float val;
- GeoIPRecord *gr;
-
- gr = ngx_http_geoip_get_city_record(r);
- if (gr == NULL) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->data = ngx_pnalloc(r->pool, NGX_INT64_LEN + 5);
- if (v->data == NULL) {
- GeoIPRecord_delete(gr);
- return NGX_ERROR;
- }
-
- val = *(float *) ((char *) gr + data);
-
- v->len = ngx_sprintf(v->data, "%.4f", val) - v->data;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- GeoIPRecord_delete(gr);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_geoip_city_int_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- int val;
- GeoIPRecord *gr;
-
- gr = ngx_http_geoip_get_city_record(r);
- if (gr == NULL) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->data = ngx_pnalloc(r->pool, NGX_INT64_LEN);
- if (v->data == NULL) {
- GeoIPRecord_delete(gr);
- return NGX_ERROR;
- }
-
- val = *(int *) ((char *) gr + data);
-
- v->len = ngx_sprintf(v->data, "%d", val) - v->data;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- GeoIPRecord_delete(gr);
-
- return NGX_OK;
-}
-
-
-static GeoIPRecord *
-ngx_http_geoip_get_city_record(ngx_http_request_t *r)
-{
- ngx_http_geoip_conf_t *gcf;
-
- gcf = ngx_http_get_module_main_conf(r, ngx_http_geoip_module);
-
- if (gcf->city) {
-#if (NGX_HAVE_GEOIP_V6)
- return gcf->city_v6
- ? GeoIP_record_by_ipnum_v6(gcf->city,
- ngx_http_geoip_addr_v6(r, gcf))
- : GeoIP_record_by_ipnum(gcf->city,
- ngx_http_geoip_addr(r, gcf));
-#else
- return GeoIP_record_by_ipnum(gcf->city, ngx_http_geoip_addr(r, gcf));
-#endif
- }
-
- return NULL;
-}
-
-
-static ngx_int_t
-ngx_http_geoip_add_variables(ngx_conf_t *cf)
-{
- ngx_http_variable_t *var, *v;
-
- for (v = ngx_http_geoip_vars; v->name.len; v++) {
- var = ngx_http_add_variable(cf, &v->name, v->flags);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = v->get_handler;
- var->data = v->data;
- }
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_geoip_create_conf(ngx_conf_t *cf)
-{
- ngx_pool_cleanup_t *cln;
- ngx_http_geoip_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_geoip_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->proxy_recursive = NGX_CONF_UNSET;
-
- cln = ngx_pool_cleanup_add(cf->pool, 0);
- if (cln == NULL) {
- return NULL;
- }
-
- cln->handler = ngx_http_geoip_cleanup;
- cln->data = conf;
-
- return conf;
-}
-
-
-static char *
-ngx_http_geoip_init_conf(ngx_conf_t *cf, void *conf)
-{
- ngx_http_geoip_conf_t *gcf = conf;
-
- ngx_conf_init_value(gcf->proxy_recursive, 0);
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_geoip_country(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_geoip_conf_t *gcf = conf;
-
- ngx_str_t *value;
-
- if (gcf->country) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- gcf->country = GeoIP_open((char *) value[1].data, GEOIP_MEMORY_CACHE);
-
- if (gcf->country == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "GeoIP_open(\"%V\") failed", &value[1]);
-
- return NGX_CONF_ERROR;
- }
-
- if (cf->args->nelts == 3) {
- if (ngx_strcmp(value[2].data, "utf8") == 0) {
- GeoIP_set_charset(gcf->country, GEOIP_CHARSET_UTF8);
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[2]);
- return NGX_CONF_ERROR;
- }
- }
-
- switch (gcf->country->databaseType) {
-
- case GEOIP_COUNTRY_EDITION:
-
- return NGX_CONF_OK;
-
-#if (NGX_HAVE_GEOIP_V6)
- case GEOIP_COUNTRY_EDITION_V6:
-
- gcf->country_v6 = 1;
- return NGX_CONF_OK;
-#endif
-
- default:
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid GeoIP database \"%V\" type:%d",
- &value[1], gcf->country->databaseType);
- return NGX_CONF_ERROR;
- }
-}
-
-
-static char *
-ngx_http_geoip_org(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_geoip_conf_t *gcf = conf;
-
- ngx_str_t *value;
-
- if (gcf->org) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- gcf->org = GeoIP_open((char *) value[1].data, GEOIP_MEMORY_CACHE);
-
- if (gcf->org == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "GeoIP_open(\"%V\") failed", &value[1]);
-
- return NGX_CONF_ERROR;
- }
-
- if (cf->args->nelts == 3) {
- if (ngx_strcmp(value[2].data, "utf8") == 0) {
- GeoIP_set_charset(gcf->org, GEOIP_CHARSET_UTF8);
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[2]);
- return NGX_CONF_ERROR;
- }
- }
-
- switch (gcf->org->databaseType) {
-
- case GEOIP_ISP_EDITION:
- case GEOIP_ORG_EDITION:
- case GEOIP_DOMAIN_EDITION:
- case GEOIP_ASNUM_EDITION:
-
- return NGX_CONF_OK;
-
-#if (NGX_HAVE_GEOIP_V6)
- case GEOIP_ISP_EDITION_V6:
- case GEOIP_ORG_EDITION_V6:
- case GEOIP_DOMAIN_EDITION_V6:
- case GEOIP_ASNUM_EDITION_V6:
-
- gcf->org_v6 = 1;
- return NGX_CONF_OK;
-#endif
-
- default:
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid GeoIP database \"%V\" type:%d",
- &value[1], gcf->org->databaseType);
- return NGX_CONF_ERROR;
- }
-}
-
-
-static char *
-ngx_http_geoip_city(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_geoip_conf_t *gcf = conf;
-
- ngx_str_t *value;
-
- if (gcf->city) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- gcf->city = GeoIP_open((char *) value[1].data, GEOIP_MEMORY_CACHE);
-
- if (gcf->city == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "GeoIP_open(\"%V\") failed", &value[1]);
-
- return NGX_CONF_ERROR;
- }
-
- if (cf->args->nelts == 3) {
- if (ngx_strcmp(value[2].data, "utf8") == 0) {
- GeoIP_set_charset(gcf->city, GEOIP_CHARSET_UTF8);
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[2]);
- return NGX_CONF_ERROR;
- }
- }
-
- switch (gcf->city->databaseType) {
-
- case GEOIP_CITY_EDITION_REV0:
- case GEOIP_CITY_EDITION_REV1:
-
- return NGX_CONF_OK;
-
-#if (NGX_HAVE_GEOIP_V6)
- case GEOIP_CITY_EDITION_REV0_V6:
- case GEOIP_CITY_EDITION_REV1_V6:
-
- gcf->city_v6 = 1;
- return NGX_CONF_OK;
-#endif
-
- default:
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid GeoIP City database \"%V\" type:%d",
- &value[1], gcf->city->databaseType);
- return NGX_CONF_ERROR;
- }
-}
-
-
-static char *
-ngx_http_geoip_proxy(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_geoip_conf_t *gcf = conf;
-
- ngx_str_t *value;
- ngx_cidr_t cidr, *c;
-
- value = cf->args->elts;
-
- if (ngx_http_geoip_cidr_value(cf, &value[1], &cidr) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (gcf->proxies == NULL) {
- gcf->proxies = ngx_array_create(cf->pool, 4, sizeof(ngx_cidr_t));
- if (gcf->proxies == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- c = ngx_array_push(gcf->proxies);
- if (c == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *c = cidr;
-
- return NGX_CONF_OK;
-}
-
-static ngx_int_t
-ngx_http_geoip_cidr_value(ngx_conf_t *cf, ngx_str_t *net, ngx_cidr_t *cidr)
-{
- ngx_int_t rc;
-
- if (ngx_strcmp(net->data, "255.255.255.255") == 0) {
- cidr->family = AF_INET;
- cidr->u.in.addr = 0xffffffff;
- cidr->u.in.mask = 0xffffffff;
-
- return NGX_OK;
- }
-
- rc = ngx_ptocidr(net, cidr);
-
- if (rc == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid network \"%V\"", net);
- return NGX_ERROR;
- }
-
- if (rc == NGX_DONE) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "low address bits of %V are meaningless", net);
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_geoip_cleanup(void *data)
-{
- ngx_http_geoip_conf_t *gcf = data;
-
- if (gcf->country) {
- GeoIP_delete(gcf->country);
- }
-
- if (gcf->org) {
- GeoIP_delete(gcf->org);
- }
-
- if (gcf->city) {
- GeoIP_delete(gcf->city);
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gunzip_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gunzip_filter_module.c
deleted file mode 100644
index 70ec0aacea6..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gunzip_filter_module.c
+++ /dev/null
@@ -1,681 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Maxim Dounin
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-#include <zlib.h>
-
-
-typedef struct {
- ngx_flag_t enable;
- ngx_bufs_t bufs;
-} ngx_http_gunzip_conf_t;
-
-
-typedef struct {
- ngx_chain_t *in;
- ngx_chain_t *free;
- ngx_chain_t *busy;
- ngx_chain_t *out;
- ngx_chain_t **last_out;
-
- ngx_buf_t *in_buf;
- ngx_buf_t *out_buf;
- ngx_int_t bufs;
-
- unsigned started:1;
- unsigned flush:4;
- unsigned redo:1;
- unsigned done:1;
- unsigned nomem:1;
-
- z_stream zstream;
- ngx_http_request_t *request;
-} ngx_http_gunzip_ctx_t;
-
-
-static ngx_int_t ngx_http_gunzip_filter_inflate_start(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gunzip_filter_add_data(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gunzip_filter_get_buf(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gunzip_filter_inflate(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gunzip_filter_inflate_end(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx);
-
-static void *ngx_http_gunzip_filter_alloc(void *opaque, u_int items,
- u_int size);
-static void ngx_http_gunzip_filter_free(void *opaque, void *address);
-
-static ngx_int_t ngx_http_gunzip_filter_init(ngx_conf_t *cf);
-static void *ngx_http_gunzip_create_conf(ngx_conf_t *cf);
-static char *ngx_http_gunzip_merge_conf(ngx_conf_t *cf,
- void *parent, void *child);
-
-
-static ngx_command_t ngx_http_gunzip_filter_commands[] = {
-
- { ngx_string("gunzip"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gunzip_conf_t, enable),
- NULL },
-
- { ngx_string("gunzip_buffers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_conf_set_bufs_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gunzip_conf_t, bufs),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_gunzip_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_gunzip_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_gunzip_create_conf, /* create location configuration */
- ngx_http_gunzip_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_gunzip_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_gunzip_filter_module_ctx, /* module context */
- ngx_http_gunzip_filter_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_gunzip_header_filter(ngx_http_request_t *r)
-{
- ngx_http_gunzip_ctx_t *ctx;
- ngx_http_gunzip_conf_t *conf;
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_gunzip_filter_module);
-
- /* TODO support multiple content-codings */
- /* TODO always gunzip - due to configuration or module request */
- /* TODO ignore content encoding? */
-
- if (!conf->enable
- || r->headers_out.content_encoding == NULL
- || r->headers_out.content_encoding->value.len != 4
- || ngx_strncasecmp(r->headers_out.content_encoding->value.data,
- (u_char *) "gzip", 4) != 0)
- {
- return ngx_http_next_header_filter(r);
- }
-
- r->gzip_vary = 1;
-
- if (!r->gzip_tested) {
- if (ngx_http_gzip_ok(r) == NGX_OK) {
- return ngx_http_next_header_filter(r);
- }
-
- } else if (r->gzip_ok) {
- return ngx_http_next_header_filter(r);
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_gunzip_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_gunzip_filter_module);
-
- ctx->request = r;
-
- r->filter_need_in_memory = 1;
-
- r->headers_out.content_encoding->hash = 0;
- r->headers_out.content_encoding = NULL;
-
- ngx_http_clear_content_length(r);
- ngx_http_clear_accept_ranges(r);
- ngx_http_weak_etag(r);
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_gunzip_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- int rc;
- ngx_chain_t *cl;
- ngx_http_gunzip_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_gunzip_filter_module);
-
- if (ctx == NULL || ctx->done) {
- return ngx_http_next_body_filter(r, in);
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http gunzip filter");
-
- if (!ctx->started) {
- if (ngx_http_gunzip_filter_inflate_start(r, ctx) != NGX_OK) {
- goto failed;
- }
- }
-
- if (in) {
- if (ngx_chain_add_copy(r->pool, &ctx->in, in) != NGX_OK) {
- goto failed;
- }
- }
-
- if (ctx->nomem || in == NULL) {
-
- /* flush busy buffers */
-
- if (ngx_http_next_body_filter(r, NULL) == NGX_ERROR) {
- goto failed;
- }
-
- cl = NULL;
-
- ngx_chain_update_chains(r->pool, &ctx->free, &ctx->busy, &cl,
- (ngx_buf_tag_t) &ngx_http_gunzip_filter_module);
- ctx->nomem = 0;
- }
-
- for ( ;; ) {
-
- /* cycle while we can write to a client */
-
- for ( ;; ) {
-
- /* cycle while there is data to feed zlib and ... */
-
- rc = ngx_http_gunzip_filter_add_data(r, ctx);
-
- if (rc == NGX_DECLINED) {
- break;
- }
-
- if (rc == NGX_AGAIN) {
- continue;
- }
-
-
- /* ... there are buffers to write zlib output */
-
- rc = ngx_http_gunzip_filter_get_buf(r, ctx);
-
- if (rc == NGX_DECLINED) {
- break;
- }
-
- if (rc == NGX_ERROR) {
- goto failed;
- }
-
- rc = ngx_http_gunzip_filter_inflate(r, ctx);
-
- if (rc == NGX_OK) {
- break;
- }
-
- if (rc == NGX_ERROR) {
- goto failed;
- }
-
- /* rc == NGX_AGAIN */
- }
-
- if (ctx->out == NULL) {
- return ctx->busy ? NGX_AGAIN : NGX_OK;
- }
-
- rc = ngx_http_next_body_filter(r, ctx->out);
-
- if (rc == NGX_ERROR) {
- goto failed;
- }
-
- ngx_chain_update_chains(r->pool, &ctx->free, &ctx->busy, &ctx->out,
- (ngx_buf_tag_t) &ngx_http_gunzip_filter_module);
- ctx->last_out = &ctx->out;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "gunzip out: %p", ctx->out);
-
- ctx->nomem = 0;
-
- if (ctx->done) {
- return rc;
- }
- }
-
- /* unreachable */
-
-failed:
-
- ctx->done = 1;
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_gunzip_filter_inflate_start(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx)
-{
- int rc;
-
- ctx->zstream.next_in = Z_NULL;
- ctx->zstream.avail_in = 0;
-
- ctx->zstream.zalloc = ngx_http_gunzip_filter_alloc;
- ctx->zstream.zfree = ngx_http_gunzip_filter_free;
- ctx->zstream.opaque = ctx;
-
- /* windowBits +16 to decode gzip, zlib 1.2.0.4+ */
- rc = inflateInit2(&ctx->zstream, MAX_WBITS + 16);
-
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "inflateInit2() failed: %d", rc);
- return NGX_ERROR;
- }
-
- ctx->started = 1;
-
- ctx->last_out = &ctx->out;
- ctx->flush = Z_NO_FLUSH;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gunzip_filter_add_data(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx)
-{
- if (ctx->zstream.avail_in || ctx->flush != Z_NO_FLUSH || ctx->redo) {
- return NGX_OK;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "gunzip in: %p", ctx->in);
-
- if (ctx->in == NULL) {
- return NGX_DECLINED;
- }
-
- ctx->in_buf = ctx->in->buf;
- ctx->in = ctx->in->next;
-
- ctx->zstream.next_in = ctx->in_buf->pos;
- ctx->zstream.avail_in = ctx->in_buf->last - ctx->in_buf->pos;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "gunzip in_buf:%p ni:%p ai:%ud",
- ctx->in_buf,
- ctx->zstream.next_in, ctx->zstream.avail_in);
-
- if (ctx->in_buf->last_buf || ctx->in_buf->last_in_chain) {
- ctx->flush = Z_FINISH;
-
- } else if (ctx->in_buf->flush) {
- ctx->flush = Z_SYNC_FLUSH;
-
- } else if (ctx->zstream.avail_in == 0) {
- /* ctx->flush == Z_NO_FLUSH */
- return NGX_AGAIN;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gunzip_filter_get_buf(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx)
-{
- ngx_http_gunzip_conf_t *conf;
-
- if (ctx->zstream.avail_out) {
- return NGX_OK;
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_gunzip_filter_module);
-
- if (ctx->free) {
- ctx->out_buf = ctx->free->buf;
- ctx->free = ctx->free->next;
-
- ctx->out_buf->flush = 0;
-
- } else if (ctx->bufs < conf->bufs.num) {
-
- ctx->out_buf = ngx_create_temp_buf(r->pool, conf->bufs.size);
- if (ctx->out_buf == NULL) {
- return NGX_ERROR;
- }
-
- ctx->out_buf->tag = (ngx_buf_tag_t) &ngx_http_gunzip_filter_module;
- ctx->out_buf->recycled = 1;
- ctx->bufs++;
-
- } else {
- ctx->nomem = 1;
- return NGX_DECLINED;
- }
-
- ctx->zstream.next_out = ctx->out_buf->pos;
- ctx->zstream.avail_out = conf->bufs.size;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gunzip_filter_inflate(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx)
-{
- int rc;
- ngx_buf_t *b;
- ngx_chain_t *cl;
-
- ngx_log_debug6(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "inflate in: ni:%p no:%p ai:%ud ao:%ud fl:%d redo:%d",
- ctx->zstream.next_in, ctx->zstream.next_out,
- ctx->zstream.avail_in, ctx->zstream.avail_out,
- ctx->flush, ctx->redo);
-
- rc = inflate(&ctx->zstream, ctx->flush);
-
- if (rc != Z_OK && rc != Z_STREAM_END && rc != Z_BUF_ERROR) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "inflate() failed: %d, %d", ctx->flush, rc);
- return NGX_ERROR;
- }
-
- ngx_log_debug5(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "inflate out: ni:%p no:%p ai:%ud ao:%ud rc:%d",
- ctx->zstream.next_in, ctx->zstream.next_out,
- ctx->zstream.avail_in, ctx->zstream.avail_out,
- rc);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "gunzip in_buf:%p pos:%p",
- ctx->in_buf, ctx->in_buf->pos);
-
- if (ctx->zstream.next_in) {
- ctx->in_buf->pos = ctx->zstream.next_in;
-
- if (ctx->zstream.avail_in == 0) {
- ctx->zstream.next_in = NULL;
- }
- }
-
- ctx->out_buf->last = ctx->zstream.next_out;
-
- if (ctx->zstream.avail_out == 0) {
-
- /* zlib wants to output some more data */
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = ctx->out_buf;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- ctx->redo = 1;
-
- return NGX_AGAIN;
- }
-
- ctx->redo = 0;
-
- if (ctx->flush == Z_SYNC_FLUSH) {
-
- ctx->flush = Z_NO_FLUSH;
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = ctx->out_buf;
-
- if (ngx_buf_size(b) == 0) {
-
- b = ngx_calloc_buf(ctx->request->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- } else {
- ctx->zstream.avail_out = 0;
- }
-
- b->flush = 1;
-
- cl->buf = b;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- return NGX_OK;
- }
-
- if (ctx->flush == Z_FINISH && ctx->zstream.avail_in == 0) {
-
- if (rc != Z_STREAM_END) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "inflate() returned %d on response end", rc);
- return NGX_ERROR;
- }
-
- if (ngx_http_gunzip_filter_inflate_end(r, ctx) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
-
- if (rc == Z_STREAM_END && ctx->zstream.avail_in > 0) {
-
- rc = inflateReset(&ctx->zstream);
-
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "inflateReset() failed: %d", rc);
- return NGX_ERROR;
- }
-
- ctx->redo = 1;
-
- return NGX_AGAIN;
- }
-
- if (ctx->in == NULL) {
-
- b = ctx->out_buf;
-
- if (ngx_buf_size(b) == 0) {
- return NGX_OK;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- ctx->zstream.avail_out = 0;
-
- cl->buf = b;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- return NGX_OK;
- }
-
- return NGX_AGAIN;
-}
-
-
-static ngx_int_t
-ngx_http_gunzip_filter_inflate_end(ngx_http_request_t *r,
- ngx_http_gunzip_ctx_t *ctx)
-{
- int rc;
- ngx_buf_t *b;
- ngx_chain_t *cl;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "gunzip inflate end");
-
- rc = inflateEnd(&ctx->zstream);
-
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "inflateEnd() failed: %d", rc);
- return NGX_ERROR;
- }
-
- b = ctx->out_buf;
-
- if (ngx_buf_size(b) == 0) {
-
- b = ngx_calloc_buf(ctx->request->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- b->last_buf = (r == r->main) ? 1 : 0;
- b->last_in_chain = 1;
- b->sync = 1;
-
- ctx->done = 1;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_gunzip_filter_alloc(void *opaque, u_int items, u_int size)
-{
- ngx_http_gunzip_ctx_t *ctx = opaque;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ctx->request->connection->log, 0,
- "gunzip alloc: n:%ud s:%ud",
- items, size);
-
- return ngx_palloc(ctx->request->pool, items * size);
-}
-
-
-static void
-ngx_http_gunzip_filter_free(void *opaque, void *address)
-{
-#if 0
- ngx_http_gunzip_ctx_t *ctx = opaque;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->request->connection->log, 0,
- "gunzip free: %p", address);
-#endif
-}
-
-
-static void *
-ngx_http_gunzip_create_conf(ngx_conf_t *cf)
-{
- ngx_http_gunzip_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_gunzip_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->bufs.num = 0;
- */
-
- conf->enable = NGX_CONF_UNSET;
-
- return conf;
-}
-
-
-static char *
-ngx_http_gunzip_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_gunzip_conf_t *prev = parent;
- ngx_http_gunzip_conf_t *conf = child;
-
- ngx_conf_merge_value(conf->enable, prev->enable, 0);
-
- ngx_conf_merge_bufs_value(conf->bufs, prev->bufs,
- (128 * 1024) / ngx_pagesize, ngx_pagesize);
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gunzip_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_gunzip_header_filter;
-
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_gunzip_body_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_filter_module.c
deleted file mode 100644
index c57a4a3c7cc..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_filter_module.c
+++ /dev/null
@@ -1,1229 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-#include <zlib.h>
-
-
-typedef struct {
- ngx_flag_t enable;
- ngx_flag_t no_buffer;
-
- ngx_hash_t types;
-
- ngx_bufs_t bufs;
-
- size_t postpone_gzipping;
- ngx_int_t level;
- size_t wbits;
- size_t memlevel;
- ssize_t min_length;
-
- ngx_array_t *types_keys;
-} ngx_http_gzip_conf_t;
-
-
-typedef struct {
- ngx_chain_t *in;
- ngx_chain_t *free;
- ngx_chain_t *busy;
- ngx_chain_t *out;
- ngx_chain_t **last_out;
-
- ngx_chain_t *copied;
- ngx_chain_t *copy_buf;
-
- ngx_buf_t *in_buf;
- ngx_buf_t *out_buf;
- ngx_int_t bufs;
-
- void *preallocated;
- char *free_mem;
- ngx_uint_t allocated;
-
- int wbits;
- int memlevel;
-
- unsigned flush:4;
- unsigned redo:1;
- unsigned done:1;
- unsigned nomem:1;
- unsigned gzheader:1;
- unsigned buffering:1;
-
- size_t zin;
- size_t zout;
-
- uint32_t crc32;
- z_stream zstream;
- ngx_http_request_t *request;
-} ngx_http_gzip_ctx_t;
-
-
-#if (NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED)
-
-struct gztrailer {
- uint32_t crc32;
- uint32_t zlen;
-};
-
-#else /* NGX_HAVE_BIG_ENDIAN || !NGX_HAVE_NONALIGNED */
-
-struct gztrailer {
- u_char crc32[4];
- u_char zlen[4];
-};
-
-#endif
-
-
-static void ngx_http_gzip_filter_memory(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gzip_filter_buffer(ngx_http_gzip_ctx_t *ctx,
- ngx_chain_t *in);
-static ngx_int_t ngx_http_gzip_filter_deflate_start(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gzip_filter_gzheader(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gzip_filter_add_data(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gzip_filter_get_buf(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gzip_filter_deflate(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx);
-static ngx_int_t ngx_http_gzip_filter_deflate_end(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx);
-
-static void *ngx_http_gzip_filter_alloc(void *opaque, u_int items,
- u_int size);
-static void ngx_http_gzip_filter_free(void *opaque, void *address);
-static void ngx_http_gzip_filter_free_copy_buf(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx);
-
-static ngx_int_t ngx_http_gzip_add_variables(ngx_conf_t *cf);
-static ngx_int_t ngx_http_gzip_ratio_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-static ngx_int_t ngx_http_gzip_filter_init(ngx_conf_t *cf);
-static void *ngx_http_gzip_create_conf(ngx_conf_t *cf);
-static char *ngx_http_gzip_merge_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static char *ngx_http_gzip_window(ngx_conf_t *cf, void *post, void *data);
-static char *ngx_http_gzip_hash(ngx_conf_t *cf, void *post, void *data);
-
-
-static ngx_conf_num_bounds_t ngx_http_gzip_comp_level_bounds = {
- ngx_conf_check_num_bounds, 1, 9
-};
-
-static ngx_conf_post_handler_pt ngx_http_gzip_window_p = ngx_http_gzip_window;
-static ngx_conf_post_handler_pt ngx_http_gzip_hash_p = ngx_http_gzip_hash;
-
-
-static ngx_command_t ngx_http_gzip_filter_commands[] = {
-
- { ngx_string("gzip"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_conf_t, enable),
- NULL },
-
- { ngx_string("gzip_buffers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_conf_set_bufs_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_conf_t, bufs),
- NULL },
-
- { ngx_string("gzip_types"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_types_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_conf_t, types_keys),
- &ngx_http_html_default_types[0] },
-
- { ngx_string("gzip_comp_level"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_conf_t, level),
- &ngx_http_gzip_comp_level_bounds },
-
- { ngx_string("gzip_window"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_conf_t, wbits),
- &ngx_http_gzip_window_p },
-
- { ngx_string("gzip_hash"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_conf_t, memlevel),
- &ngx_http_gzip_hash_p },
-
- { ngx_string("postpone_gzipping"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_conf_t, postpone_gzipping),
- NULL },
-
- { ngx_string("gzip_no_buffer"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_conf_t, no_buffer),
- NULL },
-
- { ngx_string("gzip_min_length"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_conf_t, min_length),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_gzip_filter_module_ctx = {
- ngx_http_gzip_add_variables, /* preconfiguration */
- ngx_http_gzip_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_gzip_create_conf, /* create location configuration */
- ngx_http_gzip_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_gzip_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_gzip_filter_module_ctx, /* module context */
- ngx_http_gzip_filter_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_http_gzip_ratio = ngx_string("gzip_ratio");
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_gzip_header_filter(ngx_http_request_t *r)
-{
- ngx_table_elt_t *h;
- ngx_http_gzip_ctx_t *ctx;
- ngx_http_gzip_conf_t *conf;
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module);
-
- if (!conf->enable
- || (r->headers_out.status != NGX_HTTP_OK
- && r->headers_out.status != NGX_HTTP_FORBIDDEN
- && r->headers_out.status != NGX_HTTP_NOT_FOUND)
- || (r->headers_out.content_encoding
- && r->headers_out.content_encoding->value.len)
- || (r->headers_out.content_length_n != -1
- && r->headers_out.content_length_n < conf->min_length)
- || ngx_http_test_content_type(r, &conf->types) == NULL
- || r->header_only)
- {
- return ngx_http_next_header_filter(r);
- }
-
- r->gzip_vary = 1;
-
-#if (NGX_HTTP_DEGRADATION)
- {
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->gzip_disable_degradation && ngx_http_degraded(r)) {
- return ngx_http_next_header_filter(r);
- }
- }
-#endif
-
- if (!r->gzip_tested) {
- if (ngx_http_gzip_ok(r) != NGX_OK) {
- return ngx_http_next_header_filter(r);
- }
-
- } else if (!r->gzip_ok) {
- return ngx_http_next_header_filter(r);
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_gzip_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_gzip_filter_module);
-
- ctx->request = r;
- ctx->buffering = (conf->postpone_gzipping != 0);
-
- ngx_http_gzip_filter_memory(r, ctx);
-
- h = ngx_list_push(&r->headers_out.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = 1;
- ngx_str_set(&h->key, "Content-Encoding");
- ngx_str_set(&h->value, "gzip");
- r->headers_out.content_encoding = h;
-
- r->main_filter_need_in_memory = 1;
-
- ngx_http_clear_content_length(r);
- ngx_http_clear_accept_ranges(r);
- ngx_http_weak_etag(r);
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_gzip_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- int rc;
- ngx_chain_t *cl;
- ngx_http_gzip_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_gzip_filter_module);
-
- if (ctx == NULL || ctx->done || r->header_only) {
- return ngx_http_next_body_filter(r, in);
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http gzip filter");
-
- if (ctx->buffering) {
-
- /*
- * With default memory settings zlib starts to output gzipped data
- * only after it has got about 90K, so it makes sense to allocate
- * zlib memory (200-400K) only after we have enough data to compress.
- * Although we copy buffers, nevertheless for not big responses
- * this allows to allocate zlib memory, to compress and to output
- * the response in one step using hot CPU cache.
- */
-
- if (in) {
- switch (ngx_http_gzip_filter_buffer(ctx, in)) {
-
- case NGX_OK:
- return NGX_OK;
-
- case NGX_DONE:
- in = NULL;
- break;
-
- default: /* NGX_ERROR */
- goto failed;
- }
-
- } else {
- ctx->buffering = 0;
- }
- }
-
- if (ctx->preallocated == NULL) {
- if (ngx_http_gzip_filter_deflate_start(r, ctx) != NGX_OK) {
- goto failed;
- }
- }
-
- if (in) {
- if (ngx_chain_add_copy(r->pool, &ctx->in, in) != NGX_OK) {
- goto failed;
- }
-
- r->connection->buffered |= NGX_HTTP_GZIP_BUFFERED;
- }
-
- if (ctx->nomem || in == NULL) {
-
- /* flush busy buffers */
-
- if (ngx_http_next_body_filter(r, NULL) == NGX_ERROR) {
- goto failed;
- }
-
- cl = NULL;
-
- ngx_chain_update_chains(r->pool, &ctx->free, &ctx->busy, &cl,
- (ngx_buf_tag_t) &ngx_http_gzip_filter_module);
- ctx->nomem = 0;
- }
-
- for ( ;; ) {
-
- /* cycle while we can write to a client */
-
- for ( ;; ) {
-
- /* cycle while there is data to feed zlib and ... */
-
- rc = ngx_http_gzip_filter_add_data(r, ctx);
-
- if (rc == NGX_DECLINED) {
- break;
- }
-
- if (rc == NGX_AGAIN) {
- continue;
- }
-
-
- /* ... there are buffers to write zlib output */
-
- rc = ngx_http_gzip_filter_get_buf(r, ctx);
-
- if (rc == NGX_DECLINED) {
- break;
- }
-
- if (rc == NGX_ERROR) {
- goto failed;
- }
-
-
- rc = ngx_http_gzip_filter_deflate(r, ctx);
-
- if (rc == NGX_OK) {
- break;
- }
-
- if (rc == NGX_ERROR) {
- goto failed;
- }
-
- /* rc == NGX_AGAIN */
- }
-
- if (ctx->out == NULL) {
- ngx_http_gzip_filter_free_copy_buf(r, ctx);
-
- return ctx->busy ? NGX_AGAIN : NGX_OK;
- }
-
- if (!ctx->gzheader) {
- if (ngx_http_gzip_filter_gzheader(r, ctx) != NGX_OK) {
- goto failed;
- }
- }
-
- rc = ngx_http_next_body_filter(r, ctx->out);
-
- if (rc == NGX_ERROR) {
- goto failed;
- }
-
- ngx_http_gzip_filter_free_copy_buf(r, ctx);
-
- ngx_chain_update_chains(r->pool, &ctx->free, &ctx->busy, &ctx->out,
- (ngx_buf_tag_t) &ngx_http_gzip_filter_module);
- ctx->last_out = &ctx->out;
-
- ctx->nomem = 0;
-
- if (ctx->done) {
- return rc;
- }
- }
-
- /* unreachable */
-
-failed:
-
- ctx->done = 1;
-
- if (ctx->preallocated) {
- deflateEnd(&ctx->zstream);
-
- ngx_pfree(r->pool, ctx->preallocated);
- }
-
- ngx_http_gzip_filter_free_copy_buf(r, ctx);
-
- return NGX_ERROR;
-}
-
-
-static void
-ngx_http_gzip_filter_memory(ngx_http_request_t *r, ngx_http_gzip_ctx_t *ctx)
-{
- int wbits, memlevel;
- ngx_http_gzip_conf_t *conf;
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module);
-
- wbits = conf->wbits;
- memlevel = conf->memlevel;
-
- if (r->headers_out.content_length_n > 0) {
-
- /* the actual zlib window size is smaller by 262 bytes */
-
- while (r->headers_out.content_length_n < ((1 << (wbits - 1)) - 262)) {
- wbits--;
- memlevel--;
- }
-
- if (memlevel < 1) {
- memlevel = 1;
- }
- }
-
- ctx->wbits = wbits;
- ctx->memlevel = memlevel;
-
- /*
- * We preallocate a memory for zlib in one buffer (200K-400K), this
- * decreases a number of malloc() and free() calls and also probably
- * decreases a number of syscalls (sbrk()/mmap() and so on).
- * Besides we free the memory as soon as a gzipping will complete
- * and do not wait while a whole response will be sent to a client.
- *
- * 8K is for zlib deflate_state, it takes
- * *) 5816 bytes on i386 and sparc64 (32-bit mode)
- * *) 5920 bytes on amd64 and sparc64
- */
-
- ctx->allocated = 8192 + (1 << (wbits + 2)) + (1 << (memlevel + 9));
-}
-
-
-static ngx_int_t
-ngx_http_gzip_filter_buffer(ngx_http_gzip_ctx_t *ctx, ngx_chain_t *in)
-{
- size_t size, buffered;
- ngx_buf_t *b, *buf;
- ngx_chain_t *cl, **ll;
- ngx_http_request_t *r;
- ngx_http_gzip_conf_t *conf;
-
- r = ctx->request;
-
- r->connection->buffered |= NGX_HTTP_GZIP_BUFFERED;
-
- buffered = 0;
- ll = &ctx->in;
-
- for (cl = ctx->in; cl; cl = cl->next) {
- buffered += cl->buf->last - cl->buf->pos;
- ll = &cl->next;
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module);
-
- while (in) {
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = in->buf;
-
- size = b->last - b->pos;
- buffered += size;
-
- if (b->flush || b->last_buf || buffered > conf->postpone_gzipping) {
- ctx->buffering = 0;
- }
-
- if (ctx->buffering && size) {
-
- buf = ngx_create_temp_buf(r->pool, size);
- if (buf == NULL) {
- return NGX_ERROR;
- }
-
- buf->last = ngx_cpymem(buf->pos, b->pos, size);
- b->pos = b->last;
-
- buf->last_buf = b->last_buf;
- buf->tag = (ngx_buf_tag_t) &ngx_http_gzip_filter_module;
-
- cl->buf = buf;
-
- } else {
- cl->buf = b;
- }
-
- *ll = cl;
- ll = &cl->next;
- in = in->next;
- }
-
- *ll = NULL;
-
- return ctx->buffering ? NGX_OK : NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_filter_deflate_start(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx)
-{
- int rc;
- ngx_http_gzip_conf_t *conf;
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module);
-
- ctx->preallocated = ngx_palloc(r->pool, ctx->allocated);
- if (ctx->preallocated == NULL) {
- return NGX_ERROR;
- }
-
- ctx->free_mem = ctx->preallocated;
-
- ctx->zstream.zalloc = ngx_http_gzip_filter_alloc;
- ctx->zstream.zfree = ngx_http_gzip_filter_free;
- ctx->zstream.opaque = ctx;
-
- rc = deflateInit2(&ctx->zstream, (int) conf->level, Z_DEFLATED,
- - ctx->wbits, ctx->memlevel, Z_DEFAULT_STRATEGY);
-
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "deflateInit2() failed: %d", rc);
- return NGX_ERROR;
- }
-
- ctx->last_out = &ctx->out;
- ctx->crc32 = crc32(0L, Z_NULL, 0);
- ctx->flush = Z_NO_FLUSH;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_filter_gzheader(ngx_http_request_t *r, ngx_http_gzip_ctx_t *ctx)
-{
- ngx_buf_t *b;
- ngx_chain_t *cl;
- static u_char gzheader[10] =
- { 0x1f, 0x8b, Z_DEFLATED, 0, 0, 0, 0, 0, 0, 3 };
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- b->memory = 1;
- b->pos = gzheader;
- b->last = b->pos + 10;
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- cl->next = ctx->out;
- ctx->out = cl;
-
- ctx->gzheader = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_filter_add_data(ngx_http_request_t *r, ngx_http_gzip_ctx_t *ctx)
-{
- if (ctx->zstream.avail_in || ctx->flush != Z_NO_FLUSH || ctx->redo) {
- return NGX_OK;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "gzip in: %p", ctx->in);
-
- if (ctx->in == NULL) {
- return NGX_DECLINED;
- }
-
- if (ctx->copy_buf) {
-
- /*
- * to avoid CPU cache trashing we do not free() just quit buf,
- * but postpone free()ing after zlib compressing and data output
- */
-
- ctx->copy_buf->next = ctx->copied;
- ctx->copied = ctx->copy_buf;
- ctx->copy_buf = NULL;
- }
-
- ctx->in_buf = ctx->in->buf;
-
- if (ctx->in_buf->tag == (ngx_buf_tag_t) &ngx_http_gzip_filter_module) {
- ctx->copy_buf = ctx->in;
- }
-
- ctx->in = ctx->in->next;
-
- ctx->zstream.next_in = ctx->in_buf->pos;
- ctx->zstream.avail_in = ctx->in_buf->last - ctx->in_buf->pos;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "gzip in_buf:%p ni:%p ai:%ud",
- ctx->in_buf,
- ctx->zstream.next_in, ctx->zstream.avail_in);
-
- if (ctx->in_buf->last_buf) {
- ctx->flush = Z_FINISH;
-
- } else if (ctx->in_buf->flush) {
- ctx->flush = Z_SYNC_FLUSH;
- }
-
- if (ctx->zstream.avail_in) {
-
- ctx->crc32 = crc32(ctx->crc32, ctx->zstream.next_in,
- ctx->zstream.avail_in);
-
- } else if (ctx->flush == Z_NO_FLUSH) {
- return NGX_AGAIN;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_filter_get_buf(ngx_http_request_t *r, ngx_http_gzip_ctx_t *ctx)
-{
- ngx_http_gzip_conf_t *conf;
-
- if (ctx->zstream.avail_out) {
- return NGX_OK;
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module);
-
- if (ctx->free) {
- ctx->out_buf = ctx->free->buf;
- ctx->free = ctx->free->next;
-
- } else if (ctx->bufs < conf->bufs.num) {
-
- ctx->out_buf = ngx_create_temp_buf(r->pool, conf->bufs.size);
- if (ctx->out_buf == NULL) {
- return NGX_ERROR;
- }
-
- ctx->out_buf->tag = (ngx_buf_tag_t) &ngx_http_gzip_filter_module;
- ctx->out_buf->recycled = 1;
- ctx->bufs++;
-
- } else {
- ctx->nomem = 1;
- return NGX_DECLINED;
- }
-
- ctx->zstream.next_out = ctx->out_buf->pos;
- ctx->zstream.avail_out = conf->bufs.size;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_filter_deflate(ngx_http_request_t *r, ngx_http_gzip_ctx_t *ctx)
-{
- int rc;
- ngx_buf_t *b;
- ngx_chain_t *cl;
- ngx_http_gzip_conf_t *conf;
-
- ngx_log_debug6(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "deflate in: ni:%p no:%p ai:%ud ao:%ud fl:%d redo:%d",
- ctx->zstream.next_in, ctx->zstream.next_out,
- ctx->zstream.avail_in, ctx->zstream.avail_out,
- ctx->flush, ctx->redo);
-
- rc = deflate(&ctx->zstream, ctx->flush);
-
- if (rc != Z_OK && rc != Z_STREAM_END && rc != Z_BUF_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "deflate() failed: %d, %d", ctx->flush, rc);
- return NGX_ERROR;
- }
-
- ngx_log_debug5(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "deflate out: ni:%p no:%p ai:%ud ao:%ud rc:%d",
- ctx->zstream.next_in, ctx->zstream.next_out,
- ctx->zstream.avail_in, ctx->zstream.avail_out,
- rc);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "gzip in_buf:%p pos:%p",
- ctx->in_buf, ctx->in_buf->pos);
-
- if (ctx->zstream.next_in) {
- ctx->in_buf->pos = ctx->zstream.next_in;
-
- if (ctx->zstream.avail_in == 0) {
- ctx->zstream.next_in = NULL;
- }
- }
-
- ctx->out_buf->last = ctx->zstream.next_out;
-
- if (ctx->zstream.avail_out == 0) {
-
- /* zlib wants to output some more gzipped data */
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = ctx->out_buf;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- ctx->redo = 1;
-
- return NGX_AGAIN;
- }
-
- ctx->redo = 0;
-
- if (ctx->flush == Z_SYNC_FLUSH) {
-
- ctx->flush = Z_NO_FLUSH;
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = ctx->out_buf;
-
- if (ngx_buf_size(b) == 0) {
-
- b = ngx_calloc_buf(ctx->request->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- } else {
- ctx->zstream.avail_out = 0;
- }
-
- b->flush = 1;
-
- cl->buf = b;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
-
- return NGX_OK;
- }
-
- if (rc == Z_STREAM_END) {
-
- if (ngx_http_gzip_filter_deflate_end(r, ctx) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_filter_module);
-
- if (conf->no_buffer && ctx->in == NULL) {
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = ctx->out_buf;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- return NGX_OK;
- }
-
- return NGX_AGAIN;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_filter_deflate_end(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx)
-{
- int rc;
- ngx_buf_t *b;
- ngx_chain_t *cl;
- struct gztrailer *trailer;
-
- ctx->zin = ctx->zstream.total_in;
- ctx->zout = 10 + ctx->zstream.total_out + 8;
-
- rc = deflateEnd(&ctx->zstream);
-
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "deflateEnd() failed: %d", rc);
- return NGX_ERROR;
- }
-
- ngx_pfree(r->pool, ctx->preallocated);
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = ctx->out_buf;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- if (ctx->zstream.avail_out >= 8) {
- trailer = (struct gztrailer *) ctx->out_buf->last;
- ctx->out_buf->last += 8;
- ctx->out_buf->last_buf = 1;
-
- } else {
- b = ngx_create_temp_buf(r->pool, 8);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- b->last_buf = 1;
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
- trailer = (struct gztrailer *) b->pos;
- b->last += 8;
- }
-
-#if (NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED)
-
- trailer->crc32 = ctx->crc32;
- trailer->zlen = ctx->zin;
-
-#else
-
- trailer->crc32[0] = (u_char) (ctx->crc32 & 0xff);
- trailer->crc32[1] = (u_char) ((ctx->crc32 >> 8) & 0xff);
- trailer->crc32[2] = (u_char) ((ctx->crc32 >> 16) & 0xff);
- trailer->crc32[3] = (u_char) ((ctx->crc32 >> 24) & 0xff);
-
- trailer->zlen[0] = (u_char) (ctx->zin & 0xff);
- trailer->zlen[1] = (u_char) ((ctx->zin >> 8) & 0xff);
- trailer->zlen[2] = (u_char) ((ctx->zin >> 16) & 0xff);
- trailer->zlen[3] = (u_char) ((ctx->zin >> 24) & 0xff);
-
-#endif
-
- ctx->zstream.avail_in = 0;
- ctx->zstream.avail_out = 0;
-
- ctx->done = 1;
-
- r->connection->buffered &= ~NGX_HTTP_GZIP_BUFFERED;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_gzip_filter_alloc(void *opaque, u_int items, u_int size)
-{
- ngx_http_gzip_ctx_t *ctx = opaque;
-
- void *p;
- ngx_uint_t alloc;
-
- alloc = items * size;
-
- if (alloc % 512 != 0 && alloc < 8192) {
-
- /*
- * The zlib deflate_state allocation, it takes about 6K,
- * we allocate 8K. Other allocations are divisible by 512.
- */
-
- alloc = 8192;
- }
-
- if (alloc <= ctx->allocated) {
- p = ctx->free_mem;
- ctx->free_mem += alloc;
- ctx->allocated -= alloc;
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, ctx->request->connection->log, 0,
- "gzip alloc: n:%ud s:%ud a:%ud p:%p",
- items, size, alloc, p);
-
- return p;
- }
-
- ngx_log_error(NGX_LOG_ALERT, ctx->request->connection->log, 0,
- "gzip filter failed to use preallocated memory: %ud of %ud",
- items * size, ctx->allocated);
-
- p = ngx_palloc(ctx->request->pool, items * size);
-
- return p;
-}
-
-
-static void
-ngx_http_gzip_filter_free(void *opaque, void *address)
-{
-#if 0
- ngx_http_gzip_ctx_t *ctx = opaque;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->request->connection->log, 0,
- "gzip free: %p", address);
-#endif
-}
-
-
-static void
-ngx_http_gzip_filter_free_copy_buf(ngx_http_request_t *r,
- ngx_http_gzip_ctx_t *ctx)
-{
- ngx_chain_t *cl;
-
- for (cl = ctx->copied; cl; cl = cl->next) {
- ngx_pfree(r->pool, cl->buf->start);
- }
-
- ctx->copied = NULL;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_add_variables(ngx_conf_t *cf)
-{
- ngx_http_variable_t *var;
-
- var = ngx_http_add_variable(cf, &ngx_http_gzip_ratio, NGX_HTTP_VAR_NOHASH);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = ngx_http_gzip_ratio_variable;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_ratio_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_uint_t zint, zfrac;
- ngx_http_gzip_ctx_t *ctx;
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_gzip_filter_module);
-
- if (ctx == NULL || ctx->zout == 0) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->data = ngx_pnalloc(r->pool, NGX_INT32_LEN + 3);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- zint = (ngx_uint_t) (ctx->zin / ctx->zout);
- zfrac = (ngx_uint_t) ((ctx->zin * 100 / ctx->zout) % 100);
-
- if ((ctx->zin * 1000 / ctx->zout) % 10 > 4) {
-
- /* the rounding, e.g., 2.125 to 2.13 */
-
- zfrac++;
-
- if (zfrac > 99) {
- zint++;
- zfrac = 0;
- }
- }
-
- v->len = ngx_sprintf(v->data, "%ui.%02ui", zint, zfrac) - v->data;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_gzip_create_conf(ngx_conf_t *cf)
-{
- ngx_http_gzip_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_gzip_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->bufs.num = 0;
- * conf->types = { NULL };
- * conf->types_keys = NULL;
- */
-
- conf->enable = NGX_CONF_UNSET;
- conf->no_buffer = NGX_CONF_UNSET;
-
- conf->postpone_gzipping = NGX_CONF_UNSET_SIZE;
- conf->level = NGX_CONF_UNSET;
- conf->wbits = NGX_CONF_UNSET_SIZE;
- conf->memlevel = NGX_CONF_UNSET_SIZE;
- conf->min_length = NGX_CONF_UNSET;
-
- return conf;
-}
-
-
-static char *
-ngx_http_gzip_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_gzip_conf_t *prev = parent;
- ngx_http_gzip_conf_t *conf = child;
-
- ngx_conf_merge_value(conf->enable, prev->enable, 0);
- ngx_conf_merge_value(conf->no_buffer, prev->no_buffer, 0);
-
- ngx_conf_merge_bufs_value(conf->bufs, prev->bufs,
- (128 * 1024) / ngx_pagesize, ngx_pagesize);
-
- ngx_conf_merge_size_value(conf->postpone_gzipping, prev->postpone_gzipping,
- 0);
- ngx_conf_merge_value(conf->level, prev->level, 1);
- ngx_conf_merge_size_value(conf->wbits, prev->wbits, MAX_WBITS);
- ngx_conf_merge_size_value(conf->memlevel, prev->memlevel,
- MAX_MEM_LEVEL - 1);
- ngx_conf_merge_value(conf->min_length, prev->min_length, 20);
-
- if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
- &prev->types_keys, &prev->types,
- ngx_http_html_default_types)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_gzip_header_filter;
-
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_gzip_body_filter;
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_gzip_window(ngx_conf_t *cf, void *post, void *data)
-{
- size_t *np = data;
-
- size_t wbits, wsize;
-
- wbits = 15;
-
- for (wsize = 32 * 1024; wsize > 256; wsize >>= 1) {
-
- if (wsize == *np) {
- *np = wbits;
-
- return NGX_CONF_OK;
- }
-
- wbits--;
- }
-
- return "must be 512, 1k, 2k, 4k, 8k, 16k, or 32k";
-}
-
-
-static char *
-ngx_http_gzip_hash(ngx_conf_t *cf, void *post, void *data)
-{
- size_t *np = data;
-
- size_t memlevel, hsize;
-
- memlevel = 9;
-
- for (hsize = 128 * 1024; hsize > 256; hsize >>= 1) {
-
- if (hsize == *np) {
- *np = memlevel;
-
- return NGX_CONF_OK;
- }
-
- memlevel--;
- }
-
- return "must be 512, 1k, 2k, 4k, 8k, 16k, 32k, 64k, or 128k";
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_static_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_static_module.c
deleted file mode 100644
index 4d54090772b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_gzip_static_module.c
+++ /dev/null
@@ -1,331 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_GZIP_STATIC_OFF 0
-#define NGX_HTTP_GZIP_STATIC_ON 1
-#define NGX_HTTP_GZIP_STATIC_ALWAYS 2
-
-
-typedef struct {
- ngx_uint_t enable;
-} ngx_http_gzip_static_conf_t;
-
-
-static ngx_int_t ngx_http_gzip_static_handler(ngx_http_request_t *r);
-static void *ngx_http_gzip_static_create_conf(ngx_conf_t *cf);
-static char *ngx_http_gzip_static_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static ngx_int_t ngx_http_gzip_static_init(ngx_conf_t *cf);
-
-
-static ngx_conf_enum_t ngx_http_gzip_static[] = {
- { ngx_string("off"), NGX_HTTP_GZIP_STATIC_OFF },
- { ngx_string("on"), NGX_HTTP_GZIP_STATIC_ON },
- { ngx_string("always"), NGX_HTTP_GZIP_STATIC_ALWAYS },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_command_t ngx_http_gzip_static_commands[] = {
-
- { ngx_string("gzip_static"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_gzip_static_conf_t, enable),
- &ngx_http_gzip_static },
-
- ngx_null_command
-};
-
-
-ngx_http_module_t ngx_http_gzip_static_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_gzip_static_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_gzip_static_create_conf, /* create location configuration */
- ngx_http_gzip_static_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_gzip_static_module = {
- NGX_MODULE_V1,
- &ngx_http_gzip_static_module_ctx, /* module context */
- ngx_http_gzip_static_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_gzip_static_handler(ngx_http_request_t *r)
-{
- u_char *p;
- size_t root;
- ngx_str_t path;
- ngx_int_t rc;
- ngx_uint_t level;
- ngx_log_t *log;
- ngx_buf_t *b;
- ngx_chain_t out;
- ngx_table_elt_t *h;
- ngx_open_file_info_t of;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_gzip_static_conf_t *gzcf;
-
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
- return NGX_DECLINED;
- }
-
- if (r->uri.data[r->uri.len - 1] == '/') {
- return NGX_DECLINED;
- }
-
- gzcf = ngx_http_get_module_loc_conf(r, ngx_http_gzip_static_module);
-
- if (gzcf->enable == NGX_HTTP_GZIP_STATIC_OFF) {
- return NGX_DECLINED;
- }
-
- if (gzcf->enable == NGX_HTTP_GZIP_STATIC_ON) {
- rc = ngx_http_gzip_ok(r);
-
- } else {
- /* always */
- rc = NGX_OK;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (!clcf->gzip_vary && rc != NGX_OK) {
- return NGX_DECLINED;
- }
-
- log = r->connection->log;
-
- p = ngx_http_map_uri_to_path(r, &path, &root, sizeof(".gz") - 1);
- if (p == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- *p++ = '.';
- *p++ = 'g';
- *p++ = 'z';
- *p = '\0';
-
- path.len = p - path.data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
- "http filename: \"%s\"", path.data);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.read_ahead = clcf->read_ahead;
- of.directio = clcf->directio;
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.errors = clcf->open_file_cache_errors;
- of.events = clcf->open_file_cache_events;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- != NGX_OK)
- {
- switch (of.err) {
-
- case 0:
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
-
- case NGX_ENOENT:
- case NGX_ENOTDIR:
- case NGX_ENAMETOOLONG:
-
- return NGX_DECLINED;
-
- case NGX_EACCES:
-#if (NGX_HAVE_OPENAT)
- case NGX_EMLINK:
- case NGX_ELOOP:
-#endif
-
- level = NGX_LOG_ERR;
- break;
-
- default:
-
- level = NGX_LOG_CRIT;
- break;
- }
-
- ngx_log_error(level, log, of.err,
- "%s \"%s\" failed", of.failed, path.data);
-
- return NGX_DECLINED;
- }
-
- if (gzcf->enable == NGX_HTTP_GZIP_STATIC_ON) {
- r->gzip_vary = 1;
-
- if (rc != NGX_OK) {
- return NGX_DECLINED;
- }
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd);
-
- if (of.is_dir) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http dir");
- return NGX_DECLINED;
- }
-
-#if !(NGX_WIN32) /* the not regular files are probably Unix specific */
-
- if (!of.is_file) {
- ngx_log_error(NGX_LOG_CRIT, log, 0,
- "\"%s\" is not a regular file", path.data);
-
- return NGX_HTTP_NOT_FOUND;
- }
-
-#endif
-
- r->root_tested = !r->error_page;
-
- rc = ngx_http_discard_request_body(r);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- log->action = "sending response to client";
-
- r->headers_out.status = NGX_HTTP_OK;
- r->headers_out.content_length_n = of.size;
- r->headers_out.last_modified_time = of.mtime;
-
- if (ngx_http_set_etag(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_http_set_content_type(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- h = ngx_list_push(&r->headers_out.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = 1;
- ngx_str_set(&h->key, "Content-Encoding");
- ngx_str_set(&h->value, "gzip");
- r->headers_out.content_encoding = h;
-
- /* we need to allocate all before the header would be sent */
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t));
- if (b->file == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- return rc;
- }
-
- b->file_pos = 0;
- b->file_last = of.size;
-
- b->in_file = b->file_last ? 1 : 0;
- b->last_buf = (r == r->main) ? 1 : 0;
- b->last_in_chain = 1;
-
- b->file->fd = of.fd;
- b->file->name = path;
- b->file->log = log;
- b->file->directio = of.is_directio;
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_output_filter(r, &out);
-}
-
-
-static void *
-ngx_http_gzip_static_create_conf(ngx_conf_t *cf)
-{
- ngx_http_gzip_static_conf_t *conf;
-
- conf = ngx_palloc(cf->pool, sizeof(ngx_http_gzip_static_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->enable = NGX_CONF_UNSET_UINT;
-
- return conf;
-}
-
-
-static char *
-ngx_http_gzip_static_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_gzip_static_conf_t *prev = parent;
- ngx_http_gzip_static_conf_t *conf = child;
-
- ngx_conf_merge_uint_value(conf->enable, prev->enable,
- NGX_HTTP_GZIP_STATIC_OFF);
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_gzip_static_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_CONTENT_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_gzip_static_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_headers_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_headers_filter_module.c
deleted file mode 100644
index f33cfb78e3d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_headers_filter_module.c
+++ /dev/null
@@ -1,663 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct ngx_http_header_val_s ngx_http_header_val_t;
-
-typedef ngx_int_t (*ngx_http_set_header_pt)(ngx_http_request_t *r,
- ngx_http_header_val_t *hv, ngx_str_t *value);
-
-
-typedef struct {
- ngx_str_t name;
- ngx_uint_t offset;
- ngx_http_set_header_pt handler;
-} ngx_http_set_header_t;
-
-
-struct ngx_http_header_val_s {
- ngx_http_complex_value_t value;
- ngx_str_t key;
- ngx_http_set_header_pt handler;
- ngx_uint_t offset;
- ngx_uint_t always; /* unsigned always:1 */
-};
-
-
-typedef enum {
- NGX_HTTP_EXPIRES_OFF,
- NGX_HTTP_EXPIRES_EPOCH,
- NGX_HTTP_EXPIRES_MAX,
- NGX_HTTP_EXPIRES_ACCESS,
- NGX_HTTP_EXPIRES_MODIFIED,
- NGX_HTTP_EXPIRES_DAILY,
- NGX_HTTP_EXPIRES_UNSET
-} ngx_http_expires_t;
-
-
-typedef struct {
- ngx_http_expires_t expires;
- time_t expires_time;
- ngx_array_t *headers;
-} ngx_http_headers_conf_t;
-
-
-static ngx_int_t ngx_http_set_expires(ngx_http_request_t *r,
- ngx_http_headers_conf_t *conf);
-static ngx_int_t ngx_http_add_cache_control(ngx_http_request_t *r,
- ngx_http_header_val_t *hv, ngx_str_t *value);
-static ngx_int_t ngx_http_add_header(ngx_http_request_t *r,
- ngx_http_header_val_t *hv, ngx_str_t *value);
-static ngx_int_t ngx_http_set_last_modified(ngx_http_request_t *r,
- ngx_http_header_val_t *hv, ngx_str_t *value);
-static ngx_int_t ngx_http_set_response_header(ngx_http_request_t *r,
- ngx_http_header_val_t *hv, ngx_str_t *value);
-
-static void *ngx_http_headers_create_conf(ngx_conf_t *cf);
-static char *ngx_http_headers_merge_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_headers_filter_init(ngx_conf_t *cf);
-static char *ngx_http_headers_expires(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_headers_add(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_http_set_header_t ngx_http_set_headers[] = {
-
- { ngx_string("Cache-Control"), 0, ngx_http_add_cache_control },
-
- { ngx_string("Last-Modified"),
- offsetof(ngx_http_headers_out_t, last_modified),
- ngx_http_set_last_modified },
-
- { ngx_string("ETag"),
- offsetof(ngx_http_headers_out_t, etag),
- ngx_http_set_response_header },
-
- { ngx_null_string, 0, NULL }
-};
-
-
-static ngx_command_t ngx_http_headers_filter_commands[] = {
-
- { ngx_string("expires"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE12,
- ngx_http_headers_expires,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL},
-
- { ngx_string("add_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE23,
- ngx_http_headers_add,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL},
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_headers_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_headers_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_headers_create_conf, /* create location configuration */
- ngx_http_headers_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_headers_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_headers_filter_module_ctx, /* module context */
- ngx_http_headers_filter_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-
-
-static ngx_int_t
-ngx_http_headers_filter(ngx_http_request_t *r)
-{
- ngx_str_t value;
- ngx_uint_t i, safe_status;
- ngx_http_header_val_t *h;
- ngx_http_headers_conf_t *conf;
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_headers_filter_module);
-
- if ((conf->expires == NGX_HTTP_EXPIRES_OFF && conf->headers == NULL)
- || r != r->main)
- {
- return ngx_http_next_header_filter(r);
- }
-
- switch (r->headers_out.status) {
-
- case NGX_HTTP_OK:
- case NGX_HTTP_CREATED:
- case NGX_HTTP_NO_CONTENT:
- case NGX_HTTP_PARTIAL_CONTENT:
- case NGX_HTTP_MOVED_PERMANENTLY:
- case NGX_HTTP_MOVED_TEMPORARILY:
- case NGX_HTTP_SEE_OTHER:
- case NGX_HTTP_NOT_MODIFIED:
- case NGX_HTTP_TEMPORARY_REDIRECT:
- safe_status = 1;
- break;
-
- default:
- safe_status = 0;
- break;
- }
-
- if (conf->expires != NGX_HTTP_EXPIRES_OFF && safe_status) {
- if (ngx_http_set_expires(r, conf) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- if (conf->headers) {
- h = conf->headers->elts;
- for (i = 0; i < conf->headers->nelts; i++) {
-
- if (!safe_status && !h[i].always) {
- continue;
- }
-
- if (ngx_http_complex_value(r, &h[i].value, &value) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (h[i].handler(r, &h[i], &value) != NGX_OK) {
- return NGX_ERROR;
- }
- }
- }
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_set_expires(ngx_http_request_t *r, ngx_http_headers_conf_t *conf)
-{
- size_t len;
- time_t now, expires_time, max_age;
- ngx_uint_t i;
- ngx_table_elt_t *expires, *cc, **ccp;
-
- expires = r->headers_out.expires;
-
- if (expires == NULL) {
-
- expires = ngx_list_push(&r->headers_out.headers);
- if (expires == NULL) {
- return NGX_ERROR;
- }
-
- r->headers_out.expires = expires;
-
- expires->hash = 1;
- ngx_str_set(&expires->key, "Expires");
- }
-
- len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT");
- expires->value.len = len - 1;
-
- ccp = r->headers_out.cache_control.elts;
-
- if (ccp == NULL) {
-
- if (ngx_array_init(&r->headers_out.cache_control, r->pool,
- 1, sizeof(ngx_table_elt_t *))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- ccp = ngx_array_push(&r->headers_out.cache_control);
- if (ccp == NULL) {
- return NGX_ERROR;
- }
-
- cc = ngx_list_push(&r->headers_out.headers);
- if (cc == NULL) {
- return NGX_ERROR;
- }
-
- cc->hash = 1;
- ngx_str_set(&cc->key, "Cache-Control");
- *ccp = cc;
-
- } else {
- for (i = 1; i < r->headers_out.cache_control.nelts; i++) {
- ccp[i]->hash = 0;
- }
-
- cc = ccp[0];
- }
-
- if (conf->expires == NGX_HTTP_EXPIRES_EPOCH) {
- expires->value.data = (u_char *) "Thu, 01 Jan 1970 00:00:01 GMT";
- ngx_str_set(&cc->value, "no-cache");
- return NGX_OK;
- }
-
- if (conf->expires == NGX_HTTP_EXPIRES_MAX) {
- expires->value.data = (u_char *) "Thu, 31 Dec 2037 23:55:55 GMT";
- /* 10 years */
- ngx_str_set(&cc->value, "max-age=315360000");
- return NGX_OK;
- }
-
- expires->value.data = ngx_pnalloc(r->pool, len);
- if (expires->value.data == NULL) {
- return NGX_ERROR;
- }
-
- if (conf->expires_time == 0 && conf->expires != NGX_HTTP_EXPIRES_DAILY) {
- ngx_memcpy(expires->value.data, ngx_cached_http_time.data,
- ngx_cached_http_time.len + 1);
- ngx_str_set(&cc->value, "max-age=0");
- return NGX_OK;
- }
-
- now = ngx_time();
-
- if (conf->expires == NGX_HTTP_EXPIRES_DAILY) {
- expires_time = ngx_next_time(conf->expires_time);
- max_age = expires_time - now;
-
- } else if (conf->expires == NGX_HTTP_EXPIRES_ACCESS
- || r->headers_out.last_modified_time == -1)
- {
- expires_time = now + conf->expires_time;
- max_age = conf->expires_time;
-
- } else {
- expires_time = r->headers_out.last_modified_time + conf->expires_time;
- max_age = expires_time - now;
- }
-
- ngx_http_time(expires->value.data, expires_time);
-
- if (conf->expires_time < 0 || max_age < 0) {
- ngx_str_set(&cc->value, "no-cache");
- return NGX_OK;
- }
-
- cc->value.data = ngx_pnalloc(r->pool,
- sizeof("max-age=") + NGX_TIME_T_LEN + 1);
- if (cc->value.data == NULL) {
- return NGX_ERROR;
- }
-
- cc->value.len = ngx_sprintf(cc->value.data, "max-age=%T", max_age)
- - cc->value.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_add_header(ngx_http_request_t *r, ngx_http_header_val_t *hv,
- ngx_str_t *value)
-{
- ngx_table_elt_t *h;
-
- if (value->len) {
- h = ngx_list_push(&r->headers_out.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = 1;
- h->key = hv->key;
- h->value = *value;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_add_cache_control(ngx_http_request_t *r, ngx_http_header_val_t *hv,
- ngx_str_t *value)
-{
- ngx_table_elt_t *cc, **ccp;
-
- if (value->len == 0) {
- return NGX_OK;
- }
-
- ccp = r->headers_out.cache_control.elts;
-
- if (ccp == NULL) {
-
- if (ngx_array_init(&r->headers_out.cache_control, r->pool,
- 1, sizeof(ngx_table_elt_t *))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
-
- ccp = ngx_array_push(&r->headers_out.cache_control);
- if (ccp == NULL) {
- return NGX_ERROR;
- }
-
- cc = ngx_list_push(&r->headers_out.headers);
- if (cc == NULL) {
- return NGX_ERROR;
- }
-
- cc->hash = 1;
- ngx_str_set(&cc->key, "Cache-Control");
- cc->value = *value;
-
- *ccp = cc;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_set_last_modified(ngx_http_request_t *r, ngx_http_header_val_t *hv,
- ngx_str_t *value)
-{
- if (ngx_http_set_response_header(r, hv, value) != NGX_OK) {
- return NGX_ERROR;
- }
-
- r->headers_out.last_modified_time =
- (value->len) ? ngx_http_parse_time(value->data, value->len) : -1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_set_response_header(ngx_http_request_t *r, ngx_http_header_val_t *hv,
- ngx_str_t *value)
-{
- ngx_table_elt_t *h, **old;
-
- old = (ngx_table_elt_t **) ((char *) &r->headers_out + hv->offset);
-
- if (value->len == 0) {
- if (*old) {
- (*old)->hash = 0;
- *old = NULL;
- }
-
- return NGX_OK;
- }
-
- if (*old) {
- h = *old;
-
- } else {
- h = ngx_list_push(&r->headers_out.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *old = h;
- }
-
- h->hash = 1;
- h->key = hv->key;
- h->value = *value;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_headers_create_conf(ngx_conf_t *cf)
-{
- ngx_http_headers_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_headers_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->headers = NULL;
- * conf->expires_time = 0;
- */
-
- conf->expires = NGX_HTTP_EXPIRES_UNSET;
-
- return conf;
-}
-
-
-static char *
-ngx_http_headers_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_headers_conf_t *prev = parent;
- ngx_http_headers_conf_t *conf = child;
-
- if (conf->expires == NGX_HTTP_EXPIRES_UNSET) {
- conf->expires = prev->expires;
- conf->expires_time = prev->expires_time;
-
- if (conf->expires == NGX_HTTP_EXPIRES_UNSET) {
- conf->expires = NGX_HTTP_EXPIRES_OFF;
- }
- }
-
- if (conf->headers == NULL) {
- conf->headers = prev->headers;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_headers_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_headers_filter;
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_headers_expires(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_headers_conf_t *hcf = conf;
-
- ngx_uint_t minus, n;
- ngx_str_t *value;
-
- if (hcf->expires != NGX_HTTP_EXPIRES_UNSET) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (cf->args->nelts == 2) {
-
- if (ngx_strcmp(value[1].data, "epoch") == 0) {
- hcf->expires = NGX_HTTP_EXPIRES_EPOCH;
- return NGX_CONF_OK;
- }
-
- if (ngx_strcmp(value[1].data, "max") == 0) {
- hcf->expires = NGX_HTTP_EXPIRES_MAX;
- return NGX_CONF_OK;
- }
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- hcf->expires = NGX_HTTP_EXPIRES_OFF;
- return NGX_CONF_OK;
- }
-
- hcf->expires = NGX_HTTP_EXPIRES_ACCESS;
-
- n = 1;
-
- } else { /* cf->args->nelts == 3 */
-
- if (ngx_strcmp(value[1].data, "modified") != 0) {
- return "invalid value";
- }
-
- hcf->expires = NGX_HTTP_EXPIRES_MODIFIED;
-
- n = 2;
- }
-
- if (value[n].data[0] == '@') {
- value[n].data++;
- value[n].len--;
- minus = 0;
-
- if (hcf->expires == NGX_HTTP_EXPIRES_MODIFIED) {
- return "daily time cannot be used with \"modified\" parameter";
- }
-
- hcf->expires = NGX_HTTP_EXPIRES_DAILY;
-
- } else if (value[n].data[0] == '+') {
- value[n].data++;
- value[n].len--;
- minus = 0;
-
- } else if (value[n].data[0] == '-') {
- value[n].data++;
- value[n].len--;
- minus = 1;
-
- } else {
- minus = 0;
- }
-
- hcf->expires_time = ngx_parse_time(&value[n], 1);
-
- if (hcf->expires_time == (time_t) NGX_ERROR) {
- return "invalid value";
- }
-
- if (hcf->expires == NGX_HTTP_EXPIRES_DAILY
- && hcf->expires_time > 24 * 60 * 60)
- {
- return "daily time value must be less than 24 hours";
- }
-
- if (minus) {
- hcf->expires_time = - hcf->expires_time;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_headers_add(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_headers_conf_t *hcf = conf;
-
- ngx_str_t *value;
- ngx_uint_t i;
- ngx_http_header_val_t *hv;
- ngx_http_set_header_t *set;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- if (hcf->headers == NULL) {
- hcf->headers = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_header_val_t));
- if (hcf->headers == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- hv = ngx_array_push(hcf->headers);
- if (hv == NULL) {
- return NGX_CONF_ERROR;
- }
-
- hv->key = value[1];
- hv->handler = ngx_http_add_header;
- hv->offset = 0;
- hv->always = 0;
-
- set = ngx_http_set_headers;
- for (i = 0; set[i].name.len; i++) {
- if (ngx_strcasecmp(value[1].data, set[i].name.data) != 0) {
- continue;
- }
-
- hv->offset = set[i].offset;
- hv->handler = set[i].handler;
-
- break;
- }
-
- if (value[2].len == 0) {
- ngx_memzero(&hv->value, sizeof(ngx_http_complex_value_t));
- return NGX_CONF_OK;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[2];
- ccv.complex_value = &hv->value;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (cf->args->nelts == 3) {
- return NGX_CONF_OK;
- }
-
- if (ngx_strcmp(value[3].data, "always") != 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[3]);
- return NGX_CONF_ERROR;
- }
-
- hv->always = 1;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_image_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_image_filter_module.c
deleted file mode 100644
index bd7a3097015..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_image_filter_module.c
+++ /dev/null
@@ -1,1521 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-#include <gd.h>
-
-
-#define NGX_HTTP_IMAGE_OFF 0
-#define NGX_HTTP_IMAGE_TEST 1
-#define NGX_HTTP_IMAGE_SIZE 2
-#define NGX_HTTP_IMAGE_RESIZE 3
-#define NGX_HTTP_IMAGE_CROP 4
-#define NGX_HTTP_IMAGE_ROTATE 5
-
-
-#define NGX_HTTP_IMAGE_START 0
-#define NGX_HTTP_IMAGE_READ 1
-#define NGX_HTTP_IMAGE_PROCESS 2
-#define NGX_HTTP_IMAGE_PASS 3
-#define NGX_HTTP_IMAGE_DONE 4
-
-
-#define NGX_HTTP_IMAGE_NONE 0
-#define NGX_HTTP_IMAGE_JPEG 1
-#define NGX_HTTP_IMAGE_GIF 2
-#define NGX_HTTP_IMAGE_PNG 3
-
-
-#define NGX_HTTP_IMAGE_BUFFERED 0x08
-
-
-typedef struct {
- ngx_uint_t filter;
- ngx_uint_t width;
- ngx_uint_t height;
- ngx_uint_t angle;
- ngx_uint_t jpeg_quality;
- ngx_uint_t sharpen;
-
- ngx_flag_t transparency;
- ngx_flag_t interlace;
-
- ngx_http_complex_value_t *wcv;
- ngx_http_complex_value_t *hcv;
- ngx_http_complex_value_t *acv;
- ngx_http_complex_value_t *jqcv;
- ngx_http_complex_value_t *shcv;
-
- size_t buffer_size;
-} ngx_http_image_filter_conf_t;
-
-
-typedef struct {
- u_char *image;
- u_char *last;
-
- size_t length;
-
- ngx_uint_t width;
- ngx_uint_t height;
- ngx_uint_t max_width;
- ngx_uint_t max_height;
- ngx_uint_t angle;
-
- ngx_uint_t phase;
- ngx_uint_t type;
- ngx_uint_t force;
-} ngx_http_image_filter_ctx_t;
-
-
-static ngx_int_t ngx_http_image_send(ngx_http_request_t *r,
- ngx_http_image_filter_ctx_t *ctx, ngx_chain_t *in);
-static ngx_uint_t ngx_http_image_test(ngx_http_request_t *r, ngx_chain_t *in);
-static ngx_int_t ngx_http_image_read(ngx_http_request_t *r, ngx_chain_t *in);
-static ngx_buf_t *ngx_http_image_process(ngx_http_request_t *r);
-static ngx_buf_t *ngx_http_image_json(ngx_http_request_t *r,
- ngx_http_image_filter_ctx_t *ctx);
-static ngx_buf_t *ngx_http_image_asis(ngx_http_request_t *r,
- ngx_http_image_filter_ctx_t *ctx);
-static void ngx_http_image_length(ngx_http_request_t *r, ngx_buf_t *b);
-static ngx_int_t ngx_http_image_size(ngx_http_request_t *r,
- ngx_http_image_filter_ctx_t *ctx);
-
-static ngx_buf_t *ngx_http_image_resize(ngx_http_request_t *r,
- ngx_http_image_filter_ctx_t *ctx);
-static gdImagePtr ngx_http_image_source(ngx_http_request_t *r,
- ngx_http_image_filter_ctx_t *ctx);
-static gdImagePtr ngx_http_image_new(ngx_http_request_t *r, int w, int h,
- int colors);
-static u_char *ngx_http_image_out(ngx_http_request_t *r, ngx_uint_t type,
- gdImagePtr img, int *size);
-static void ngx_http_image_cleanup(void *data);
-static ngx_uint_t ngx_http_image_filter_get_value(ngx_http_request_t *r,
- ngx_http_complex_value_t *cv, ngx_uint_t v);
-static ngx_uint_t ngx_http_image_filter_value(ngx_str_t *value);
-
-
-static void *ngx_http_image_filter_create_conf(ngx_conf_t *cf);
-static char *ngx_http_image_filter_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_http_image_filter(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_image_filter_jpeg_quality(ngx_conf_t *cf,
- ngx_command_t *cmd, void *conf);
-static char *ngx_http_image_filter_sharpen(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static ngx_int_t ngx_http_image_filter_init(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_image_filter_commands[] = {
-
- { ngx_string("image_filter"),
- NGX_HTTP_LOC_CONF|NGX_CONF_TAKE123,
- ngx_http_image_filter,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("image_filter_jpeg_quality"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_image_filter_jpeg_quality,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("image_filter_sharpen"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_image_filter_sharpen,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("image_filter_transparency"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_image_filter_conf_t, transparency),
- NULL },
-
- { ngx_string("image_filter_interlace"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_image_filter_conf_t, interlace),
- NULL },
-
- { ngx_string("image_filter_buffer"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_image_filter_conf_t, buffer_size),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_image_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_image_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_image_filter_create_conf, /* create location configuration */
- ngx_http_image_filter_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_image_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_image_filter_module_ctx, /* module context */
- ngx_http_image_filter_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_str_t ngx_http_image_types[] = {
- ngx_string("image/jpeg"),
- ngx_string("image/gif"),
- ngx_string("image/png")
-};
-
-
-static ngx_int_t
-ngx_http_image_header_filter(ngx_http_request_t *r)
-{
- off_t len;
- ngx_http_image_filter_ctx_t *ctx;
- ngx_http_image_filter_conf_t *conf;
-
- if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED) {
- return ngx_http_next_header_filter(r);
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module);
-
- if (ctx) {
- ngx_http_set_ctx(r, NULL, ngx_http_image_filter_module);
- return ngx_http_next_header_filter(r);
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module);
-
- if (conf->filter == NGX_HTTP_IMAGE_OFF) {
- return ngx_http_next_header_filter(r);
- }
-
- if (r->headers_out.content_type.len
- >= sizeof("multipart/x-mixed-replace") - 1
- && ngx_strncasecmp(r->headers_out.content_type.data,
- (u_char *) "multipart/x-mixed-replace",
- sizeof("multipart/x-mixed-replace") - 1)
- == 0)
- {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "image filter: multipart/x-mixed-replace response");
-
- return NGX_ERROR;
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_image_filter_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_image_filter_module);
-
- len = r->headers_out.content_length_n;
-
- if (len != -1 && len > (off_t) conf->buffer_size) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "image filter: too big response: %O", len);
-
- return NGX_HTTP_UNSUPPORTED_MEDIA_TYPE;
- }
-
- if (len == -1) {
- ctx->length = conf->buffer_size;
-
- } else {
- ctx->length = (size_t) len;
- }
-
- if (r->headers_out.refresh) {
- r->headers_out.refresh->hash = 0;
- }
-
- r->main_filter_need_in_memory = 1;
- r->allow_ranges = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_image_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- ngx_int_t rc;
- ngx_str_t *ct;
- ngx_chain_t out;
- ngx_http_image_filter_ctx_t *ctx;
- ngx_http_image_filter_conf_t *conf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "image filter");
-
- if (in == NULL) {
- return ngx_http_next_body_filter(r, in);
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module);
-
- if (ctx == NULL) {
- return ngx_http_next_body_filter(r, in);
- }
-
- switch (ctx->phase) {
-
- case NGX_HTTP_IMAGE_START:
-
- ctx->type = ngx_http_image_test(r, in);
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module);
-
- if (ctx->type == NGX_HTTP_IMAGE_NONE) {
-
- if (conf->filter == NGX_HTTP_IMAGE_SIZE) {
- out.buf = ngx_http_image_json(r, NULL);
-
- if (out.buf) {
- out.next = NULL;
- ctx->phase = NGX_HTTP_IMAGE_DONE;
-
- return ngx_http_image_send(r, ctx, &out);
- }
- }
-
- return ngx_http_filter_finalize_request(r,
- &ngx_http_image_filter_module,
- NGX_HTTP_UNSUPPORTED_MEDIA_TYPE);
- }
-
- /* override content type */
-
- ct = &ngx_http_image_types[ctx->type - 1];
- r->headers_out.content_type_len = ct->len;
- r->headers_out.content_type = *ct;
- r->headers_out.content_type_lowcase = NULL;
-
- if (conf->filter == NGX_HTTP_IMAGE_TEST) {
- ctx->phase = NGX_HTTP_IMAGE_PASS;
-
- return ngx_http_image_send(r, ctx, in);
- }
-
- ctx->phase = NGX_HTTP_IMAGE_READ;
-
- /* fall through */
-
- case NGX_HTTP_IMAGE_READ:
-
- rc = ngx_http_image_read(r, in);
-
- if (rc == NGX_AGAIN) {
- return NGX_OK;
- }
-
- if (rc == NGX_ERROR) {
- return ngx_http_filter_finalize_request(r,
- &ngx_http_image_filter_module,
- NGX_HTTP_UNSUPPORTED_MEDIA_TYPE);
- }
-
- /* fall through */
-
- case NGX_HTTP_IMAGE_PROCESS:
-
- out.buf = ngx_http_image_process(r);
-
- if (out.buf == NULL) {
- return ngx_http_filter_finalize_request(r,
- &ngx_http_image_filter_module,
- NGX_HTTP_UNSUPPORTED_MEDIA_TYPE);
- }
-
- out.next = NULL;
- ctx->phase = NGX_HTTP_IMAGE_PASS;
-
- return ngx_http_image_send(r, ctx, &out);
-
- case NGX_HTTP_IMAGE_PASS:
-
- return ngx_http_next_body_filter(r, in);
-
- default: /* NGX_HTTP_IMAGE_DONE */
-
- rc = ngx_http_next_body_filter(r, NULL);
-
- /* NGX_ERROR resets any pending data */
- return (rc == NGX_OK) ? NGX_ERROR : rc;
- }
-}
-
-
-static ngx_int_t
-ngx_http_image_send(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx,
- ngx_chain_t *in)
-{
- ngx_int_t rc;
-
- rc = ngx_http_next_header_filter(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- return NGX_ERROR;
- }
-
- rc = ngx_http_next_body_filter(r, in);
-
- if (ctx->phase == NGX_HTTP_IMAGE_DONE) {
- /* NGX_ERROR resets any pending data */
- return (rc == NGX_OK) ? NGX_ERROR : rc;
- }
-
- return rc;
-}
-
-
-static ngx_uint_t
-ngx_http_image_test(ngx_http_request_t *r, ngx_chain_t *in)
-{
- u_char *p;
-
- p = in->buf->pos;
-
- if (in->buf->last - p < 16) {
- return NGX_HTTP_IMAGE_NONE;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "image filter: \"%c%c\"", p[0], p[1]);
-
- if (p[0] == 0xff && p[1] == 0xd8) {
-
- /* JPEG */
-
- return NGX_HTTP_IMAGE_JPEG;
-
- } else if (p[0] == 'G' && p[1] == 'I' && p[2] == 'F' && p[3] == '8'
- && p[5] == 'a')
- {
- if (p[4] == '9' || p[4] == '7') {
- /* GIF */
- return NGX_HTTP_IMAGE_GIF;
- }
-
- } else if (p[0] == 0x89 && p[1] == 'P' && p[2] == 'N' && p[3] == 'G'
- && p[4] == 0x0d && p[5] == 0x0a && p[6] == 0x1a && p[7] == 0x0a)
- {
- /* PNG */
-
- return NGX_HTTP_IMAGE_PNG;
- }
-
- return NGX_HTTP_IMAGE_NONE;
-}
-
-
-static ngx_int_t
-ngx_http_image_read(ngx_http_request_t *r, ngx_chain_t *in)
-{
- u_char *p;
- size_t size, rest;
- ngx_buf_t *b;
- ngx_chain_t *cl;
- ngx_http_image_filter_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module);
-
- if (ctx->image == NULL) {
- ctx->image = ngx_palloc(r->pool, ctx->length);
- if (ctx->image == NULL) {
- return NGX_ERROR;
- }
-
- ctx->last = ctx->image;
- }
-
- p = ctx->last;
-
- for (cl = in; cl; cl = cl->next) {
-
- b = cl->buf;
- size = b->last - b->pos;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "image buf: %uz", size);
-
- rest = ctx->image + ctx->length - p;
-
- if (size > rest) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "image filter: too big response");
- return NGX_ERROR;
- }
-
- p = ngx_cpymem(p, b->pos, size);
- b->pos += size;
-
- if (b->last_buf) {
- ctx->last = p;
- return NGX_OK;
- }
- }
-
- ctx->last = p;
- r->connection->buffered |= NGX_HTTP_IMAGE_BUFFERED;
-
- return NGX_AGAIN;
-}
-
-
-static ngx_buf_t *
-ngx_http_image_process(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_http_image_filter_ctx_t *ctx;
- ngx_http_image_filter_conf_t *conf;
-
- r->connection->buffered &= ~NGX_HTTP_IMAGE_BUFFERED;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_image_filter_module);
-
- rc = ngx_http_image_size(r, ctx);
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module);
-
- if (conf->filter == NGX_HTTP_IMAGE_SIZE) {
- return ngx_http_image_json(r, rc == NGX_OK ? ctx : NULL);
- }
-
- ctx->angle = ngx_http_image_filter_get_value(r, conf->acv, conf->angle);
-
- if (conf->filter == NGX_HTTP_IMAGE_ROTATE) {
-
- if (ctx->angle != 90 && ctx->angle != 180 && ctx->angle != 270) {
- return NULL;
- }
-
- return ngx_http_image_resize(r, ctx);
- }
-
- ctx->max_width = ngx_http_image_filter_get_value(r, conf->wcv, conf->width);
- if (ctx->max_width == 0) {
- return NULL;
- }
-
- ctx->max_height = ngx_http_image_filter_get_value(r, conf->hcv,
- conf->height);
- if (ctx->max_height == 0) {
- return NULL;
- }
-
- if (rc == NGX_OK
- && ctx->width <= ctx->max_width
- && ctx->height <= ctx->max_height
- && ctx->angle == 0
- && !ctx->force)
- {
- return ngx_http_image_asis(r, ctx);
- }
-
- return ngx_http_image_resize(r, ctx);
-}
-
-
-static ngx_buf_t *
-ngx_http_image_json(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
-{
- size_t len;
- ngx_buf_t *b;
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NULL;
- }
-
- b->memory = 1;
- b->last_buf = 1;
-
- ngx_http_clean_header(r);
-
- r->headers_out.status = NGX_HTTP_OK;
- r->headers_out.content_type_len = sizeof("application/json") - 1;
- ngx_str_set(&r->headers_out.content_type, "application/json");
- r->headers_out.content_type_lowcase = NULL;
-
- if (ctx == NULL) {
- b->pos = (u_char *) "{}" CRLF;
- b->last = b->pos + sizeof("{}" CRLF) - 1;
-
- ngx_http_image_length(r, b);
-
- return b;
- }
-
- len = sizeof("{ \"img\" : "
- "{ \"width\": , \"height\": , \"type\": \"jpeg\" } }" CRLF) - 1
- + 2 * NGX_SIZE_T_LEN;
-
- b->pos = ngx_pnalloc(r->pool, len);
- if (b->pos == NULL) {
- return NULL;
- }
-
- b->last = ngx_sprintf(b->pos,
- "{ \"img\" : "
- "{ \"width\": %uz,"
- " \"height\": %uz,"
- " \"type\": \"%s\" } }" CRLF,
- ctx->width, ctx->height,
- ngx_http_image_types[ctx->type - 1].data + 6);
-
- ngx_http_image_length(r, b);
-
- return b;
-}
-
-
-static ngx_buf_t *
-ngx_http_image_asis(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
-{
- ngx_buf_t *b;
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NULL;
- }
-
- b->pos = ctx->image;
- b->last = ctx->last;
- b->memory = 1;
- b->last_buf = 1;
-
- ngx_http_image_length(r, b);
-
- return b;
-}
-
-
-static void
-ngx_http_image_length(ngx_http_request_t *r, ngx_buf_t *b)
-{
- r->headers_out.content_length_n = b->last - b->pos;
-
- if (r->headers_out.content_length) {
- r->headers_out.content_length->hash = 0;
- }
-
- r->headers_out.content_length = NULL;
-}
-
-
-static ngx_int_t
-ngx_http_image_size(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
-{
- u_char *p, *last;
- size_t len, app;
- ngx_uint_t width, height;
-
- p = ctx->image;
-
- switch (ctx->type) {
-
- case NGX_HTTP_IMAGE_JPEG:
-
- p += 2;
- last = ctx->image + ctx->length - 10;
- width = 0;
- height = 0;
- app = 0;
-
- while (p < last) {
-
- if (p[0] == 0xff && p[1] != 0xff) {
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "JPEG: %02xd %02xd", p[0], p[1]);
-
- p++;
-
- if ((*p == 0xc0 || *p == 0xc1 || *p == 0xc2 || *p == 0xc3
- || *p == 0xc9 || *p == 0xca || *p == 0xcb)
- && (width == 0 || height == 0))
- {
- width = p[6] * 256 + p[7];
- height = p[4] * 256 + p[5];
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "JPEG: %02xd %02xd", p[1], p[2]);
-
- len = p[1] * 256 + p[2];
-
- if (*p >= 0xe1 && *p <= 0xef) {
- /* application data, e.g., EXIF, Adobe XMP, etc. */
- app += len;
- }
-
- p += len;
-
- continue;
- }
-
- p++;
- }
-
- if (width == 0 || height == 0) {
- return NGX_DECLINED;
- }
-
- if (ctx->length / 20 < app) {
- /* force conversion if application data consume more than 5% */
- ctx->force = 1;
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "app data size: %uz", app);
- }
-
- break;
-
- case NGX_HTTP_IMAGE_GIF:
-
- if (ctx->length < 10) {
- return NGX_DECLINED;
- }
-
- width = p[7] * 256 + p[6];
- height = p[9] * 256 + p[8];
-
- break;
-
- case NGX_HTTP_IMAGE_PNG:
-
- if (ctx->length < 24) {
- return NGX_DECLINED;
- }
-
- width = p[18] * 256 + p[19];
- height = p[22] * 256 + p[23];
-
- break;
-
- default:
-
- return NGX_DECLINED;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "image size: %d x %d", width, height);
-
- ctx->width = width;
- ctx->height = height;
-
- return NGX_OK;
-}
-
-
-static ngx_buf_t *
-ngx_http_image_resize(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
-{
- int sx, sy, dx, dy, ox, oy, ax, ay, size,
- colors, palette, transparent, sharpen,
- red, green, blue, t;
- u_char *out;
- ngx_buf_t *b;
- ngx_uint_t resize;
- gdImagePtr src, dst;
- ngx_pool_cleanup_t *cln;
- ngx_http_image_filter_conf_t *conf;
-
- src = ngx_http_image_source(r, ctx);
-
- if (src == NULL) {
- return NULL;
- }
-
- sx = gdImageSX(src);
- sy = gdImageSY(src);
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module);
-
- if (!ctx->force
- && ctx->angle == 0
- && (ngx_uint_t) sx <= ctx->max_width
- && (ngx_uint_t) sy <= ctx->max_height)
- {
- gdImageDestroy(src);
- return ngx_http_image_asis(r, ctx);
- }
-
- colors = gdImageColorsTotal(src);
-
- if (colors && conf->transparency) {
- transparent = gdImageGetTransparent(src);
-
- if (transparent != -1) {
- palette = colors;
- red = gdImageRed(src, transparent);
- green = gdImageGreen(src, transparent);
- blue = gdImageBlue(src, transparent);
-
- goto transparent;
- }
- }
-
- palette = 0;
- transparent = -1;
- red = 0;
- green = 0;
- blue = 0;
-
-transparent:
-
- gdImageColorTransparent(src, -1);
-
- dx = sx;
- dy = sy;
-
- if (conf->filter == NGX_HTTP_IMAGE_RESIZE) {
-
- if ((ngx_uint_t) dx > ctx->max_width) {
- dy = dy * ctx->max_width / dx;
- dy = dy ? dy : 1;
- dx = ctx->max_width;
- }
-
- if ((ngx_uint_t) dy > ctx->max_height) {
- dx = dx * ctx->max_height / dy;
- dx = dx ? dx : 1;
- dy = ctx->max_height;
- }
-
- resize = 1;
-
- } else if (conf->filter == NGX_HTTP_IMAGE_ROTATE) {
-
- resize = 0;
-
- } else { /* NGX_HTTP_IMAGE_CROP */
-
- resize = 0;
-
- if ((double) dx / dy < (double) ctx->max_width / ctx->max_height) {
- if ((ngx_uint_t) dx > ctx->max_width) {
- dy = dy * ctx->max_width / dx;
- dy = dy ? dy : 1;
- dx = ctx->max_width;
- resize = 1;
- }
-
- } else {
- if ((ngx_uint_t) dy > ctx->max_height) {
- dx = dx * ctx->max_height / dy;
- dx = dx ? dx : 1;
- dy = ctx->max_height;
- resize = 1;
- }
- }
- }
-
- if (resize) {
- dst = ngx_http_image_new(r, dx, dy, palette);
- if (dst == NULL) {
- gdImageDestroy(src);
- return NULL;
- }
-
- if (colors == 0) {
- gdImageSaveAlpha(dst, 1);
- gdImageAlphaBlending(dst, 0);
- }
-
- gdImageCopyResampled(dst, src, 0, 0, 0, 0, dx, dy, sx, sy);
-
- if (colors) {
- gdImageTrueColorToPalette(dst, 1, 256);
- }
-
- gdImageDestroy(src);
-
- } else {
- dst = src;
- }
-
- if (ctx->angle) {
- src = dst;
-
- ax = (dx % 2 == 0) ? 1 : 0;
- ay = (dy % 2 == 0) ? 1 : 0;
-
- switch (ctx->angle) {
-
- case 90:
- case 270:
- dst = ngx_http_image_new(r, dy, dx, palette);
- if (dst == NULL) {
- gdImageDestroy(src);
- return NULL;
- }
- if (ctx->angle == 90) {
- ox = dy / 2 + ay;
- oy = dx / 2 - ax;
-
- } else {
- ox = dy / 2 - ay;
- oy = dx / 2 + ax;
- }
-
- gdImageCopyRotated(dst, src, ox, oy, 0, 0,
- dx + ax, dy + ay, ctx->angle);
- gdImageDestroy(src);
-
- t = dx;
- dx = dy;
- dy = t;
- break;
-
- case 180:
- dst = ngx_http_image_new(r, dx, dy, palette);
- if (dst == NULL) {
- gdImageDestroy(src);
- return NULL;
- }
- gdImageCopyRotated(dst, src, dx / 2 - ax, dy / 2 - ay, 0, 0,
- dx + ax, dy + ay, ctx->angle);
- gdImageDestroy(src);
- break;
- }
- }
-
- if (conf->filter == NGX_HTTP_IMAGE_CROP) {
-
- src = dst;
-
- if ((ngx_uint_t) dx > ctx->max_width) {
- ox = dx - ctx->max_width;
-
- } else {
- ox = 0;
- }
-
- if ((ngx_uint_t) dy > ctx->max_height) {
- oy = dy - ctx->max_height;
-
- } else {
- oy = 0;
- }
-
- if (ox || oy) {
-
- dst = ngx_http_image_new(r, dx - ox, dy - oy, colors);
-
- if (dst == NULL) {
- gdImageDestroy(src);
- return NULL;
- }
-
- ox /= 2;
- oy /= 2;
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "image crop: %d x %d @ %d x %d",
- dx, dy, ox, oy);
-
- if (colors == 0) {
- gdImageSaveAlpha(dst, 1);
- gdImageAlphaBlending(dst, 0);
- }
-
- gdImageCopy(dst, src, 0, 0, ox, oy, dx - ox, dy - oy);
-
- if (colors) {
- gdImageTrueColorToPalette(dst, 1, 256);
- }
-
- gdImageDestroy(src);
- }
- }
-
- if (transparent != -1 && colors) {
- gdImageColorTransparent(dst, gdImageColorExact(dst, red, green, blue));
- }
-
- sharpen = ngx_http_image_filter_get_value(r, conf->shcv, conf->sharpen);
- if (sharpen > 0) {
- gdImageSharpen(dst, sharpen);
- }
-
- gdImageInterlace(dst, (int) conf->interlace);
-
- out = ngx_http_image_out(r, ctx->type, dst, &size);
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "image: %d x %d %d", sx, sy, colors);
-
- gdImageDestroy(dst);
- ngx_pfree(r->pool, ctx->image);
-
- if (out == NULL) {
- return NULL;
- }
-
- cln = ngx_pool_cleanup_add(r->pool, 0);
- if (cln == NULL) {
- gdFree(out);
- return NULL;
- }
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- gdFree(out);
- return NULL;
- }
-
- cln->handler = ngx_http_image_cleanup;
- cln->data = out;
-
- b->pos = out;
- b->last = out + size;
- b->memory = 1;
- b->last_buf = 1;
-
- ngx_http_image_length(r, b);
- ngx_http_weak_etag(r);
-
- return b;
-}
-
-
-static gdImagePtr
-ngx_http_image_source(ngx_http_request_t *r, ngx_http_image_filter_ctx_t *ctx)
-{
- char *failed;
- gdImagePtr img;
-
- img = NULL;
-
- switch (ctx->type) {
-
- case NGX_HTTP_IMAGE_JPEG:
- img = gdImageCreateFromJpegPtr(ctx->length, ctx->image);
- failed = "gdImageCreateFromJpegPtr() failed";
- break;
-
- case NGX_HTTP_IMAGE_GIF:
- img = gdImageCreateFromGifPtr(ctx->length, ctx->image);
- failed = "gdImageCreateFromGifPtr() failed";
- break;
-
- case NGX_HTTP_IMAGE_PNG:
- img = gdImageCreateFromPngPtr(ctx->length, ctx->image);
- failed = "gdImageCreateFromPngPtr() failed";
- break;
-
- default:
- failed = "unknown image type";
- break;
- }
-
- if (img == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, failed);
- }
-
- return img;
-}
-
-
-static gdImagePtr
-ngx_http_image_new(ngx_http_request_t *r, int w, int h, int colors)
-{
- gdImagePtr img;
-
- if (colors == 0) {
- img = gdImageCreateTrueColor(w, h);
-
- if (img == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "gdImageCreateTrueColor() failed");
- return NULL;
- }
-
- } else {
- img = gdImageCreate(w, h);
-
- if (img == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "gdImageCreate() failed");
- return NULL;
- }
- }
-
- return img;
-}
-
-
-static u_char *
-ngx_http_image_out(ngx_http_request_t *r, ngx_uint_t type, gdImagePtr img,
- int *size)
-{
- char *failed;
- u_char *out;
- ngx_int_t jq;
- ngx_http_image_filter_conf_t *conf;
-
- out = NULL;
-
- switch (type) {
-
- case NGX_HTTP_IMAGE_JPEG:
- conf = ngx_http_get_module_loc_conf(r, ngx_http_image_filter_module);
-
- jq = ngx_http_image_filter_get_value(r, conf->jqcv, conf->jpeg_quality);
- if (jq <= 0) {
- return NULL;
- }
-
- out = gdImageJpegPtr(img, size, jq);
- failed = "gdImageJpegPtr() failed";
- break;
-
- case NGX_HTTP_IMAGE_GIF:
- out = gdImageGifPtr(img, size);
- failed = "gdImageGifPtr() failed";
- break;
-
- case NGX_HTTP_IMAGE_PNG:
- out = gdImagePngPtr(img, size);
- failed = "gdImagePngPtr() failed";
- break;
-
- default:
- failed = "unknown image type";
- break;
- }
-
- if (out == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, failed);
- }
-
- return out;
-}
-
-
-static void
-ngx_http_image_cleanup(void *data)
-{
- gdFree(data);
-}
-
-
-static ngx_uint_t
-ngx_http_image_filter_get_value(ngx_http_request_t *r,
- ngx_http_complex_value_t *cv, ngx_uint_t v)
-{
- ngx_str_t val;
-
- if (cv == NULL) {
- return v;
- }
-
- if (ngx_http_complex_value(r, cv, &val) != NGX_OK) {
- return 0;
- }
-
- return ngx_http_image_filter_value(&val);
-}
-
-
-static ngx_uint_t
-ngx_http_image_filter_value(ngx_str_t *value)
-{
- ngx_int_t n;
-
- if (value->len == 1 && value->data[0] == '-') {
- return (ngx_uint_t) -1;
- }
-
- n = ngx_atoi(value->data, value->len);
-
- if (n > 0) {
- return (ngx_uint_t) n;
- }
-
- return 0;
-}
-
-
-static void *
-ngx_http_image_filter_create_conf(ngx_conf_t *cf)
-{
- ngx_http_image_filter_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_image_filter_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->width = 0;
- * conf->height = 0;
- * conf->angle = 0;
- * conf->wcv = NULL;
- * conf->hcv = NULL;
- * conf->acv = NULL;
- * conf->jqcv = NULL;
- * conf->shcv = NULL;
- */
-
- conf->filter = NGX_CONF_UNSET_UINT;
- conf->jpeg_quality = NGX_CONF_UNSET_UINT;
- conf->sharpen = NGX_CONF_UNSET_UINT;
- conf->transparency = NGX_CONF_UNSET;
- conf->interlace = NGX_CONF_UNSET;
- conf->buffer_size = NGX_CONF_UNSET_SIZE;
-
- return conf;
-}
-
-
-static char *
-ngx_http_image_filter_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_image_filter_conf_t *prev = parent;
- ngx_http_image_filter_conf_t *conf = child;
-
- if (conf->filter == NGX_CONF_UNSET_UINT) {
-
- if (prev->filter == NGX_CONF_UNSET_UINT) {
- conf->filter = NGX_HTTP_IMAGE_OFF;
-
- } else {
- conf->filter = prev->filter;
- conf->width = prev->width;
- conf->height = prev->height;
- conf->angle = prev->angle;
- conf->wcv = prev->wcv;
- conf->hcv = prev->hcv;
- conf->acv = prev->acv;
- }
- }
-
- if (conf->jpeg_quality == NGX_CONF_UNSET_UINT) {
-
- /* 75 is libjpeg default quality */
- ngx_conf_merge_uint_value(conf->jpeg_quality, prev->jpeg_quality, 75);
-
- if (conf->jqcv == NULL) {
- conf->jqcv = prev->jqcv;
- }
- }
-
- if (conf->sharpen == NGX_CONF_UNSET_UINT) {
- ngx_conf_merge_uint_value(conf->sharpen, prev->sharpen, 0);
-
- if (conf->shcv == NULL) {
- conf->shcv = prev->shcv;
- }
- }
-
- ngx_conf_merge_value(conf->transparency, prev->transparency, 1);
-
- ngx_conf_merge_value(conf->interlace, prev->interlace, 0);
-
- ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size,
- 1 * 1024 * 1024);
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_image_filter(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_image_filter_conf_t *imcf = conf;
-
- ngx_str_t *value;
- ngx_int_t n;
- ngx_uint_t i;
- ngx_http_complex_value_t cv;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- i = 1;
-
- if (cf->args->nelts == 2) {
- if (ngx_strcmp(value[i].data, "off") == 0) {
- imcf->filter = NGX_HTTP_IMAGE_OFF;
-
- } else if (ngx_strcmp(value[i].data, "test") == 0) {
- imcf->filter = NGX_HTTP_IMAGE_TEST;
-
- } else if (ngx_strcmp(value[i].data, "size") == 0) {
- imcf->filter = NGX_HTTP_IMAGE_SIZE;
-
- } else {
- goto failed;
- }
-
- return NGX_CONF_OK;
-
- } else if (cf->args->nelts == 3) {
-
- if (ngx_strcmp(value[i].data, "rotate") == 0) {
- if (imcf->filter != NGX_HTTP_IMAGE_RESIZE
- && imcf->filter != NGX_HTTP_IMAGE_CROP)
- {
- imcf->filter = NGX_HTTP_IMAGE_ROTATE;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[++i];
- ccv.complex_value = &cv;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (cv.lengths == NULL) {
- n = ngx_http_image_filter_value(&value[i]);
-
- if (n != 90 && n != 180 && n != 270) {
- goto failed;
- }
-
- imcf->angle = (ngx_uint_t) n;
-
- } else {
- imcf->acv = ngx_palloc(cf->pool,
- sizeof(ngx_http_complex_value_t));
- if (imcf->acv == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *imcf->acv = cv;
- }
-
- return NGX_CONF_OK;
-
- } else {
- goto failed;
- }
- }
-
- if (ngx_strcmp(value[i].data, "resize") == 0) {
- imcf->filter = NGX_HTTP_IMAGE_RESIZE;
-
- } else if (ngx_strcmp(value[i].data, "crop") == 0) {
- imcf->filter = NGX_HTTP_IMAGE_CROP;
-
- } else {
- goto failed;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[++i];
- ccv.complex_value = &cv;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (cv.lengths == NULL) {
- n = ngx_http_image_filter_value(&value[i]);
-
- if (n == 0) {
- goto failed;
- }
-
- imcf->width = (ngx_uint_t) n;
-
- } else {
- imcf->wcv = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
- if (imcf->wcv == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *imcf->wcv = cv;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[++i];
- ccv.complex_value = &cv;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (cv.lengths == NULL) {
- n = ngx_http_image_filter_value(&value[i]);
-
- if (n == 0) {
- goto failed;
- }
-
- imcf->height = (ngx_uint_t) n;
-
- } else {
- imcf->hcv = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
- if (imcf->hcv == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *imcf->hcv = cv;
- }
-
- return NGX_CONF_OK;
-
-failed:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"",
- &value[i]);
-
- return NGX_CONF_ERROR;
-}
-
-
-static char *
-ngx_http_image_filter_jpeg_quality(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf)
-{
- ngx_http_image_filter_conf_t *imcf = conf;
-
- ngx_str_t *value;
- ngx_int_t n;
- ngx_http_complex_value_t cv;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &cv;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (cv.lengths == NULL) {
- n = ngx_http_image_filter_value(&value[1]);
-
- if (n <= 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- imcf->jpeg_quality = (ngx_uint_t) n;
-
- } else {
- imcf->jqcv = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
- if (imcf->jqcv == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *imcf->jqcv = cv;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_image_filter_sharpen(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf)
-{
- ngx_http_image_filter_conf_t *imcf = conf;
-
- ngx_str_t *value;
- ngx_int_t n;
- ngx_http_complex_value_t cv;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &cv;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (cv.lengths == NULL) {
- n = ngx_http_image_filter_value(&value[1]);
-
- if (n < 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- imcf->sharpen = (ngx_uint_t) n;
-
- } else {
- imcf->shcv = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
- if (imcf->shcv == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *imcf->shcv = cv;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_image_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_image_header_filter;
-
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_image_body_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_index_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_index_module.c
deleted file mode 100644
index d3544db5bf5..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_index_module.c
+++ /dev/null
@@ -1,540 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_str_t name;
- ngx_array_t *lengths;
- ngx_array_t *values;
-} ngx_http_index_t;
-
-
-typedef struct {
- ngx_array_t *indices; /* array of ngx_http_index_t */
- size_t max_index_len;
-} ngx_http_index_loc_conf_t;
-
-
-#define NGX_HTTP_DEFAULT_INDEX "index.html"
-
-
-static ngx_int_t ngx_http_index_test_dir(ngx_http_request_t *r,
- ngx_http_core_loc_conf_t *clcf, u_char *path, u_char *last);
-static ngx_int_t ngx_http_index_error(ngx_http_request_t *r,
- ngx_http_core_loc_conf_t *clcf, u_char *file, ngx_err_t err);
-
-static ngx_int_t ngx_http_index_init(ngx_conf_t *cf);
-static void *ngx_http_index_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_index_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static char *ngx_http_index_set_index(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_http_index_commands[] = {
-
- { ngx_string("index"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_index_set_index,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_index_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_index_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_index_create_loc_conf, /* create location configuration */
- ngx_http_index_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_index_module = {
- NGX_MODULE_V1,
- &ngx_http_index_module_ctx, /* module context */
- ngx_http_index_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-/*
- * Try to open/test the first index file before the test of directory
- * existence because valid requests should prevail over invalid ones.
- * If open()/stat() of a file will fail then stat() of a directory
- * should be faster because kernel may have already cached some data.
- * Besides, Win32 may return ERROR_PATH_NOT_FOUND (NGX_ENOTDIR) at once.
- * Unix has ENOTDIR error; however, it's less helpful than Win32's one:
- * it only indicates that path points to a regular file, not a directory.
- */
-
-static ngx_int_t
-ngx_http_index_handler(ngx_http_request_t *r)
-{
- u_char *p, *name;
- size_t len, root, reserve, allocated;
- ngx_int_t rc;
- ngx_str_t path, uri;
- ngx_uint_t i, dir_tested;
- ngx_http_index_t *index;
- ngx_open_file_info_t of;
- ngx_http_script_code_pt code;
- ngx_http_script_engine_t e;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_index_loc_conf_t *ilcf;
- ngx_http_script_len_code_pt lcode;
-
- if (r->uri.data[r->uri.len - 1] != '/') {
- return NGX_DECLINED;
- }
-
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
- return NGX_DECLINED;
- }
-
- ilcf = ngx_http_get_module_loc_conf(r, ngx_http_index_module);
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- allocated = 0;
- root = 0;
- dir_tested = 0;
- name = NULL;
- /* suppress MSVC warning */
- path.data = NULL;
-
- index = ilcf->indices->elts;
- for (i = 0; i < ilcf->indices->nelts; i++) {
-
- if (index[i].lengths == NULL) {
-
- if (index[i].name.data[0] == '/') {
- return ngx_http_internal_redirect(r, &index[i].name, &r->args);
- }
-
- reserve = ilcf->max_index_len;
- len = index[i].name.len;
-
- } else {
- ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
-
- e.ip = index[i].lengths->elts;
- e.request = r;
- e.flushed = 1;
-
- /* 1 is for terminating '\0' as in static names */
- len = 1;
-
- while (*(uintptr_t *) e.ip) {
- lcode = *(ngx_http_script_len_code_pt *) e.ip;
- len += lcode(&e);
- }
-
- /* 16 bytes are preallocation */
-
- reserve = len + 16;
- }
-
- if (reserve > allocated) {
-
- name = ngx_http_map_uri_to_path(r, &path, &root, reserve);
- if (name == NULL) {
- return NGX_ERROR;
- }
-
- allocated = path.data + path.len - name;
- }
-
- if (index[i].values == NULL) {
-
- /* index[i].name.len includes the terminating '\0' */
-
- ngx_memcpy(name, index[i].name.data, index[i].name.len);
-
- path.len = (name + index[i].name.len - 1) - path.data;
-
- } else {
- e.ip = index[i].values->elts;
- e.pos = name;
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
-
- if (*name == '/') {
- uri.len = len - 1;
- uri.data = name;
- return ngx_http_internal_redirect(r, &uri, &r->args);
- }
-
- path.len = e.pos - path.data;
-
- *e.pos = '\0';
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "open index \"%V\"", &path);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.read_ahead = clcf->read_ahead;
- of.directio = clcf->directio;
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.test_only = 1;
- of.errors = clcf->open_file_cache_errors;
- of.events = clcf->open_file_cache_events;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- != NGX_OK)
- {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, of.err,
- "%s \"%s\" failed", of.failed, path.data);
-
- if (of.err == 0) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
-#if (NGX_HAVE_OPENAT)
- if (of.err == NGX_EMLINK
- || of.err == NGX_ELOOP)
- {
- return NGX_HTTP_FORBIDDEN;
- }
-#endif
-
- if (of.err == NGX_ENOTDIR
- || of.err == NGX_ENAMETOOLONG
- || of.err == NGX_EACCES)
- {
- return ngx_http_index_error(r, clcf, path.data, of.err);
- }
-
- if (!dir_tested) {
- rc = ngx_http_index_test_dir(r, clcf, path.data, name - 1);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- dir_tested = 1;
- }
-
- if (of.err == NGX_ENOENT) {
- continue;
- }
-
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,
- "%s \"%s\" failed", of.failed, path.data);
-
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- uri.len = r->uri.len + len - 1;
-
- if (!clcf->alias) {
- uri.data = path.data + root;
-
- } else {
- uri.data = ngx_pnalloc(r->pool, uri.len);
- if (uri.data == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- p = ngx_copy(uri.data, r->uri.data, r->uri.len);
- ngx_memcpy(p, name, len - 1);
- }
-
- return ngx_http_internal_redirect(r, &uri, &r->args);
- }
-
- return NGX_DECLINED;
-}
-
-
-static ngx_int_t
-ngx_http_index_test_dir(ngx_http_request_t *r, ngx_http_core_loc_conf_t *clcf,
- u_char *path, u_char *last)
-{
- u_char c;
- ngx_str_t dir;
- ngx_open_file_info_t of;
-
- c = *last;
- if (c != '/' || path == last) {
- /* "alias" without trailing slash */
- c = *(++last);
- }
- *last = '\0';
-
- dir.len = last - path;
- dir.data = path;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http index check dir: \"%V\"", &dir);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.test_dir = 1;
- of.test_only = 1;
- of.valid = clcf->open_file_cache_valid;
- of.errors = clcf->open_file_cache_errors;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &dir, &of) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &dir, &of, r->pool)
- != NGX_OK)
- {
- if (of.err) {
-
-#if (NGX_HAVE_OPENAT)
- if (of.err == NGX_EMLINK
- || of.err == NGX_ELOOP)
- {
- return NGX_HTTP_FORBIDDEN;
- }
-#endif
-
- if (of.err == NGX_ENOENT) {
- *last = c;
- return ngx_http_index_error(r, clcf, dir.data, NGX_ENOENT);
- }
-
- if (of.err == NGX_EACCES) {
-
- *last = c;
-
- /*
- * ngx_http_index_test_dir() is called after the first index
- * file testing has returned an error distinct from NGX_EACCES.
- * This means that directory searching is allowed.
- */
-
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,
- "%s \"%s\" failed", of.failed, dir.data);
- }
-
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- *last = c;
-
- if (of.is_dir) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "\"%s\" is not a directory", dir.data);
-
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_index_error(ngx_http_request_t *r, ngx_http_core_loc_conf_t *clcf,
- u_char *file, ngx_err_t err)
-{
- if (err == NGX_EACCES) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, err,
- "\"%s\" is forbidden", file);
-
- return NGX_HTTP_FORBIDDEN;
- }
-
- if (clcf->log_not_found) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, err,
- "\"%s\" is not found", file);
- }
-
- return NGX_HTTP_NOT_FOUND;
-}
-
-
-static void *
-ngx_http_index_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_index_loc_conf_t *conf;
-
- conf = ngx_palloc(cf->pool, sizeof(ngx_http_index_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->indices = NULL;
- conf->max_index_len = 0;
-
- return conf;
-}
-
-
-static char *
-ngx_http_index_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_index_loc_conf_t *prev = parent;
- ngx_http_index_loc_conf_t *conf = child;
-
- ngx_http_index_t *index;
-
- if (conf->indices == NULL) {
- conf->indices = prev->indices;
- conf->max_index_len = prev->max_index_len;
- }
-
- if (conf->indices == NULL) {
- conf->indices = ngx_array_create(cf->pool, 1, sizeof(ngx_http_index_t));
- if (conf->indices == NULL) {
- return NGX_CONF_ERROR;
- }
-
- index = ngx_array_push(conf->indices);
- if (index == NULL) {
- return NGX_CONF_ERROR;
- }
-
- index->name.len = sizeof(NGX_HTTP_DEFAULT_INDEX);
- index->name.data = (u_char *) NGX_HTTP_DEFAULT_INDEX;
- index->lengths = NULL;
- index->values = NULL;
-
- conf->max_index_len = sizeof(NGX_HTTP_DEFAULT_INDEX);
-
- return NGX_CONF_OK;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_index_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_CONTENT_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_index_handler;
-
- return NGX_OK;
-}
-
-
-/* TODO: warn about duplicate indices */
-
-static char *
-ngx_http_index_set_index(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_index_loc_conf_t *ilcf = conf;
-
- ngx_str_t *value;
- ngx_uint_t i, n;
- ngx_http_index_t *index;
- ngx_http_script_compile_t sc;
-
- if (ilcf->indices == NULL) {
- ilcf->indices = ngx_array_create(cf->pool, 2, sizeof(ngx_http_index_t));
- if (ilcf->indices == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (value[i].data[0] == '/' && i != cf->args->nelts - 1) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "only the last index in \"index\" directive "
- "should be absolute");
- }
-
- if (value[i].len == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "index \"%V\" in \"index\" directive is invalid",
- &value[1]);
- return NGX_CONF_ERROR;
- }
-
- index = ngx_array_push(ilcf->indices);
- if (index == NULL) {
- return NGX_CONF_ERROR;
- }
-
- index->name.len = value[i].len;
- index->name.data = value[i].data;
- index->lengths = NULL;
- index->values = NULL;
-
- n = ngx_http_script_variables_count(&value[i]);
-
- if (n == 0) {
- if (ilcf->max_index_len < index->name.len) {
- ilcf->max_index_len = index->name.len;
- }
-
- if (index->name.data[0] == '/') {
- continue;
- }
-
- /* include the terminating '\0' to the length to use ngx_memcpy() */
- index->name.len++;
-
- continue;
- }
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &value[i];
- sc.lengths = &index->lengths;
- sc.values = &index->values;
- sc.variables = n;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_conn_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_conn_module.c
deleted file mode 100644
index 4379311ca83..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_conn_module.c
+++ /dev/null
@@ -1,670 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- u_char color;
- u_char len;
- u_short conn;
- u_char data[1];
-} ngx_http_limit_conn_node_t;
-
-
-typedef struct {
- ngx_shm_zone_t *shm_zone;
- ngx_rbtree_node_t *node;
-} ngx_http_limit_conn_cleanup_t;
-
-
-typedef struct {
- ngx_rbtree_t *rbtree;
- ngx_http_complex_value_t key;
-} ngx_http_limit_conn_ctx_t;
-
-
-typedef struct {
- ngx_shm_zone_t *shm_zone;
- ngx_uint_t conn;
-} ngx_http_limit_conn_limit_t;
-
-
-typedef struct {
- ngx_array_t limits;
- ngx_uint_t log_level;
- ngx_uint_t status_code;
-} ngx_http_limit_conn_conf_t;
-
-
-static ngx_rbtree_node_t *ngx_http_limit_conn_lookup(ngx_rbtree_t *rbtree,
- ngx_str_t *key, uint32_t hash);
-static void ngx_http_limit_conn_cleanup(void *data);
-static ngx_inline void ngx_http_limit_conn_cleanup_all(ngx_pool_t *pool);
-
-static void *ngx_http_limit_conn_create_conf(ngx_conf_t *cf);
-static char *ngx_http_limit_conn_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_http_limit_conn_zone(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_limit_conn(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static ngx_int_t ngx_http_limit_conn_init(ngx_conf_t *cf);
-
-
-static ngx_conf_enum_t ngx_http_limit_conn_log_levels[] = {
- { ngx_string("info"), NGX_LOG_INFO },
- { ngx_string("notice"), NGX_LOG_NOTICE },
- { ngx_string("warn"), NGX_LOG_WARN },
- { ngx_string("error"), NGX_LOG_ERR },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_conf_num_bounds_t ngx_http_limit_conn_status_bounds = {
- ngx_conf_check_num_bounds, 400, 599
-};
-
-
-static ngx_command_t ngx_http_limit_conn_commands[] = {
-
- { ngx_string("limit_conn_zone"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE2,
- ngx_http_limit_conn_zone,
- 0,
- 0,
- NULL },
-
- { ngx_string("limit_conn"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_http_limit_conn,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("limit_conn_log_level"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_limit_conn_conf_t, log_level),
- &ngx_http_limit_conn_log_levels },
-
- { ngx_string("limit_conn_status"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_limit_conn_conf_t, status_code),
- &ngx_http_limit_conn_status_bounds },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_limit_conn_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_limit_conn_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_limit_conn_create_conf, /* create location configuration */
- ngx_http_limit_conn_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_limit_conn_module = {
- NGX_MODULE_V1,
- &ngx_http_limit_conn_module_ctx, /* module context */
- ngx_http_limit_conn_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_limit_conn_handler(ngx_http_request_t *r)
-{
- size_t n;
- uint32_t hash;
- ngx_str_t key;
- ngx_uint_t i;
- ngx_slab_pool_t *shpool;
- ngx_rbtree_node_t *node;
- ngx_pool_cleanup_t *cln;
- ngx_http_limit_conn_ctx_t *ctx;
- ngx_http_limit_conn_node_t *lc;
- ngx_http_limit_conn_conf_t *lccf;
- ngx_http_limit_conn_limit_t *limits;
- ngx_http_limit_conn_cleanup_t *lccln;
-
- if (r->main->limit_conn_set) {
- return NGX_DECLINED;
- }
-
- lccf = ngx_http_get_module_loc_conf(r, ngx_http_limit_conn_module);
- limits = lccf->limits.elts;
-
- for (i = 0; i < lccf->limits.nelts; i++) {
- ctx = limits[i].shm_zone->data;
-
- if (ngx_http_complex_value(r, &ctx->key, &key) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (key.len == 0) {
- continue;
- }
-
- if (key.len > 255) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "the value of the \"%V\" key "
- "is more than 255 bytes: \"%V\"",
- &ctx->key.value, &key);
- continue;
- }
-
- r->main->limit_conn_set = 1;
-
- hash = ngx_crc32_short(key.data, key.len);
-
- shpool = (ngx_slab_pool_t *) limits[i].shm_zone->shm.addr;
-
- ngx_shmtx_lock(&shpool->mutex);
-
- node = ngx_http_limit_conn_lookup(ctx->rbtree, &key, hash);
-
- if (node == NULL) {
-
- n = offsetof(ngx_rbtree_node_t, color)
- + offsetof(ngx_http_limit_conn_node_t, data)
- + key.len;
-
- node = ngx_slab_alloc_locked(shpool, n);
-
- if (node == NULL) {
- ngx_shmtx_unlock(&shpool->mutex);
- ngx_http_limit_conn_cleanup_all(r->pool);
- return lccf->status_code;
- }
-
- lc = (ngx_http_limit_conn_node_t *) &node->color;
-
- node->key = hash;
- lc->len = (u_char) key.len;
- lc->conn = 1;
- ngx_memcpy(lc->data, key.data, key.len);
-
- ngx_rbtree_insert(ctx->rbtree, node);
-
- } else {
-
- lc = (ngx_http_limit_conn_node_t *) &node->color;
-
- if ((ngx_uint_t) lc->conn >= limits[i].conn) {
-
- ngx_shmtx_unlock(&shpool->mutex);
-
- ngx_log_error(lccf->log_level, r->connection->log, 0,
- "limiting connections by zone \"%V\"",
- &limits[i].shm_zone->shm.name);
-
- ngx_http_limit_conn_cleanup_all(r->pool);
- return lccf->status_code;
- }
-
- lc->conn++;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "limit conn: %08XD %d", node->key, lc->conn);
-
- ngx_shmtx_unlock(&shpool->mutex);
-
- cln = ngx_pool_cleanup_add(r->pool,
- sizeof(ngx_http_limit_conn_cleanup_t));
- if (cln == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- cln->handler = ngx_http_limit_conn_cleanup;
- lccln = cln->data;
-
- lccln->shm_zone = limits[i].shm_zone;
- lccln->node = node;
- }
-
- return NGX_DECLINED;
-}
-
-
-static void
-ngx_http_limit_conn_rbtree_insert_value(ngx_rbtree_node_t *temp,
- ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel)
-{
- ngx_rbtree_node_t **p;
- ngx_http_limit_conn_node_t *lcn, *lcnt;
-
- for ( ;; ) {
-
- if (node->key < temp->key) {
-
- p = &temp->left;
-
- } else if (node->key > temp->key) {
-
- p = &temp->right;
-
- } else { /* node->key == temp->key */
-
- lcn = (ngx_http_limit_conn_node_t *) &node->color;
- lcnt = (ngx_http_limit_conn_node_t *) &temp->color;
-
- p = (ngx_memn2cmp(lcn->data, lcnt->data, lcn->len, lcnt->len) < 0)
- ? &temp->left : &temp->right;
- }
-
- if (*p == sentinel) {
- break;
- }
-
- temp = *p;
- }
-
- *p = node;
- node->parent = temp;
- node->left = sentinel;
- node->right = sentinel;
- ngx_rbt_red(node);
-}
-
-
-static ngx_rbtree_node_t *
-ngx_http_limit_conn_lookup(ngx_rbtree_t *rbtree, ngx_str_t *key, uint32_t hash)
-{
- ngx_int_t rc;
- ngx_rbtree_node_t *node, *sentinel;
- ngx_http_limit_conn_node_t *lcn;
-
- node = rbtree->root;
- sentinel = rbtree->sentinel;
-
- while (node != sentinel) {
-
- if (hash < node->key) {
- node = node->left;
- continue;
- }
-
- if (hash > node->key) {
- node = node->right;
- continue;
- }
-
- /* hash == node->key */
-
- lcn = (ngx_http_limit_conn_node_t *) &node->color;
-
- rc = ngx_memn2cmp(key->data, lcn->data, key->len, (size_t) lcn->len);
-
- if (rc == 0) {
- return node;
- }
-
- node = (rc < 0) ? node->left : node->right;
- }
-
- return NULL;
-}
-
-
-static void
-ngx_http_limit_conn_cleanup(void *data)
-{
- ngx_http_limit_conn_cleanup_t *lccln = data;
-
- ngx_slab_pool_t *shpool;
- ngx_rbtree_node_t *node;
- ngx_http_limit_conn_ctx_t *ctx;
- ngx_http_limit_conn_node_t *lc;
-
- ctx = lccln->shm_zone->data;
- shpool = (ngx_slab_pool_t *) lccln->shm_zone->shm.addr;
- node = lccln->node;
- lc = (ngx_http_limit_conn_node_t *) &node->color;
-
- ngx_shmtx_lock(&shpool->mutex);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, lccln->shm_zone->shm.log, 0,
- "limit conn cleanup: %08XD %d", node->key, lc->conn);
-
- lc->conn--;
-
- if (lc->conn == 0) {
- ngx_rbtree_delete(ctx->rbtree, node);
- ngx_slab_free_locked(shpool, node);
- }
-
- ngx_shmtx_unlock(&shpool->mutex);
-}
-
-
-static ngx_inline void
-ngx_http_limit_conn_cleanup_all(ngx_pool_t *pool)
-{
- ngx_pool_cleanup_t *cln;
-
- cln = pool->cleanup;
-
- while (cln && cln->handler == ngx_http_limit_conn_cleanup) {
- ngx_http_limit_conn_cleanup(cln->data);
- cln = cln->next;
- }
-
- pool->cleanup = cln;
-}
-
-
-static ngx_int_t
-ngx_http_limit_conn_init_zone(ngx_shm_zone_t *shm_zone, void *data)
-{
- ngx_http_limit_conn_ctx_t *octx = data;
-
- size_t len;
- ngx_slab_pool_t *shpool;
- ngx_rbtree_node_t *sentinel;
- ngx_http_limit_conn_ctx_t *ctx;
-
- ctx = shm_zone->data;
-
- if (octx) {
- if (ctx->key.value.len != octx->key.value.len
- || ngx_strncmp(ctx->key.value.data, octx->key.value.data,
- ctx->key.value.len)
- != 0)
- {
- ngx_log_error(NGX_LOG_EMERG, shm_zone->shm.log, 0,
- "limit_conn_zone \"%V\" uses the \"%V\" key "
- "while previously it used the \"%V\" key",
- &shm_zone->shm.name, &ctx->key.value,
- &octx->key.value);
- return NGX_ERROR;
- }
-
- ctx->rbtree = octx->rbtree;
-
- return NGX_OK;
- }
-
- shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
-
- if (shm_zone->shm.exists) {
- ctx->rbtree = shpool->data;
-
- return NGX_OK;
- }
-
- ctx->rbtree = ngx_slab_alloc(shpool, sizeof(ngx_rbtree_t));
- if (ctx->rbtree == NULL) {
- return NGX_ERROR;
- }
-
- shpool->data = ctx->rbtree;
-
- sentinel = ngx_slab_alloc(shpool, sizeof(ngx_rbtree_node_t));
- if (sentinel == NULL) {
- return NGX_ERROR;
- }
-
- ngx_rbtree_init(ctx->rbtree, sentinel,
- ngx_http_limit_conn_rbtree_insert_value);
-
- len = sizeof(" in limit_conn_zone \"\"") + shm_zone->shm.name.len;
-
- shpool->log_ctx = ngx_slab_alloc(shpool, len);
- if (shpool->log_ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_sprintf(shpool->log_ctx, " in limit_conn_zone \"%V\"%Z",
- &shm_zone->shm.name);
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_limit_conn_create_conf(ngx_conf_t *cf)
-{
- ngx_http_limit_conn_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_conn_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->limits.elts = NULL;
- */
-
- conf->log_level = NGX_CONF_UNSET_UINT;
- conf->status_code = NGX_CONF_UNSET_UINT;
-
- return conf;
-}
-
-
-static char *
-ngx_http_limit_conn_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_limit_conn_conf_t *prev = parent;
- ngx_http_limit_conn_conf_t *conf = child;
-
- if (conf->limits.elts == NULL) {
- conf->limits = prev->limits;
- }
-
- ngx_conf_merge_uint_value(conf->log_level, prev->log_level, NGX_LOG_ERR);
- ngx_conf_merge_uint_value(conf->status_code, prev->status_code,
- NGX_HTTP_SERVICE_UNAVAILABLE);
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_limit_conn_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- u_char *p;
- ssize_t size;
- ngx_str_t *value, name, s;
- ngx_uint_t i;
- ngx_shm_zone_t *shm_zone;
- ngx_http_limit_conn_ctx_t *ctx;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_conn_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &ctx->key;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- size = 0;
- name.len = 0;
-
- for (i = 2; i < cf->args->nelts; i++) {
-
- if (ngx_strncmp(value[i].data, "zone=", 5) == 0) {
-
- name.data = value[i].data + 5;
-
- p = (u_char *) ngx_strchr(name.data, ':');
-
- if (p == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid zone size \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- name.len = p - name.data;
-
- s.data = p + 1;
- s.len = value[i].data + value[i].len - s.data;
-
- size = ngx_parse_size(&s);
-
- if (size == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid zone size \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (size < (ssize_t) (8 * ngx_pagesize)) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "zone \"%V\" is too small", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (name.len == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"%V\" must have \"zone\" parameter",
- &cmd->name);
- return NGX_CONF_ERROR;
- }
-
- shm_zone = ngx_shared_memory_add(cf, &name, size,
- &ngx_http_limit_conn_module);
- if (shm_zone == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (shm_zone->data) {
- ctx = shm_zone->data;
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%V \"%V\" is already bound to key \"%V\"",
- &cmd->name, &name, &ctx->key.value);
- return NGX_CONF_ERROR;
- }
-
- shm_zone->init = ngx_http_limit_conn_init_zone;
- shm_zone->data = ctx;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_limit_conn(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_shm_zone_t *shm_zone;
- ngx_http_limit_conn_conf_t *lccf = conf;
- ngx_http_limit_conn_limit_t *limit, *limits;
-
- ngx_str_t *value;
- ngx_int_t n;
- ngx_uint_t i;
-
- value = cf->args->elts;
-
- shm_zone = ngx_shared_memory_add(cf, &value[1], 0,
- &ngx_http_limit_conn_module);
- if (shm_zone == NULL) {
- return NGX_CONF_ERROR;
- }
-
- limits = lccf->limits.elts;
-
- if (limits == NULL) {
- if (ngx_array_init(&lccf->limits, cf->pool, 1,
- sizeof(ngx_http_limit_conn_limit_t))
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
-
- for (i = 0; i < lccf->limits.nelts; i++) {
- if (shm_zone == limits[i].shm_zone) {
- return "is duplicate";
- }
- }
-
- n = ngx_atoi(value[2].data, value[2].len);
- if (n <= 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid number of connections \"%V\"", &value[2]);
- return NGX_CONF_ERROR;
- }
-
- if (n > 65535) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "connection limit must be less 65536");
- return NGX_CONF_ERROR;
- }
-
- limit = ngx_array_push(&lccf->limits);
- if (limit == NULL) {
- return NGX_CONF_ERROR;
- }
-
- limit->conn = n;
- limit->shm_zone = shm_zone;
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_limit_conn_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_PREACCESS_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_limit_conn_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_req_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_req_module.c
deleted file mode 100644
index 5d5cbe94406..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_limit_req_module.c
+++ /dev/null
@@ -1,975 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- u_char color;
- u_char dummy;
- u_short len;
- ngx_queue_t queue;
- ngx_msec_t last;
- /* integer value, 1 corresponds to 0.001 r/s */
- ngx_uint_t excess;
- ngx_uint_t count;
- u_char data[1];
-} ngx_http_limit_req_node_t;
-
-
-typedef struct {
- ngx_rbtree_t rbtree;
- ngx_rbtree_node_t sentinel;
- ngx_queue_t queue;
-} ngx_http_limit_req_shctx_t;
-
-
-typedef struct {
- ngx_http_limit_req_shctx_t *sh;
- ngx_slab_pool_t *shpool;
- /* integer value, 1 corresponds to 0.001 r/s */
- ngx_uint_t rate;
- ngx_http_complex_value_t key;
- ngx_http_limit_req_node_t *node;
-} ngx_http_limit_req_ctx_t;
-
-
-typedef struct {
- ngx_shm_zone_t *shm_zone;
- /* integer value, 1 corresponds to 0.001 r/s */
- ngx_uint_t burst;
- ngx_uint_t nodelay; /* unsigned nodelay:1 */
-} ngx_http_limit_req_limit_t;
-
-
-typedef struct {
- ngx_array_t limits;
- ngx_uint_t limit_log_level;
- ngx_uint_t delay_log_level;
- ngx_uint_t status_code;
-} ngx_http_limit_req_conf_t;
-
-
-static void ngx_http_limit_req_delay(ngx_http_request_t *r);
-static ngx_int_t ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit,
- ngx_uint_t hash, ngx_str_t *key, ngx_uint_t *ep, ngx_uint_t account);
-static ngx_msec_t ngx_http_limit_req_account(ngx_http_limit_req_limit_t *limits,
- ngx_uint_t n, ngx_uint_t *ep, ngx_http_limit_req_limit_t **limit);
-static void ngx_http_limit_req_expire(ngx_http_limit_req_ctx_t *ctx,
- ngx_uint_t n);
-
-static void *ngx_http_limit_req_create_conf(ngx_conf_t *cf);
-static char *ngx_http_limit_req_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_http_limit_req_zone(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_limit_req(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static ngx_int_t ngx_http_limit_req_init(ngx_conf_t *cf);
-
-
-static ngx_conf_enum_t ngx_http_limit_req_log_levels[] = {
- { ngx_string("info"), NGX_LOG_INFO },
- { ngx_string("notice"), NGX_LOG_NOTICE },
- { ngx_string("warn"), NGX_LOG_WARN },
- { ngx_string("error"), NGX_LOG_ERR },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_conf_num_bounds_t ngx_http_limit_req_status_bounds = {
- ngx_conf_check_num_bounds, 400, 599
-};
-
-
-static ngx_command_t ngx_http_limit_req_commands[] = {
-
- { ngx_string("limit_req_zone"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE3,
- ngx_http_limit_req_zone,
- 0,
- 0,
- NULL },
-
- { ngx_string("limit_req"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE123,
- ngx_http_limit_req,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("limit_req_log_level"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_limit_req_conf_t, limit_log_level),
- &ngx_http_limit_req_log_levels },
-
- { ngx_string("limit_req_status"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_limit_req_conf_t, status_code),
- &ngx_http_limit_req_status_bounds },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_limit_req_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_limit_req_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_limit_req_create_conf, /* create location configuration */
- ngx_http_limit_req_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_limit_req_module = {
- NGX_MODULE_V1,
- &ngx_http_limit_req_module_ctx, /* module context */
- ngx_http_limit_req_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_limit_req_handler(ngx_http_request_t *r)
-{
- uint32_t hash;
- ngx_str_t key;
- ngx_int_t rc;
- ngx_uint_t n, excess;
- ngx_msec_t delay;
- ngx_http_limit_req_ctx_t *ctx;
- ngx_http_limit_req_conf_t *lrcf;
- ngx_http_limit_req_limit_t *limit, *limits;
-
- if (r->main->limit_req_set) {
- return NGX_DECLINED;
- }
-
- lrcf = ngx_http_get_module_loc_conf(r, ngx_http_limit_req_module);
- limits = lrcf->limits.elts;
-
- excess = 0;
-
- rc = NGX_DECLINED;
-
-#if (NGX_SUPPRESS_WARN)
- limit = NULL;
-#endif
-
- for (n = 0; n < lrcf->limits.nelts; n++) {
-
- limit = &limits[n];
-
- ctx = limit->shm_zone->data;
-
- if (ngx_http_complex_value(r, &ctx->key, &key) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (key.len == 0) {
- continue;
- }
-
- if (key.len > 65535) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "the value of the \"%V\" key "
- "is more than 65535 bytes: \"%V\"",
- &ctx->key.value, &key);
- continue;
- }
-
- hash = ngx_crc32_short(key.data, key.len);
-
- ngx_shmtx_lock(&ctx->shpool->mutex);
-
- rc = ngx_http_limit_req_lookup(limit, hash, &key, &excess,
- (n == lrcf->limits.nelts - 1));
-
- ngx_shmtx_unlock(&ctx->shpool->mutex);
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "limit_req[%ui]: %i %ui.%03ui",
- n, rc, excess / 1000, excess % 1000);
-
- if (rc != NGX_AGAIN) {
- break;
- }
- }
-
- if (rc == NGX_DECLINED) {
- return NGX_DECLINED;
- }
-
- r->main->limit_req_set = 1;
-
- if (rc == NGX_BUSY || rc == NGX_ERROR) {
-
- if (rc == NGX_BUSY) {
- ngx_log_error(lrcf->limit_log_level, r->connection->log, 0,
- "limiting requests, excess: %ui.%03ui by zone \"%V\"",
- excess / 1000, excess % 1000,
- &limit->shm_zone->shm.name);
- }
-
- while (n--) {
- ctx = limits[n].shm_zone->data;
-
- if (ctx->node == NULL) {
- continue;
- }
-
- ngx_shmtx_lock(&ctx->shpool->mutex);
-
- ctx->node->count--;
-
- ngx_shmtx_unlock(&ctx->shpool->mutex);
-
- ctx->node = NULL;
- }
-
- return lrcf->status_code;
- }
-
- /* rc == NGX_AGAIN || rc == NGX_OK */
-
- if (rc == NGX_AGAIN) {
- excess = 0;
- }
-
- delay = ngx_http_limit_req_account(limits, n, &excess, &limit);
-
- if (!delay) {
- return NGX_DECLINED;
- }
-
- ngx_log_error(lrcf->delay_log_level, r->connection->log, 0,
- "delaying request, excess: %ui.%03ui, by zone \"%V\"",
- excess / 1000, excess % 1000, &limit->shm_zone->shm.name);
-
- if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- r->read_event_handler = ngx_http_test_reading;
- r->write_event_handler = ngx_http_limit_req_delay;
- ngx_add_timer(r->connection->write, delay);
-
- return NGX_AGAIN;
-}
-
-
-static void
-ngx_http_limit_req_delay(ngx_http_request_t *r)
-{
- ngx_event_t *wev;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "limit_req delay");
-
- wev = r->connection->write;
-
- if (!wev->timedout) {
-
- if (ngx_handle_write_event(wev, 0) != NGX_OK) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- }
-
- return;
- }
-
- wev->timedout = 0;
-
- if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- r->read_event_handler = ngx_http_block_reading;
- r->write_event_handler = ngx_http_core_run_phases;
-
- ngx_http_core_run_phases(r);
-}
-
-
-static void
-ngx_http_limit_req_rbtree_insert_value(ngx_rbtree_node_t *temp,
- ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel)
-{
- ngx_rbtree_node_t **p;
- ngx_http_limit_req_node_t *lrn, *lrnt;
-
- for ( ;; ) {
-
- if (node->key < temp->key) {
-
- p = &temp->left;
-
- } else if (node->key > temp->key) {
-
- p = &temp->right;
-
- } else { /* node->key == temp->key */
-
- lrn = (ngx_http_limit_req_node_t *) &node->color;
- lrnt = (ngx_http_limit_req_node_t *) &temp->color;
-
- p = (ngx_memn2cmp(lrn->data, lrnt->data, lrn->len, lrnt->len) < 0)
- ? &temp->left : &temp->right;
- }
-
- if (*p == sentinel) {
- break;
- }
-
- temp = *p;
- }
-
- *p = node;
- node->parent = temp;
- node->left = sentinel;
- node->right = sentinel;
- ngx_rbt_red(node);
-}
-
-
-static ngx_int_t
-ngx_http_limit_req_lookup(ngx_http_limit_req_limit_t *limit, ngx_uint_t hash,
- ngx_str_t *key, ngx_uint_t *ep, ngx_uint_t account)
-{
- size_t size;
- ngx_int_t rc, excess;
- ngx_time_t *tp;
- ngx_msec_t now;
- ngx_msec_int_t ms;
- ngx_rbtree_node_t *node, *sentinel;
- ngx_http_limit_req_ctx_t *ctx;
- ngx_http_limit_req_node_t *lr;
-
- tp = ngx_timeofday();
- now = (ngx_msec_t) (tp->sec * 1000 + tp->msec);
-
- ctx = limit->shm_zone->data;
-
- node = ctx->sh->rbtree.root;
- sentinel = ctx->sh->rbtree.sentinel;
-
- while (node != sentinel) {
-
- if (hash < node->key) {
- node = node->left;
- continue;
- }
-
- if (hash > node->key) {
- node = node->right;
- continue;
- }
-
- /* hash == node->key */
-
- lr = (ngx_http_limit_req_node_t *) &node->color;
-
- rc = ngx_memn2cmp(key->data, lr->data, key->len, (size_t) lr->len);
-
- if (rc == 0) {
- ngx_queue_remove(&lr->queue);
- ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
-
- ms = (ngx_msec_int_t) (now - lr->last);
-
- excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000;
-
- if (excess < 0) {
- excess = 0;
- }
-
- *ep = excess;
-
- if ((ngx_uint_t) excess > limit->burst) {
- return NGX_BUSY;
- }
-
- if (account) {
- lr->excess = excess;
- lr->last = now;
- return NGX_OK;
- }
-
- lr->count++;
-
- ctx->node = lr;
-
- return NGX_AGAIN;
- }
-
- node = (rc < 0) ? node->left : node->right;
- }
-
- *ep = 0;
-
- size = offsetof(ngx_rbtree_node_t, color)
- + offsetof(ngx_http_limit_req_node_t, data)
- + key->len;
-
- ngx_http_limit_req_expire(ctx, 1);
-
- node = ngx_slab_alloc_locked(ctx->shpool, size);
-
- if (node == NULL) {
- ngx_http_limit_req_expire(ctx, 0);
-
- node = ngx_slab_alloc_locked(ctx->shpool, size);
- if (node == NULL) {
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
- "could not allocate node%s", ctx->shpool->log_ctx);
- return NGX_ERROR;
- }
- }
-
- node->key = hash;
-
- lr = (ngx_http_limit_req_node_t *) &node->color;
-
- lr->len = (u_short) key->len;
- lr->excess = 0;
-
- ngx_memcpy(lr->data, key->data, key->len);
-
- ngx_rbtree_insert(&ctx->sh->rbtree, node);
-
- ngx_queue_insert_head(&ctx->sh->queue, &lr->queue);
-
- if (account) {
- lr->last = now;
- lr->count = 0;
- return NGX_OK;
- }
-
- lr->last = 0;
- lr->count = 1;
-
- ctx->node = lr;
-
- return NGX_AGAIN;
-}
-
-
-static ngx_msec_t
-ngx_http_limit_req_account(ngx_http_limit_req_limit_t *limits, ngx_uint_t n,
- ngx_uint_t *ep, ngx_http_limit_req_limit_t **limit)
-{
- ngx_int_t excess;
- ngx_time_t *tp;
- ngx_msec_t now, delay, max_delay;
- ngx_msec_int_t ms;
- ngx_http_limit_req_ctx_t *ctx;
- ngx_http_limit_req_node_t *lr;
-
- excess = *ep;
-
- if (excess == 0 || (*limit)->nodelay) {
- max_delay = 0;
-
- } else {
- ctx = (*limit)->shm_zone->data;
- max_delay = excess * 1000 / ctx->rate;
- }
-
- while (n--) {
- ctx = limits[n].shm_zone->data;
- lr = ctx->node;
-
- if (lr == NULL) {
- continue;
- }
-
- ngx_shmtx_lock(&ctx->shpool->mutex);
-
- tp = ngx_timeofday();
-
- now = (ngx_msec_t) (tp->sec * 1000 + tp->msec);
- ms = (ngx_msec_int_t) (now - lr->last);
-
- excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000;
-
- if (excess < 0) {
- excess = 0;
- }
-
- lr->last = now;
- lr->excess = excess;
- lr->count--;
-
- ngx_shmtx_unlock(&ctx->shpool->mutex);
-
- ctx->node = NULL;
-
- if (limits[n].nodelay) {
- continue;
- }
-
- delay = excess * 1000 / ctx->rate;
-
- if (delay > max_delay) {
- max_delay = delay;
- *ep = excess;
- *limit = &limits[n];
- }
- }
-
- return max_delay;
-}
-
-
-static void
-ngx_http_limit_req_expire(ngx_http_limit_req_ctx_t *ctx, ngx_uint_t n)
-{
- ngx_int_t excess;
- ngx_time_t *tp;
- ngx_msec_t now;
- ngx_queue_t *q;
- ngx_msec_int_t ms;
- ngx_rbtree_node_t *node;
- ngx_http_limit_req_node_t *lr;
-
- tp = ngx_timeofday();
-
- now = (ngx_msec_t) (tp->sec * 1000 + tp->msec);
-
- /*
- * n == 1 deletes one or two zero rate entries
- * n == 0 deletes oldest entry by force
- * and one or two zero rate entries
- */
-
- while (n < 3) {
-
- if (ngx_queue_empty(&ctx->sh->queue)) {
- return;
- }
-
- q = ngx_queue_last(&ctx->sh->queue);
-
- lr = ngx_queue_data(q, ngx_http_limit_req_node_t, queue);
-
- if (lr->count) {
-
- /*
- * There is not much sense in looking further,
- * because we bump nodes on the lookup stage.
- */
-
- return;
- }
-
- if (n++ != 0) {
-
- ms = (ngx_msec_int_t) (now - lr->last);
- ms = ngx_abs(ms);
-
- if (ms < 60000) {
- return;
- }
-
- excess = lr->excess - ctx->rate * ms / 1000;
-
- if (excess > 0) {
- return;
- }
- }
-
- ngx_queue_remove(q);
-
- node = (ngx_rbtree_node_t *)
- ((u_char *) lr - offsetof(ngx_rbtree_node_t, color));
-
- ngx_rbtree_delete(&ctx->sh->rbtree, node);
-
- ngx_slab_free_locked(ctx->shpool, node);
- }
-}
-
-
-static ngx_int_t
-ngx_http_limit_req_init_zone(ngx_shm_zone_t *shm_zone, void *data)
-{
- ngx_http_limit_req_ctx_t *octx = data;
-
- size_t len;
- ngx_http_limit_req_ctx_t *ctx;
-
- ctx = shm_zone->data;
-
- if (octx) {
- if (ctx->key.value.len != octx->key.value.len
- || ngx_strncmp(ctx->key.value.data, octx->key.value.data,
- ctx->key.value.len)
- != 0)
- {
- ngx_log_error(NGX_LOG_EMERG, shm_zone->shm.log, 0,
- "limit_req \"%V\" uses the \"%V\" key "
- "while previously it used the \"%V\" key",
- &shm_zone->shm.name, &ctx->key.value,
- &octx->key.value);
- return NGX_ERROR;
- }
-
- ctx->sh = octx->sh;
- ctx->shpool = octx->shpool;
-
- return NGX_OK;
- }
-
- ctx->shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
-
- if (shm_zone->shm.exists) {
- ctx->sh = ctx->shpool->data;
-
- return NGX_OK;
- }
-
- ctx->sh = ngx_slab_alloc(ctx->shpool, sizeof(ngx_http_limit_req_shctx_t));
- if (ctx->sh == NULL) {
- return NGX_ERROR;
- }
-
- ctx->shpool->data = ctx->sh;
-
- ngx_rbtree_init(&ctx->sh->rbtree, &ctx->sh->sentinel,
- ngx_http_limit_req_rbtree_insert_value);
-
- ngx_queue_init(&ctx->sh->queue);
-
- len = sizeof(" in limit_req zone \"\"") + shm_zone->shm.name.len;
-
- ctx->shpool->log_ctx = ngx_slab_alloc(ctx->shpool, len);
- if (ctx->shpool->log_ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_sprintf(ctx->shpool->log_ctx, " in limit_req zone \"%V\"%Z",
- &shm_zone->shm.name);
-
- ctx->shpool->log_nomem = 0;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_limit_req_create_conf(ngx_conf_t *cf)
-{
- ngx_http_limit_req_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_req_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->limits.elts = NULL;
- */
-
- conf->limit_log_level = NGX_CONF_UNSET_UINT;
- conf->status_code = NGX_CONF_UNSET_UINT;
-
- return conf;
-}
-
-
-static char *
-ngx_http_limit_req_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_limit_req_conf_t *prev = parent;
- ngx_http_limit_req_conf_t *conf = child;
-
- if (conf->limits.elts == NULL) {
- conf->limits = prev->limits;
- }
-
- ngx_conf_merge_uint_value(conf->limit_log_level, prev->limit_log_level,
- NGX_LOG_ERR);
-
- conf->delay_log_level = (conf->limit_log_level == NGX_LOG_INFO) ?
- NGX_LOG_INFO : conf->limit_log_level + 1;
-
- ngx_conf_merge_uint_value(conf->status_code, prev->status_code,
- NGX_HTTP_SERVICE_UNAVAILABLE);
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_limit_req_zone(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- u_char *p;
- size_t len;
- ssize_t size;
- ngx_str_t *value, name, s;
- ngx_int_t rate, scale;
- ngx_uint_t i;
- ngx_shm_zone_t *shm_zone;
- ngx_http_limit_req_ctx_t *ctx;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_limit_req_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &ctx->key;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- size = 0;
- rate = 1;
- scale = 1;
- name.len = 0;
-
- for (i = 2; i < cf->args->nelts; i++) {
-
- if (ngx_strncmp(value[i].data, "zone=", 5) == 0) {
-
- name.data = value[i].data + 5;
-
- p = (u_char *) ngx_strchr(name.data, ':');
-
- if (p == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid zone size \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- name.len = p - name.data;
-
- s.data = p + 1;
- s.len = value[i].data + value[i].len - s.data;
-
- size = ngx_parse_size(&s);
-
- if (size == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid zone size \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (size < (ssize_t) (8 * ngx_pagesize)) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "zone \"%V\" is too small", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "rate=", 5) == 0) {
-
- len = value[i].len;
- p = value[i].data + len - 3;
-
- if (ngx_strncmp(p, "r/s", 3) == 0) {
- scale = 1;
- len -= 3;
-
- } else if (ngx_strncmp(p, "r/m", 3) == 0) {
- scale = 60;
- len -= 3;
- }
-
- rate = ngx_atoi(value[i].data + 5, len - 5);
- if (rate <= 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid rate \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (name.len == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"%V\" must have \"zone\" parameter",
- &cmd->name);
- return NGX_CONF_ERROR;
- }
-
- ctx->rate = rate * 1000 / scale;
-
- shm_zone = ngx_shared_memory_add(cf, &name, size,
- &ngx_http_limit_req_module);
- if (shm_zone == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (shm_zone->data) {
- ctx = shm_zone->data;
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%V \"%V\" is already bound to key \"%V\"",
- &cmd->name, &name, &ctx->key.value);
- return NGX_CONF_ERROR;
- }
-
- shm_zone->init = ngx_http_limit_req_init_zone;
- shm_zone->data = ctx;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_limit_req(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_limit_req_conf_t *lrcf = conf;
-
- ngx_int_t burst;
- ngx_str_t *value, s;
- ngx_uint_t i, nodelay;
- ngx_shm_zone_t *shm_zone;
- ngx_http_limit_req_limit_t *limit, *limits;
-
- value = cf->args->elts;
-
- shm_zone = NULL;
- burst = 0;
- nodelay = 0;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (ngx_strncmp(value[i].data, "zone=", 5) == 0) {
-
- s.len = value[i].len - 5;
- s.data = value[i].data + 5;
-
- shm_zone = ngx_shared_memory_add(cf, &s, 0,
- &ngx_http_limit_req_module);
- if (shm_zone == NULL) {
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "burst=", 6) == 0) {
-
- burst = ngx_atoi(value[i].data + 6, value[i].len - 6);
- if (burst <= 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid burst rate \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "nodelay") == 0) {
- nodelay = 1;
- continue;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (shm_zone == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"%V\" must have \"zone\" parameter",
- &cmd->name);
- return NGX_CONF_ERROR;
- }
-
- if (shm_zone->data == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "unknown limit_req_zone \"%V\"",
- &shm_zone->shm.name);
- return NGX_CONF_ERROR;
- }
-
- limits = lrcf->limits.elts;
-
- if (limits == NULL) {
- if (ngx_array_init(&lrcf->limits, cf->pool, 1,
- sizeof(ngx_http_limit_req_limit_t))
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
-
- for (i = 0; i < lrcf->limits.nelts; i++) {
- if (shm_zone == limits[i].shm_zone) {
- return "is duplicate";
- }
- }
-
- limit = ngx_array_push(&lrcf->limits);
- if (limit == NULL) {
- return NGX_CONF_ERROR;
- }
-
- limit->shm_zone = shm_zone;
- limit->burst = burst * 1000;
- limit->nodelay = nodelay;
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_limit_req_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_PREACCESS_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_limit_req_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_log_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_log_module.c
deleted file mode 100644
index cec77e74950..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_log_module.c
+++ /dev/null
@@ -1,1786 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-#if (NGX_ZLIB)
-#include <zlib.h>
-#endif
-
-
-typedef struct ngx_http_log_op_s ngx_http_log_op_t;
-
-typedef u_char *(*ngx_http_log_op_run_pt) (ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-
-typedef size_t (*ngx_http_log_op_getlen_pt) (ngx_http_request_t *r,
- uintptr_t data);
-
-
-struct ngx_http_log_op_s {
- size_t len;
- ngx_http_log_op_getlen_pt getlen;
- ngx_http_log_op_run_pt run;
- uintptr_t data;
-};
-
-
-typedef struct {
- ngx_str_t name;
- ngx_array_t *flushes;
- ngx_array_t *ops; /* array of ngx_http_log_op_t */
-} ngx_http_log_fmt_t;
-
-
-typedef struct {
- ngx_array_t formats; /* array of ngx_http_log_fmt_t */
- ngx_uint_t combined_used; /* unsigned combined_used:1 */
-} ngx_http_log_main_conf_t;
-
-
-typedef struct {
- u_char *start;
- u_char *pos;
- u_char *last;
-
- ngx_event_t *event;
- ngx_msec_t flush;
- ngx_int_t gzip;
-} ngx_http_log_buf_t;
-
-
-typedef struct {
- ngx_array_t *lengths;
- ngx_array_t *values;
-} ngx_http_log_script_t;
-
-
-typedef struct {
- ngx_open_file_t *file;
- ngx_http_log_script_t *script;
- time_t disk_full_time;
- time_t error_log_time;
- ngx_syslog_peer_t *syslog_peer;
- ngx_http_log_fmt_t *format;
- ngx_http_complex_value_t *filter;
-} ngx_http_log_t;
-
-
-typedef struct {
- ngx_array_t *logs; /* array of ngx_http_log_t */
-
- ngx_open_file_cache_t *open_file_cache;
- time_t open_file_cache_valid;
- ngx_uint_t open_file_cache_min_uses;
-
- ngx_uint_t off; /* unsigned off:1 */
-} ngx_http_log_loc_conf_t;
-
-
-typedef struct {
- ngx_str_t name;
- size_t len;
- ngx_http_log_op_run_pt run;
-} ngx_http_log_var_t;
-
-
-static void ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log,
- u_char *buf, size_t len);
-static ssize_t ngx_http_log_script_write(ngx_http_request_t *r,
- ngx_http_log_script_t *script, u_char **name, u_char *buf, size_t len);
-
-#if (NGX_ZLIB)
-static ssize_t ngx_http_log_gzip(ngx_fd_t fd, u_char *buf, size_t len,
- ngx_int_t level, ngx_log_t *log);
-
-static void *ngx_http_log_gzip_alloc(void *opaque, u_int items, u_int size);
-static void ngx_http_log_gzip_free(void *opaque, void *address);
-#endif
-
-static void ngx_http_log_flush(ngx_open_file_t *file, ngx_log_t *log);
-static void ngx_http_log_flush_handler(ngx_event_t *ev);
-
-static u_char *ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-static u_char *ngx_http_log_time(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-static u_char *ngx_http_log_iso8601(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-static u_char *ngx_http_log_msec(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-static u_char *ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-static u_char *ngx_http_log_status(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-static u_char *ngx_http_log_bytes_sent(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-static u_char *ngx_http_log_body_bytes_sent(ngx_http_request_t *r,
- u_char *buf, ngx_http_log_op_t *op);
-static u_char *ngx_http_log_request_length(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-
-static ngx_int_t ngx_http_log_variable_compile(ngx_conf_t *cf,
- ngx_http_log_op_t *op, ngx_str_t *value);
-static size_t ngx_http_log_variable_getlen(ngx_http_request_t *r,
- uintptr_t data);
-static u_char *ngx_http_log_variable(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op);
-static uintptr_t ngx_http_log_escape(u_char *dst, u_char *src, size_t size);
-
-
-static void *ngx_http_log_create_main_conf(ngx_conf_t *cf);
-static void *ngx_http_log_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_log_set_format(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_log_compile_format(ngx_conf_t *cf,
- ngx_array_t *flushes, ngx_array_t *ops, ngx_array_t *args, ngx_uint_t s);
-static char *ngx_http_log_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static ngx_int_t ngx_http_log_init(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_log_commands[] = {
-
- { ngx_string("log_format"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_2MORE,
- ngx_http_log_set_format,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("access_log"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_HTTP_LMT_CONF|NGX_CONF_1MORE,
- ngx_http_log_set_log,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("open_log_file_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
- ngx_http_log_open_file_cache,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_log_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_log_init, /* postconfiguration */
-
- ngx_http_log_create_main_conf, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_log_create_loc_conf, /* create location configuration */
- ngx_http_log_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_log_module = {
- NGX_MODULE_V1,
- &ngx_http_log_module_ctx, /* module context */
- ngx_http_log_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_http_access_log = ngx_string(NGX_HTTP_LOG_PATH);
-
-
-static ngx_str_t ngx_http_combined_fmt =
- ngx_string("$remote_addr - $remote_user [$time_local] "
- "\"$request\" $status $body_bytes_sent "
- "\"$http_referer\" \"$http_user_agent\"");
-
-
-static ngx_http_log_var_t ngx_http_log_vars[] = {
- { ngx_string("pipe"), 1, ngx_http_log_pipe },
- { ngx_string("time_local"), sizeof("28/Sep/1970:12:00:00 +0600") - 1,
- ngx_http_log_time },
- { ngx_string("time_iso8601"), sizeof("1970-09-28T12:00:00+06:00") - 1,
- ngx_http_log_iso8601 },
- { ngx_string("msec"), NGX_TIME_T_LEN + 4, ngx_http_log_msec },
- { ngx_string("request_time"), NGX_TIME_T_LEN + 4,
- ngx_http_log_request_time },
- { ngx_string("status"), NGX_INT_T_LEN, ngx_http_log_status },
- { ngx_string("bytes_sent"), NGX_OFF_T_LEN, ngx_http_log_bytes_sent },
- { ngx_string("body_bytes_sent"), NGX_OFF_T_LEN,
- ngx_http_log_body_bytes_sent },
- { ngx_string("request_length"), NGX_SIZE_T_LEN,
- ngx_http_log_request_length },
-
- { ngx_null_string, 0, NULL }
-};
-
-
-static ngx_int_t
-ngx_http_log_handler(ngx_http_request_t *r)
-{
- u_char *line, *p;
- size_t len, size;
- ssize_t n;
- ngx_str_t val;
- ngx_uint_t i, l;
- ngx_http_log_t *log;
- ngx_http_log_op_t *op;
- ngx_http_log_buf_t *buffer;
- ngx_http_log_loc_conf_t *lcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http log handler");
-
- lcf = ngx_http_get_module_loc_conf(r, ngx_http_log_module);
-
- if (lcf->off) {
- return NGX_OK;
- }
-
- log = lcf->logs->elts;
- for (l = 0; l < lcf->logs->nelts; l++) {
-
- if (log[l].filter) {
- if (ngx_http_complex_value(r, log[l].filter, &val) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (val.len == 0 || (val.len == 1 && val.data[0] == '0')) {
- continue;
- }
- }
-
- if (ngx_time() == log[l].disk_full_time) {
-
- /*
- * on FreeBSD writing to a full filesystem with enabled softupdates
- * may block process for much longer time than writing to non-full
- * filesystem, so we skip writing to a log for one second
- */
-
- continue;
- }
-
- ngx_http_script_flush_no_cacheable_variables(r, log[l].format->flushes);
-
- len = 0;
- op = log[l].format->ops->elts;
- for (i = 0; i < log[l].format->ops->nelts; i++) {
- if (op[i].len == 0) {
- len += op[i].getlen(r, op[i].data);
-
- } else {
- len += op[i].len;
- }
- }
-
- if (log[l].syslog_peer) {
-
- /* length of syslog's PRI and HEADER message parts */
- len += sizeof("<255>Jan 01 00:00:00 ") - 1
- + ngx_cycle->hostname.len + 1
- + log[l].syslog_peer->tag.len + 2;
-
- goto alloc_line;
- }
-
- len += NGX_LINEFEED_SIZE;
-
- buffer = log[l].file ? log[l].file->data : NULL;
-
- if (buffer) {
-
- if (len > (size_t) (buffer->last - buffer->pos)) {
-
- ngx_http_log_write(r, &log[l], buffer->start,
- buffer->pos - buffer->start);
-
- buffer->pos = buffer->start;
- }
-
- if (len <= (size_t) (buffer->last - buffer->pos)) {
-
- p = buffer->pos;
-
- if (buffer->event && p == buffer->start) {
- ngx_add_timer(buffer->event, buffer->flush);
- }
-
- for (i = 0; i < log[l].format->ops->nelts; i++) {
- p = op[i].run(r, p, &op[i]);
- }
-
- ngx_linefeed(p);
-
- buffer->pos = p;
-
- continue;
- }
-
- if (buffer->event && buffer->event->timer_set) {
- ngx_del_timer(buffer->event);
- }
- }
-
- alloc_line:
-
- line = ngx_pnalloc(r->pool, len);
- if (line == NULL) {
- return NGX_ERROR;
- }
-
- p = line;
-
- if (log[l].syslog_peer) {
- p = ngx_syslog_add_header(log[l].syslog_peer, line);
- }
-
- for (i = 0; i < log[l].format->ops->nelts; i++) {
- p = op[i].run(r, p, &op[i]);
- }
-
- if (log[l].syslog_peer) {
-
- size = p - line;
-
- n = ngx_syslog_send(log[l].syslog_peer, line, size);
-
- if (n < 0) {
- ngx_log_error(NGX_LOG_WARN, r->connection->log, 0,
- "send() to syslog failed");
-
- } else if ((size_t) n != size) {
- ngx_log_error(NGX_LOG_WARN, r->connection->log, 0,
- "send() to syslog has written only %z of %uz",
- n, size);
- }
-
- continue;
- }
-
- ngx_linefeed(p);
-
- ngx_http_log_write(r, &log[l], line, p - line);
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_log_write(ngx_http_request_t *r, ngx_http_log_t *log, u_char *buf,
- size_t len)
-{
- u_char *name;
- time_t now;
- ssize_t n;
- ngx_err_t err;
-#if (NGX_ZLIB)
- ngx_http_log_buf_t *buffer;
-#endif
-
- if (log->script == NULL) {
- name = log->file->name.data;
-
-#if (NGX_ZLIB)
- buffer = log->file->data;
-
- if (buffer && buffer->gzip) {
- n = ngx_http_log_gzip(log->file->fd, buf, len, buffer->gzip,
- r->connection->log);
- } else {
- n = ngx_write_fd(log->file->fd, buf, len);
- }
-#else
- n = ngx_write_fd(log->file->fd, buf, len);
-#endif
-
- } else {
- name = NULL;
- n = ngx_http_log_script_write(r, log->script, &name, buf, len);
- }
-
- if (n == (ssize_t) len) {
- return;
- }
-
- now = ngx_time();
-
- if (n == -1) {
- err = ngx_errno;
-
- if (err == NGX_ENOSPC) {
- log->disk_full_time = now;
- }
-
- if (now - log->error_log_time > 59) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, err,
- ngx_write_fd_n " to \"%s\" failed", name);
-
- log->error_log_time = now;
- }
-
- return;
- }
-
- if (now - log->error_log_time > 59) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- ngx_write_fd_n " to \"%s\" was incomplete: %z of %uz",
- name, n, len);
-
- log->error_log_time = now;
- }
-}
-
-
-static ssize_t
-ngx_http_log_script_write(ngx_http_request_t *r, ngx_http_log_script_t *script,
- u_char **name, u_char *buf, size_t len)
-{
- size_t root;
- ssize_t n;
- ngx_str_t log, path;
- ngx_open_file_info_t of;
- ngx_http_log_loc_conf_t *llcf;
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (!r->root_tested) {
-
- /* test root directory existence */
-
- if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) {
- /* simulate successful logging */
- return len;
- }
-
- path.data[root] = '\0';
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.test_dir = 1;
- of.test_only = 1;
- of.errors = clcf->open_file_cache_errors;
- of.events = clcf->open_file_cache_events;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
- /* simulate successful logging */
- return len;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- != NGX_OK)
- {
- if (of.err == 0) {
- /* simulate successful logging */
- return len;
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, of.err,
- "testing \"%s\" existence failed", path.data);
-
- /* simulate successful logging */
- return len;
- }
-
- if (!of.is_dir) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ENOTDIR,
- "testing \"%s\" existence failed", path.data);
-
- /* simulate successful logging */
- return len;
- }
- }
-
- if (ngx_http_script_run(r, &log, script->lengths->elts, 1,
- script->values->elts)
- == NULL)
- {
- /* simulate successful logging */
- return len;
- }
-
- log.data[log.len - 1] = '\0';
- *name = log.data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http log \"%s\"", log.data);
-
- llcf = ngx_http_get_module_loc_conf(r, ngx_http_log_module);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.log = 1;
- of.valid = llcf->open_file_cache_valid;
- of.min_uses = llcf->open_file_cache_min_uses;
- of.directio = NGX_OPEN_FILE_DIRECTIO_OFF;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &log, &of) != NGX_OK) {
- /* simulate successful logging */
- return len;
- }
-
- if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool)
- != NGX_OK)
- {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- "%s \"%s\" failed", of.failed, log.data);
- /* simulate successful logging */
- return len;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http log #%d", of.fd);
-
- n = ngx_write_fd(of.fd, buf, len);
-
- return n;
-}
-
-
-#if (NGX_ZLIB)
-
-static ssize_t
-ngx_http_log_gzip(ngx_fd_t fd, u_char *buf, size_t len, ngx_int_t level,
- ngx_log_t *log)
-{
- int rc, wbits, memlevel;
- u_char *out;
- size_t size;
- ssize_t n;
- z_stream zstream;
- ngx_err_t err;
- ngx_pool_t *pool;
-
- wbits = MAX_WBITS;
- memlevel = MAX_MEM_LEVEL - 1;
-
- while ((ssize_t) len < ((1 << (wbits - 1)) - 262)) {
- wbits--;
- memlevel--;
- }
-
- /*
- * This is a formula from deflateBound() for conservative upper bound of
- * compressed data plus 18 bytes of gzip wrapper.
- */
-
- size = len + ((len + 7) >> 3) + ((len + 63) >> 6) + 5 + 18;
-
- ngx_memzero(&zstream, sizeof(z_stream));
-
- pool = ngx_create_pool(256, log);
- if (pool == NULL) {
- /* simulate successful logging */
- return len;
- }
-
- pool->log = log;
-
- zstream.zalloc = ngx_http_log_gzip_alloc;
- zstream.zfree = ngx_http_log_gzip_free;
- zstream.opaque = pool;
-
- out = ngx_pnalloc(pool, size);
- if (out == NULL) {
- goto done;
- }
-
- zstream.next_in = buf;
- zstream.avail_in = len;
- zstream.next_out = out;
- zstream.avail_out = size;
-
- rc = deflateInit2(&zstream, (int) level, Z_DEFLATED, wbits + 16, memlevel,
- Z_DEFAULT_STRATEGY);
-
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, log, 0, "deflateInit2() failed: %d", rc);
- goto done;
- }
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, log, 0,
- "deflate in: ni:%p no:%p ai:%ud ao:%ud",
- zstream.next_in, zstream.next_out,
- zstream.avail_in, zstream.avail_out);
-
- rc = deflate(&zstream, Z_FINISH);
-
- if (rc != Z_STREAM_END) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "deflate(Z_FINISH) failed: %d", rc);
- goto done;
- }
-
- ngx_log_debug5(NGX_LOG_DEBUG_HTTP, log, 0,
- "deflate out: ni:%p no:%p ai:%ud ao:%ud rc:%d",
- zstream.next_in, zstream.next_out,
- zstream.avail_in, zstream.avail_out,
- rc);
-
- size -= zstream.avail_out;
-
- rc = deflateEnd(&zstream);
-
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, log, 0, "deflateEnd() failed: %d", rc);
- goto done;
- }
-
- n = ngx_write_fd(fd, out, size);
-
- if (n != (ssize_t) size) {
- err = (n == -1) ? ngx_errno : 0;
-
- ngx_destroy_pool(pool);
-
- ngx_set_errno(err);
- return -1;
- }
-
-done:
-
- ngx_destroy_pool(pool);
-
- /* simulate successful logging */
- return len;
-}
-
-
-static void *
-ngx_http_log_gzip_alloc(void *opaque, u_int items, u_int size)
-{
- ngx_pool_t *pool = opaque;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pool->log, 0,
- "gzip alloc: n:%ud s:%ud", items, size);
-
- return ngx_palloc(pool, items * size);
-}
-
-
-static void
-ngx_http_log_gzip_free(void *opaque, void *address)
-{
-#if 0
- ngx_pool_t *pool = opaque;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pool->log, 0, "gzip free: %p", address);
-#endif
-}
-
-#endif
-
-
-static void
-ngx_http_log_flush(ngx_open_file_t *file, ngx_log_t *log)
-{
- size_t len;
- ssize_t n;
- ngx_http_log_buf_t *buffer;
-
- buffer = file->data;
-
- len = buffer->pos - buffer->start;
-
- if (len == 0) {
- return;
- }
-
-#if (NGX_ZLIB)
- if (buffer->gzip) {
- n = ngx_http_log_gzip(file->fd, buffer->start, len, buffer->gzip, log);
- } else {
- n = ngx_write_fd(file->fd, buffer->start, len);
- }
-#else
- n = ngx_write_fd(file->fd, buffer->start, len);
-#endif
-
- if (n == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- ngx_write_fd_n " to \"%s\" failed",
- file->name.data);
-
- } else if ((size_t) n != len) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- ngx_write_fd_n " to \"%s\" was incomplete: %z of %uz",
- file->name.data, n, len);
- }
-
- buffer->pos = buffer->start;
-
- if (buffer->event && buffer->event->timer_set) {
- ngx_del_timer(buffer->event);
- }
-}
-
-
-static void
-ngx_http_log_flush_handler(ngx_event_t *ev)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, 0,
- "http log buffer flush handler");
-
- ngx_http_log_flush(ev->data, ev->log);
-}
-
-
-static u_char *
-ngx_http_log_copy_short(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op)
-{
- size_t len;
- uintptr_t data;
-
- len = op->len;
- data = op->data;
-
- while (len--) {
- *buf++ = (u_char) (data & 0xff);
- data >>= 8;
- }
-
- return buf;
-}
-
-
-static u_char *
-ngx_http_log_copy_long(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op)
-{
- return ngx_cpymem(buf, (u_char *) op->data, op->len);
-}
-
-
-static u_char *
-ngx_http_log_pipe(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
-{
- if (r->pipeline) {
- *buf = 'p';
- } else {
- *buf = '.';
- }
-
- return buf + 1;
-}
-
-
-static u_char *
-ngx_http_log_time(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
-{
- return ngx_cpymem(buf, ngx_cached_http_log_time.data,
- ngx_cached_http_log_time.len);
-}
-
-static u_char *
-ngx_http_log_iso8601(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
-{
- return ngx_cpymem(buf, ngx_cached_http_log_iso8601.data,
- ngx_cached_http_log_iso8601.len);
-}
-
-static u_char *
-ngx_http_log_msec(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
-{
- ngx_time_t *tp;
-
- tp = ngx_timeofday();
-
- return ngx_sprintf(buf, "%T.%03M", tp->sec, tp->msec);
-}
-
-
-static u_char *
-ngx_http_log_request_time(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op)
-{
- ngx_time_t *tp;
- ngx_msec_int_t ms;
-
- tp = ngx_timeofday();
-
- ms = (ngx_msec_int_t)
- ((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec));
- ms = ngx_max(ms, 0);
-
- return ngx_sprintf(buf, "%T.%03M", (time_t) ms / 1000, ms % 1000);
-}
-
-
-static u_char *
-ngx_http_log_status(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
-{
- ngx_uint_t status;
-
- if (r->err_status) {
- status = r->err_status;
-
- } else if (r->headers_out.status) {
- status = r->headers_out.status;
-
- } else if (r->http_version == NGX_HTTP_VERSION_9) {
- status = 9;
-
- } else {
- status = 0;
- }
-
- return ngx_sprintf(buf, "%03ui", status);
-}
-
-
-static u_char *
-ngx_http_log_bytes_sent(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op)
-{
- return ngx_sprintf(buf, "%O", r->connection->sent);
-}
-
-
-/*
- * although there is a real $body_bytes_sent variable,
- * this log operation code function is more optimized for logging
- */
-
-static u_char *
-ngx_http_log_body_bytes_sent(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op)
-{
- off_t length;
-
- length = r->connection->sent - r->header_size;
-
- if (length > 0) {
- return ngx_sprintf(buf, "%O", length);
- }
-
- *buf = '0';
-
- return buf + 1;
-}
-
-
-static u_char *
-ngx_http_log_request_length(ngx_http_request_t *r, u_char *buf,
- ngx_http_log_op_t *op)
-{
- return ngx_sprintf(buf, "%O", r->request_length);
-}
-
-
-static ngx_int_t
-ngx_http_log_variable_compile(ngx_conf_t *cf, ngx_http_log_op_t *op,
- ngx_str_t *value)
-{
- ngx_int_t index;
-
- index = ngx_http_get_variable_index(cf, value);
- if (index == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- op->len = 0;
- op->getlen = ngx_http_log_variable_getlen;
- op->run = ngx_http_log_variable;
- op->data = index;
-
- return NGX_OK;
-}
-
-
-static size_t
-ngx_http_log_variable_getlen(ngx_http_request_t *r, uintptr_t data)
-{
- uintptr_t len;
- ngx_http_variable_value_t *value;
-
- value = ngx_http_get_indexed_variable(r, data);
-
- if (value == NULL || value->not_found) {
- return 1;
- }
-
- len = ngx_http_log_escape(NULL, value->data, value->len);
-
- value->escape = len ? 1 : 0;
-
- return value->len + len * 3;
-}
-
-
-static u_char *
-ngx_http_log_variable(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
-{
- ngx_http_variable_value_t *value;
-
- value = ngx_http_get_indexed_variable(r, op->data);
-
- if (value == NULL || value->not_found) {
- *buf = '-';
- return buf + 1;
- }
-
- if (value->escape == 0) {
- return ngx_cpymem(buf, value->data, value->len);
-
- } else {
- return (u_char *) ngx_http_log_escape(buf, value->data, value->len);
- }
-}
-
-
-static uintptr_t
-ngx_http_log_escape(u_char *dst, u_char *src, size_t size)
-{
- ngx_uint_t n;
- static u_char hex[] = "0123456789ABCDEF";
-
- static uint32_t escape[] = {
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
-
- /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */
- 0x00000004, /* 0000 0000 0000 0000 0000 0000 0000 0100 */
-
- /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */
- 0x10000000, /* 0001 0000 0000 0000 0000 0000 0000 0000 */
-
- /* ~}| {zyx wvut srqp onml kjih gfed cba` */
- 0x80000000, /* 1000 0000 0000 0000 0000 0000 0000 0000 */
-
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
- };
-
-
- if (dst == NULL) {
-
- /* find the number of the characters to be escaped */
-
- n = 0;
-
- while (size) {
- if (escape[*src >> 5] & (1 << (*src & 0x1f))) {
- n++;
- }
- src++;
- size--;
- }
-
- return (uintptr_t) n;
- }
-
- while (size) {
- if (escape[*src >> 5] & (1 << (*src & 0x1f))) {
- *dst++ = '\\';
- *dst++ = 'x';
- *dst++ = hex[*src >> 4];
- *dst++ = hex[*src & 0xf];
- src++;
-
- } else {
- *dst++ = *src++;
- }
- size--;
- }
-
- return (uintptr_t) dst;
-}
-
-
-static void *
-ngx_http_log_create_main_conf(ngx_conf_t *cf)
-{
- ngx_http_log_main_conf_t *conf;
-
- ngx_http_log_fmt_t *fmt;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_log_main_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- if (ngx_array_init(&conf->formats, cf->pool, 4, sizeof(ngx_http_log_fmt_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- fmt = ngx_array_push(&conf->formats);
- if (fmt == NULL) {
- return NULL;
- }
-
- ngx_str_set(&fmt->name, "combined");
-
- fmt->flushes = NULL;
-
- fmt->ops = ngx_array_create(cf->pool, 16, sizeof(ngx_http_log_op_t));
- if (fmt->ops == NULL) {
- return NULL;
- }
-
- return conf;
-}
-
-
-static void *
-ngx_http_log_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_log_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_log_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->open_file_cache = NGX_CONF_UNSET_PTR;
-
- return conf;
-}
-
-
-static char *
-ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_log_loc_conf_t *prev = parent;
- ngx_http_log_loc_conf_t *conf = child;
-
- ngx_http_log_t *log;
- ngx_http_log_fmt_t *fmt;
- ngx_http_log_main_conf_t *lmcf;
-
- if (conf->open_file_cache == NGX_CONF_UNSET_PTR) {
-
- conf->open_file_cache = prev->open_file_cache;
- conf->open_file_cache_valid = prev->open_file_cache_valid;
- conf->open_file_cache_min_uses = prev->open_file_cache_min_uses;
-
- if (conf->open_file_cache == NGX_CONF_UNSET_PTR) {
- conf->open_file_cache = NULL;
- }
- }
-
- if (conf->logs || conf->off) {
- return NGX_CONF_OK;
- }
-
- conf->logs = prev->logs;
- conf->off = prev->off;
-
- if (conf->logs || conf->off) {
- return NGX_CONF_OK;
- }
-
- conf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_log_t));
- if (conf->logs == NULL) {
- return NGX_CONF_ERROR;
- }
-
- log = ngx_array_push(conf->logs);
- if (log == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(log, sizeof(ngx_http_log_t));
-
- log->file = ngx_conf_open_file(cf->cycle, &ngx_http_access_log);
- if (log->file == NULL) {
- return NGX_CONF_ERROR;
- }
-
- lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
- fmt = lmcf->formats.elts;
-
- /* the default "combined" format */
- log->format = &fmt[0];
- lmcf->combined_used = 1;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_log_loc_conf_t *llcf = conf;
-
- ssize_t size;
- ngx_int_t gzip;
- ngx_uint_t i, n;
- ngx_msec_t flush;
- ngx_str_t *value, name, s;
- ngx_http_log_t *log;
- ngx_syslog_peer_t *peer;
- ngx_http_log_buf_t *buffer;
- ngx_http_log_fmt_t *fmt;
- ngx_http_log_main_conf_t *lmcf;
- ngx_http_script_compile_t sc;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- llcf->off = 1;
- if (cf->args->nelts == 2) {
- return NGX_CONF_OK;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[2]);
- return NGX_CONF_ERROR;
- }
-
- if (llcf->logs == NULL) {
- llcf->logs = ngx_array_create(cf->pool, 2, sizeof(ngx_http_log_t));
- if (llcf->logs == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
-
- log = ngx_array_push(llcf->logs);
- if (log == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(log, sizeof(ngx_http_log_t));
-
-
- if (ngx_strncmp(value[1].data, "syslog:", 7) == 0) {
-
- peer = ngx_pcalloc(cf->pool, sizeof(ngx_syslog_peer_t));
- if (peer == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_syslog_process_conf(cf, peer) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
-
- log->syslog_peer = peer;
-
- goto process_formats;
- }
-
- n = ngx_http_script_variables_count(&value[1]);
-
- if (n == 0) {
- log->file = ngx_conf_open_file(cf->cycle, &value[1]);
- if (log->file == NULL) {
- return NGX_CONF_ERROR;
- }
-
- } else {
- if (ngx_conf_full_name(cf->cycle, &value[1], 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- log->script = ngx_pcalloc(cf->pool, sizeof(ngx_http_log_script_t));
- if (log->script == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &value[1];
- sc.lengths = &log->script->lengths;
- sc.values = &log->script->values;
- sc.variables = n;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
-process_formats:
-
- if (cf->args->nelts >= 3) {
- name = value[2];
-
- if (ngx_strcmp(name.data, "combined") == 0) {
- lmcf->combined_used = 1;
- }
-
- } else {
- ngx_str_set(&name, "combined");
- lmcf->combined_used = 1;
- }
-
- fmt = lmcf->formats.elts;
- for (i = 0; i < lmcf->formats.nelts; i++) {
- if (fmt[i].name.len == name.len
- && ngx_strcasecmp(fmt[i].name.data, name.data) == 0)
- {
- log->format = &fmt[i];
- break;
- }
- }
-
- if (log->format == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "unknown log format \"%V\"", &name);
- return NGX_CONF_ERROR;
- }
-
- size = 0;
- flush = 0;
- gzip = 0;
-
- for (i = 3; i < cf->args->nelts; i++) {
-
- if (ngx_strncmp(value[i].data, "buffer=", 7) == 0) {
- s.len = value[i].len - 7;
- s.data = value[i].data + 7;
-
- size = ngx_parse_size(&s);
-
- if (size == NGX_ERROR || size == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid buffer size \"%V\"", &s);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "flush=", 6) == 0) {
- s.len = value[i].len - 6;
- s.data = value[i].data + 6;
-
- flush = ngx_parse_time(&s, 0);
-
- if (flush == (ngx_msec_t) NGX_ERROR || flush == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid flush time \"%V\"", &s);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "gzip", 4) == 0
- && (value[i].len == 4 || value[i].data[4] == '='))
- {
-#if (NGX_ZLIB)
- if (size == 0) {
- size = 64 * 1024;
- }
-
- if (value[i].len == 4) {
- gzip = Z_BEST_SPEED;
- continue;
- }
-
- s.len = value[i].len - 5;
- s.data = value[i].data + 5;
-
- gzip = ngx_atoi(s.data, s.len);
-
- if (gzip < 1 || gzip > 9) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid compression level \"%V\"", &s);
- return NGX_CONF_ERROR;
- }
-
- continue;
-
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "nginx was built without zlib support");
- return NGX_CONF_ERROR;
-#endif
- }
-
- if (ngx_strncmp(value[i].data, "if=", 3) == 0) {
- s.len = value[i].len - 3;
- s.data = value[i].data + 3;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &s;
- ccv.complex_value = ngx_palloc(cf->pool,
- sizeof(ngx_http_complex_value_t));
- if (ccv.complex_value == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- log->filter = ccv.complex_value;
-
- continue;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (flush && size == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "no buffer is defined for access_log \"%V\"",
- &value[1]);
- return NGX_CONF_ERROR;
- }
-
- if (size) {
-
- if (log->script) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "buffered logs cannot have variables in name");
- return NGX_CONF_ERROR;
- }
-
- if (log->syslog_peer) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "logs to syslog cannot be buffered");
- return NGX_CONF_ERROR;
- }
-
- if (log->file->data) {
- buffer = log->file->data;
-
- if (buffer->last - buffer->start != size
- || buffer->flush != flush
- || buffer->gzip != gzip)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "access_log \"%V\" already defined "
- "with conflicting parameters",
- &value[1]);
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
- }
-
- buffer = ngx_pcalloc(cf->pool, sizeof(ngx_http_log_buf_t));
- if (buffer == NULL) {
- return NGX_CONF_ERROR;
- }
-
- buffer->start = ngx_pnalloc(cf->pool, size);
- if (buffer->start == NULL) {
- return NGX_CONF_ERROR;
- }
-
- buffer->pos = buffer->start;
- buffer->last = buffer->start + size;
-
- if (flush) {
- buffer->event = ngx_pcalloc(cf->pool, sizeof(ngx_event_t));
- if (buffer->event == NULL) {
- return NGX_CONF_ERROR;
- }
-
- buffer->event->data = log->file;
- buffer->event->handler = ngx_http_log_flush_handler;
- buffer->event->log = &cf->cycle->new_log;
-
- buffer->flush = flush;
- }
-
- buffer->gzip = gzip;
-
- log->file->flush = ngx_http_log_flush;
- log->file->data = buffer;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_log_set_format(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_log_main_conf_t *lmcf = conf;
-
- ngx_str_t *value;
- ngx_uint_t i;
- ngx_http_log_fmt_t *fmt;
-
- if (cf->cmd_type != NGX_HTTP_MAIN_CONF) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "the \"log_format\" directive may be used "
- "only on \"http\" level");
- }
-
- value = cf->args->elts;
-
- fmt = lmcf->formats.elts;
- for (i = 0; i < lmcf->formats.nelts; i++) {
- if (fmt[i].name.len == value[1].len
- && ngx_strcmp(fmt[i].name.data, value[1].data) == 0)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate \"log_format\" name \"%V\"",
- &value[1]);
- return NGX_CONF_ERROR;
- }
- }
-
- fmt = ngx_array_push(&lmcf->formats);
- if (fmt == NULL) {
- return NGX_CONF_ERROR;
- }
-
- fmt->name = value[1];
-
- fmt->flushes = ngx_array_create(cf->pool, 4, sizeof(ngx_int_t));
- if (fmt->flushes == NULL) {
- return NGX_CONF_ERROR;
- }
-
- fmt->ops = ngx_array_create(cf->pool, 16, sizeof(ngx_http_log_op_t));
- if (fmt->ops == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return ngx_http_log_compile_format(cf, fmt->flushes, fmt->ops, cf->args, 2);
-}
-
-
-static char *
-ngx_http_log_compile_format(ngx_conf_t *cf, ngx_array_t *flushes,
- ngx_array_t *ops, ngx_array_t *args, ngx_uint_t s)
-{
- u_char *data, *p, ch;
- size_t i, len;
- ngx_str_t *value, var;
- ngx_int_t *flush;
- ngx_uint_t bracket;
- ngx_http_log_op_t *op;
- ngx_http_log_var_t *v;
-
- value = args->elts;
-
- for ( /* void */ ; s < args->nelts; s++) {
-
- i = 0;
-
- while (i < value[s].len) {
-
- op = ngx_array_push(ops);
- if (op == NULL) {
- return NGX_CONF_ERROR;
- }
-
- data = &value[s].data[i];
-
- if (value[s].data[i] == '$') {
-
- if (++i == value[s].len) {
- goto invalid;
- }
-
- if (value[s].data[i] == '{') {
- bracket = 1;
-
- if (++i == value[s].len) {
- goto invalid;
- }
-
- var.data = &value[s].data[i];
-
- } else {
- bracket = 0;
- var.data = &value[s].data[i];
- }
-
- for (var.len = 0; i < value[s].len; i++, var.len++) {
- ch = value[s].data[i];
-
- if (ch == '}' && bracket) {
- i++;
- bracket = 0;
- break;
- }
-
- if ((ch >= 'A' && ch <= 'Z')
- || (ch >= 'a' && ch <= 'z')
- || (ch >= '0' && ch <= '9')
- || ch == '_')
- {
- continue;
- }
-
- break;
- }
-
- if (bracket) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the closing bracket in \"%V\" "
- "variable is missing", &var);
- return NGX_CONF_ERROR;
- }
-
- if (var.len == 0) {
- goto invalid;
- }
-
- for (v = ngx_http_log_vars; v->name.len; v++) {
-
- if (v->name.len == var.len
- && ngx_strncmp(v->name.data, var.data, var.len) == 0)
- {
- op->len = v->len;
- op->getlen = NULL;
- op->run = v->run;
- op->data = 0;
-
- goto found;
- }
- }
-
- if (ngx_http_log_variable_compile(cf, op, &var) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (flushes) {
-
- flush = ngx_array_push(flushes);
- if (flush == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *flush = op->data; /* variable index */
- }
-
- found:
-
- continue;
- }
-
- i++;
-
- while (i < value[s].len && value[s].data[i] != '$') {
- i++;
- }
-
- len = &value[s].data[i] - data;
-
- if (len) {
-
- op->len = len;
- op->getlen = NULL;
-
- if (len <= sizeof(uintptr_t)) {
- op->run = ngx_http_log_copy_short;
- op->data = 0;
-
- while (len--) {
- op->data <<= 8;
- op->data |= data[len];
- }
-
- } else {
- op->run = ngx_http_log_copy_long;
-
- p = ngx_pnalloc(cf->pool, len);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memcpy(p, data, len);
- op->data = (uintptr_t) p;
- }
- }
- }
- }
-
- return NGX_CONF_OK;
-
-invalid:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%s\"", data);
-
- return NGX_CONF_ERROR;
-}
-
-
-static char *
-ngx_http_log_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_log_loc_conf_t *llcf = conf;
-
- time_t inactive, valid;
- ngx_str_t *value, s;
- ngx_int_t max, min_uses;
- ngx_uint_t i;
-
- if (llcf->open_file_cache != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- max = 0;
- inactive = 10;
- valid = 60;
- min_uses = 1;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (ngx_strncmp(value[i].data, "max=", 4) == 0) {
-
- max = ngx_atoi(value[i].data + 4, value[i].len - 4);
- if (max == NGX_ERROR) {
- goto failed;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "inactive=", 9) == 0) {
-
- s.len = value[i].len - 9;
- s.data = value[i].data + 9;
-
- inactive = ngx_parse_time(&s, 1);
- if (inactive == (time_t) NGX_ERROR) {
- goto failed;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "min_uses=", 9) == 0) {
-
- min_uses = ngx_atoi(value[i].data + 9, value[i].len - 9);
- if (min_uses == NGX_ERROR) {
- goto failed;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "valid=", 6) == 0) {
-
- s.len = value[i].len - 6;
- s.data = value[i].data + 6;
-
- valid = ngx_parse_time(&s, 1);
- if (valid == (time_t) NGX_ERROR) {
- goto failed;
- }
-
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "off") == 0) {
-
- llcf->open_file_cache = NULL;
-
- continue;
- }
-
- failed:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid \"open_log_file_cache\" parameter \"%V\"",
- &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (llcf->open_file_cache == NULL) {
- return NGX_CONF_OK;
- }
-
- if (max == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"open_log_file_cache\" must have \"max\" parameter");
- return NGX_CONF_ERROR;
- }
-
- llcf->open_file_cache = ngx_open_file_cache_init(cf->pool, max, inactive);
-
- if (llcf->open_file_cache) {
-
- llcf->open_file_cache_valid = valid;
- llcf->open_file_cache_min_uses = min_uses;
-
- return NGX_CONF_OK;
- }
-
- return NGX_CONF_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_log_init(ngx_conf_t *cf)
-{
- ngx_str_t *value;
- ngx_array_t a;
- ngx_http_handler_pt *h;
- ngx_http_log_fmt_t *fmt;
- ngx_http_log_main_conf_t *lmcf;
- ngx_http_core_main_conf_t *cmcf;
-
- lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
-
- if (lmcf->combined_used) {
- if (ngx_array_init(&a, cf->pool, 1, sizeof(ngx_str_t)) != NGX_OK) {
- return NGX_ERROR;
- }
-
- value = ngx_array_push(&a);
- if (value == NULL) {
- return NGX_ERROR;
- }
-
- *value = ngx_http_combined_fmt;
- fmt = lmcf->formats.elts;
-
- if (ngx_http_log_compile_format(cf, NULL, fmt->ops, &a, 0)
- != NGX_CONF_OK)
- {
- return NGX_ERROR;
- }
- }
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_LOG_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_log_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_map_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_map_module.c
deleted file mode 100644
index 3245e04132c..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_map_module.c
+++ /dev/null
@@ -1,567 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_uint_t hash_max_size;
- ngx_uint_t hash_bucket_size;
-} ngx_http_map_conf_t;
-
-
-typedef struct {
- ngx_hash_keys_arrays_t keys;
-
- ngx_array_t *values_hash;
- ngx_array_t var_values;
-#if (NGX_PCRE)
- ngx_array_t regexes;
-#endif
-
- ngx_http_variable_value_t *default_value;
- ngx_conf_t *cf;
- ngx_uint_t hostnames; /* unsigned hostnames:1 */
-} ngx_http_map_conf_ctx_t;
-
-
-typedef struct {
- ngx_http_map_t map;
- ngx_http_complex_value_t value;
- ngx_http_variable_value_t *default_value;
- ngx_uint_t hostnames; /* unsigned hostnames:1 */
-} ngx_http_map_ctx_t;
-
-
-static int ngx_libc_cdecl ngx_http_map_cmp_dns_wildcards(const void *one,
- const void *two);
-static void *ngx_http_map_create_conf(ngx_conf_t *cf);
-static char *ngx_http_map_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static char *ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf);
-
-
-static ngx_command_t ngx_http_map_commands[] = {
-
- { ngx_string("map"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE2,
- ngx_http_map_block,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("map_hash_max_size"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_map_conf_t, hash_max_size),
- NULL },
-
- { ngx_string("map_hash_bucket_size"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_map_conf_t, hash_bucket_size),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_map_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- ngx_http_map_create_conf, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_map_module = {
- NGX_MODULE_V1,
- &ngx_http_map_module_ctx, /* module context */
- ngx_http_map_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_map_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_http_map_ctx_t *map = (ngx_http_map_ctx_t *) data;
-
- ngx_str_t val;
- ngx_http_variable_value_t *value;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http map started");
-
- if (ngx_http_complex_value(r, &map->value, &val) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (map->hostnames && val.len > 0 && val.data[val.len - 1] == '.') {
- val.len--;
- }
-
- value = ngx_http_map_find(r, &map->map, &val);
-
- if (value == NULL) {
- value = map->default_value;
- }
-
- if (!value->valid) {
- value = ngx_http_get_flushed_variable(r, (uintptr_t) value->data);
-
- if (value == NULL || value->not_found) {
- value = &ngx_http_variable_null_value;
- }
- }
-
- *v = *value;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http map: \"%v\" \"%v\"", &val, v);
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_map_create_conf(ngx_conf_t *cf)
-{
- ngx_http_map_conf_t *mcf;
-
- mcf = ngx_palloc(cf->pool, sizeof(ngx_http_map_conf_t));
- if (mcf == NULL) {
- return NULL;
- }
-
- mcf->hash_max_size = NGX_CONF_UNSET_UINT;
- mcf->hash_bucket_size = NGX_CONF_UNSET_UINT;
-
- return mcf;
-}
-
-
-static char *
-ngx_http_map_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_map_conf_t *mcf = conf;
-
- char *rv;
- ngx_str_t *value, name;
- ngx_conf_t save;
- ngx_pool_t *pool;
- ngx_hash_init_t hash;
- ngx_http_map_ctx_t *map;
- ngx_http_variable_t *var;
- ngx_http_map_conf_ctx_t ctx;
- ngx_http_compile_complex_value_t ccv;
-
- if (mcf->hash_max_size == NGX_CONF_UNSET_UINT) {
- mcf->hash_max_size = 2048;
- }
-
- if (mcf->hash_bucket_size == NGX_CONF_UNSET_UINT) {
- mcf->hash_bucket_size = ngx_cacheline_size;
-
- } else {
- mcf->hash_bucket_size = ngx_align(mcf->hash_bucket_size,
- ngx_cacheline_size);
- }
-
- map = ngx_pcalloc(cf->pool, sizeof(ngx_http_map_ctx_t));
- if (map == NULL) {
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &map->value;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- name = value[2];
-
- if (name.data[0] != '$') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"%V\"", &name);
- return NGX_CONF_ERROR;
- }
-
- name.len--;
- name.data++;
-
- var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
- if (var == NULL) {
- return NGX_CONF_ERROR;
- }
-
- var->get_handler = ngx_http_map_variable;
- var->data = (uintptr_t) map;
-
- pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, cf->log);
- if (pool == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx.keys.pool = cf->pool;
- ctx.keys.temp_pool = pool;
-
- if (ngx_hash_keys_array_init(&ctx.keys, NGX_HASH_LARGE) != NGX_OK) {
- ngx_destroy_pool(pool);
- return NGX_CONF_ERROR;
- }
-
- ctx.values_hash = ngx_pcalloc(pool, sizeof(ngx_array_t) * ctx.keys.hsize);
- if (ctx.values_hash == NULL) {
- ngx_destroy_pool(pool);
- return NGX_CONF_ERROR;
- }
-
- if (ngx_array_init(&ctx.var_values, cf->pool, 2,
- sizeof(ngx_http_variable_value_t))
- != NGX_OK)
- {
- ngx_destroy_pool(pool);
- return NGX_CONF_ERROR;
- }
-
-#if (NGX_PCRE)
- if (ngx_array_init(&ctx.regexes, cf->pool, 2, sizeof(ngx_http_map_regex_t))
- != NGX_OK)
- {
- ngx_destroy_pool(pool);
- return NGX_CONF_ERROR;
- }
-#endif
-
- ctx.default_value = NULL;
- ctx.cf = &save;
- ctx.hostnames = 0;
-
- save = *cf;
- cf->pool = pool;
- cf->ctx = &ctx;
- cf->handler = ngx_http_map;
- cf->handler_conf = conf;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = save;
-
- if (rv != NGX_CONF_OK) {
- ngx_destroy_pool(pool);
- return rv;
- }
-
- map->default_value = ctx.default_value ? ctx.default_value:
- &ngx_http_variable_null_value;
-
- map->hostnames = ctx.hostnames;
-
- hash.key = ngx_hash_key_lc;
- hash.max_size = mcf->hash_max_size;
- hash.bucket_size = mcf->hash_bucket_size;
- hash.name = "map_hash";
- hash.pool = cf->pool;
-
- if (ctx.keys.keys.nelts) {
- hash.hash = &map->map.hash.hash;
- hash.temp_pool = NULL;
-
- if (ngx_hash_init(&hash, ctx.keys.keys.elts, ctx.keys.keys.nelts)
- != NGX_OK)
- {
- ngx_destroy_pool(pool);
- return NGX_CONF_ERROR;
- }
- }
-
- if (ctx.keys.dns_wc_head.nelts) {
-
- ngx_qsort(ctx.keys.dns_wc_head.elts,
- (size_t) ctx.keys.dns_wc_head.nelts,
- sizeof(ngx_hash_key_t), ngx_http_map_cmp_dns_wildcards);
-
- hash.hash = NULL;
- hash.temp_pool = pool;
-
- if (ngx_hash_wildcard_init(&hash, ctx.keys.dns_wc_head.elts,
- ctx.keys.dns_wc_head.nelts)
- != NGX_OK)
- {
- ngx_destroy_pool(pool);
- return NGX_CONF_ERROR;
- }
-
- map->map.hash.wc_head = (ngx_hash_wildcard_t *) hash.hash;
- }
-
- if (ctx.keys.dns_wc_tail.nelts) {
-
- ngx_qsort(ctx.keys.dns_wc_tail.elts,
- (size_t) ctx.keys.dns_wc_tail.nelts,
- sizeof(ngx_hash_key_t), ngx_http_map_cmp_dns_wildcards);
-
- hash.hash = NULL;
- hash.temp_pool = pool;
-
- if (ngx_hash_wildcard_init(&hash, ctx.keys.dns_wc_tail.elts,
- ctx.keys.dns_wc_tail.nelts)
- != NGX_OK)
- {
- ngx_destroy_pool(pool);
- return NGX_CONF_ERROR;
- }
-
- map->map.hash.wc_tail = (ngx_hash_wildcard_t *) hash.hash;
- }
-
-#if (NGX_PCRE)
-
- if (ctx.regexes.nelts) {
- map->map.regex = ctx.regexes.elts;
- map->map.nregex = ctx.regexes.nelts;
- }
-
-#endif
-
- ngx_destroy_pool(pool);
-
- return rv;
-}
-
-
-static int ngx_libc_cdecl
-ngx_http_map_cmp_dns_wildcards(const void *one, const void *two)
-{
- ngx_hash_key_t *first, *second;
-
- first = (ngx_hash_key_t *) one;
- second = (ngx_hash_key_t *) two;
-
- return ngx_dns_strcmp(first->key.data, second->key.data);
-}
-
-
-static char *
-ngx_http_map(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
-{
- ngx_int_t rc, index;
- ngx_str_t *value, name;
- ngx_uint_t i, key;
- ngx_http_map_conf_ctx_t *ctx;
- ngx_http_variable_value_t *var, **vp;
-
- ctx = cf->ctx;
-
- value = cf->args->elts;
-
- if (cf->args->nelts == 1
- && ngx_strcmp(value[0].data, "hostnames") == 0)
- {
- ctx->hostnames = 1;
- return NGX_CONF_OK;
-
- } else if (cf->args->nelts != 2) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid number of the map parameters");
- return NGX_CONF_ERROR;
- }
-
- if (ngx_strcmp(value[0].data, "include") == 0) {
- return ngx_conf_include(cf, dummy, conf);
- }
-
- if (value[1].data[0] == '$') {
- name = value[1];
- name.len--;
- name.data++;
-
- index = ngx_http_get_variable_index(ctx->cf, &name);
- if (index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- var = ctx->var_values.elts;
-
- for (i = 0; i < ctx->var_values.nelts; i++) {
- if (index == (intptr_t) var[i].data) {
- var = &var[i];
- goto found;
- }
- }
-
- var = ngx_array_push(&ctx->var_values);
- if (var == NULL) {
- return NGX_CONF_ERROR;
- }
-
- var->valid = 0;
- var->no_cacheable = 0;
- var->not_found = 0;
- var->len = 0;
- var->data = (u_char *) (intptr_t) index;
-
- goto found;
- }
-
- key = 0;
-
- for (i = 0; i < value[1].len; i++) {
- key = ngx_hash(key, value[1].data[i]);
- }
-
- key %= ctx->keys.hsize;
-
- vp = ctx->values_hash[key].elts;
-
- if (vp) {
- for (i = 0; i < ctx->values_hash[key].nelts; i++) {
- if (value[1].len != (size_t) vp[i]->len) {
- continue;
- }
-
- if (ngx_strncmp(value[1].data, vp[i]->data, value[1].len) == 0) {
- var = vp[i];
- goto found;
- }
- }
-
- } else {
- if (ngx_array_init(&ctx->values_hash[key], cf->pool, 4,
- sizeof(ngx_http_variable_value_t *))
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
-
- var = ngx_palloc(ctx->keys.pool, sizeof(ngx_http_variable_value_t));
- if (var == NULL) {
- return NGX_CONF_ERROR;
- }
-
- var->len = value[1].len;
- var->data = ngx_pstrdup(ctx->keys.pool, &value[1]);
- if (var->data == NULL) {
- return NGX_CONF_ERROR;
- }
-
- var->valid = 1;
- var->no_cacheable = 0;
- var->not_found = 0;
-
- vp = ngx_array_push(&ctx->values_hash[key]);
- if (vp == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *vp = var;
-
-found:
-
- if (ngx_strcmp(value[0].data, "default") == 0) {
-
- if (ctx->default_value) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate default map parameter");
- return NGX_CONF_ERROR;
- }
-
- ctx->default_value = var;
-
- return NGX_CONF_OK;
- }
-
-#if (NGX_PCRE)
-
- if (value[0].len && value[0].data[0] == '~') {
- ngx_regex_compile_t rc;
- ngx_http_map_regex_t *regex;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
-
- regex = ngx_array_push(&ctx->regexes);
- if (regex == NULL) {
- return NGX_CONF_ERROR;
- }
-
- value[0].len--;
- value[0].data++;
-
- ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
-
- if (value[0].data[0] == '*') {
- value[0].len--;
- value[0].data++;
- rc.options = NGX_REGEX_CASELESS;
- }
-
- rc.pattern = value[0];
- rc.err.len = NGX_MAX_CONF_ERRSTR;
- rc.err.data = errstr;
-
- regex->regex = ngx_http_regex_compile(ctx->cf, &rc);
- if (regex->regex == NULL) {
- return NGX_CONF_ERROR;
- }
-
- regex->value = var;
-
- return NGX_CONF_OK;
- }
-
-#endif
-
- if (value[0].len && value[0].data[0] == '\\') {
- value[0].len--;
- value[0].data++;
- }
-
- rc = ngx_hash_add_key(&ctx->keys, &value[0], var,
- (ctx->hostnames) ? NGX_HASH_WILDCARD_KEY : 0);
-
- if (rc == NGX_OK) {
- return NGX_CONF_OK;
- }
-
- if (rc == NGX_DECLINED) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid hostname or wildcard \"%V\"", &value[0]);
- }
-
- if (rc == NGX_BUSY) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "conflicting parameter \"%V\"", &value[0]);
- }
-
- return NGX_CONF_ERROR;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_memcached_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_memcached_module.c
deleted file mode 100644
index 17f1d8e100a..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_memcached_module.c
+++ /dev/null
@@ -1,722 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_http_upstream_conf_t upstream;
- ngx_int_t index;
- ngx_uint_t gzip_flag;
-} ngx_http_memcached_loc_conf_t;
-
-
-typedef struct {
- size_t rest;
- ngx_http_request_t *request;
- ngx_str_t key;
-} ngx_http_memcached_ctx_t;
-
-
-static ngx_int_t ngx_http_memcached_create_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_memcached_reinit_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_memcached_process_header(ngx_http_request_t *r);
-static ngx_int_t ngx_http_memcached_filter_init(void *data);
-static ngx_int_t ngx_http_memcached_filter(void *data, ssize_t bytes);
-static void ngx_http_memcached_abort_request(ngx_http_request_t *r);
-static void ngx_http_memcached_finalize_request(ngx_http_request_t *r,
- ngx_int_t rc);
-
-static void *ngx_http_memcached_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_memcached_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-
-static char *ngx_http_memcached_pass(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_conf_bitmask_t ngx_http_memcached_next_upstream_masks[] = {
- { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR },
- { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT },
- { ngx_string("invalid_response"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER },
- { ngx_string("not_found"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
- { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_command_t ngx_http_memcached_commands[] = {
-
- { ngx_string("memcached_pass"),
- NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
- ngx_http_memcached_pass,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("memcached_bind"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_upstream_bind_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memcached_loc_conf_t, upstream.local),
- NULL },
-
- { ngx_string("memcached_connect_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memcached_loc_conf_t, upstream.connect_timeout),
- NULL },
-
- { ngx_string("memcached_send_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memcached_loc_conf_t, upstream.send_timeout),
- NULL },
-
- { ngx_string("memcached_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memcached_loc_conf_t, upstream.buffer_size),
- NULL },
-
- { ngx_string("memcached_read_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memcached_loc_conf_t, upstream.read_timeout),
- NULL },
-
- { ngx_string("memcached_next_upstream"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memcached_loc_conf_t, upstream.next_upstream),
- &ngx_http_memcached_next_upstream_masks },
-
- { ngx_string("memcached_next_upstream_tries"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memcached_loc_conf_t, upstream.next_upstream_tries),
- NULL },
-
- { ngx_string("memcached_next_upstream_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memcached_loc_conf_t, upstream.next_upstream_timeout),
- NULL },
-
- { ngx_string("memcached_gzip_flag"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_memcached_loc_conf_t, gzip_flag),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_memcached_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_memcached_create_loc_conf, /* create location configuration */
- ngx_http_memcached_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_memcached_module = {
- NGX_MODULE_V1,
- &ngx_http_memcached_module_ctx, /* module context */
- ngx_http_memcached_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_http_memcached_key = ngx_string("memcached_key");
-
-
-#define NGX_HTTP_MEMCACHED_END (sizeof(ngx_http_memcached_end) - 1)
-static u_char ngx_http_memcached_end[] = CRLF "END" CRLF;
-
-
-static ngx_int_t
-ngx_http_memcached_handler(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_http_upstream_t *u;
- ngx_http_memcached_ctx_t *ctx;
- ngx_http_memcached_loc_conf_t *mlcf;
-
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
- return NGX_HTTP_NOT_ALLOWED;
- }
-
- rc = ngx_http_discard_request_body(r);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- if (ngx_http_set_content_type(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_http_upstream_create(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- u = r->upstream;
-
- ngx_str_set(&u->schema, "memcached://");
- u->output.tag = (ngx_buf_tag_t) &ngx_http_memcached_module;
-
- mlcf = ngx_http_get_module_loc_conf(r, ngx_http_memcached_module);
-
- u->conf = &mlcf->upstream;
-
- u->create_request = ngx_http_memcached_create_request;
- u->reinit_request = ngx_http_memcached_reinit_request;
- u->process_header = ngx_http_memcached_process_header;
- u->abort_request = ngx_http_memcached_abort_request;
- u->finalize_request = ngx_http_memcached_finalize_request;
-
- ctx = ngx_palloc(r->pool, sizeof(ngx_http_memcached_ctx_t));
- if (ctx == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctx->request = r;
-
- ngx_http_set_ctx(r, ctx, ngx_http_memcached_module);
-
- u->input_filter_init = ngx_http_memcached_filter_init;
- u->input_filter = ngx_http_memcached_filter;
- u->input_filter_ctx = ctx;
-
- r->main->count++;
-
- ngx_http_upstream_init(r);
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_http_memcached_create_request(ngx_http_request_t *r)
-{
- size_t len;
- uintptr_t escape;
- ngx_buf_t *b;
- ngx_chain_t *cl;
- ngx_http_memcached_ctx_t *ctx;
- ngx_http_variable_value_t *vv;
- ngx_http_memcached_loc_conf_t *mlcf;
-
- mlcf = ngx_http_get_module_loc_conf(r, ngx_http_memcached_module);
-
- vv = ngx_http_get_indexed_variable(r, mlcf->index);
-
- if (vv == NULL || vv->not_found || vv->len == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "the \"$memcached_key\" variable is not set");
- return NGX_ERROR;
- }
-
- escape = 2 * ngx_escape_uri(NULL, vv->data, vv->len, NGX_ESCAPE_MEMCACHED);
-
- len = sizeof("get ") - 1 + vv->len + escape + sizeof(CRLF) - 1;
-
- b = ngx_create_temp_buf(r->pool, len);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- cl->next = NULL;
-
- r->upstream->request_bufs = cl;
-
- *b->last++ = 'g'; *b->last++ = 'e'; *b->last++ = 't'; *b->last++ = ' ';
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_memcached_module);
-
- ctx->key.data = b->last;
-
- if (escape == 0) {
- b->last = ngx_copy(b->last, vv->data, vv->len);
-
- } else {
- b->last = (u_char *) ngx_escape_uri(b->last, vv->data, vv->len,
- NGX_ESCAPE_MEMCACHED);
- }
-
- ctx->key.len = b->last - ctx->key.data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http memcached request: \"%V\"", &ctx->key);
-
- *b->last++ = CR; *b->last++ = LF;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_memcached_reinit_request(ngx_http_request_t *r)
-{
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_memcached_process_header(ngx_http_request_t *r)
-{
- u_char *p, *start;
- ngx_str_t line;
- ngx_uint_t flags;
- ngx_table_elt_t *h;
- ngx_http_upstream_t *u;
- ngx_http_memcached_ctx_t *ctx;
- ngx_http_memcached_loc_conf_t *mlcf;
-
- u = r->upstream;
-
- for (p = u->buffer.pos; p < u->buffer.last; p++) {
- if (*p == LF) {
- goto found;
- }
- }
-
- return NGX_AGAIN;
-
-found:
-
- line.data = u->buffer.pos;
- line.len = p - u->buffer.pos;
-
- if (line.len == 0 || *(p - 1) != CR) {
- goto no_valid;
- }
-
- *p = '\0';
- line.len--;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "memcached: \"%V\"", &line);
-
- p = u->buffer.pos;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_memcached_module);
- mlcf = ngx_http_get_module_loc_conf(r, ngx_http_memcached_module);
-
- if (ngx_strncmp(p, "VALUE ", sizeof("VALUE ") - 1) == 0) {
-
- p += sizeof("VALUE ") - 1;
-
- if (ngx_strncmp(p, ctx->key.data, ctx->key.len) != 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "memcached sent invalid key in response \"%V\" "
- "for key \"%V\"",
- &line, &ctx->key);
-
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-
- p += ctx->key.len;
-
- if (*p++ != ' ') {
- goto no_valid;
- }
-
- /* flags */
-
- start = p;
-
- while (*p) {
- if (*p++ == ' ') {
- if (mlcf->gzip_flag) {
- goto flags;
- } else {
- goto length;
- }
- }
- }
-
- goto no_valid;
-
- flags:
-
- flags = ngx_atoi(start, p - start - 1);
-
- if (flags == (ngx_uint_t) NGX_ERROR) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "memcached sent invalid flags in response \"%V\" "
- "for key \"%V\"",
- &line, &ctx->key);
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-
- if (flags & mlcf->gzip_flag) {
- h = ngx_list_push(&r->headers_out.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = 1;
- ngx_str_set(&h->key, "Content-Encoding");
- ngx_str_set(&h->value, "gzip");
- r->headers_out.content_encoding = h;
- }
-
- length:
-
- start = p;
- p = line.data + line.len;
-
- u->headers_in.content_length_n = ngx_atoof(start, p - start);
- if (u->headers_in.content_length_n == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "memcached sent invalid length in response \"%V\" "
- "for key \"%V\"",
- &line, &ctx->key);
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-
- u->headers_in.status_n = 200;
- u->state->status = 200;
- u->buffer.pos = p + sizeof(CRLF) - 1;
-
- return NGX_OK;
- }
-
- if (ngx_strcmp(p, "END\x0d") == 0) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "key: \"%V\" was not found by memcached", &ctx->key);
-
- u->headers_in.content_length_n = 0;
- u->headers_in.status_n = 404;
- u->state->status = 404;
- u->buffer.pos = p + sizeof("END" CRLF) - 1;
- u->keepalive = 1;
-
- return NGX_OK;
- }
-
-no_valid:
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "memcached sent invalid response: \"%V\"", &line);
-
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
-}
-
-
-static ngx_int_t
-ngx_http_memcached_filter_init(void *data)
-{
- ngx_http_memcached_ctx_t *ctx = data;
-
- ngx_http_upstream_t *u;
-
- u = ctx->request->upstream;
-
- if (u->headers_in.status_n != 404) {
- u->length = u->headers_in.content_length_n + NGX_HTTP_MEMCACHED_END;
- ctx->rest = NGX_HTTP_MEMCACHED_END;
-
- } else {
- u->length = 0;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_memcached_filter(void *data, ssize_t bytes)
-{
- ngx_http_memcached_ctx_t *ctx = data;
-
- u_char *last;
- ngx_buf_t *b;
- ngx_chain_t *cl, **ll;
- ngx_http_upstream_t *u;
-
- u = ctx->request->upstream;
- b = &u->buffer;
-
- if (u->length == (ssize_t) ctx->rest) {
-
- if (ngx_strncmp(b->last,
- ngx_http_memcached_end + NGX_HTTP_MEMCACHED_END - ctx->rest,
- bytes)
- != 0)
- {
- ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
- "memcached sent invalid trailer");
-
- u->length = 0;
- ctx->rest = 0;
-
- return NGX_OK;
- }
-
- u->length -= bytes;
- ctx->rest -= bytes;
-
- if (u->length == 0) {
- u->keepalive = 1;
- }
-
- return NGX_OK;
- }
-
- for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) {
- ll = &cl->next;
- }
-
- cl = ngx_chain_get_free_buf(ctx->request->pool, &u->free_bufs);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf->flush = 1;
- cl->buf->memory = 1;
-
- *ll = cl;
-
- last = b->last;
- cl->buf->pos = last;
- b->last += bytes;
- cl->buf->last = b->last;
- cl->buf->tag = u->output.tag;
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, ctx->request->connection->log, 0,
- "memcached filter bytes:%z size:%z length:%z rest:%z",
- bytes, b->last - b->pos, u->length, ctx->rest);
-
- if (bytes <= (ssize_t) (u->length - NGX_HTTP_MEMCACHED_END)) {
- u->length -= bytes;
- return NGX_OK;
- }
-
- last += (size_t) (u->length - NGX_HTTP_MEMCACHED_END);
-
- if (ngx_strncmp(last, ngx_http_memcached_end, b->last - last) != 0) {
- ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
- "memcached sent invalid trailer");
-
- b->last = last;
- cl->buf->last = last;
- u->length = 0;
- ctx->rest = 0;
-
- return NGX_OK;
- }
-
- ctx->rest -= b->last - last;
- b->last = last;
- cl->buf->last = last;
- u->length = ctx->rest;
-
- if (u->length == 0) {
- u->keepalive = 1;
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_memcached_abort_request(ngx_http_request_t *r)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "abort http memcached request");
- return;
-}
-
-
-static void
-ngx_http_memcached_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "finalize http memcached request");
- return;
-}
-
-
-static void *
-ngx_http_memcached_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_memcached_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_memcached_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->upstream.bufs.num = 0;
- * conf->upstream.next_upstream = 0;
- * conf->upstream.temp_path = NULL;
- * conf->upstream.uri = { 0, NULL };
- * conf->upstream.location = NULL;
- */
-
- conf->upstream.local = NGX_CONF_UNSET_PTR;
- conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
- conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
-
- conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
-
- /* the hardcoded values */
- conf->upstream.cyclic_temp_file = 0;
- conf->upstream.buffering = 0;
- conf->upstream.ignore_client_abort = 0;
- conf->upstream.send_lowat = 0;
- conf->upstream.bufs.num = 0;
- conf->upstream.busy_buffers_size = 0;
- conf->upstream.max_temp_file_size = 0;
- conf->upstream.temp_file_write_size = 0;
- conf->upstream.intercept_errors = 1;
- conf->upstream.intercept_404 = 1;
- conf->upstream.pass_request_headers = 0;
- conf->upstream.pass_request_body = 0;
-
- conf->index = NGX_CONF_UNSET;
- conf->gzip_flag = NGX_CONF_UNSET_UINT;
-
- return conf;
-}
-
-
-static char *
-ngx_http_memcached_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_memcached_loc_conf_t *prev = parent;
- ngx_http_memcached_loc_conf_t *conf = child;
-
- ngx_conf_merge_ptr_value(conf->upstream.local,
- prev->upstream.local, NULL);
-
- ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
- prev->upstream.next_upstream_tries, 0);
-
- ngx_conf_merge_msec_value(conf->upstream.connect_timeout,
- prev->upstream.connect_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.send_timeout,
- prev->upstream.send_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.read_timeout,
- prev->upstream.read_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
- prev->upstream.next_upstream_timeout, 0);
-
- ngx_conf_merge_size_value(conf->upstream.buffer_size,
- prev->upstream.buffer_size,
- (size_t) ngx_pagesize);
-
- ngx_conf_merge_bitmask_value(conf->upstream.next_upstream,
- prev->upstream.next_upstream,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_ERROR
- |NGX_HTTP_UPSTREAM_FT_TIMEOUT));
-
- if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) {
- conf->upstream.next_upstream = NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF;
- }
-
- if (conf->upstream.upstream == NULL) {
- conf->upstream.upstream = prev->upstream.upstream;
- }
-
- if (conf->index == NGX_CONF_UNSET) {
- conf->index = prev->index;
- }
-
- ngx_conf_merge_uint_value(conf->gzip_flag, prev->gzip_flag, 0);
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_memcached_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_memcached_loc_conf_t *mlcf = conf;
-
- ngx_str_t *value;
- ngx_url_t u;
- ngx_http_core_loc_conf_t *clcf;
-
- if (mlcf->upstream.upstream) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url = value[1];
- u.no_resolve = 1;
-
- mlcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0);
- if (mlcf->upstream.upstream == NULL) {
- return NGX_CONF_ERROR;
- }
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
-
- clcf->handler = ngx_http_memcached_handler;
-
- if (clcf->name.data[clcf->name.len - 1] == '/') {
- clcf->auto_redirect = 1;
- }
-
- mlcf->index = ngx_http_get_variable_index(cf, &ngx_http_memcached_key);
-
- if (mlcf->index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_mp4_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_mp4_module.c
deleted file mode 100644
index 980bf571917..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_mp4_module.c
+++ /dev/null
@@ -1,3500 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_MP4_TRAK_ATOM 0
-#define NGX_HTTP_MP4_TKHD_ATOM 1
-#define NGX_HTTP_MP4_MDIA_ATOM 2
-#define NGX_HTTP_MP4_MDHD_ATOM 3
-#define NGX_HTTP_MP4_HDLR_ATOM 4
-#define NGX_HTTP_MP4_MINF_ATOM 5
-#define NGX_HTTP_MP4_VMHD_ATOM 6
-#define NGX_HTTP_MP4_SMHD_ATOM 7
-#define NGX_HTTP_MP4_DINF_ATOM 8
-#define NGX_HTTP_MP4_STBL_ATOM 9
-#define NGX_HTTP_MP4_STSD_ATOM 10
-#define NGX_HTTP_MP4_STTS_ATOM 11
-#define NGX_HTTP_MP4_STTS_DATA 12
-#define NGX_HTTP_MP4_STSS_ATOM 13
-#define NGX_HTTP_MP4_STSS_DATA 14
-#define NGX_HTTP_MP4_CTTS_ATOM 15
-#define NGX_HTTP_MP4_CTTS_DATA 16
-#define NGX_HTTP_MP4_STSC_ATOM 17
-#define NGX_HTTP_MP4_STSC_START 18
-#define NGX_HTTP_MP4_STSC_DATA 19
-#define NGX_HTTP_MP4_STSC_END 20
-#define NGX_HTTP_MP4_STSZ_ATOM 21
-#define NGX_HTTP_MP4_STSZ_DATA 22
-#define NGX_HTTP_MP4_STCO_ATOM 23
-#define NGX_HTTP_MP4_STCO_DATA 24
-#define NGX_HTTP_MP4_CO64_ATOM 25
-#define NGX_HTTP_MP4_CO64_DATA 26
-
-#define NGX_HTTP_MP4_LAST_ATOM NGX_HTTP_MP4_CO64_DATA
-
-
-typedef struct {
- size_t buffer_size;
- size_t max_buffer_size;
-} ngx_http_mp4_conf_t;
-
-
-typedef struct {
- u_char chunk[4];
- u_char samples[4];
- u_char id[4];
-} ngx_mp4_stsc_entry_t;
-
-
-typedef struct {
- uint32_t timescale;
- uint32_t time_to_sample_entries;
- uint32_t sample_to_chunk_entries;
- uint32_t sync_samples_entries;
- uint32_t composition_offset_entries;
- uint32_t sample_sizes_entries;
- uint32_t chunks;
-
- ngx_uint_t start_sample;
- ngx_uint_t end_sample;
- ngx_uint_t start_chunk;
- ngx_uint_t end_chunk;
- ngx_uint_t start_chunk_samples;
- ngx_uint_t end_chunk_samples;
- uint64_t start_chunk_samples_size;
- uint64_t end_chunk_samples_size;
- off_t start_offset;
- off_t end_offset;
-
- size_t tkhd_size;
- size_t mdhd_size;
- size_t hdlr_size;
- size_t vmhd_size;
- size_t smhd_size;
- size_t dinf_size;
- size_t size;
-
- ngx_chain_t out[NGX_HTTP_MP4_LAST_ATOM + 1];
-
- ngx_buf_t trak_atom_buf;
- ngx_buf_t tkhd_atom_buf;
- ngx_buf_t mdia_atom_buf;
- ngx_buf_t mdhd_atom_buf;
- ngx_buf_t hdlr_atom_buf;
- ngx_buf_t minf_atom_buf;
- ngx_buf_t vmhd_atom_buf;
- ngx_buf_t smhd_atom_buf;
- ngx_buf_t dinf_atom_buf;
- ngx_buf_t stbl_atom_buf;
- ngx_buf_t stsd_atom_buf;
- ngx_buf_t stts_atom_buf;
- ngx_buf_t stts_data_buf;
- ngx_buf_t stss_atom_buf;
- ngx_buf_t stss_data_buf;
- ngx_buf_t ctts_atom_buf;
- ngx_buf_t ctts_data_buf;
- ngx_buf_t stsc_atom_buf;
- ngx_buf_t stsc_start_chunk_buf;
- ngx_buf_t stsc_end_chunk_buf;
- ngx_buf_t stsc_data_buf;
- ngx_buf_t stsz_atom_buf;
- ngx_buf_t stsz_data_buf;
- ngx_buf_t stco_atom_buf;
- ngx_buf_t stco_data_buf;
- ngx_buf_t co64_atom_buf;
- ngx_buf_t co64_data_buf;
-
- ngx_mp4_stsc_entry_t stsc_start_chunk_entry;
- ngx_mp4_stsc_entry_t stsc_end_chunk_entry;
-} ngx_http_mp4_trak_t;
-
-
-typedef struct {
- ngx_file_t file;
-
- u_char *buffer;
- u_char *buffer_start;
- u_char *buffer_pos;
- u_char *buffer_end;
- size_t buffer_size;
-
- off_t offset;
- off_t end;
- off_t content_length;
- ngx_uint_t start;
- ngx_uint_t length;
- uint32_t timescale;
- ngx_http_request_t *request;
- ngx_array_t trak;
- ngx_http_mp4_trak_t traks[2];
-
- size_t ftyp_size;
- size_t moov_size;
-
- ngx_chain_t *out;
- ngx_chain_t ftyp_atom;
- ngx_chain_t moov_atom;
- ngx_chain_t mvhd_atom;
- ngx_chain_t mdat_atom;
- ngx_chain_t mdat_data;
-
- ngx_buf_t ftyp_atom_buf;
- ngx_buf_t moov_atom_buf;
- ngx_buf_t mvhd_atom_buf;
- ngx_buf_t mdat_atom_buf;
- ngx_buf_t mdat_data_buf;
-
- u_char moov_atom_header[8];
- u_char mdat_atom_header[16];
-} ngx_http_mp4_file_t;
-
-
-typedef struct {
- char *name;
- ngx_int_t (*handler)(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-} ngx_http_mp4_atom_handler_t;
-
-
-#define ngx_mp4_atom_header(mp4) (mp4->buffer_pos - 8)
-#define ngx_mp4_atom_data(mp4) mp4->buffer_pos
-#define ngx_mp4_atom_data_size(t) (uint64_t) (sizeof(t) - 8)
-
-
-#define ngx_mp4_atom_next(mp4, n) \
- mp4->buffer_pos += (size_t) n; \
- mp4->offset += n
-
-
-#define ngx_mp4_set_atom_name(p, n1, n2, n3, n4) \
- ((u_char *) (p))[4] = n1; \
- ((u_char *) (p))[5] = n2; \
- ((u_char *) (p))[6] = n3; \
- ((u_char *) (p))[7] = n4
-
-#define ngx_mp4_get_32value(p) \
- ( ((uint32_t) ((u_char *) (p))[0] << 24) \
- + ( ((u_char *) (p))[1] << 16) \
- + ( ((u_char *) (p))[2] << 8) \
- + ( ((u_char *) (p))[3]) )
-
-#define ngx_mp4_set_32value(p, n) \
- ((u_char *) (p))[0] = (u_char) ((n) >> 24); \
- ((u_char *) (p))[1] = (u_char) ((n) >> 16); \
- ((u_char *) (p))[2] = (u_char) ((n) >> 8); \
- ((u_char *) (p))[3] = (u_char) (n)
-
-#define ngx_mp4_get_64value(p) \
- ( ((uint64_t) ((u_char *) (p))[0] << 56) \
- + ((uint64_t) ((u_char *) (p))[1] << 48) \
- + ((uint64_t) ((u_char *) (p))[2] << 40) \
- + ((uint64_t) ((u_char *) (p))[3] << 32) \
- + ((uint64_t) ((u_char *) (p))[4] << 24) \
- + ( ((u_char *) (p))[5] << 16) \
- + ( ((u_char *) (p))[6] << 8) \
- + ( ((u_char *) (p))[7]) )
-
-#define ngx_mp4_set_64value(p, n) \
- ((u_char *) (p))[0] = (u_char) ((uint64_t) (n) >> 56); \
- ((u_char *) (p))[1] = (u_char) ((uint64_t) (n) >> 48); \
- ((u_char *) (p))[2] = (u_char) ((uint64_t) (n) >> 40); \
- ((u_char *) (p))[3] = (u_char) ((uint64_t) (n) >> 32); \
- ((u_char *) (p))[4] = (u_char) ( (n) >> 24); \
- ((u_char *) (p))[5] = (u_char) ( (n) >> 16); \
- ((u_char *) (p))[6] = (u_char) ( (n) >> 8); \
- ((u_char *) (p))[7] = (u_char) (n)
-
-#define ngx_mp4_last_trak(mp4) \
- &((ngx_http_mp4_trak_t *) mp4->trak.elts)[mp4->trak.nelts - 1]
-
-
-static ngx_int_t ngx_http_mp4_handler(ngx_http_request_t *r);
-
-static ngx_int_t ngx_http_mp4_process(ngx_http_mp4_file_t *mp4);
-static ngx_int_t ngx_http_mp4_read_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_atom_handler_t *atom, uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read(ngx_http_mp4_file_t *mp4, size_t size);
-static ngx_int_t ngx_http_mp4_read_ftyp_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_moov_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_mdat_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static size_t ngx_http_mp4_update_mdat_atom(ngx_http_mp4_file_t *mp4,
- off_t start_offset, off_t end_offset);
-static ngx_int_t ngx_http_mp4_read_mvhd_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_trak_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static void ngx_http_mp4_update_trak_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static ngx_int_t ngx_http_mp4_read_cmov_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_tkhd_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_mdia_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static void ngx_http_mp4_update_mdia_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static ngx_int_t ngx_http_mp4_read_mdhd_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_hdlr_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_minf_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static void ngx_http_mp4_update_minf_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static ngx_int_t ngx_http_mp4_read_dinf_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_vmhd_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_smhd_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_stbl_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static void ngx_http_mp4_update_stbl_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static ngx_int_t ngx_http_mp4_read_stsd_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_read_stts_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_update_stts_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static ngx_int_t ngx_http_mp4_crop_stts_data(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, ngx_uint_t start);
-static ngx_int_t ngx_http_mp4_read_stss_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_update_stss_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static void ngx_http_mp4_crop_stss_data(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, ngx_uint_t start);
-static ngx_int_t ngx_http_mp4_read_ctts_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static void ngx_http_mp4_update_ctts_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static void ngx_http_mp4_crop_ctts_data(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, ngx_uint_t start);
-static ngx_int_t ngx_http_mp4_read_stsc_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_update_stsc_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static ngx_int_t ngx_http_mp4_crop_stsc_data(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, ngx_uint_t start);
-static ngx_int_t ngx_http_mp4_read_stsz_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_update_stsz_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static ngx_int_t ngx_http_mp4_read_stco_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_update_stco_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static void ngx_http_mp4_adjust_stco_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, int32_t adjustment);
-static ngx_int_t ngx_http_mp4_read_co64_atom(ngx_http_mp4_file_t *mp4,
- uint64_t atom_data_size);
-static ngx_int_t ngx_http_mp4_update_co64_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak);
-static void ngx_http_mp4_adjust_co64_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, off_t adjustment);
-
-static char *ngx_http_mp4(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static void *ngx_http_mp4_create_conf(ngx_conf_t *cf);
-static char *ngx_http_mp4_merge_conf(ngx_conf_t *cf, void *parent, void *child);
-
-
-static ngx_command_t ngx_http_mp4_commands[] = {
-
- { ngx_string("mp4"),
- NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS,
- ngx_http_mp4,
- 0,
- 0,
- NULL },
-
- { ngx_string("mp4_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_mp4_conf_t, buffer_size),
- NULL },
-
- { ngx_string("mp4_max_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_mp4_conf_t, max_buffer_size),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_mp4_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_mp4_create_conf, /* create location configuration */
- ngx_http_mp4_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_mp4_module = {
- NGX_MODULE_V1,
- &ngx_http_mp4_module_ctx, /* module context */
- ngx_http_mp4_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_mp4_atom_handler_t ngx_http_mp4_atoms[] = {
- { "ftyp", ngx_http_mp4_read_ftyp_atom },
- { "moov", ngx_http_mp4_read_moov_atom },
- { "mdat", ngx_http_mp4_read_mdat_atom },
- { NULL, NULL }
-};
-
-static ngx_http_mp4_atom_handler_t ngx_http_mp4_moov_atoms[] = {
- { "mvhd", ngx_http_mp4_read_mvhd_atom },
- { "trak", ngx_http_mp4_read_trak_atom },
- { "cmov", ngx_http_mp4_read_cmov_atom },
- { NULL, NULL }
-};
-
-static ngx_http_mp4_atom_handler_t ngx_http_mp4_trak_atoms[] = {
- { "tkhd", ngx_http_mp4_read_tkhd_atom },
- { "mdia", ngx_http_mp4_read_mdia_atom },
- { NULL, NULL }
-};
-
-static ngx_http_mp4_atom_handler_t ngx_http_mp4_mdia_atoms[] = {
- { "mdhd", ngx_http_mp4_read_mdhd_atom },
- { "hdlr", ngx_http_mp4_read_hdlr_atom },
- { "minf", ngx_http_mp4_read_minf_atom },
- { NULL, NULL }
-};
-
-static ngx_http_mp4_atom_handler_t ngx_http_mp4_minf_atoms[] = {
- { "vmhd", ngx_http_mp4_read_vmhd_atom },
- { "smhd", ngx_http_mp4_read_smhd_atom },
- { "dinf", ngx_http_mp4_read_dinf_atom },
- { "stbl", ngx_http_mp4_read_stbl_atom },
- { NULL, NULL }
-};
-
-static ngx_http_mp4_atom_handler_t ngx_http_mp4_stbl_atoms[] = {
- { "stsd", ngx_http_mp4_read_stsd_atom },
- { "stts", ngx_http_mp4_read_stts_atom },
- { "stss", ngx_http_mp4_read_stss_atom },
- { "ctts", ngx_http_mp4_read_ctts_atom },
- { "stsc", ngx_http_mp4_read_stsc_atom },
- { "stsz", ngx_http_mp4_read_stsz_atom },
- { "stco", ngx_http_mp4_read_stco_atom },
- { "co64", ngx_http_mp4_read_co64_atom },
- { NULL, NULL }
-};
-
-
-static ngx_int_t
-ngx_http_mp4_handler(ngx_http_request_t *r)
-{
- u_char *last;
- size_t root;
- ngx_int_t rc, start, end;
- ngx_uint_t level, length;
- ngx_str_t path, value;
- ngx_log_t *log;
- ngx_buf_t *b;
- ngx_chain_t out;
- ngx_http_mp4_file_t *mp4;
- ngx_open_file_info_t of;
- ngx_http_core_loc_conf_t *clcf;
-
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
- return NGX_HTTP_NOT_ALLOWED;
- }
-
- if (r->uri.data[r->uri.len - 1] == '/') {
- return NGX_DECLINED;
- }
-
- rc = ngx_http_discard_request_body(r);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- last = ngx_http_map_uri_to_path(r, &path, &root, 0);
- if (last == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- log = r->connection->log;
-
- path.len = last - path.data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
- "http mp4 filename: \"%V\"", &path);
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.read_ahead = clcf->read_ahead;
- of.directio = NGX_MAX_OFF_T_VALUE;
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.errors = clcf->open_file_cache_errors;
- of.events = clcf->open_file_cache_events;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- != NGX_OK)
- {
- switch (of.err) {
-
- case 0:
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
-
- case NGX_ENOENT:
- case NGX_ENOTDIR:
- case NGX_ENAMETOOLONG:
-
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_NOT_FOUND;
- break;
-
- case NGX_EACCES:
-#if (NGX_HAVE_OPENAT)
- case NGX_EMLINK:
- case NGX_ELOOP:
-#endif
-
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_FORBIDDEN;
- break;
-
- default:
-
- level = NGX_LOG_CRIT;
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- break;
- }
-
- if (rc != NGX_HTTP_NOT_FOUND || clcf->log_not_found) {
- ngx_log_error(level, log, of.err,
- "%s \"%s\" failed", of.failed, path.data);
- }
-
- return rc;
- }
-
- if (!of.is_file) {
-
- if (ngx_close_file(of.fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", path.data);
- }
-
- return NGX_DECLINED;
- }
-
- r->root_tested = !r->error_page;
- r->allow_ranges = 1;
-
- start = -1;
- length = 0;
- r->headers_out.content_length_n = of.size;
- mp4 = NULL;
- b = NULL;
-
- if (r->args.len) {
-
- if (ngx_http_arg(r, (u_char *) "start", 5, &value) == NGX_OK) {
-
- /*
- * A Flash player may send start value with a lot of digits
- * after dot so strtod() is used instead of atofp(). NaNs and
- * infinities become negative numbers after (int) conversion.
- */
-
- ngx_set_errno(0);
- start = (int) (strtod((char *) value.data, NULL) * 1000);
-
- if (ngx_errno != 0) {
- start = -1;
- }
- }
-
- if (ngx_http_arg(r, (u_char *) "end", 3, &value) == NGX_OK) {
-
- ngx_set_errno(0);
- end = (int) (strtod((char *) value.data, NULL) * 1000);
-
- if (ngx_errno != 0) {
- end = -1;
- }
-
- if (end > 0) {
- if (start < 0) {
- start = 0;
- }
-
- if (end > start) {
- length = end - start;
- }
- }
- }
- }
-
- if (start >= 0) {
- r->single_range = 1;
-
- mp4 = ngx_pcalloc(r->pool, sizeof(ngx_http_mp4_file_t));
- if (mp4 == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- mp4->file.fd = of.fd;
- mp4->file.name = path;
- mp4->file.log = r->connection->log;
- mp4->end = of.size;
- mp4->start = (ngx_uint_t) start;
- mp4->length = length;
- mp4->request = r;
-
- switch (ngx_http_mp4_process(mp4)) {
-
- case NGX_DECLINED:
- if (mp4->buffer) {
- ngx_pfree(r->pool, mp4->buffer);
- }
-
- ngx_pfree(r->pool, mp4);
- mp4 = NULL;
-
- break;
-
- case NGX_OK:
- r->headers_out.content_length_n = mp4->content_length;
- break;
-
- default: /* NGX_ERROR */
- if (mp4->buffer) {
- ngx_pfree(r->pool, mp4->buffer);
- }
-
- ngx_pfree(r->pool, mp4);
-
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
- }
-
- log->action = "sending mp4 to client";
-
- if (clcf->directio <= of.size) {
-
- /*
- * DIRECTIO is set on transfer only
- * to allow kernel to cache "moov" atom
- */
-
- if (ngx_directio_on(of.fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- ngx_directio_on_n " \"%s\" failed", path.data);
- }
-
- of.is_directio = 1;
-
- if (mp4) {
- mp4->file.directio = 1;
- }
- }
-
- r->headers_out.status = NGX_HTTP_OK;
- r->headers_out.last_modified_time = of.mtime;
-
- if (ngx_http_set_etag(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_http_set_content_type(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (mp4 == NULL) {
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t));
- if (b->file == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
- }
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- return rc;
- }
-
- if (mp4) {
- return ngx_http_output_filter(r, mp4->out);
- }
-
- b->file_pos = 0;
- b->file_last = of.size;
-
- b->in_file = b->file_last ? 1 : 0;
- b->last_buf = (r == r->main) ? 1 : 0;
- b->last_in_chain = 1;
-
- b->file->fd = of.fd;
- b->file->name = path;
- b->file->log = log;
- b->file->directio = of.is_directio;
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_output_filter(r, &out);
-}
-
-
-static ngx_int_t
-ngx_http_mp4_process(ngx_http_mp4_file_t *mp4)
-{
- off_t start_offset, end_offset, adjustment;
- ngx_int_t rc;
- ngx_uint_t i, j;
- ngx_chain_t **prev;
- ngx_http_mp4_trak_t *trak;
- ngx_http_mp4_conf_t *conf;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 start:%ui, length:%ui", mp4->start, mp4->length);
-
- conf = ngx_http_get_module_loc_conf(mp4->request, ngx_http_mp4_module);
-
- mp4->buffer_size = conf->buffer_size;
-
- rc = ngx_http_mp4_read_atom(mp4, ngx_http_mp4_atoms, mp4->end);
- if (rc != NGX_OK) {
- return rc;
- }
-
- if (mp4->trak.nelts == 0) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "no mp4 trak atoms were found in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (mp4->mdat_atom.buf == NULL) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "no mp4 mdat atom was found in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- prev = &mp4->out;
-
- if (mp4->ftyp_atom.buf) {
- *prev = &mp4->ftyp_atom;
- prev = &mp4->ftyp_atom.next;
- }
-
- *prev = &mp4->moov_atom;
- prev = &mp4->moov_atom.next;
-
- if (mp4->mvhd_atom.buf) {
- mp4->moov_size += mp4->mvhd_atom_buf.last - mp4->mvhd_atom_buf.pos;
- *prev = &mp4->mvhd_atom;
- prev = &mp4->mvhd_atom.next;
- }
-
- start_offset = mp4->end;
- end_offset = 0;
- trak = mp4->trak.elts;
-
- for (i = 0; i < mp4->trak.nelts; i++) {
-
- if (ngx_http_mp4_update_stts_atom(mp4, &trak[i]) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ngx_http_mp4_update_stss_atom(mp4, &trak[i]) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_http_mp4_update_ctts_atom(mp4, &trak[i]);
-
- if (ngx_http_mp4_update_stsc_atom(mp4, &trak[i]) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ngx_http_mp4_update_stsz_atom(mp4, &trak[i]) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (trak[i].out[NGX_HTTP_MP4_CO64_DATA].buf) {
- if (ngx_http_mp4_update_co64_atom(mp4, &trak[i]) != NGX_OK) {
- return NGX_ERROR;
- }
-
- } else {
- if (ngx_http_mp4_update_stco_atom(mp4, &trak[i]) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- ngx_http_mp4_update_stbl_atom(mp4, &trak[i]);
- ngx_http_mp4_update_minf_atom(mp4, &trak[i]);
- trak[i].size += trak[i].mdhd_size;
- trak[i].size += trak[i].hdlr_size;
- ngx_http_mp4_update_mdia_atom(mp4, &trak[i]);
- trak[i].size += trak[i].tkhd_size;
- ngx_http_mp4_update_trak_atom(mp4, &trak[i]);
-
- mp4->moov_size += trak[i].size;
-
- if (start_offset > trak[i].start_offset) {
- start_offset = trak[i].start_offset;
- }
-
- if (end_offset < trak[i].end_offset) {
- end_offset = trak[i].end_offset;
- }
-
- *prev = &trak[i].out[NGX_HTTP_MP4_TRAK_ATOM];
- prev = &trak[i].out[NGX_HTTP_MP4_TRAK_ATOM].next;
-
- for (j = 0; j < NGX_HTTP_MP4_LAST_ATOM + 1; j++) {
- if (trak[i].out[j].buf) {
- *prev = &trak[i].out[j];
- prev = &trak[i].out[j].next;
- }
- }
- }
-
- if (end_offset < start_offset) {
- end_offset = start_offset;
- }
-
- mp4->moov_size += 8;
-
- ngx_mp4_set_32value(mp4->moov_atom_header, mp4->moov_size);
- ngx_mp4_set_atom_name(mp4->moov_atom_header, 'm', 'o', 'o', 'v');
- mp4->content_length += mp4->moov_size;
-
- *prev = &mp4->mdat_atom;
-
- if (start_offset > mp4->mdat_data.buf->file_last) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "start time is out mp4 mdat atom in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- adjustment = mp4->ftyp_size + mp4->moov_size
- + ngx_http_mp4_update_mdat_atom(mp4, start_offset, end_offset)
- - start_offset;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 adjustment:%O", adjustment);
-
- for (i = 0; i < mp4->trak.nelts; i++) {
- if (trak[i].out[NGX_HTTP_MP4_CO64_DATA].buf) {
- ngx_http_mp4_adjust_co64_atom(mp4, &trak[i], adjustment);
- } else {
- ngx_http_mp4_adjust_stco_atom(mp4, &trak[i], (int32_t) adjustment);
- }
- }
-
- return NGX_OK;
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
-} ngx_mp4_atom_header_t;
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char size64[8];
-} ngx_mp4_atom_header64_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_atom_handler_t *atom, uint64_t atom_data_size)
-{
- off_t end;
- size_t atom_header_size;
- u_char *atom_header, *atom_name;
- uint64_t atom_size;
- ngx_int_t rc;
- ngx_uint_t n;
-
- end = mp4->offset + atom_data_size;
-
- while (mp4->offset < end) {
-
- if (ngx_http_mp4_read(mp4, sizeof(uint32_t)) != NGX_OK) {
- return NGX_ERROR;
- }
-
- atom_header = mp4->buffer_pos;
- atom_size = ngx_mp4_get_32value(atom_header);
- atom_header_size = sizeof(ngx_mp4_atom_header_t);
-
- if (atom_size == 0) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 atom end");
- return NGX_OK;
- }
-
- if (atom_size < sizeof(ngx_mp4_atom_header_t)) {
-
- if (atom_size == 1) {
-
- if (ngx_http_mp4_read(mp4, sizeof(ngx_mp4_atom_header64_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- /* 64-bit atom size */
- atom_header = mp4->buffer_pos;
- atom_size = ngx_mp4_get_64value(atom_header + 8);
- atom_header_size = sizeof(ngx_mp4_atom_header64_t);
-
- } else {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 atom is too small:%uL",
- mp4->file.name.data, atom_size);
- return NGX_ERROR;
- }
- }
-
- if (ngx_http_mp4_read(mp4, sizeof(ngx_mp4_atom_header_t)) != NGX_OK) {
- return NGX_ERROR;
- }
-
- atom_header = mp4->buffer_pos;
- atom_name = atom_header + sizeof(uint32_t);
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 atom: %*s @%O:%uL",
- 4, atom_name, mp4->offset, atom_size);
-
- if (atom_size > (uint64_t) (NGX_MAX_OFF_T_VALUE - mp4->offset)
- || mp4->offset + (off_t) atom_size > end)
- {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 atom too large:%uL",
- mp4->file.name.data, atom_size);
- return NGX_ERROR;
- }
-
- for (n = 0; atom[n].name; n++) {
-
- if (ngx_strncmp(atom_name, atom[n].name, 4) == 0) {
-
- ngx_mp4_atom_next(mp4, atom_header_size);
-
- rc = atom[n].handler(mp4, atom_size - atom_header_size);
- if (rc != NGX_OK) {
- return rc;
- }
-
- goto next;
- }
- }
-
- ngx_mp4_atom_next(mp4, atom_size);
-
- next:
- continue;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read(ngx_http_mp4_file_t *mp4, size_t size)
-{
- ssize_t n;
-
- if (mp4->buffer_pos + size <= mp4->buffer_end) {
- return NGX_OK;
- }
-
- if (mp4->offset + (off_t) mp4->buffer_size > mp4->end) {
- mp4->buffer_size = (size_t) (mp4->end - mp4->offset);
- }
-
- if (mp4->buffer_size < size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 file truncated", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (mp4->buffer == NULL) {
- mp4->buffer = ngx_palloc(mp4->request->pool, mp4->buffer_size);
- if (mp4->buffer == NULL) {
- return NGX_ERROR;
- }
-
- mp4->buffer_start = mp4->buffer;
- }
-
- n = ngx_read_file(&mp4->file, mp4->buffer_start, mp4->buffer_size,
- mp4->offset);
-
- if (n == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if ((size_t) n != mp4->buffer_size) {
- ngx_log_error(NGX_LOG_CRIT, mp4->file.log, 0,
- ngx_read_file_n " read only %z of %z from \"%s\"",
- n, mp4->buffer_size, mp4->file.name.data);
- return NGX_ERROR;
- }
-
- mp4->buffer_pos = mp4->buffer_start;
- mp4->buffer_end = mp4->buffer_start + mp4->buffer_size;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_ftyp_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *ftyp_atom;
- size_t atom_size;
- ngx_buf_t *atom;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 ftyp atom");
-
- if (atom_data_size > 1024
- || ngx_mp4_atom_data(mp4) + (size_t) atom_data_size > mp4->buffer_end)
- {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 ftyp atom is too large:%uL",
- mp4->file.name.data, atom_data_size);
- return NGX_ERROR;
- }
-
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
-
- ftyp_atom = ngx_palloc(mp4->request->pool, atom_size);
- if (ftyp_atom == NULL) {
- return NGX_ERROR;
- }
-
- ngx_mp4_set_32value(ftyp_atom, atom_size);
- ngx_mp4_set_atom_name(ftyp_atom, 'f', 't', 'y', 'p');
-
- /*
- * only moov atom content is guaranteed to be in mp4->buffer
- * during sending response, so ftyp atom content should be copied
- */
- ngx_memcpy(ftyp_atom + sizeof(ngx_mp4_atom_header_t),
- ngx_mp4_atom_data(mp4), (size_t) atom_data_size);
-
- atom = &mp4->ftyp_atom_buf;
- atom->temporary = 1;
- atom->pos = ftyp_atom;
- atom->last = ftyp_atom + atom_size;
-
- mp4->ftyp_atom.buf = atom;
- mp4->ftyp_size = atom_size;
- mp4->content_length = atom_size;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-/*
- * Small excess buffer to process atoms after moov atom, mp4->buffer_start
- * will be set to this buffer part after moov atom processing.
- */
-#define NGX_HTTP_MP4_MOOV_BUFFER_EXCESS (4 * 1024)
-
-static ngx_int_t
-ngx_http_mp4_read_moov_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- ngx_int_t rc;
- ngx_uint_t no_mdat;
- ngx_buf_t *atom;
- ngx_http_mp4_conf_t *conf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 moov atom");
-
- no_mdat = (mp4->mdat_atom.buf == NULL);
-
- if (no_mdat && mp4->start == 0 && mp4->length == 0) {
- /*
- * send original file if moov atom resides before
- * mdat atom and client requests integral file
- */
- return NGX_DECLINED;
- }
-
- conf = ngx_http_get_module_loc_conf(mp4->request, ngx_http_mp4_module);
-
- if (atom_data_size > mp4->buffer_size) {
-
- if (atom_data_size > conf->max_buffer_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 moov atom is too large:%uL, "
- "you may want to increase mp4_max_buffer_size",
- mp4->file.name.data, atom_data_size);
- return NGX_ERROR;
- }
-
- ngx_pfree(mp4->request->pool, mp4->buffer);
- mp4->buffer = NULL;
- mp4->buffer_pos = NULL;
- mp4->buffer_end = NULL;
-
- mp4->buffer_size = (size_t) atom_data_size
- + NGX_HTTP_MP4_MOOV_BUFFER_EXCESS * no_mdat;
- }
-
- if (ngx_http_mp4_read(mp4, (size_t) atom_data_size) != NGX_OK) {
- return NGX_ERROR;
- }
-
- mp4->trak.elts = &mp4->traks;
- mp4->trak.size = sizeof(ngx_http_mp4_trak_t);
- mp4->trak.nalloc = 2;
- mp4->trak.pool = mp4->request->pool;
-
- atom = &mp4->moov_atom_buf;
- atom->temporary = 1;
- atom->pos = mp4->moov_atom_header;
- atom->last = mp4->moov_atom_header + 8;
-
- mp4->moov_atom.buf = &mp4->moov_atom_buf;
-
- rc = ngx_http_mp4_read_atom(mp4, ngx_http_mp4_moov_atoms, atom_data_size);
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 moov atom done");
-
- if (no_mdat) {
- mp4->buffer_start = mp4->buffer_pos;
- mp4->buffer_size = NGX_HTTP_MP4_MOOV_BUFFER_EXCESS;
-
- if (mp4->buffer_start + mp4->buffer_size > mp4->buffer_end) {
- mp4->buffer = NULL;
- mp4->buffer_pos = NULL;
- mp4->buffer_end = NULL;
- }
-
- } else {
- /* skip atoms after moov atom */
- mp4->offset = mp4->end;
- }
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_mdat_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- ngx_buf_t *data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 mdat atom");
-
- data = &mp4->mdat_data_buf;
- data->file = &mp4->file;
- data->in_file = 1;
- data->last_buf = 1;
- data->last_in_chain = 1;
- data->file_last = mp4->offset + atom_data_size;
-
- mp4->mdat_atom.buf = &mp4->mdat_atom_buf;
- mp4->mdat_atom.next = &mp4->mdat_data;
- mp4->mdat_data.buf = data;
-
- if (mp4->trak.nelts) {
- /* skip atoms after mdat atom */
- mp4->offset = mp4->end;
-
- } else {
- ngx_mp4_atom_next(mp4, atom_data_size);
- }
-
- return NGX_OK;
-}
-
-
-static size_t
-ngx_http_mp4_update_mdat_atom(ngx_http_mp4_file_t *mp4, off_t start_offset,
- off_t end_offset)
-{
- off_t atom_data_size;
- u_char *atom_header;
- uint32_t atom_header_size;
- uint64_t atom_size;
- ngx_buf_t *atom;
-
- atom_data_size = end_offset - start_offset;
- mp4->mdat_data.buf->file_pos = start_offset;
- mp4->mdat_data.buf->file_last = end_offset;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mdat new offset @%O:%O", start_offset, atom_data_size);
-
- atom_header = mp4->mdat_atom_header;
-
- if ((uint64_t) atom_data_size > (uint64_t) 0xffffffff) {
- atom_size = 1;
- atom_header_size = sizeof(ngx_mp4_atom_header64_t);
- ngx_mp4_set_64value(atom_header + sizeof(ngx_mp4_atom_header_t),
- sizeof(ngx_mp4_atom_header64_t) + atom_data_size);
- } else {
- atom_size = sizeof(ngx_mp4_atom_header_t) + atom_data_size;
- atom_header_size = sizeof(ngx_mp4_atom_header_t);
- }
-
- mp4->content_length += atom_header_size + atom_data_size;
-
- ngx_mp4_set_32value(atom_header, atom_size);
- ngx_mp4_set_atom_name(atom_header, 'm', 'd', 'a', 't');
-
- atom = &mp4->mdat_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + atom_header_size;
-
- return atom_header_size;
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char creation_time[4];
- u_char modification_time[4];
- u_char timescale[4];
- u_char duration[4];
- u_char rate[4];
- u_char volume[2];
- u_char reserved[10];
- u_char matrix[36];
- u_char preview_time[4];
- u_char preview_duration[4];
- u_char poster_time[4];
- u_char selection_time[4];
- u_char selection_duration[4];
- u_char current_time[4];
- u_char next_track_id[4];
-} ngx_mp4_mvhd_atom_t;
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char creation_time[8];
- u_char modification_time[8];
- u_char timescale[4];
- u_char duration[8];
- u_char rate[4];
- u_char volume[2];
- u_char reserved[10];
- u_char matrix[36];
- u_char preview_time[4];
- u_char preview_duration[4];
- u_char poster_time[4];
- u_char selection_time[4];
- u_char selection_duration[4];
- u_char current_time[4];
- u_char next_track_id[4];
-} ngx_mp4_mvhd64_atom_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_mvhd_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- size_t atom_size;
- uint32_t timescale;
- uint64_t duration, start_time, length_time;
- ngx_buf_t *atom;
- ngx_mp4_mvhd_atom_t *mvhd_atom;
- ngx_mp4_mvhd64_atom_t *mvhd64_atom;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 mvhd atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- mvhd_atom = (ngx_mp4_mvhd_atom_t *) atom_header;
- mvhd64_atom = (ngx_mp4_mvhd64_atom_t *) atom_header;
- ngx_mp4_set_atom_name(atom_header, 'm', 'v', 'h', 'd');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_mvhd_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 mvhd atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (mvhd_atom->version[0] == 0) {
- /* version 0: 32-bit duration */
- timescale = ngx_mp4_get_32value(mvhd_atom->timescale);
- duration = ngx_mp4_get_32value(mvhd_atom->duration);
-
- } else {
- /* version 1: 64-bit duration */
-
- if (ngx_mp4_atom_data_size(ngx_mp4_mvhd64_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 mvhd atom too small",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- timescale = ngx_mp4_get_32value(mvhd64_atom->timescale);
- duration = ngx_mp4_get_64value(mvhd64_atom->duration);
- }
-
- mp4->timescale = timescale;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mvhd timescale:%uD, duration:%uL, time:%.3fs",
- timescale, duration, (double) duration / timescale);
-
- start_time = (uint64_t) mp4->start * timescale / 1000;
-
- if (duration < start_time) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 start time exceeds file duration",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- duration -= start_time;
-
- if (mp4->length) {
- length_time = (uint64_t) mp4->length * timescale / 1000;
-
- if (duration > length_time) {
- duration = length_time;
- }
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mvhd new duration:%uL, time:%.3fs",
- duration, (double) duration / timescale);
-
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
- ngx_mp4_set_32value(mvhd_atom->size, atom_size);
-
- if (mvhd_atom->version[0] == 0) {
- ngx_mp4_set_32value(mvhd_atom->duration, duration);
-
- } else {
- ngx_mp4_set_64value(mvhd64_atom->duration, duration);
- }
-
- atom = &mp4->mvhd_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + atom_size;
-
- mp4->mvhd_atom.buf = atom;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_trak_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header, *atom_end;
- off_t atom_file_end;
- ngx_int_t rc;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 trak atom");
-
- trak = ngx_array_push(&mp4->trak);
- if (trak == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memzero(trak, sizeof(ngx_http_mp4_trak_t));
-
- atom_header = ngx_mp4_atom_header(mp4);
- ngx_mp4_set_atom_name(atom_header, 't', 'r', 'a', 'k');
-
- atom = &trak->trak_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + sizeof(ngx_mp4_atom_header_t);
-
- trak->out[NGX_HTTP_MP4_TRAK_ATOM].buf = atom;
-
- atom_end = mp4->buffer_pos + (size_t) atom_data_size;
- atom_file_end = mp4->offset + atom_data_size;
-
- rc = ngx_http_mp4_read_atom(mp4, ngx_http_mp4_trak_atoms, atom_data_size);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 trak atom: %i", rc);
-
- if (rc == NGX_DECLINED) {
- /* skip this trak */
- ngx_memzero(trak, sizeof(ngx_http_mp4_trak_t));
- mp4->trak.nelts--;
- mp4->buffer_pos = atom_end;
- mp4->offset = atom_file_end;
- return NGX_OK;
- }
-
- return rc;
-}
-
-
-static void
-ngx_http_mp4_update_trak_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- ngx_buf_t *atom;
-
- trak->size += sizeof(ngx_mp4_atom_header_t);
- atom = &trak->trak_atom_buf;
- ngx_mp4_set_32value(atom->pos, trak->size);
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_cmov_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 compressed moov atom (cmov) is not supported",
- mp4->file.name.data);
-
- return NGX_ERROR;
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char creation_time[4];
- u_char modification_time[4];
- u_char track_id[4];
- u_char reserved1[4];
- u_char duration[4];
- u_char reserved2[8];
- u_char layer[2];
- u_char group[2];
- u_char volume[2];
- u_char reverved3[2];
- u_char matrix[36];
- u_char width[4];
- u_char heigth[4];
-} ngx_mp4_tkhd_atom_t;
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char creation_time[8];
- u_char modification_time[8];
- u_char track_id[4];
- u_char reserved1[4];
- u_char duration[8];
- u_char reserved2[8];
- u_char layer[2];
- u_char group[2];
- u_char volume[2];
- u_char reverved3[2];
- u_char matrix[36];
- u_char width[4];
- u_char heigth[4];
-} ngx_mp4_tkhd64_atom_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_tkhd_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- size_t atom_size;
- uint64_t duration, start_time, length_time;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
- ngx_mp4_tkhd_atom_t *tkhd_atom;
- ngx_mp4_tkhd64_atom_t *tkhd64_atom;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 tkhd atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- tkhd_atom = (ngx_mp4_tkhd_atom_t *) atom_header;
- tkhd64_atom = (ngx_mp4_tkhd64_atom_t *) atom_header;
- ngx_mp4_set_atom_name(tkhd_atom, 't', 'k', 'h', 'd');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_tkhd_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 tkhd atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (tkhd_atom->version[0] == 0) {
- /* version 0: 32-bit duration */
- duration = ngx_mp4_get_32value(tkhd_atom->duration);
-
- } else {
- /* version 1: 64-bit duration */
-
- if (ngx_mp4_atom_data_size(ngx_mp4_tkhd64_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 tkhd atom too small",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- duration = ngx_mp4_get_64value(tkhd64_atom->duration);
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "tkhd duration:%uL, time:%.3fs",
- duration, (double) duration / mp4->timescale);
-
- start_time = (uint64_t) mp4->start * mp4->timescale / 1000;
-
- if (duration <= start_time) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "tkhd duration is less than start time");
- return NGX_DECLINED;
- }
-
- duration -= start_time;
-
- if (mp4->length) {
- length_time = (uint64_t) mp4->length * mp4->timescale / 1000;
-
- if (duration > length_time) {
- duration = length_time;
- }
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "tkhd new duration:%uL, time:%.3fs",
- duration, (double) duration / mp4->timescale);
-
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
-
- trak = ngx_mp4_last_trak(mp4);
- trak->tkhd_size = atom_size;
-
- ngx_mp4_set_32value(tkhd_atom->size, atom_size);
-
- if (tkhd_atom->version[0] == 0) {
- ngx_mp4_set_32value(tkhd_atom->duration, duration);
-
- } else {
- ngx_mp4_set_64value(tkhd64_atom->duration, duration);
- }
-
- atom = &trak->tkhd_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + atom_size;
-
- trak->out[NGX_HTTP_MP4_TKHD_ATOM].buf = atom;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_mdia_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "process mdia atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- ngx_mp4_set_atom_name(atom_header, 'm', 'd', 'i', 'a');
-
- trak = ngx_mp4_last_trak(mp4);
-
- atom = &trak->mdia_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + sizeof(ngx_mp4_atom_header_t);
-
- trak->out[NGX_HTTP_MP4_MDIA_ATOM].buf = atom;
-
- return ngx_http_mp4_read_atom(mp4, ngx_http_mp4_mdia_atoms, atom_data_size);
-}
-
-
-static void
-ngx_http_mp4_update_mdia_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- ngx_buf_t *atom;
-
- trak->size += sizeof(ngx_mp4_atom_header_t);
- atom = &trak->mdia_atom_buf;
- ngx_mp4_set_32value(atom->pos, trak->size);
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char creation_time[4];
- u_char modification_time[4];
- u_char timescale[4];
- u_char duration[4];
- u_char language[2];
- u_char quality[2];
-} ngx_mp4_mdhd_atom_t;
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char creation_time[8];
- u_char modification_time[8];
- u_char timescale[4];
- u_char duration[8];
- u_char language[2];
- u_char quality[2];
-} ngx_mp4_mdhd64_atom_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_mdhd_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- size_t atom_size;
- uint32_t timescale;
- uint64_t duration, start_time, length_time;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
- ngx_mp4_mdhd_atom_t *mdhd_atom;
- ngx_mp4_mdhd64_atom_t *mdhd64_atom;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 mdhd atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- mdhd_atom = (ngx_mp4_mdhd_atom_t *) atom_header;
- mdhd64_atom = (ngx_mp4_mdhd64_atom_t *) atom_header;
- ngx_mp4_set_atom_name(mdhd_atom, 'm', 'd', 'h', 'd');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_mdhd_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 mdhd atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (mdhd_atom->version[0] == 0) {
- /* version 0: everything is 32-bit */
- timescale = ngx_mp4_get_32value(mdhd_atom->timescale);
- duration = ngx_mp4_get_32value(mdhd_atom->duration);
-
- } else {
- /* version 1: 64-bit duration and 32-bit timescale */
-
- if (ngx_mp4_atom_data_size(ngx_mp4_mdhd64_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 mdhd atom too small",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- timescale = ngx_mp4_get_32value(mdhd64_atom->timescale);
- duration = ngx_mp4_get_64value(mdhd64_atom->duration);
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mdhd timescale:%uD, duration:%uL, time:%.3fs",
- timescale, duration, (double) duration / timescale);
-
- start_time = (uint64_t) mp4->start * timescale / 1000;
-
- if (duration <= start_time) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mdhd duration is less than start time");
- return NGX_DECLINED;
- }
-
- duration -= start_time;
-
- if (mp4->length) {
- length_time = (uint64_t) mp4->length * timescale / 1000;
-
- if (duration > length_time) {
- duration = length_time;
- }
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mdhd new duration:%uL, time:%.3fs",
- duration, (double) duration / timescale);
-
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
-
- trak = ngx_mp4_last_trak(mp4);
- trak->mdhd_size = atom_size;
- trak->timescale = timescale;
-
- ngx_mp4_set_32value(mdhd_atom->size, atom_size);
-
- if (mdhd_atom->version[0] == 0) {
- ngx_mp4_set_32value(mdhd_atom->duration, duration);
-
- } else {
- ngx_mp4_set_64value(mdhd64_atom->duration, duration);
- }
-
- atom = &trak->mdhd_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + atom_size;
-
- trak->out[NGX_HTTP_MP4_MDHD_ATOM].buf = atom;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_hdlr_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- size_t atom_size;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 hdlr atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
- ngx_mp4_set_32value(atom_header, atom_size);
- ngx_mp4_set_atom_name(atom_header, 'h', 'd', 'l', 'r');
-
- trak = ngx_mp4_last_trak(mp4);
-
- atom = &trak->hdlr_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + atom_size;
-
- trak->hdlr_size = atom_size;
- trak->out[NGX_HTTP_MP4_HDLR_ATOM].buf = atom;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_minf_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "process minf atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- ngx_mp4_set_atom_name(atom_header, 'm', 'i', 'n', 'f');
-
- trak = ngx_mp4_last_trak(mp4);
-
- atom = &trak->minf_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + sizeof(ngx_mp4_atom_header_t);
-
- trak->out[NGX_HTTP_MP4_MINF_ATOM].buf = atom;
-
- return ngx_http_mp4_read_atom(mp4, ngx_http_mp4_minf_atoms, atom_data_size);
-}
-
-
-static void
-ngx_http_mp4_update_minf_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- ngx_buf_t *atom;
-
- trak->size += sizeof(ngx_mp4_atom_header_t)
- + trak->vmhd_size
- + trak->smhd_size
- + trak->dinf_size;
- atom = &trak->minf_atom_buf;
- ngx_mp4_set_32value(atom->pos, trak->size);
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_vmhd_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- size_t atom_size;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 vmhd atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
- ngx_mp4_set_32value(atom_header, atom_size);
- ngx_mp4_set_atom_name(atom_header, 'v', 'm', 'h', 'd');
-
- trak = ngx_mp4_last_trak(mp4);
-
- atom = &trak->vmhd_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + atom_size;
-
- trak->vmhd_size += atom_size;
- trak->out[NGX_HTTP_MP4_VMHD_ATOM].buf = atom;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_smhd_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- size_t atom_size;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 smhd atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
- ngx_mp4_set_32value(atom_header, atom_size);
- ngx_mp4_set_atom_name(atom_header, 's', 'm', 'h', 'd');
-
- trak = ngx_mp4_last_trak(mp4);
-
- atom = &trak->smhd_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + atom_size;
-
- trak->smhd_size += atom_size;
- trak->out[NGX_HTTP_MP4_SMHD_ATOM].buf = atom;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_dinf_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- size_t atom_size;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 dinf atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
- ngx_mp4_set_32value(atom_header, atom_size);
- ngx_mp4_set_atom_name(atom_header, 'd', 'i', 'n', 'f');
-
- trak = ngx_mp4_last_trak(mp4);
-
- atom = &trak->dinf_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + atom_size;
-
- trak->dinf_size += atom_size;
- trak->out[NGX_HTTP_MP4_DINF_ATOM].buf = atom;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_read_stbl_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header;
- ngx_buf_t *atom;
- ngx_http_mp4_trak_t *trak;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "process stbl atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- ngx_mp4_set_atom_name(atom_header, 's', 't', 'b', 'l');
-
- trak = ngx_mp4_last_trak(mp4);
-
- atom = &trak->stbl_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_header + sizeof(ngx_mp4_atom_header_t);
-
- trak->out[NGX_HTTP_MP4_STBL_ATOM].buf = atom;
-
- return ngx_http_mp4_read_atom(mp4, ngx_http_mp4_stbl_atoms, atom_data_size);
-}
-
-
-static void
-ngx_http_mp4_update_stbl_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- ngx_buf_t *atom;
-
- trak->size += sizeof(ngx_mp4_atom_header_t);
- atom = &trak->stbl_atom_buf;
- ngx_mp4_set_32value(atom->pos, trak->size);
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char entries[4];
-
- u_char media_size[4];
- u_char media_name[4];
-} ngx_mp4_stsd_atom_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_stsd_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header, *atom_table;
- size_t atom_size;
- ngx_buf_t *atom;
- ngx_mp4_stsd_atom_t *stsd_atom;
- ngx_http_mp4_trak_t *trak;
-
- /* sample description atom */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 stsd atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- stsd_atom = (ngx_mp4_stsd_atom_t *) atom_header;
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
- atom_table = atom_header + atom_size;
- ngx_mp4_set_32value(stsd_atom->size, atom_size);
- ngx_mp4_set_atom_name(stsd_atom, 's', 't', 's', 'd');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_stsd_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stsd atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "stsd entries:%uD, media:%*s",
- ngx_mp4_get_32value(stsd_atom->entries),
- 4, stsd_atom->media_name);
-
- trak = ngx_mp4_last_trak(mp4);
-
- atom = &trak->stsd_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_table;
-
- trak->out[NGX_HTTP_MP4_STSD_ATOM].buf = atom;
- trak->size += atom_size;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char entries[4];
-} ngx_mp4_stts_atom_t;
-
-typedef struct {
- u_char count[4];
- u_char duration[4];
-} ngx_mp4_stts_entry_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_stts_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header, *atom_table, *atom_end;
- uint32_t entries;
- ngx_buf_t *atom, *data;
- ngx_mp4_stts_atom_t *stts_atom;
- ngx_http_mp4_trak_t *trak;
-
- /* time-to-sample atom */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 stts atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- stts_atom = (ngx_mp4_stts_atom_t *) atom_header;
- ngx_mp4_set_atom_name(stts_atom, 's', 't', 't', 's');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_stts_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stts atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries = ngx_mp4_get_32value(stts_atom->entries);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 time-to-sample entries:%uD", entries);
-
- if (ngx_mp4_atom_data_size(ngx_mp4_stts_atom_t)
- + entries * sizeof(ngx_mp4_stts_entry_t) > atom_data_size)
- {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stts atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- atom_table = atom_header + sizeof(ngx_mp4_stts_atom_t);
- atom_end = atom_table + entries * sizeof(ngx_mp4_stts_entry_t);
-
- trak = ngx_mp4_last_trak(mp4);
- trak->time_to_sample_entries = entries;
-
- atom = &trak->stts_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_table;
-
- data = &trak->stts_data_buf;
- data->temporary = 1;
- data->pos = atom_table;
- data->last = atom_end;
-
- trak->out[NGX_HTTP_MP4_STTS_ATOM].buf = atom;
- trak->out[NGX_HTTP_MP4_STTS_DATA].buf = data;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_update_stts_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- size_t atom_size;
- ngx_buf_t *atom, *data;
- ngx_mp4_stts_atom_t *stts_atom;
-
- /*
- * mdia.minf.stbl.stts updating requires trak->timescale
- * from mdia.mdhd atom which may reside after mdia.minf
- */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stts atom update");
-
- data = trak->out[NGX_HTTP_MP4_STTS_DATA].buf;
-
- if (data == NULL) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "no mp4 stts atoms were found in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (ngx_http_mp4_crop_stts_data(mp4, trak, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ngx_http_mp4_crop_stts_data(mp4, trak, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "time-to-sample entries:%uD", trak->time_to_sample_entries);
-
- atom_size = sizeof(ngx_mp4_stts_atom_t) + (data->last - data->pos);
- trak->size += atom_size;
-
- atom = trak->out[NGX_HTTP_MP4_STTS_ATOM].buf;
- stts_atom = (ngx_mp4_stts_atom_t *) atom->pos;
- ngx_mp4_set_32value(stts_atom->size, atom_size);
- ngx_mp4_set_32value(stts_atom->entries, trak->time_to_sample_entries);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_crop_stts_data(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, ngx_uint_t start)
-{
- uint32_t count, duration, rest;
- uint64_t start_time;
- ngx_buf_t *data;
- ngx_uint_t start_sample, entries, start_sec;
- ngx_mp4_stts_entry_t *entry, *end;
-
- if (start) {
- start_sec = mp4->start;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stts crop start_time:%ui", start_sec);
-
- } else if (mp4->length) {
- start_sec = mp4->length;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stts crop end_time:%ui", start_sec);
-
- } else {
- return NGX_OK;
- }
-
- data = trak->out[NGX_HTTP_MP4_STTS_DATA].buf;
-
- start_time = (uint64_t) start_sec * trak->timescale / 1000;
-
- entries = trak->time_to_sample_entries;
- start_sample = 0;
- entry = (ngx_mp4_stts_entry_t *) data->pos;
- end = (ngx_mp4_stts_entry_t *) data->last;
-
- while (entry < end) {
- count = ngx_mp4_get_32value(entry->count);
- duration = ngx_mp4_get_32value(entry->duration);
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "time:%uL, count:%uD, duration:%uD",
- start_time, count, duration);
-
- if (start_time < (uint64_t) count * duration) {
- start_sample += (ngx_uint_t) (start_time / duration);
- rest = (uint32_t) (start_time / duration);
- goto found;
- }
-
- start_sample += count;
- start_time -= count * duration;
- entries--;
- entry++;
- }
-
- if (start) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "start time is out mp4 stts samples in \"%s\"",
- mp4->file.name.data);
-
- return NGX_ERROR;
-
- } else {
- trak->end_sample = trak->start_sample + start_sample;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "end_sample:%ui", trak->end_sample);
-
- return NGX_OK;
- }
-
-found:
-
- if (start) {
- ngx_mp4_set_32value(entry->count, count - rest);
- data->pos = (u_char *) entry;
- trak->time_to_sample_entries = entries;
- trak->start_sample = start_sample;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "start_sample:%ui, new count:%uD",
- trak->start_sample, count - rest);
-
- } else {
- ngx_mp4_set_32value(entry->count, rest);
- data->last = (u_char *) (entry + 1);
- trak->time_to_sample_entries -= entries - 1;
- trak->end_sample = trak->start_sample + start_sample;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "end_sample:%ui, new count:%uD",
- trak->end_sample, rest);
- }
-
- return NGX_OK;
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char entries[4];
-} ngx_http_mp4_stss_atom_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_stss_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header, *atom_table, *atom_end;
- uint32_t entries;
- ngx_buf_t *atom, *data;
- ngx_http_mp4_trak_t *trak;
- ngx_http_mp4_stss_atom_t *stss_atom;
-
- /* sync samples atom */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 stss atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- stss_atom = (ngx_http_mp4_stss_atom_t *) atom_header;
- ngx_mp4_set_atom_name(stss_atom, 's', 't', 's', 's');
-
- if (ngx_mp4_atom_data_size(ngx_http_mp4_stss_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stss atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries = ngx_mp4_get_32value(stss_atom->entries);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sync sample entries:%uD", entries);
-
- trak = ngx_mp4_last_trak(mp4);
- trak->sync_samples_entries = entries;
-
- atom_table = atom_header + sizeof(ngx_http_mp4_stss_atom_t);
-
- atom = &trak->stss_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_table;
-
- if (ngx_mp4_atom_data_size(ngx_http_mp4_stss_atom_t)
- + entries * sizeof(uint32_t) > atom_data_size)
- {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stss atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- atom_end = atom_table + entries * sizeof(uint32_t);
-
- data = &trak->stss_data_buf;
- data->temporary = 1;
- data->pos = atom_table;
- data->last = atom_end;
-
- trak->out[NGX_HTTP_MP4_STSS_ATOM].buf = atom;
- trak->out[NGX_HTTP_MP4_STSS_DATA].buf = data;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_update_stss_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- size_t atom_size;
- uint32_t sample, start_sample, *entry, *end;
- ngx_buf_t *atom, *data;
- ngx_http_mp4_stss_atom_t *stss_atom;
-
- /*
- * mdia.minf.stbl.stss updating requires trak->start_sample
- * from mdia.minf.stbl.stts which depends on value from mdia.mdhd
- * atom which may reside after mdia.minf
- */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stss atom update");
-
- data = trak->out[NGX_HTTP_MP4_STSS_DATA].buf;
-
- if (data == NULL) {
- return NGX_OK;
- }
-
- ngx_http_mp4_crop_stss_data(mp4, trak, 1);
- ngx_http_mp4_crop_stss_data(mp4, trak, 0);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sync sample entries:%uD", trak->sync_samples_entries);
-
- if (trak->sync_samples_entries) {
- entry = (uint32_t *) data->pos;
- end = (uint32_t *) data->last;
-
- start_sample = trak->start_sample;
-
- while (entry < end) {
- sample = ngx_mp4_get_32value(entry);
- sample -= start_sample;
- ngx_mp4_set_32value(entry, sample);
- entry++;
- }
-
- } else {
- trak->out[NGX_HTTP_MP4_STSS_DATA].buf = NULL;
- }
-
- atom_size = sizeof(ngx_http_mp4_stss_atom_t) + (data->last - data->pos);
- trak->size += atom_size;
-
- atom = trak->out[NGX_HTTP_MP4_STSS_ATOM].buf;
- stss_atom = (ngx_http_mp4_stss_atom_t *) atom->pos;
-
- ngx_mp4_set_32value(stss_atom->size, atom_size);
- ngx_mp4_set_32value(stss_atom->entries, trak->sync_samples_entries);
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_mp4_crop_stss_data(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, ngx_uint_t start)
-{
- uint32_t sample, start_sample, *entry, *end;
- ngx_buf_t *data;
- ngx_uint_t entries;
-
- /* sync samples starts from 1 */
-
- if (start) {
- start_sample = trak->start_sample + 1;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stss crop start_sample:%uD", start_sample);
-
- } else if (mp4->length) {
- start_sample = trak->end_sample + 1;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stss crop end_sample:%uD", start_sample);
-
- } else {
- return;
- }
-
- data = trak->out[NGX_HTTP_MP4_STSS_DATA].buf;
-
- entries = trak->sync_samples_entries;
- entry = (uint32_t *) data->pos;
- end = (uint32_t *) data->last;
-
- while (entry < end) {
- sample = ngx_mp4_get_32value(entry);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sync:%uD", sample);
-
- if (sample >= start_sample) {
- goto found;
- }
-
- entries--;
- entry++;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sample is out of mp4 stss atom");
-
-found:
-
- if (start) {
- data->pos = (u_char *) entry;
- trak->sync_samples_entries = entries;
-
- } else {
- data->last = (u_char *) entry;
- trak->sync_samples_entries -= entries;
- }
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char entries[4];
-} ngx_mp4_ctts_atom_t;
-
-typedef struct {
- u_char count[4];
- u_char offset[4];
-} ngx_mp4_ctts_entry_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_ctts_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header, *atom_table, *atom_end;
- uint32_t entries;
- ngx_buf_t *atom, *data;
- ngx_mp4_ctts_atom_t *ctts_atom;
- ngx_http_mp4_trak_t *trak;
-
- /* composition offsets atom */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 ctts atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- ctts_atom = (ngx_mp4_ctts_atom_t *) atom_header;
- ngx_mp4_set_atom_name(ctts_atom, 'c', 't', 't', 's');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_ctts_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 ctts atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries = ngx_mp4_get_32value(ctts_atom->entries);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "composition offset entries:%uD", entries);
-
- trak = ngx_mp4_last_trak(mp4);
- trak->composition_offset_entries = entries;
-
- atom_table = atom_header + sizeof(ngx_mp4_ctts_atom_t);
-
- atom = &trak->ctts_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_table;
-
- if (ngx_mp4_atom_data_size(ngx_mp4_ctts_atom_t)
- + entries * sizeof(ngx_mp4_ctts_entry_t) > atom_data_size)
- {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 ctts atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- atom_end = atom_table + entries * sizeof(ngx_mp4_ctts_entry_t);
-
- data = &trak->ctts_data_buf;
- data->temporary = 1;
- data->pos = atom_table;
- data->last = atom_end;
-
- trak->out[NGX_HTTP_MP4_CTTS_ATOM].buf = atom;
- trak->out[NGX_HTTP_MP4_CTTS_DATA].buf = data;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_mp4_update_ctts_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- size_t atom_size;
- ngx_buf_t *atom, *data;
- ngx_mp4_ctts_atom_t *ctts_atom;
-
- /*
- * mdia.minf.stbl.ctts updating requires trak->start_sample
- * from mdia.minf.stbl.stts which depends on value from mdia.mdhd
- * atom which may reside after mdia.minf
- */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 ctts atom update");
-
- data = trak->out[NGX_HTTP_MP4_CTTS_DATA].buf;
-
- if (data == NULL) {
- return;
- }
-
- ngx_http_mp4_crop_ctts_data(mp4, trak, 1);
- ngx_http_mp4_crop_ctts_data(mp4, trak, 0);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "composition offset entries:%uD",
- trak->composition_offset_entries);
-
- if (trak->composition_offset_entries == 0) {
- trak->out[NGX_HTTP_MP4_CTTS_ATOM].buf = NULL;
- trak->out[NGX_HTTP_MP4_CTTS_DATA].buf = NULL;
- return;
- }
-
- atom_size = sizeof(ngx_mp4_ctts_atom_t) + (data->last - data->pos);
- trak->size += atom_size;
-
- atom = trak->out[NGX_HTTP_MP4_CTTS_ATOM].buf;
- ctts_atom = (ngx_mp4_ctts_atom_t *) atom->pos;
-
- ngx_mp4_set_32value(ctts_atom->size, atom_size);
- ngx_mp4_set_32value(ctts_atom->entries, trak->composition_offset_entries);
-
- return;
-}
-
-
-static void
-ngx_http_mp4_crop_ctts_data(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, ngx_uint_t start)
-{
- uint32_t count, start_sample, rest;
- ngx_buf_t *data;
- ngx_uint_t entries;
- ngx_mp4_ctts_entry_t *entry, *end;
-
- /* sync samples starts from 1 */
-
- if (start) {
- start_sample = trak->start_sample + 1;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 ctts crop start_sample:%uD", start_sample);
-
- } else if (mp4->length) {
- start_sample = trak->end_sample - trak->start_sample + 1;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 ctts crop end_sample:%uD", start_sample);
-
- } else {
- return;
- }
-
- data = trak->out[NGX_HTTP_MP4_CTTS_DATA].buf;
-
- entries = trak->composition_offset_entries;
- entry = (ngx_mp4_ctts_entry_t *) data->pos;
- end = (ngx_mp4_ctts_entry_t *) data->last;
-
- while (entry < end) {
- count = ngx_mp4_get_32value(entry->count);
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sample:%uD, count:%uD, offset:%uD",
- start_sample, count, ngx_mp4_get_32value(entry->offset));
-
- if (start_sample <= count) {
- rest = start_sample - 1;
- goto found;
- }
-
- start_sample -= count;
- entries--;
- entry++;
- }
-
- if (start) {
- data->pos = (u_char *) end;
- trak->composition_offset_entries = 0;
- }
-
- return;
-
-found:
-
- if (start) {
- ngx_mp4_set_32value(entry->count, count - rest);
- data->pos = (u_char *) entry;
- trak->composition_offset_entries = entries;
-
- } else {
- ngx_mp4_set_32value(entry->count, rest);
- data->last = (u_char *) (entry + 1);
- trak->composition_offset_entries -= entries - 1;
- }
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char entries[4];
-} ngx_mp4_stsc_atom_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_stsc_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header, *atom_table, *atom_end;
- uint32_t entries;
- ngx_buf_t *atom, *data;
- ngx_mp4_stsc_atom_t *stsc_atom;
- ngx_http_mp4_trak_t *trak;
-
- /* sample-to-chunk atom */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 stsc atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- stsc_atom = (ngx_mp4_stsc_atom_t *) atom_header;
- ngx_mp4_set_atom_name(stsc_atom, 's', 't', 's', 'c');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_stsc_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stsc atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries = ngx_mp4_get_32value(stsc_atom->entries);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sample-to-chunk entries:%uD", entries);
-
- if (ngx_mp4_atom_data_size(ngx_mp4_stsc_atom_t)
- + entries * sizeof(ngx_mp4_stsc_entry_t) > atom_data_size)
- {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stsc atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- atom_table = atom_header + sizeof(ngx_mp4_stsc_atom_t);
- atom_end = atom_table + entries * sizeof(ngx_mp4_stsc_entry_t);
-
- trak = ngx_mp4_last_trak(mp4);
- trak->sample_to_chunk_entries = entries;
-
- atom = &trak->stsc_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_table;
-
- data = &trak->stsc_data_buf;
- data->temporary = 1;
- data->pos = atom_table;
- data->last = atom_end;
-
- trak->out[NGX_HTTP_MP4_STSC_ATOM].buf = atom;
- trak->out[NGX_HTTP_MP4_STSC_DATA].buf = data;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_update_stsc_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- size_t atom_size;
- uint32_t chunk;
- ngx_buf_t *atom, *data;
- ngx_mp4_stsc_atom_t *stsc_atom;
- ngx_mp4_stsc_entry_t *entry, *end;
-
- /*
- * mdia.minf.stbl.stsc updating requires trak->start_sample
- * from mdia.minf.stbl.stts which depends on value from mdia.mdhd
- * atom which may reside after mdia.minf
- */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stsc atom update");
-
- data = trak->out[NGX_HTTP_MP4_STSC_DATA].buf;
-
- if (data == NULL) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "no mp4 stsc atoms were found in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (trak->sample_to_chunk_entries == 0) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "zero number of entries in stsc atom in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (ngx_http_mp4_crop_stsc_data(mp4, trak, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ngx_http_mp4_crop_stsc_data(mp4, trak, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sample-to-chunk entries:%uD",
- trak->sample_to_chunk_entries);
-
- entry = (ngx_mp4_stsc_entry_t *) data->pos;
- end = (ngx_mp4_stsc_entry_t *) data->last;
-
- while (entry < end) {
- chunk = ngx_mp4_get_32value(entry->chunk);
- chunk -= trak->start_chunk;
- ngx_mp4_set_32value(entry->chunk, chunk);
- entry++;
- }
-
- atom_size = sizeof(ngx_mp4_stsc_atom_t)
- + trak->sample_to_chunk_entries * sizeof(ngx_mp4_stsc_entry_t);
-
- trak->size += atom_size;
-
- atom = trak->out[NGX_HTTP_MP4_STSC_ATOM].buf;
- stsc_atom = (ngx_mp4_stsc_atom_t *) atom->pos;
-
- ngx_mp4_set_32value(stsc_atom->size, atom_size);
- ngx_mp4_set_32value(stsc_atom->entries, trak->sample_to_chunk_entries);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_crop_stsc_data(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, ngx_uint_t start)
-{
- uint32_t start_sample, chunk, samples, id, next_chunk, n,
- prev_samples;
- ngx_buf_t *data, *buf;
- ngx_uint_t entries, target_chunk, chunk_samples;
- ngx_mp4_stsc_entry_t *entry, *end, *first;
-
- entries = trak->sample_to_chunk_entries - 1;
-
- if (start) {
- start_sample = (uint32_t) trak->start_sample;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stsc crop start_sample:%uD", start_sample);
-
- } else if (mp4->length) {
- start_sample = (uint32_t) (trak->end_sample - trak->start_sample);
- samples = 0;
-
- data = trak->out[NGX_HTTP_MP4_STSC_START].buf;
-
- if (data) {
- entry = (ngx_mp4_stsc_entry_t *) data->pos;
- samples = ngx_mp4_get_32value(entry->samples);
- entries--;
-
- if (samples > start_sample) {
- samples = start_sample;
- ngx_mp4_set_32value(entry->samples, samples);
- }
-
- start_sample -= samples;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stsc crop end_sample:%uD, ext_samples:%uD",
- start_sample, samples);
-
- } else {
- return NGX_OK;
- }
-
- data = trak->out[NGX_HTTP_MP4_STSC_DATA].buf;
-
- entry = (ngx_mp4_stsc_entry_t *) data->pos;
- end = (ngx_mp4_stsc_entry_t *) data->last;
-
- chunk = ngx_mp4_get_32value(entry->chunk);
- samples = ngx_mp4_get_32value(entry->samples);
- id = ngx_mp4_get_32value(entry->id);
- prev_samples = 0;
- entry++;
-
- while (entry < end) {
-
- next_chunk = ngx_mp4_get_32value(entry->chunk);
-
- ngx_log_debug5(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sample:%uD, chunk:%uD, chunks:%uD, "
- "samples:%uD, id:%uD",
- start_sample, chunk, next_chunk - chunk, samples, id);
-
- n = (next_chunk - chunk) * samples;
-
- if (start_sample < n) {
- goto found;
- }
-
- start_sample -= n;
-
- prev_samples = samples;
- chunk = next_chunk;
- samples = ngx_mp4_get_32value(entry->samples);
- id = ngx_mp4_get_32value(entry->id);
- entries--;
- entry++;
- }
-
- next_chunk = trak->chunks + 1;
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sample:%uD, chunk:%uD, chunks:%uD, samples:%uD",
- start_sample, chunk, next_chunk - chunk, samples);
-
- n = (next_chunk - chunk) * samples;
-
- if (start_sample > n) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "%s time is out mp4 stsc chunks in \"%s\"",
- start ? "start" : "end", mp4->file.name.data);
- return NGX_ERROR;
- }
-
-found:
-
- entries++;
- entry--;
-
- if (samples == 0) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "zero number of samples in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- target_chunk = chunk - 1;
- target_chunk += start_sample / samples;
- chunk_samples = start_sample % samples;
-
- if (start) {
- data->pos = (u_char *) entry;
-
- trak->sample_to_chunk_entries = entries;
- trak->start_chunk = target_chunk;
- trak->start_chunk_samples = chunk_samples;
-
- ngx_mp4_set_32value(entry->chunk, trak->start_chunk + 1);
-
- samples -= chunk_samples;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "start_chunk:%ui, start_chunk_samples:%ui",
- trak->start_chunk, trak->start_chunk_samples);
-
- } else {
- if (start_sample) {
- data->last = (u_char *) (entry + 1);
- trak->sample_to_chunk_entries -= entries - 1;
- trak->end_chunk_samples = samples;
-
- } else {
- data->last = (u_char *) entry;
- trak->sample_to_chunk_entries -= entries;
- trak->end_chunk_samples = prev_samples;
- }
-
- if (chunk_samples) {
- trak->end_chunk = target_chunk + 1;
- trak->end_chunk_samples = chunk_samples;
-
- } else {
- trak->end_chunk = target_chunk;
- }
-
- samples = chunk_samples;
- next_chunk = chunk + 1;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "end_chunk:%ui, end_chunk_samples:%ui",
- trak->end_chunk, trak->end_chunk_samples);
- }
-
- if (chunk_samples && next_chunk - target_chunk == 2) {
-
- ngx_mp4_set_32value(entry->samples, samples);
-
- } else if (chunk_samples && start) {
-
- first = &trak->stsc_start_chunk_entry;
- ngx_mp4_set_32value(first->chunk, 1);
- ngx_mp4_set_32value(first->samples, samples);
- ngx_mp4_set_32value(first->id, id);
-
- buf = &trak->stsc_start_chunk_buf;
- buf->temporary = 1;
- buf->pos = (u_char *) first;
- buf->last = (u_char *) first + sizeof(ngx_mp4_stsc_entry_t);
-
- trak->out[NGX_HTTP_MP4_STSC_START].buf = buf;
-
- ngx_mp4_set_32value(entry->chunk, trak->start_chunk + 2);
-
- trak->sample_to_chunk_entries++;
-
- } else if (chunk_samples) {
-
- first = &trak->stsc_end_chunk_entry;
- ngx_mp4_set_32value(first->chunk, trak->end_chunk - trak->start_chunk);
- ngx_mp4_set_32value(first->samples, samples);
- ngx_mp4_set_32value(first->id, id);
-
- buf = &trak->stsc_end_chunk_buf;
- buf->temporary = 1;
- buf->pos = (u_char *) first;
- buf->last = (u_char *) first + sizeof(ngx_mp4_stsc_entry_t);
-
- trak->out[NGX_HTTP_MP4_STSC_END].buf = buf;
-
- trak->sample_to_chunk_entries++;
- }
-
- return NGX_OK;
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char uniform_size[4];
- u_char entries[4];
-} ngx_mp4_stsz_atom_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_stsz_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header, *atom_table, *atom_end;
- size_t atom_size;
- uint32_t entries, size;
- ngx_buf_t *atom, *data;
- ngx_mp4_stsz_atom_t *stsz_atom;
- ngx_http_mp4_trak_t *trak;
-
- /* sample sizes atom */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 stsz atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- stsz_atom = (ngx_mp4_stsz_atom_t *) atom_header;
- ngx_mp4_set_atom_name(stsz_atom, 's', 't', 's', 'z');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_stsz_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stsz atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- size = ngx_mp4_get_32value(stsz_atom->uniform_size);
- entries = ngx_mp4_get_32value(stsz_atom->entries);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "sample uniform size:%uD, entries:%uD", size, entries);
-
- trak = ngx_mp4_last_trak(mp4);
- trak->sample_sizes_entries = entries;
-
- atom_table = atom_header + sizeof(ngx_mp4_stsz_atom_t);
-
- atom = &trak->stsz_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_table;
-
- trak->out[NGX_HTTP_MP4_STSZ_ATOM].buf = atom;
-
- if (size == 0) {
- if (ngx_mp4_atom_data_size(ngx_mp4_stsz_atom_t)
- + entries * sizeof(uint32_t) > atom_data_size)
- {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stsz atom too small",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- atom_end = atom_table + entries * sizeof(uint32_t);
-
- data = &trak->stsz_data_buf;
- data->temporary = 1;
- data->pos = atom_table;
- data->last = atom_end;
-
- trak->out[NGX_HTTP_MP4_STSZ_DATA].buf = data;
-
- } else {
- /* if size != 0 then all samples are the same size */
- /* TODO : chunk samples */
- atom_size = sizeof(ngx_mp4_atom_header_t) + (size_t) atom_data_size;
- ngx_mp4_set_32value(atom_header, atom_size);
- trak->size += atom_size;
- }
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_update_stsz_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- size_t atom_size;
- uint32_t *pos, *end, entries;
- ngx_buf_t *atom, *data;
- ngx_mp4_stsz_atom_t *stsz_atom;
-
- /*
- * mdia.minf.stbl.stsz updating requires trak->start_sample
- * from mdia.minf.stbl.stts which depends on value from mdia.mdhd
- * atom which may reside after mdia.minf
- */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stsz atom update");
-
- data = trak->out[NGX_HTTP_MP4_STSZ_DATA].buf;
-
- if (data) {
- entries = trak->sample_sizes_entries;
-
- if (trak->start_sample > entries) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "start time is out mp4 stsz samples in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries -= trak->start_sample;
- data->pos += trak->start_sample * sizeof(uint32_t);
- end = (uint32_t *) data->pos;
-
- for (pos = end - trak->start_chunk_samples; pos < end; pos++) {
- trak->start_chunk_samples_size += ngx_mp4_get_32value(pos);
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "chunk samples sizes:%uL",
- trak->start_chunk_samples_size);
-
- if (mp4->length) {
- if (trak->end_sample - trak->start_sample > entries) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "end time is out mp4 stsz samples in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries = trak->end_sample - trak->start_sample;
- data->last = data->pos + entries * sizeof(uint32_t);
- end = (uint32_t *) data->last;
-
- for (pos = end - trak->end_chunk_samples; pos < end; pos++) {
- trak->end_chunk_samples_size += ngx_mp4_get_32value(pos);
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stsz end_chunk_samples_size:%uL",
- trak->end_chunk_samples_size);
- }
-
- atom_size = sizeof(ngx_mp4_stsz_atom_t) + (data->last - data->pos);
- trak->size += atom_size;
-
- atom = trak->out[NGX_HTTP_MP4_STSZ_ATOM].buf;
- stsz_atom = (ngx_mp4_stsz_atom_t *) atom->pos;
-
- ngx_mp4_set_32value(stsz_atom->size, atom_size);
- ngx_mp4_set_32value(stsz_atom->entries, entries);
- }
-
- return NGX_OK;
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char entries[4];
-} ngx_mp4_stco_atom_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_stco_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header, *atom_table, *atom_end;
- uint32_t entries;
- ngx_buf_t *atom, *data;
- ngx_mp4_stco_atom_t *stco_atom;
- ngx_http_mp4_trak_t *trak;
-
- /* chunk offsets atom */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 stco atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- stco_atom = (ngx_mp4_stco_atom_t *) atom_header;
- ngx_mp4_set_atom_name(stco_atom, 's', 't', 'c', 'o');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_stco_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stco atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries = ngx_mp4_get_32value(stco_atom->entries);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "chunks:%uD", entries);
-
- if (ngx_mp4_atom_data_size(ngx_mp4_stco_atom_t)
- + entries * sizeof(uint32_t) > atom_data_size)
- {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 stco atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- atom_table = atom_header + sizeof(ngx_mp4_stco_atom_t);
- atom_end = atom_table + entries * sizeof(uint32_t);
-
- trak = ngx_mp4_last_trak(mp4);
- trak->chunks = entries;
-
- atom = &trak->stco_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_table;
-
- data = &trak->stco_data_buf;
- data->temporary = 1;
- data->pos = atom_table;
- data->last = atom_end;
-
- trak->out[NGX_HTTP_MP4_STCO_ATOM].buf = atom;
- trak->out[NGX_HTTP_MP4_STCO_DATA].buf = data;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_update_stco_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- size_t atom_size;
- uint32_t entries;
- ngx_buf_t *atom, *data;
- ngx_mp4_stco_atom_t *stco_atom;
-
- /*
- * mdia.minf.stbl.stco updating requires trak->start_chunk
- * from mdia.minf.stbl.stsc which depends on value from mdia.mdhd
- * atom which may reside after mdia.minf
- */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stco atom update");
-
- data = trak->out[NGX_HTTP_MP4_STCO_DATA].buf;
-
- if (data == NULL) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "no mp4 stco atoms were found in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (trak->start_chunk > trak->chunks) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "start time is out mp4 stco chunks in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- data->pos += trak->start_chunk * sizeof(uint32_t);
-
- trak->start_offset = ngx_mp4_get_32value(data->pos);
- trak->start_offset += trak->start_chunk_samples_size;
- ngx_mp4_set_32value(data->pos, trak->start_offset);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "start chunk offset:%O", trak->start_offset);
-
- if (mp4->length) {
-
- if (trak->end_chunk > trak->chunks) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "end time is out mp4 stco chunks in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries = trak->end_chunk - trak->start_chunk;
- data->last = data->pos + entries * sizeof(uint32_t);
-
- if (entries) {
- trak->end_offset =
- ngx_mp4_get_32value(data->last - sizeof(uint32_t));
- trak->end_offset += trak->end_chunk_samples_size;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "end chunk offset:%O", trak->end_offset);
- }
-
- } else {
- entries = trak->chunks - trak->start_chunk;
- trak->end_offset = mp4->mdat_data.buf->file_last;
- }
-
- if (entries == 0) {
- trak->start_offset = mp4->end;
- trak->end_offset = 0;
- }
-
- atom_size = sizeof(ngx_mp4_stco_atom_t) + (data->last - data->pos);
- trak->size += atom_size;
-
- atom = trak->out[NGX_HTTP_MP4_STCO_ATOM].buf;
- stco_atom = (ngx_mp4_stco_atom_t *) atom->pos;
-
- ngx_mp4_set_32value(stco_atom->size, atom_size);
- ngx_mp4_set_32value(stco_atom->entries, entries);
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_mp4_adjust_stco_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, int32_t adjustment)
-{
- uint32_t offset, *entry, *end;
- ngx_buf_t *data;
-
- /*
- * moov.trak.mdia.minf.stbl.stco adjustment requires
- * minimal start offset of all traks and new moov atom size
- */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 stco atom adjustment");
-
- data = trak->out[NGX_HTTP_MP4_STCO_DATA].buf;
- entry = (uint32_t *) data->pos;
- end = (uint32_t *) data->last;
-
- while (entry < end) {
- offset = ngx_mp4_get_32value(entry);
- offset += adjustment;
- ngx_mp4_set_32value(entry, offset);
- entry++;
- }
-}
-
-
-typedef struct {
- u_char size[4];
- u_char name[4];
- u_char version[1];
- u_char flags[3];
- u_char entries[4];
-} ngx_mp4_co64_atom_t;
-
-
-static ngx_int_t
-ngx_http_mp4_read_co64_atom(ngx_http_mp4_file_t *mp4, uint64_t atom_data_size)
-{
- u_char *atom_header, *atom_table, *atom_end;
- uint32_t entries;
- ngx_buf_t *atom, *data;
- ngx_mp4_co64_atom_t *co64_atom;
- ngx_http_mp4_trak_t *trak;
-
- /* chunk offsets atom */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 co64 atom");
-
- atom_header = ngx_mp4_atom_header(mp4);
- co64_atom = (ngx_mp4_co64_atom_t *) atom_header;
- ngx_mp4_set_atom_name(co64_atom, 'c', 'o', '6', '4');
-
- if (ngx_mp4_atom_data_size(ngx_mp4_co64_atom_t) > atom_data_size) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 co64 atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries = ngx_mp4_get_32value(co64_atom->entries);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "chunks:%uD", entries);
-
- if (ngx_mp4_atom_data_size(ngx_mp4_co64_atom_t)
- + entries * sizeof(uint64_t) > atom_data_size)
- {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "\"%s\" mp4 co64 atom too small", mp4->file.name.data);
- return NGX_ERROR;
- }
-
- atom_table = atom_header + sizeof(ngx_mp4_co64_atom_t);
- atom_end = atom_table + entries * sizeof(uint64_t);
-
- trak = ngx_mp4_last_trak(mp4);
- trak->chunks = entries;
-
- atom = &trak->co64_atom_buf;
- atom->temporary = 1;
- atom->pos = atom_header;
- atom->last = atom_table;
-
- data = &trak->co64_data_buf;
- data->temporary = 1;
- data->pos = atom_table;
- data->last = atom_end;
-
- trak->out[NGX_HTTP_MP4_CO64_ATOM].buf = atom;
- trak->out[NGX_HTTP_MP4_CO64_DATA].buf = data;
-
- ngx_mp4_atom_next(mp4, atom_data_size);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_mp4_update_co64_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak)
-{
- size_t atom_size;
- uint64_t entries;
- ngx_buf_t *atom, *data;
- ngx_mp4_co64_atom_t *co64_atom;
-
- /*
- * mdia.minf.stbl.co64 updating requires trak->start_chunk
- * from mdia.minf.stbl.stsc which depends on value from mdia.mdhd
- * atom which may reside after mdia.minf
- */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 co64 atom update");
-
- data = trak->out[NGX_HTTP_MP4_CO64_DATA].buf;
-
- if (data == NULL) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "no mp4 co64 atoms were found in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- if (trak->start_chunk > trak->chunks) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "start time is out mp4 co64 chunks in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- data->pos += trak->start_chunk * sizeof(uint64_t);
-
- trak->start_offset = ngx_mp4_get_64value(data->pos);
- trak->start_offset += trak->start_chunk_samples_size;
- ngx_mp4_set_64value(data->pos, trak->start_offset);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "start chunk offset:%O", trak->start_offset);
-
- if (mp4->length) {
-
- if (trak->end_chunk > trak->chunks) {
- ngx_log_error(NGX_LOG_ERR, mp4->file.log, 0,
- "end time is out mp4 co64 chunks in \"%s\"",
- mp4->file.name.data);
- return NGX_ERROR;
- }
-
- entries = trak->end_chunk - trak->start_chunk;
- data->last = data->pos + entries * sizeof(uint64_t);
-
- if (entries) {
- trak->end_offset =
- ngx_mp4_get_64value(data->last - sizeof(uint64_t));
- trak->end_offset += trak->end_chunk_samples_size;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "end chunk offset:%O", trak->end_offset);
- }
-
- } else {
- entries = trak->chunks - trak->start_chunk;
- trak->end_offset = mp4->mdat_data.buf->file_last;
- }
-
- if (entries == 0) {
- trak->start_offset = mp4->end;
- trak->end_offset = 0;
- }
-
- atom_size = sizeof(ngx_mp4_co64_atom_t) + (data->last - data->pos);
- trak->size += atom_size;
-
- atom = trak->out[NGX_HTTP_MP4_CO64_ATOM].buf;
- co64_atom = (ngx_mp4_co64_atom_t *) atom->pos;
-
- ngx_mp4_set_32value(co64_atom->size, atom_size);
- ngx_mp4_set_32value(co64_atom->entries, entries);
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_mp4_adjust_co64_atom(ngx_http_mp4_file_t *mp4,
- ngx_http_mp4_trak_t *trak, off_t adjustment)
-{
- uint64_t offset, *entry, *end;
- ngx_buf_t *data;
-
- /*
- * moov.trak.mdia.minf.stbl.co64 adjustment requires
- * minimal start offset of all traks and new moov atom size
- */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0,
- "mp4 co64 atom adjustment");
-
- data = trak->out[NGX_HTTP_MP4_CO64_DATA].buf;
- entry = (uint64_t *) data->pos;
- end = (uint64_t *) data->last;
-
- while (entry < end) {
- offset = ngx_mp4_get_64value(entry);
- offset += adjustment;
- ngx_mp4_set_64value(entry, offset);
- entry++;
- }
-}
-
-
-static char *
-ngx_http_mp4(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- clcf->handler = ngx_http_mp4_handler;
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_http_mp4_create_conf(ngx_conf_t *cf)
-{
- ngx_http_mp4_conf_t *conf;
-
- conf = ngx_palloc(cf->pool, sizeof(ngx_http_mp4_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->buffer_size = NGX_CONF_UNSET_SIZE;
- conf->max_buffer_size = NGX_CONF_UNSET_SIZE;
-
- return conf;
-}
-
-
-static char *
-ngx_http_mp4_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_mp4_conf_t *prev = parent;
- ngx_http_mp4_conf_t *conf = child;
-
- ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size, 512 * 1024);
- ngx_conf_merge_size_value(conf->max_buffer_size, prev->max_buffer_size,
- 10 * 1024 * 1024);
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_not_modified_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_not_modified_filter_module.c
deleted file mode 100644
index acc94ded31a..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_not_modified_filter_module.c
+++ /dev/null
@@ -1,266 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static ngx_uint_t ngx_http_test_if_unmodified(ngx_http_request_t *r);
-static ngx_uint_t ngx_http_test_if_modified(ngx_http_request_t *r);
-static ngx_uint_t ngx_http_test_if_match(ngx_http_request_t *r,
- ngx_table_elt_t *header, ngx_uint_t weak);
-static ngx_int_t ngx_http_not_modified_filter_init(ngx_conf_t *cf);
-
-
-static ngx_http_module_t ngx_http_not_modified_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_not_modified_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_not_modified_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_not_modified_filter_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-
-
-static ngx_int_t
-ngx_http_not_modified_header_filter(ngx_http_request_t *r)
-{
- if (r->headers_out.status != NGX_HTTP_OK
- || r != r->main
- || r->disable_not_modified)
- {
- return ngx_http_next_header_filter(r);
- }
-
- if (r->headers_in.if_unmodified_since
- && !ngx_http_test_if_unmodified(r))
- {
- return ngx_http_filter_finalize_request(r, NULL,
- NGX_HTTP_PRECONDITION_FAILED);
- }
-
- if (r->headers_in.if_match
- && !ngx_http_test_if_match(r, r->headers_in.if_match, 0))
- {
- return ngx_http_filter_finalize_request(r, NULL,
- NGX_HTTP_PRECONDITION_FAILED);
- }
-
- if (r->headers_in.if_modified_since || r->headers_in.if_none_match) {
-
- if (r->headers_in.if_modified_since
- && ngx_http_test_if_modified(r))
- {
- return ngx_http_next_header_filter(r);
- }
-
- if (r->headers_in.if_none_match
- && !ngx_http_test_if_match(r, r->headers_in.if_none_match, 1))
- {
- return ngx_http_next_header_filter(r);
- }
-
- /* not modified */
-
- r->headers_out.status = NGX_HTTP_NOT_MODIFIED;
- r->headers_out.status_line.len = 0;
- r->headers_out.content_type.len = 0;
- ngx_http_clear_content_length(r);
- ngx_http_clear_accept_ranges(r);
-
- if (r->headers_out.content_encoding) {
- r->headers_out.content_encoding->hash = 0;
- r->headers_out.content_encoding = NULL;
- }
-
- return ngx_http_next_header_filter(r);
- }
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_uint_t
-ngx_http_test_if_unmodified(ngx_http_request_t *r)
-{
- time_t iums;
-
- if (r->headers_out.last_modified_time == (time_t) -1) {
- return 0;
- }
-
- iums = ngx_http_parse_time(r->headers_in.if_unmodified_since->value.data,
- r->headers_in.if_unmodified_since->value.len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http iums:%T lm:%T", iums, r->headers_out.last_modified_time);
-
- if (iums >= r->headers_out.last_modified_time) {
- return 1;
- }
-
- return 0;
-}
-
-
-static ngx_uint_t
-ngx_http_test_if_modified(ngx_http_request_t *r)
-{
- time_t ims;
- ngx_http_core_loc_conf_t *clcf;
-
- if (r->headers_out.last_modified_time == (time_t) -1) {
- return 1;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->if_modified_since == NGX_HTTP_IMS_OFF) {
- return 1;
- }
-
- ims = ngx_http_parse_time(r->headers_in.if_modified_since->value.data,
- r->headers_in.if_modified_since->value.len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http ims:%T lm:%T", ims, r->headers_out.last_modified_time);
-
- if (ims == r->headers_out.last_modified_time) {
- return 0;
- }
-
- if (clcf->if_modified_since == NGX_HTTP_IMS_EXACT
- || ims < r->headers_out.last_modified_time)
- {
- return 1;
- }
-
- return 0;
-}
-
-
-static ngx_uint_t
-ngx_http_test_if_match(ngx_http_request_t *r, ngx_table_elt_t *header,
- ngx_uint_t weak)
-{
- u_char *start, *end, ch;
- ngx_str_t etag, *list;
-
- list = &header->value;
-
- if (list->len == 1 && list->data[0] == '*') {
- return 1;
- }
-
- if (r->headers_out.etag == NULL) {
- return 0;
- }
-
- etag = r->headers_out.etag->value;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http im:\"%V\" etag:%V", list, &etag);
-
- if (weak
- && etag.len > 2
- && etag.data[0] == 'W'
- && etag.data[1] == '/')
- {
- etag.len -= 2;
- etag.data += 2;
- }
-
- start = list->data;
- end = list->data + list->len;
-
- while (start < end) {
-
- if (weak
- && end - start > 2
- && start[0] == 'W'
- && start[1] == '/')
- {
- start += 2;
- }
-
- if (etag.len > (size_t) (end - start)) {
- return 0;
- }
-
- if (ngx_strncmp(start, etag.data, etag.len) != 0) {
- goto skip;
- }
-
- start += etag.len;
-
- while (start < end) {
- ch = *start;
-
- if (ch == ' ' || ch == '\t') {
- start++;
- continue;
- }
-
- break;
- }
-
- if (start == end || *start == ',') {
- return 1;
- }
-
- skip:
-
- while (start < end && *start != ',') { start++; }
- while (start < end) {
- ch = *start;
-
- if (ch == ' ' || ch == '\t' || ch == ',') {
- start++;
- continue;
- }
-
- break;
- }
- }
-
- return 0;
-}
-
-
-static ngx_int_t
-ngx_http_not_modified_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_not_modified_header_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_proxy_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_proxy_module.c
deleted file mode 100644
index c8a80ef4811..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_proxy_module.c
+++ /dev/null
@@ -1,3942 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct ngx_http_proxy_rewrite_s ngx_http_proxy_rewrite_t;
-
-typedef ngx_int_t (*ngx_http_proxy_rewrite_pt)(ngx_http_request_t *r,
- ngx_table_elt_t *h, size_t prefix, size_t len,
- ngx_http_proxy_rewrite_t *pr);
-
-struct ngx_http_proxy_rewrite_s {
- ngx_http_proxy_rewrite_pt handler;
-
- union {
- ngx_http_complex_value_t complex;
-#if (NGX_PCRE)
- ngx_http_regex_t *regex;
-#endif
- } pattern;
-
- ngx_http_complex_value_t replacement;
-};
-
-
-typedef struct {
- ngx_str_t key_start;
- ngx_str_t schema;
- ngx_str_t host_header;
- ngx_str_t port;
- ngx_str_t uri;
-} ngx_http_proxy_vars_t;
-
-
-typedef struct {
- ngx_http_upstream_conf_t upstream;
-
- ngx_array_t *flushes;
- ngx_array_t *body_set_len;
- ngx_array_t *body_set;
- ngx_array_t *headers_set_len;
- ngx_array_t *headers_set;
- ngx_hash_t headers_set_hash;
-
- ngx_array_t *headers_source;
-
- ngx_array_t *proxy_lengths;
- ngx_array_t *proxy_values;
-
- ngx_array_t *redirects;
- ngx_array_t *cookie_domains;
- ngx_array_t *cookie_paths;
-
- ngx_str_t body_source;
-
- ngx_str_t method;
- ngx_str_t location;
- ngx_str_t url;
-
-#if (NGX_HTTP_CACHE)
- ngx_http_complex_value_t cache_key;
-#endif
-
- ngx_http_proxy_vars_t vars;
-
- ngx_flag_t redirect;
-
- ngx_uint_t http_version;
-
- ngx_uint_t headers_hash_max_size;
- ngx_uint_t headers_hash_bucket_size;
-
-#if (NGX_HTTP_SSL)
- ngx_uint_t ssl;
- ngx_uint_t ssl_protocols;
- ngx_str_t ssl_ciphers;
- ngx_uint_t ssl_verify_depth;
- ngx_str_t ssl_trusted_certificate;
- ngx_str_t ssl_crl;
-#endif
-} ngx_http_proxy_loc_conf_t;
-
-
-typedef struct {
- ngx_http_status_t status;
- ngx_http_chunked_t chunked;
- ngx_http_proxy_vars_t vars;
- off_t internal_body_length;
-
- ngx_uint_t head; /* unsigned head:1 */
-} ngx_http_proxy_ctx_t;
-
-
-static ngx_int_t ngx_http_proxy_eval(ngx_http_request_t *r,
- ngx_http_proxy_ctx_t *ctx, ngx_http_proxy_loc_conf_t *plcf);
-#if (NGX_HTTP_CACHE)
-static ngx_int_t ngx_http_proxy_create_key(ngx_http_request_t *r);
-#endif
-static ngx_int_t ngx_http_proxy_create_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_proxy_reinit_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_proxy_process_status_line(ngx_http_request_t *r);
-static ngx_int_t ngx_http_proxy_process_header(ngx_http_request_t *r);
-static ngx_int_t ngx_http_proxy_input_filter_init(void *data);
-static ngx_int_t ngx_http_proxy_copy_filter(ngx_event_pipe_t *p,
- ngx_buf_t *buf);
-static ngx_int_t ngx_http_proxy_chunked_filter(ngx_event_pipe_t *p,
- ngx_buf_t *buf);
-static ngx_int_t ngx_http_proxy_non_buffered_copy_filter(void *data,
- ssize_t bytes);
-static ngx_int_t ngx_http_proxy_non_buffered_chunked_filter(void *data,
- ssize_t bytes);
-static void ngx_http_proxy_abort_request(ngx_http_request_t *r);
-static void ngx_http_proxy_finalize_request(ngx_http_request_t *r,
- ngx_int_t rc);
-
-static ngx_int_t ngx_http_proxy_host_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_proxy_port_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t
- ngx_http_proxy_add_x_forwarded_for_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t
- ngx_http_proxy_internal_body_length_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_proxy_rewrite_redirect(ngx_http_request_t *r,
- ngx_table_elt_t *h, size_t prefix);
-static ngx_int_t ngx_http_proxy_rewrite_cookie(ngx_http_request_t *r,
- ngx_table_elt_t *h);
-static ngx_int_t ngx_http_proxy_rewrite_cookie_value(ngx_http_request_t *r,
- ngx_table_elt_t *h, u_char *value, ngx_array_t *rewrites);
-static ngx_int_t ngx_http_proxy_rewrite(ngx_http_request_t *r,
- ngx_table_elt_t *h, size_t prefix, size_t len, ngx_str_t *replacement);
-
-static ngx_int_t ngx_http_proxy_add_variables(ngx_conf_t *cf);
-static void *ngx_http_proxy_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_proxy_merge_headers(ngx_conf_t *cf,
- ngx_http_proxy_loc_conf_t *conf, ngx_http_proxy_loc_conf_t *prev);
-
-static char *ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_proxy_redirect(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_proxy_cookie_domain(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_proxy_cookie_path(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_proxy_store(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-#if (NGX_HTTP_CACHE)
-static char *ngx_http_proxy_cache(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_proxy_cache_key(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-#endif
-
-static char *ngx_http_proxy_lowat_check(ngx_conf_t *cf, void *post, void *data);
-
-static ngx_int_t ngx_http_proxy_rewrite_regex(ngx_conf_t *cf,
- ngx_http_proxy_rewrite_t *pr, ngx_str_t *regex, ngx_uint_t caseless);
-
-#if (NGX_HTTP_SSL)
-static ngx_int_t ngx_http_proxy_set_ssl(ngx_conf_t *cf,
- ngx_http_proxy_loc_conf_t *plcf);
-#endif
-static void ngx_http_proxy_set_vars(ngx_url_t *u, ngx_http_proxy_vars_t *v);
-
-
-static ngx_conf_post_t ngx_http_proxy_lowat_post =
- { ngx_http_proxy_lowat_check };
-
-
-static ngx_conf_bitmask_t ngx_http_proxy_next_upstream_masks[] = {
- { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR },
- { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT },
- { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER },
- { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 },
- { ngx_string("http_502"), NGX_HTTP_UPSTREAM_FT_HTTP_502 },
- { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
- { ngx_string("http_504"), NGX_HTTP_UPSTREAM_FT_HTTP_504 },
- { ngx_string("http_403"), NGX_HTTP_UPSTREAM_FT_HTTP_403 },
- { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
- { ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
- { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
- { ngx_null_string, 0 }
-};
-
-
-#if (NGX_HTTP_SSL)
-
-static ngx_conf_bitmask_t ngx_http_proxy_ssl_protocols[] = {
- { ngx_string("SSLv2"), NGX_SSL_SSLv2 },
- { ngx_string("SSLv3"), NGX_SSL_SSLv3 },
- { ngx_string("TLSv1"), NGX_SSL_TLSv1 },
- { ngx_string("TLSv1.1"), NGX_SSL_TLSv1_1 },
- { ngx_string("TLSv1.2"), NGX_SSL_TLSv1_2 },
- { ngx_null_string, 0 }
-};
-
-#endif
-
-
-static ngx_conf_enum_t ngx_http_proxy_http_version[] = {
- { ngx_string("1.0"), NGX_HTTP_VERSION_10 },
- { ngx_string("1.1"), NGX_HTTP_VERSION_11 },
- { ngx_null_string, 0 }
-};
-
-
-ngx_module_t ngx_http_proxy_module;
-
-
-static ngx_command_t ngx_http_proxy_commands[] = {
-
- { ngx_string("proxy_pass"),
- NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_HTTP_LMT_CONF|NGX_CONF_TAKE1,
- ngx_http_proxy_pass,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("proxy_redirect"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
- ngx_http_proxy_redirect,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("proxy_cookie_domain"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
- ngx_http_proxy_cookie_domain,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("proxy_cookie_path"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
- ngx_http_proxy_cookie_path,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("proxy_store"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_proxy_store,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("proxy_store_access"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE123,
- ngx_conf_set_access_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.store_access),
- NULL },
-
- { ngx_string("proxy_buffering"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.buffering),
- NULL },
-
- { ngx_string("proxy_ignore_client_abort"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.ignore_client_abort),
- NULL },
-
- { ngx_string("proxy_bind"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_upstream_bind_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.local),
- NULL },
-
- { ngx_string("proxy_connect_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.connect_timeout),
- NULL },
-
- { ngx_string("proxy_send_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.send_timeout),
- NULL },
-
- { ngx_string("proxy_send_lowat"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.send_lowat),
- &ngx_http_proxy_lowat_post },
-
- { ngx_string("proxy_intercept_errors"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.intercept_errors),
- NULL },
-
- { ngx_string("proxy_set_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_conf_set_keyval_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, headers_source),
- NULL },
-
- { ngx_string("proxy_headers_hash_max_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, headers_hash_max_size),
- NULL },
-
- { ngx_string("proxy_headers_hash_bucket_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, headers_hash_bucket_size),
- NULL },
-
- { ngx_string("proxy_set_body"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, body_source),
- NULL },
-
- { ngx_string("proxy_method"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, method),
- NULL },
-
- { ngx_string("proxy_pass_request_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.pass_request_headers),
- NULL },
-
- { ngx_string("proxy_pass_request_body"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.pass_request_body),
- NULL },
-
- { ngx_string("proxy_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.buffer_size),
- NULL },
-
- { ngx_string("proxy_read_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.read_timeout),
- NULL },
-
- { ngx_string("proxy_buffers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_conf_set_bufs_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.bufs),
- NULL },
-
- { ngx_string("proxy_busy_buffers_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.busy_buffers_size_conf),
- NULL },
-
-#if (NGX_HTTP_CACHE)
-
- { ngx_string("proxy_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_proxy_cache,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("proxy_cache_key"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_proxy_cache_key,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("proxy_cache_path"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_2MORE,
- ngx_http_file_cache_set_slot,
- 0,
- 0,
- &ngx_http_proxy_module },
-
- { ngx_string("proxy_cache_bypass"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_set_predicate_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.cache_bypass),
- NULL },
-
- { ngx_string("proxy_no_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_set_predicate_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.no_cache),
- NULL },
-
- { ngx_string("proxy_cache_valid"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_file_cache_valid_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.cache_valid),
- NULL },
-
- { ngx_string("proxy_cache_min_uses"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.cache_min_uses),
- NULL },
-
- { ngx_string("proxy_cache_use_stale"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.cache_use_stale),
- &ngx_http_proxy_next_upstream_masks },
-
- { ngx_string("proxy_cache_methods"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.cache_methods),
- &ngx_http_upstream_cache_method_mask },
-
- { ngx_string("proxy_cache_lock"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.cache_lock),
- NULL },
-
- { ngx_string("proxy_cache_lock_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.cache_lock_timeout),
- NULL },
-
- { ngx_string("proxy_cache_revalidate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.cache_revalidate),
- NULL },
-
-#endif
-
- { ngx_string("proxy_temp_path"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
- ngx_conf_set_path_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.temp_path),
- NULL },
-
- { ngx_string("proxy_max_temp_file_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.max_temp_file_size_conf),
- NULL },
-
- { ngx_string("proxy_temp_file_write_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.temp_file_write_size_conf),
- NULL },
-
- { ngx_string("proxy_next_upstream"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.next_upstream),
- &ngx_http_proxy_next_upstream_masks },
-
- { ngx_string("proxy_next_upstream_tries"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.next_upstream_tries),
- NULL },
-
- { ngx_string("proxy_next_upstream_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.next_upstream_timeout),
- NULL },
-
- { ngx_string("proxy_pass_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.pass_headers),
- NULL },
-
- { ngx_string("proxy_hide_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.hide_headers),
- NULL },
-
- { ngx_string("proxy_ignore_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.ignore_headers),
- &ngx_http_upstream_ignore_headers_masks },
-
- { ngx_string("proxy_http_version"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, http_version),
- &ngx_http_proxy_http_version },
-
-#if (NGX_HTTP_SSL)
-
- { ngx_string("proxy_ssl_session_reuse"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.ssl_session_reuse),
- NULL },
-
- { ngx_string("proxy_ssl_protocols"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, ssl_protocols),
- &ngx_http_proxy_ssl_protocols },
-
- { ngx_string("proxy_ssl_ciphers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, ssl_ciphers),
- NULL },
-
- { ngx_string("proxy_ssl_name"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_set_complex_value_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.ssl_name),
- NULL },
-
- { ngx_string("proxy_ssl_server_name"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.ssl_server_name),
- NULL },
-
- { ngx_string("proxy_ssl_verify"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, upstream.ssl_verify),
- NULL },
-
- { ngx_string("proxy_ssl_verify_depth"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, ssl_verify_depth),
- NULL },
-
- { ngx_string("proxy_ssl_trusted_certificate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, ssl_trusted_certificate),
- NULL },
-
- { ngx_string("proxy_ssl_crl"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_proxy_loc_conf_t, ssl_crl),
- NULL },
-
-#endif
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_proxy_module_ctx = {
- ngx_http_proxy_add_variables, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_proxy_create_loc_conf, /* create location configuration */
- ngx_http_proxy_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_proxy_module = {
- NGX_MODULE_V1,
- &ngx_http_proxy_module_ctx, /* module context */
- ngx_http_proxy_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static char ngx_http_proxy_version[] = " HTTP/1.0" CRLF;
-static char ngx_http_proxy_version_11[] = " HTTP/1.1" CRLF;
-
-
-static ngx_keyval_t ngx_http_proxy_headers[] = {
- { ngx_string("Host"), ngx_string("$proxy_host") },
- { ngx_string("Connection"), ngx_string("close") },
- { ngx_string("Content-Length"), ngx_string("$proxy_internal_body_length") },
- { ngx_string("Transfer-Encoding"), ngx_string("") },
- { ngx_string("Keep-Alive"), ngx_string("") },
- { ngx_string("Expect"), ngx_string("") },
- { ngx_string("Upgrade"), ngx_string("") },
- { ngx_null_string, ngx_null_string }
-};
-
-
-static ngx_str_t ngx_http_proxy_hide_headers[] = {
- ngx_string("Date"),
- ngx_string("Server"),
- ngx_string("X-Pad"),
- ngx_string("X-Accel-Expires"),
- ngx_string("X-Accel-Redirect"),
- ngx_string("X-Accel-Limit-Rate"),
- ngx_string("X-Accel-Buffering"),
- ngx_string("X-Accel-Charset"),
- ngx_null_string
-};
-
-
-#if (NGX_HTTP_CACHE)
-
-static ngx_keyval_t ngx_http_proxy_cache_headers[] = {
- { ngx_string("Host"), ngx_string("$proxy_host") },
- { ngx_string("Connection"), ngx_string("close") },
- { ngx_string("Content-Length"), ngx_string("$proxy_internal_body_length") },
- { ngx_string("Transfer-Encoding"), ngx_string("") },
- { ngx_string("Keep-Alive"), ngx_string("") },
- { ngx_string("Expect"), ngx_string("") },
- { ngx_string("Upgrade"), ngx_string("") },
- { ngx_string("If-Modified-Since"),
- ngx_string("$upstream_cache_last_modified") },
- { ngx_string("If-Unmodified-Since"), ngx_string("") },
- { ngx_string("If-None-Match"), ngx_string("$upstream_cache_etag") },
- { ngx_string("If-Match"), ngx_string("") },
- { ngx_string("Range"), ngx_string("") },
- { ngx_string("If-Range"), ngx_string("") },
- { ngx_null_string, ngx_null_string }
-};
-
-#endif
-
-
-static ngx_http_variable_t ngx_http_proxy_vars[] = {
-
- { ngx_string("proxy_host"), NULL, ngx_http_proxy_host_variable, 0,
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-
- { ngx_string("proxy_port"), NULL, ngx_http_proxy_port_variable, 0,
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-
- { ngx_string("proxy_add_x_forwarded_for"), NULL,
- ngx_http_proxy_add_x_forwarded_for_variable, 0, NGX_HTTP_VAR_NOHASH, 0 },
-
-#if 0
- { ngx_string("proxy_add_via"), NULL, NULL, 0, NGX_HTTP_VAR_NOHASH, 0 },
-#endif
-
- { ngx_string("proxy_internal_body_length"), NULL,
- ngx_http_proxy_internal_body_length_variable, 0,
- NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-static ngx_path_init_t ngx_http_proxy_temp_path = {
- ngx_string(NGX_HTTP_PROXY_TEMP_PATH), { 1, 2, 0 }
-};
-
-
-static ngx_int_t
-ngx_http_proxy_handler(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_http_upstream_t *u;
- ngx_http_proxy_ctx_t *ctx;
- ngx_http_proxy_loc_conf_t *plcf;
-
- if (ngx_http_upstream_create(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_proxy_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_proxy_module);
-
- plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module);
-
- u = r->upstream;
-
- if (plcf->proxy_lengths == NULL) {
- ctx->vars = plcf->vars;
- u->schema = plcf->vars.schema;
-#if (NGX_HTTP_SSL)
- u->ssl = (plcf->upstream.ssl != NULL);
-#endif
-
- } else {
- if (ngx_http_proxy_eval(r, ctx, plcf) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
- }
-
- u->output.tag = (ngx_buf_tag_t) &ngx_http_proxy_module;
-
- u->conf = &plcf->upstream;
-
-#if (NGX_HTTP_CACHE)
- u->create_key = ngx_http_proxy_create_key;
-#endif
- u->create_request = ngx_http_proxy_create_request;
- u->reinit_request = ngx_http_proxy_reinit_request;
- u->process_header = ngx_http_proxy_process_status_line;
- u->abort_request = ngx_http_proxy_abort_request;
- u->finalize_request = ngx_http_proxy_finalize_request;
- r->state = 0;
-
- if (plcf->redirects) {
- u->rewrite_redirect = ngx_http_proxy_rewrite_redirect;
- }
-
- if (plcf->cookie_domains || plcf->cookie_paths) {
- u->rewrite_cookie = ngx_http_proxy_rewrite_cookie;
- }
-
- u->buffering = plcf->upstream.buffering;
-
- u->pipe = ngx_pcalloc(r->pool, sizeof(ngx_event_pipe_t));
- if (u->pipe == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- u->pipe->input_filter = ngx_http_proxy_copy_filter;
- u->pipe->input_ctx = r;
-
- u->input_filter_init = ngx_http_proxy_input_filter_init;
- u->input_filter = ngx_http_proxy_non_buffered_copy_filter;
- u->input_filter_ctx = r;
-
- u->accel = 1;
-
- rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init);
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- return rc;
- }
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_eval(ngx_http_request_t *r, ngx_http_proxy_ctx_t *ctx,
- ngx_http_proxy_loc_conf_t *plcf)
-{
- u_char *p;
- size_t add;
- u_short port;
- ngx_str_t proxy;
- ngx_url_t url;
- ngx_http_upstream_t *u;
-
- if (ngx_http_script_run(r, &proxy, plcf->proxy_lengths->elts, 0,
- plcf->proxy_values->elts)
- == NULL)
- {
- return NGX_ERROR;
- }
-
- if (proxy.len > 7
- && ngx_strncasecmp(proxy.data, (u_char *) "http://", 7) == 0)
- {
- add = 7;
- port = 80;
-
-#if (NGX_HTTP_SSL)
-
- } else if (proxy.len > 8
- && ngx_strncasecmp(proxy.data, (u_char *) "https://", 8) == 0)
- {
- add = 8;
- port = 443;
- r->upstream->ssl = 1;
-
-#endif
-
- } else {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid URL prefix in \"%V\"", &proxy);
- return NGX_ERROR;
- }
-
- u = r->upstream;
-
- u->schema.len = add;
- u->schema.data = proxy.data;
-
- ngx_memzero(&url, sizeof(ngx_url_t));
-
- url.url.len = proxy.len - add;
- url.url.data = proxy.data + add;
- url.default_port = port;
- url.uri_part = 1;
- url.no_resolve = 1;
-
- if (ngx_parse_url(r->pool, &url) != NGX_OK) {
- if (url.err) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "%s in upstream \"%V\"", url.err, &url.url);
- }
-
- return NGX_ERROR;
- }
-
- if (url.uri.len) {
- if (url.uri.data[0] == '?') {
- p = ngx_pnalloc(r->pool, url.uri.len + 1);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- *p++ = '/';
- ngx_memcpy(p, url.uri.data, url.uri.len);
-
- url.uri.len++;
- url.uri.data = p - 1;
- }
- }
-
- ctx->vars.key_start = u->schema;
-
- ngx_http_proxy_set_vars(&url, &ctx->vars);
-
- u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
- if (u->resolved == NULL) {
- return NGX_ERROR;
- }
-
- if (url.addrs && url.addrs[0].sockaddr) {
- u->resolved->sockaddr = url.addrs[0].sockaddr;
- u->resolved->socklen = url.addrs[0].socklen;
- u->resolved->naddrs = 1;
- u->resolved->host = url.addrs[0].name;
-
- } else {
- u->resolved->host = url.host;
- u->resolved->port = (in_port_t) (url.no_port ? port : url.port);
- u->resolved->no_port = url.no_port;
- }
-
- return NGX_OK;
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-static ngx_int_t
-ngx_http_proxy_create_key(ngx_http_request_t *r)
-{
- size_t len, loc_len;
- u_char *p;
- uintptr_t escape;
- ngx_str_t *key;
- ngx_http_upstream_t *u;
- ngx_http_proxy_ctx_t *ctx;
- ngx_http_proxy_loc_conf_t *plcf;
-
- u = r->upstream;
-
- plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module);
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- key = ngx_array_push(&r->cache->keys);
- if (key == NULL) {
- return NGX_ERROR;
- }
-
- if (plcf->cache_key.value.data) {
-
- if (ngx_http_complex_value(r, &plcf->cache_key, key) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
-
- *key = ctx->vars.key_start;
-
- key = ngx_array_push(&r->cache->keys);
- if (key == NULL) {
- return NGX_ERROR;
- }
-
- if (plcf->proxy_lengths && ctx->vars.uri.len) {
-
- *key = ctx->vars.uri;
- u->uri = ctx->vars.uri;
-
- return NGX_OK;
-
- } else if (ctx->vars.uri.len == 0 && r->valid_unparsed_uri && r == r->main)
- {
- *key = r->unparsed_uri;
- u->uri = r->unparsed_uri;
-
- return NGX_OK;
- }
-
- loc_len = (r->valid_location && ctx->vars.uri.len) ? plcf->location.len : 0;
-
- if (r->quoted_uri || r->internal) {
- escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len,
- r->uri.len - loc_len, NGX_ESCAPE_URI);
- } else {
- escape = 0;
- }
-
- len = ctx->vars.uri.len + r->uri.len - loc_len + escape
- + sizeof("?") - 1 + r->args.len;
-
- p = ngx_pnalloc(r->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- key->data = p;
-
- if (r->valid_location) {
- p = ngx_copy(p, ctx->vars.uri.data, ctx->vars.uri.len);
- }
-
- if (escape) {
- ngx_escape_uri(p, r->uri.data + loc_len,
- r->uri.len - loc_len, NGX_ESCAPE_URI);
- p += r->uri.len - loc_len + escape;
-
- } else {
- p = ngx_copy(p, r->uri.data + loc_len, r->uri.len - loc_len);
- }
-
- if (r->args.len > 0) {
- *p++ = '?';
- p = ngx_copy(p, r->args.data, r->args.len);
- }
-
- key->len = p - key->data;
- u->uri = *key;
-
- return NGX_OK;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_proxy_create_request(ngx_http_request_t *r)
-{
- size_t len, uri_len, loc_len, body_len;
- uintptr_t escape;
- ngx_buf_t *b;
- ngx_str_t method;
- ngx_uint_t i, unparsed_uri;
- ngx_chain_t *cl, *body;
- ngx_list_part_t *part;
- ngx_table_elt_t *header;
- ngx_http_upstream_t *u;
- ngx_http_proxy_ctx_t *ctx;
- ngx_http_script_code_pt code;
- ngx_http_script_engine_t e, le;
- ngx_http_proxy_loc_conf_t *plcf;
- ngx_http_script_len_code_pt lcode;
-
- u = r->upstream;
-
- plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module);
-
- if (u->method.len) {
- /* HEAD was changed to GET to cache response */
- method = u->method;
- method.len++;
-
- } else if (plcf->method.len) {
- method = plcf->method;
-
- } else {
- method = r->method_name;
- method.len++;
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (method.len == 5
- && ngx_strncasecmp(method.data, (u_char *) "HEAD ", 5) == 0)
- {
- ctx->head = 1;
- }
-
- len = method.len + sizeof(ngx_http_proxy_version) - 1 + sizeof(CRLF) - 1;
-
- escape = 0;
- loc_len = 0;
- unparsed_uri = 0;
-
- if (plcf->proxy_lengths && ctx->vars.uri.len) {
- uri_len = ctx->vars.uri.len;
-
- } else if (ctx->vars.uri.len == 0 && r->valid_unparsed_uri && r == r->main)
- {
- unparsed_uri = 1;
- uri_len = r->unparsed_uri.len;
-
- } else {
- loc_len = (r->valid_location && ctx->vars.uri.len) ?
- plcf->location.len : 0;
-
- if (r->quoted_uri || r->space_in_uri || r->internal) {
- escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len,
- r->uri.len - loc_len, NGX_ESCAPE_URI);
- }
-
- uri_len = ctx->vars.uri.len + r->uri.len - loc_len + escape
- + sizeof("?") - 1 + r->args.len;
- }
-
- if (uri_len == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "zero length URI to proxy");
- return NGX_ERROR;
- }
-
- len += uri_len;
-
- ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
-
- ngx_http_script_flush_no_cacheable_variables(r, plcf->flushes);
-
- if (plcf->body_set_len) {
- le.ip = plcf->body_set_len->elts;
- le.request = r;
- le.flushed = 1;
- body_len = 0;
-
- while (*(uintptr_t *) le.ip) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- body_len += lcode(&le);
- }
-
- ctx->internal_body_length = body_len;
- len += body_len;
-
- } else {
- ctx->internal_body_length = r->headers_in.content_length_n;
- }
-
- le.ip = plcf->headers_set_len->elts;
- le.request = r;
- le.flushed = 1;
-
- while (*(uintptr_t *) le.ip) {
- while (*(uintptr_t *) le.ip) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- len += lcode(&le);
- }
- le.ip += sizeof(uintptr_t);
- }
-
-
- if (plcf->upstream.pass_request_headers) {
- part = &r->headers_in.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (ngx_hash_find(&plcf->headers_set_hash, header[i].hash,
- header[i].lowcase_key, header[i].key.len))
- {
- continue;
- }
-
- len += header[i].key.len + sizeof(": ") - 1
- + header[i].value.len + sizeof(CRLF) - 1;
- }
- }
-
-
- b = ngx_create_temp_buf(r->pool, len);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
-
-
- /* the request line */
-
- b->last = ngx_copy(b->last, method.data, method.len);
-
- u->uri.data = b->last;
-
- if (plcf->proxy_lengths && ctx->vars.uri.len) {
- b->last = ngx_copy(b->last, ctx->vars.uri.data, ctx->vars.uri.len);
-
- } else if (unparsed_uri) {
- b->last = ngx_copy(b->last, r->unparsed_uri.data, r->unparsed_uri.len);
-
- } else {
- if (r->valid_location) {
- b->last = ngx_copy(b->last, ctx->vars.uri.data, ctx->vars.uri.len);
- }
-
- if (escape) {
- ngx_escape_uri(b->last, r->uri.data + loc_len,
- r->uri.len - loc_len, NGX_ESCAPE_URI);
- b->last += r->uri.len - loc_len + escape;
-
- } else {
- b->last = ngx_copy(b->last, r->uri.data + loc_len,
- r->uri.len - loc_len);
- }
-
- if (r->args.len > 0) {
- *b->last++ = '?';
- b->last = ngx_copy(b->last, r->args.data, r->args.len);
- }
- }
-
- u->uri.len = b->last - u->uri.data;
-
- if (plcf->http_version == NGX_HTTP_VERSION_11) {
- b->last = ngx_cpymem(b->last, ngx_http_proxy_version_11,
- sizeof(ngx_http_proxy_version_11) - 1);
-
- } else {
- b->last = ngx_cpymem(b->last, ngx_http_proxy_version,
- sizeof(ngx_http_proxy_version) - 1);
- }
-
- ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
-
- e.ip = plcf->headers_set->elts;
- e.pos = b->last;
- e.request = r;
- e.flushed = 1;
-
- le.ip = plcf->headers_set_len->elts;
-
- while (*(uintptr_t *) le.ip) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
-
- /* skip the header line name length */
- (void) lcode(&le);
-
- if (*(ngx_http_script_len_code_pt *) le.ip) {
-
- for (len = 0; *(uintptr_t *) le.ip; len += lcode(&le)) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- }
-
- e.skip = (len == sizeof(CRLF) - 1) ? 1 : 0;
-
- } else {
- e.skip = 0;
- }
-
- le.ip += sizeof(uintptr_t);
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
- e.ip += sizeof(uintptr_t);
- }
-
- b->last = e.pos;
-
-
- if (plcf->upstream.pass_request_headers) {
- part = &r->headers_in.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (ngx_hash_find(&plcf->headers_set_hash, header[i].hash,
- header[i].lowcase_key, header[i].key.len))
- {
- continue;
- }
-
- b->last = ngx_copy(b->last, header[i].key.data, header[i].key.len);
-
- *b->last++ = ':'; *b->last++ = ' ';
-
- b->last = ngx_copy(b->last, header[i].value.data,
- header[i].value.len);
-
- *b->last++ = CR; *b->last++ = LF;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http proxy header: \"%V: %V\"",
- &header[i].key, &header[i].value);
- }
- }
-
-
- /* add "\r\n" at the header end */
- *b->last++ = CR; *b->last++ = LF;
-
- if (plcf->body_set) {
- e.ip = plcf->body_set->elts;
- e.pos = b->last;
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
-
- b->last = e.pos;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http proxy header:%N\"%*s\"",
- (size_t) (b->last - b->pos), b->pos);
-
- if (plcf->body_set == NULL && plcf->upstream.pass_request_body) {
-
- body = u->request_bufs;
- u->request_bufs = cl;
-
- while (body) {
- b = ngx_alloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(b, body->buf, sizeof(ngx_buf_t));
-
- cl->next = ngx_alloc_chain_link(r->pool);
- if (cl->next == NULL) {
- return NGX_ERROR;
- }
-
- cl = cl->next;
- cl->buf = b;
-
- body = body->next;
- }
-
- } else {
- u->request_bufs = cl;
- }
-
- b->flush = 1;
- cl->next = NULL;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_reinit_request(ngx_http_request_t *r)
-{
- ngx_http_proxy_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (ctx == NULL) {
- return NGX_OK;
- }
-
- ctx->status.code = 0;
- ctx->status.count = 0;
- ctx->status.start = NULL;
- ctx->status.end = NULL;
- ctx->chunked.state = 0;
-
- r->upstream->process_header = ngx_http_proxy_process_status_line;
- r->upstream->pipe->input_filter = ngx_http_proxy_copy_filter;
- r->upstream->input_filter = ngx_http_proxy_non_buffered_copy_filter;
- r->state = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_process_status_line(ngx_http_request_t *r)
-{
- size_t len;
- ngx_int_t rc;
- ngx_http_upstream_t *u;
- ngx_http_proxy_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- u = r->upstream;
-
- rc = ngx_http_parse_status_line(r, &u->buffer, &ctx->status);
-
- if (rc == NGX_AGAIN) {
- return rc;
- }
-
- if (rc == NGX_ERROR) {
-
-#if (NGX_HTTP_CACHE)
-
- if (r->cache) {
- r->http_version = NGX_HTTP_VERSION_9;
- return NGX_OK;
- }
-
-#endif
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent no valid HTTP/1.0 header");
-
-#if 0
- if (u->accel) {
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-#endif
-
- r->http_version = NGX_HTTP_VERSION_9;
- u->state->status = NGX_HTTP_OK;
- u->headers_in.connection_close = 1;
-
- return NGX_OK;
- }
-
- if (u->state && u->state->status == 0) {
- u->state->status = ctx->status.code;
- }
-
- u->headers_in.status_n = ctx->status.code;
-
- len = ctx->status.end - ctx->status.start;
- u->headers_in.status_line.len = len;
-
- u->headers_in.status_line.data = ngx_pnalloc(r->pool, len);
- if (u->headers_in.status_line.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(u->headers_in.status_line.data, ctx->status.start, len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http proxy status %ui \"%V\"",
- u->headers_in.status_n, &u->headers_in.status_line);
-
- if (ctx->status.http_version < NGX_HTTP_VERSION_11) {
- u->headers_in.connection_close = 1;
- }
-
- u->process_header = ngx_http_proxy_process_header;
-
- return ngx_http_proxy_process_header(r);
-}
-
-
-static ngx_int_t
-ngx_http_proxy_process_header(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_table_elt_t *h;
- ngx_http_upstream_t *u;
- ngx_http_proxy_ctx_t *ctx;
- ngx_http_upstream_header_t *hh;
- ngx_http_upstream_main_conf_t *umcf;
-
- umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
-
- for ( ;; ) {
-
- rc = ngx_http_parse_header_line(r, &r->upstream->buffer, 1);
-
- if (rc == NGX_OK) {
-
- /* a header line has been parsed successfully */
-
- h = ngx_list_push(&r->upstream->headers_in.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = r->header_hash;
-
- h->key.len = r->header_name_end - r->header_name_start;
- h->value.len = r->header_end - r->header_start;
-
- h->key.data = ngx_pnalloc(r->pool,
- h->key.len + 1 + h->value.len + 1 + h->key.len);
- if (h->key.data == NULL) {
- return NGX_ERROR;
- }
-
- h->value.data = h->key.data + h->key.len + 1;
- h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1;
-
- ngx_memcpy(h->key.data, r->header_name_start, h->key.len);
- h->key.data[h->key.len] = '\0';
- ngx_memcpy(h->value.data, r->header_start, h->value.len);
- h->value.data[h->value.len] = '\0';
-
- if (h->key.len == r->lowcase_index) {
- ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
-
- } else {
- ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
- }
-
- hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
- h->lowcase_key, h->key.len);
-
- if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http proxy header: \"%V: %V\"",
- &h->key, &h->value);
-
- continue;
- }
-
- if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
-
- /* a whole header has been parsed successfully */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http proxy header done");
-
- /*
- * if no "Server" and "Date" in header line,
- * then add the special empty headers
- */
-
- if (r->upstream->headers_in.server == NULL) {
- h = ngx_list_push(&r->upstream->headers_in.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = ngx_hash(ngx_hash(ngx_hash(ngx_hash(
- ngx_hash('s', 'e'), 'r'), 'v'), 'e'), 'r');
-
- ngx_str_set(&h->key, "Server");
- ngx_str_null(&h->value);
- h->lowcase_key = (u_char *) "server";
- }
-
- if (r->upstream->headers_in.date == NULL) {
- h = ngx_list_push(&r->upstream->headers_in.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = ngx_hash(ngx_hash(ngx_hash('d', 'a'), 't'), 'e');
-
- ngx_str_set(&h->key, "Date");
- ngx_str_null(&h->value);
- h->lowcase_key = (u_char *) "date";
- }
-
- /* clear content length if response is chunked */
-
- u = r->upstream;
-
- if (u->headers_in.chunked) {
- u->headers_in.content_length_n = -1;
- }
-
- /*
- * set u->keepalive if response has no body; this allows to keep
- * connections alive in case of r->header_only or X-Accel-Redirect
- */
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (u->headers_in.status_n == NGX_HTTP_NO_CONTENT
- || u->headers_in.status_n == NGX_HTTP_NOT_MODIFIED
- || ctx->head
- || (!u->headers_in.chunked
- && u->headers_in.content_length_n == 0))
- {
- u->keepalive = !u->headers_in.connection_close;
- }
-
- if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS) {
- u->keepalive = 0;
-
- if (r->headers_in.upgrade) {
- u->upgrade = 1;
- }
- }
-
- return NGX_OK;
- }
-
- if (rc == NGX_AGAIN) {
- return NGX_AGAIN;
- }
-
- /* there was error while a header line parsing */
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid header");
-
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-}
-
-
-static ngx_int_t
-ngx_http_proxy_input_filter_init(void *data)
-{
- ngx_http_request_t *r = data;
- ngx_http_upstream_t *u;
- ngx_http_proxy_ctx_t *ctx;
-
- u = r->upstream;
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http proxy filter init s:%d h:%d c:%d l:%O",
- u->headers_in.status_n, ctx->head, u->headers_in.chunked,
- u->headers_in.content_length_n);
-
- /* as per RFC2616, 4.4 Message Length */
-
- if (u->headers_in.status_n == NGX_HTTP_NO_CONTENT
- || u->headers_in.status_n == NGX_HTTP_NOT_MODIFIED
- || ctx->head)
- {
- /* 1xx, 204, and 304 and replies to HEAD requests */
- /* no 1xx since we don't send Expect and Upgrade */
-
- u->pipe->length = 0;
- u->length = 0;
- u->keepalive = !u->headers_in.connection_close;
-
- } else if (u->headers_in.chunked) {
- /* chunked */
-
- u->pipe->input_filter = ngx_http_proxy_chunked_filter;
- u->pipe->length = 3; /* "0" LF LF */
-
- u->input_filter = ngx_http_proxy_non_buffered_chunked_filter;
- u->length = 1;
-
- } else if (u->headers_in.content_length_n == 0) {
- /* empty body: special case as filter won't be called */
-
- u->pipe->length = 0;
- u->length = 0;
- u->keepalive = !u->headers_in.connection_close;
-
- } else {
- /* content length or connection close */
-
- u->pipe->length = u->headers_in.content_length_n;
- u->length = u->headers_in.content_length_n;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_copy_filter(ngx_event_pipe_t *p, ngx_buf_t *buf)
-{
- ngx_buf_t *b;
- ngx_chain_t *cl;
- ngx_http_request_t *r;
-
- if (buf->pos == buf->last) {
- return NGX_OK;
- }
-
- cl = ngx_chain_get_free_buf(p->pool, &p->free);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memcpy(b, buf, sizeof(ngx_buf_t));
- b->shadow = buf;
- b->tag = p->tag;
- b->last_shadow = 1;
- b->recycled = 1;
- buf->shadow = b;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, p->log, 0, "input buf #%d", b->num);
-
- if (p->in) {
- *p->last_in = cl;
- } else {
- p->in = cl;
- }
- p->last_in = &cl->next;
-
- if (p->length == -1) {
- return NGX_OK;
- }
-
- p->length -= b->last - b->pos;
-
- if (p->length == 0) {
- r = p->input_ctx;
- p->upstream_done = 1;
- r->upstream->keepalive = !r->upstream->headers_in.connection_close;
-
- } else if (p->length < 0) {
- r = p->input_ctx;
- p->upstream_done = 1;
-
- ngx_log_error(NGX_LOG_WARN, r->connection->log, 0,
- "upstream sent more data than specified in "
- "\"Content-Length\" header");
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_chunked_filter(ngx_event_pipe_t *p, ngx_buf_t *buf)
-{
- ngx_int_t rc;
- ngx_buf_t *b, **prev;
- ngx_chain_t *cl;
- ngx_http_request_t *r;
- ngx_http_proxy_ctx_t *ctx;
-
- if (buf->pos == buf->last) {
- return NGX_OK;
- }
-
- r = p->input_ctx;
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- b = NULL;
- prev = &buf->shadow;
-
- for ( ;; ) {
-
- rc = ngx_http_parse_chunked(r, buf, &ctx->chunked);
-
- if (rc == NGX_OK) {
-
- /* a chunk has been parsed successfully */
-
- cl = ngx_chain_get_free_buf(p->pool, &p->free);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->pos = buf->pos;
- b->start = buf->start;
- b->end = buf->end;
- b->tag = p->tag;
- b->temporary = 1;
- b->recycled = 1;
-
- *prev = b;
- prev = &b->shadow;
-
- if (p->in) {
- *p->last_in = cl;
- } else {
- p->in = cl;
- }
- p->last_in = &cl->next;
-
- /* STUB */ b->num = buf->num;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "input buf #%d %p", b->num, b->pos);
-
- if (buf->last - buf->pos >= ctx->chunked.size) {
-
- buf->pos += (size_t) ctx->chunked.size;
- b->last = buf->pos;
- ctx->chunked.size = 0;
-
- continue;
- }
-
- ctx->chunked.size -= buf->last - buf->pos;
- buf->pos = buf->last;
- b->last = buf->last;
-
- continue;
- }
-
- if (rc == NGX_DONE) {
-
- /* a whole response has been parsed successfully */
-
- p->upstream_done = 1;
- r->upstream->keepalive = !r->upstream->headers_in.connection_close;
-
- break;
- }
-
- if (rc == NGX_AGAIN) {
-
- /* set p->length, minimal amount of data we want to see */
-
- p->length = ctx->chunked.length;
-
- break;
- }
-
- /* invalid response */
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid chunked response");
-
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http proxy chunked state %d, length %d",
- ctx->chunked.state, p->length);
-
- if (b) {
- b->shadow = buf;
- b->last_shadow = 1;
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, p->log, 0,
- "input buf %p %z", b->pos, b->last - b->pos);
-
- return NGX_OK;
- }
-
- /* there is no data record in the buf, add it to free chain */
-
- if (ngx_event_pipe_add_free_buf(p, buf) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_non_buffered_copy_filter(void *data, ssize_t bytes)
-{
- ngx_http_request_t *r = data;
-
- ngx_buf_t *b;
- ngx_chain_t *cl, **ll;
- ngx_http_upstream_t *u;
-
- u = r->upstream;
-
- for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) {
- ll = &cl->next;
- }
-
- cl = ngx_chain_get_free_buf(r->pool, &u->free_bufs);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- *ll = cl;
-
- cl->buf->flush = 1;
- cl->buf->memory = 1;
-
- b = &u->buffer;
-
- cl->buf->pos = b->last;
- b->last += bytes;
- cl->buf->last = b->last;
- cl->buf->tag = u->output.tag;
-
- if (u->length == -1) {
- return NGX_OK;
- }
-
- u->length -= bytes;
-
- if (u->length == 0) {
- u->keepalive = !u->headers_in.connection_close;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_non_buffered_chunked_filter(void *data, ssize_t bytes)
-{
- ngx_http_request_t *r = data;
-
- ngx_int_t rc;
- ngx_buf_t *b, *buf;
- ngx_chain_t *cl, **ll;
- ngx_http_upstream_t *u;
- ngx_http_proxy_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- u = r->upstream;
- buf = &u->buffer;
-
- buf->pos = buf->last;
- buf->last += bytes;
-
- for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) {
- ll = &cl->next;
- }
-
- for ( ;; ) {
-
- rc = ngx_http_parse_chunked(r, buf, &ctx->chunked);
-
- if (rc == NGX_OK) {
-
- /* a chunk has been parsed successfully */
-
- cl = ngx_chain_get_free_buf(r->pool, &u->free_bufs);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- *ll = cl;
- ll = &cl->next;
-
- b = cl->buf;
-
- b->flush = 1;
- b->memory = 1;
-
- b->pos = buf->pos;
- b->tag = u->output.tag;
-
- if (buf->last - buf->pos >= ctx->chunked.size) {
- buf->pos += (size_t) ctx->chunked.size;
- b->last = buf->pos;
- ctx->chunked.size = 0;
-
- } else {
- ctx->chunked.size -= buf->last - buf->pos;
- buf->pos = buf->last;
- b->last = buf->last;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http proxy out buf %p %z",
- b->pos, b->last - b->pos);
-
- continue;
- }
-
- if (rc == NGX_DONE) {
-
- /* a whole response has been parsed successfully */
-
- u->keepalive = !u->headers_in.connection_close;
- u->length = 0;
-
- break;
- }
-
- if (rc == NGX_AGAIN) {
- break;
- }
-
- /* invalid response */
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid chunked response");
-
- return NGX_ERROR;
- }
-
- /* provide continuous buffer for subrequests in memory */
-
- if (r->subrequest_in_memory) {
-
- cl = u->out_bufs;
-
- if (cl) {
- buf->pos = cl->buf->pos;
- }
-
- buf->last = buf->pos;
-
- for (cl = u->out_bufs; cl; cl = cl->next) {
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http proxy in memory %p-%p %uz",
- cl->buf->pos, cl->buf->last, ngx_buf_size(cl->buf));
-
- if (buf->last == cl->buf->pos) {
- buf->last = cl->buf->last;
- continue;
- }
-
- buf->last = ngx_movemem(buf->last, cl->buf->pos,
- cl->buf->last - cl->buf->pos);
-
- cl->buf->pos = buf->last - (cl->buf->last - cl->buf->pos);
- cl->buf->last = buf->last;
- }
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_proxy_abort_request(ngx_http_request_t *r)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "abort http proxy request");
-
- return;
-}
-
-
-static void
-ngx_http_proxy_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "finalize http proxy request");
-
- return;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_host_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_proxy_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (ctx == NULL) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->len = ctx->vars.host_header.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = ctx->vars.host_header.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_port_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_proxy_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (ctx == NULL) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->len = ctx->vars.port.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = ctx->vars.port.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_add_x_forwarded_for_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- size_t len;
- u_char *p;
- ngx_uint_t i, n;
- ngx_table_elt_t **h;
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- n = r->headers_in.x_forwarded_for.nelts;
- h = r->headers_in.x_forwarded_for.elts;
-
- len = 0;
-
- for (i = 0; i < n; i++) {
- len += h[i]->value.len + sizeof(", ") - 1;
- }
-
- if (len == 0) {
- v->len = r->connection->addr_text.len;
- v->data = r->connection->addr_text.data;
- return NGX_OK;
- }
-
- len += r->connection->addr_text.len;
-
- p = ngx_pnalloc(r->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = len;
- v->data = p;
-
- for (i = 0; i < n; i++) {
- p = ngx_copy(p, h[i]->value.data, h[i]->value.len);
- *p++ = ','; *p++ = ' ';
- }
-
- ngx_memcpy(p, r->connection->addr_text.data, r->connection->addr_text.len);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_internal_body_length_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_proxy_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
-
- if (ctx == NULL || ctx->internal_body_length < 0) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- v->data = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
-
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(v->data, "%O", ctx->internal_body_length) - v->data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_rewrite_redirect(ngx_http_request_t *r, ngx_table_elt_t *h,
- size_t prefix)
-{
- size_t len;
- ngx_int_t rc;
- ngx_uint_t i;
- ngx_http_proxy_rewrite_t *pr;
- ngx_http_proxy_loc_conf_t *plcf;
-
- plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module);
-
- pr = plcf->redirects->elts;
-
- if (pr == NULL) {
- return NGX_DECLINED;
- }
-
- len = h->value.len - prefix;
-
- for (i = 0; i < plcf->redirects->nelts; i++) {
- rc = pr[i].handler(r, h, prefix, len, &pr[i]);
-
- if (rc != NGX_DECLINED) {
- return rc;
- }
- }
-
- return NGX_DECLINED;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_rewrite_cookie(ngx_http_request_t *r, ngx_table_elt_t *h)
-{
- size_t prefix;
- u_char *p;
- ngx_int_t rc, rv;
- ngx_http_proxy_loc_conf_t *plcf;
-
- p = (u_char *) ngx_strchr(h->value.data, ';');
- if (p == NULL) {
- return NGX_DECLINED;
- }
-
- prefix = p + 1 - h->value.data;
-
- rv = NGX_DECLINED;
-
- plcf = ngx_http_get_module_loc_conf(r, ngx_http_proxy_module);
-
- if (plcf->cookie_domains) {
- p = ngx_strcasestrn(h->value.data + prefix, "domain=", 7 - 1);
-
- if (p) {
- rc = ngx_http_proxy_rewrite_cookie_value(r, h, p + 7,
- plcf->cookie_domains);
- if (rc == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if (rc != NGX_DECLINED) {
- rv = rc;
- }
- }
- }
-
- if (plcf->cookie_paths) {
- p = ngx_strcasestrn(h->value.data + prefix, "path=", 5 - 1);
-
- if (p) {
- rc = ngx_http_proxy_rewrite_cookie_value(r, h, p + 5,
- plcf->cookie_paths);
- if (rc == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if (rc != NGX_DECLINED) {
- rv = rc;
- }
- }
- }
-
- return rv;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_rewrite_cookie_value(ngx_http_request_t *r, ngx_table_elt_t *h,
- u_char *value, ngx_array_t *rewrites)
-{
- size_t len, prefix;
- u_char *p;
- ngx_int_t rc;
- ngx_uint_t i;
- ngx_http_proxy_rewrite_t *pr;
-
- prefix = value - h->value.data;
-
- p = (u_char *) ngx_strchr(value, ';');
-
- len = p ? (size_t) (p - value) : (h->value.len - prefix);
-
- pr = rewrites->elts;
-
- for (i = 0; i < rewrites->nelts; i++) {
- rc = pr[i].handler(r, h, prefix, len, &pr[i]);
-
- if (rc != NGX_DECLINED) {
- return rc;
- }
- }
-
- return NGX_DECLINED;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_rewrite_complex_handler(ngx_http_request_t *r,
- ngx_table_elt_t *h, size_t prefix, size_t len, ngx_http_proxy_rewrite_t *pr)
-{
- ngx_str_t pattern, replacement;
-
- if (ngx_http_complex_value(r, &pr->pattern.complex, &pattern) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (pattern.len > len
- || ngx_rstrncmp(h->value.data + prefix, pattern.data,
- pattern.len) != 0)
- {
- return NGX_DECLINED;
- }
-
- if (ngx_http_complex_value(r, &pr->replacement, &replacement) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return ngx_http_proxy_rewrite(r, h, prefix, pattern.len, &replacement);
-}
-
-
-#if (NGX_PCRE)
-
-static ngx_int_t
-ngx_http_proxy_rewrite_regex_handler(ngx_http_request_t *r, ngx_table_elt_t *h,
- size_t prefix, size_t len, ngx_http_proxy_rewrite_t *pr)
-{
- ngx_str_t pattern, replacement;
-
- pattern.len = len;
- pattern.data = h->value.data + prefix;
-
- if (ngx_http_regex_exec(r, pr->pattern.regex, &pattern) != NGX_OK) {
- return NGX_DECLINED;
- }
-
- if (ngx_http_complex_value(r, &pr->replacement, &replacement) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (prefix == 0 && h->value.len == len) {
- h->value = replacement;
- return NGX_OK;
- }
-
- return ngx_http_proxy_rewrite(r, h, prefix, len, &replacement);
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_proxy_rewrite_domain_handler(ngx_http_request_t *r,
- ngx_table_elt_t *h, size_t prefix, size_t len, ngx_http_proxy_rewrite_t *pr)
-{
- u_char *p;
- ngx_str_t pattern, replacement;
-
- if (ngx_http_complex_value(r, &pr->pattern.complex, &pattern) != NGX_OK) {
- return NGX_ERROR;
- }
-
- p = h->value.data + prefix;
-
- if (p[0] == '.') {
- p++;
- prefix++;
- len--;
- }
-
- if (pattern.len != len || ngx_rstrncasecmp(pattern.data, p, len) != 0) {
- return NGX_DECLINED;
- }
-
- if (ngx_http_complex_value(r, &pr->replacement, &replacement) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return ngx_http_proxy_rewrite(r, h, prefix, len, &replacement);
-}
-
-
-static ngx_int_t
-ngx_http_proxy_rewrite(ngx_http_request_t *r, ngx_table_elt_t *h, size_t prefix,
- size_t len, ngx_str_t *replacement)
-{
- u_char *p, *data;
- size_t new_len;
-
- new_len = replacement->len + h->value.len - len;
-
- if (replacement->len > len) {
-
- data = ngx_pnalloc(r->pool, new_len + 1);
- if (data == NULL) {
- return NGX_ERROR;
- }
-
- p = ngx_copy(data, h->value.data, prefix);
- p = ngx_copy(p, replacement->data, replacement->len);
-
- ngx_memcpy(p, h->value.data + prefix + len,
- h->value.len - len - prefix + 1);
-
- h->value.data = data;
-
- } else {
- p = ngx_copy(h->value.data + prefix, replacement->data,
- replacement->len);
-
- ngx_memmove(p, h->value.data + prefix + len,
- h->value.len - len - prefix + 1);
- }
-
- h->value.len = new_len;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_add_variables(ngx_conf_t *cf)
-{
- ngx_http_variable_t *var, *v;
-
- for (v = ngx_http_proxy_vars; v->name.len; v++) {
- var = ngx_http_add_variable(cf, &v->name, v->flags);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = v->get_handler;
- var->data = v->data;
- }
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_proxy_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_proxy_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_proxy_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->upstream.bufs.num = 0;
- * conf->upstream.ignore_headers = 0;
- * conf->upstream.next_upstream = 0;
- * conf->upstream.cache_use_stale = 0;
- * conf->upstream.cache_methods = 0;
- * conf->upstream.temp_path = NULL;
- * conf->upstream.hide_headers_hash = { NULL, 0 };
- * conf->upstream.uri = { 0, NULL };
- * conf->upstream.location = NULL;
- * conf->upstream.store_lengths = NULL;
- * conf->upstream.store_values = NULL;
- * conf->upstream.ssl_name = NULL;
- *
- * conf->method = { 0, NULL };
- * conf->headers_source = NULL;
- * conf->headers_set_len = NULL;
- * conf->headers_set = NULL;
- * conf->headers_set_hash = NULL;
- * conf->body_set_len = NULL;
- * conf->body_set = NULL;
- * conf->body_source = { 0, NULL };
- * conf->redirects = NULL;
- * conf->ssl = 0;
- * conf->ssl_protocols = 0;
- * conf->ssl_ciphers = { 0, NULL };
- * conf->ssl_trusted_certificate = { 0, NULL };
- * conf->ssl_crl = { 0, NULL };
- */
-
- conf->upstream.store = NGX_CONF_UNSET;
- conf->upstream.store_access = NGX_CONF_UNSET_UINT;
- conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
- conf->upstream.buffering = NGX_CONF_UNSET;
- conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
-
- conf->upstream.local = NGX_CONF_UNSET_PTR;
-
- conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
-
- conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
- conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
-
- conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE;
- conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE;
- conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE;
-
- conf->upstream.pass_request_headers = NGX_CONF_UNSET;
- conf->upstream.pass_request_body = NGX_CONF_UNSET;
-
-#if (NGX_HTTP_CACHE)
- conf->upstream.cache = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
- conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
- conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_lock = NGX_CONF_UNSET;
- conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.cache_revalidate = NGX_CONF_UNSET;
-#endif
-
- conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
- conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
-
- conf->upstream.intercept_errors = NGX_CONF_UNSET;
-
-#if (NGX_HTTP_SSL)
- conf->upstream.ssl_session_reuse = NGX_CONF_UNSET;
- conf->upstream.ssl_server_name = NGX_CONF_UNSET;
- conf->upstream.ssl_verify = NGX_CONF_UNSET;
- conf->ssl_verify_depth = NGX_CONF_UNSET_UINT;
-#endif
-
- /* "proxy_cyclic_temp_file" is disabled */
- conf->upstream.cyclic_temp_file = 0;
-
- conf->redirect = NGX_CONF_UNSET;
- conf->upstream.change_buffering = 1;
-
- conf->cookie_domains = NGX_CONF_UNSET_PTR;
- conf->cookie_paths = NGX_CONF_UNSET_PTR;
-
- conf->http_version = NGX_CONF_UNSET_UINT;
-
- conf->headers_hash_max_size = NGX_CONF_UNSET_UINT;
- conf->headers_hash_bucket_size = NGX_CONF_UNSET_UINT;
-
- ngx_str_set(&conf->upstream.module, "proxy");
-
- return conf;
-}
-
-
-static char *
-ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_proxy_loc_conf_t *prev = parent;
- ngx_http_proxy_loc_conf_t *conf = child;
-
- u_char *p;
- size_t size;
- ngx_hash_init_t hash;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_proxy_rewrite_t *pr;
- ngx_http_script_compile_t sc;
-
- if (conf->upstream.store != 0) {
- ngx_conf_merge_value(conf->upstream.store,
- prev->upstream.store, 0);
-
- if (conf->upstream.store_lengths == NULL) {
- conf->upstream.store_lengths = prev->upstream.store_lengths;
- conf->upstream.store_values = prev->upstream.store_values;
- }
- }
-
- ngx_conf_merge_uint_value(conf->upstream.store_access,
- prev->upstream.store_access, 0600);
-
- ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
- prev->upstream.next_upstream_tries, 0);
-
- ngx_conf_merge_value(conf->upstream.buffering,
- prev->upstream.buffering, 1);
-
- ngx_conf_merge_value(conf->upstream.ignore_client_abort,
- prev->upstream.ignore_client_abort, 0);
-
- ngx_conf_merge_ptr_value(conf->upstream.local,
- prev->upstream.local, NULL);
-
- ngx_conf_merge_msec_value(conf->upstream.connect_timeout,
- prev->upstream.connect_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.send_timeout,
- prev->upstream.send_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.read_timeout,
- prev->upstream.read_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
- prev->upstream.next_upstream_timeout, 0);
-
- ngx_conf_merge_size_value(conf->upstream.send_lowat,
- prev->upstream.send_lowat, 0);
-
- ngx_conf_merge_size_value(conf->upstream.buffer_size,
- prev->upstream.buffer_size,
- (size_t) ngx_pagesize);
-
- ngx_conf_merge_bufs_value(conf->upstream.bufs, prev->upstream.bufs,
- 8, ngx_pagesize);
-
- if (conf->upstream.bufs.num < 2) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "there must be at least 2 \"proxy_buffers\"");
- return NGX_CONF_ERROR;
- }
-
-
- size = conf->upstream.buffer_size;
- if (size < conf->upstream.bufs.size) {
- size = conf->upstream.bufs.size;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.busy_buffers_size_conf,
- prev->upstream.busy_buffers_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.busy_buffers_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.busy_buffers_size = 2 * size;
- } else {
- conf->upstream.busy_buffers_size =
- conf->upstream.busy_buffers_size_conf;
- }
-
- if (conf->upstream.busy_buffers_size < size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_busy_buffers_size\" must be equal to or greater than "
- "the maximum of the value of \"proxy_buffer_size\" and "
- "one of the \"proxy_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
- if (conf->upstream.busy_buffers_size
- > (conf->upstream.bufs.num - 1) * conf->upstream.bufs.size)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_busy_buffers_size\" must be less than "
- "the size of all \"proxy_buffers\" minus one buffer");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.temp_file_write_size_conf,
- prev->upstream.temp_file_write_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.temp_file_write_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.temp_file_write_size = 2 * size;
- } else {
- conf->upstream.temp_file_write_size =
- conf->upstream.temp_file_write_size_conf;
- }
-
- if (conf->upstream.temp_file_write_size < size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_temp_file_write_size\" must be equal to or greater "
- "than the maximum of the value of \"proxy_buffer_size\" and "
- "one of the \"proxy_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_size_value(conf->upstream.max_temp_file_size_conf,
- prev->upstream.max_temp_file_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.max_temp_file_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.max_temp_file_size = 1024 * 1024 * 1024;
- } else {
- conf->upstream.max_temp_file_size =
- conf->upstream.max_temp_file_size_conf;
- }
-
- if (conf->upstream.max_temp_file_size != 0
- && conf->upstream.max_temp_file_size < size)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_max_temp_file_size\" must be equal to zero to disable "
- "temporary files usage or must be equal to or greater than "
- "the maximum of the value of \"proxy_buffer_size\" and "
- "one of the \"proxy_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_bitmask_value(conf->upstream.ignore_headers,
- prev->upstream.ignore_headers,
- NGX_CONF_BITMASK_SET);
-
-
- ngx_conf_merge_bitmask_value(conf->upstream.next_upstream,
- prev->upstream.next_upstream,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_ERROR
- |NGX_HTTP_UPSTREAM_FT_TIMEOUT));
-
- if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) {
- conf->upstream.next_upstream = NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF;
- }
-
- if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path,
- prev->upstream.temp_path,
- &ngx_http_proxy_temp_path)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
-
-#if (NGX_HTTP_CACHE)
-
- ngx_conf_merge_ptr_value(conf->upstream.cache,
- prev->upstream.cache, NULL);
-
- if (conf->upstream.cache && conf->upstream.cache->data == NULL) {
- ngx_shm_zone_t *shm_zone;
-
- shm_zone = conf->upstream.cache;
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_cache\" zone \"%V\" is unknown",
- &shm_zone->shm.name);
-
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_uint_value(conf->upstream.cache_min_uses,
- prev->upstream.cache_min_uses, 1);
-
- ngx_conf_merge_bitmask_value(conf->upstream.cache_use_stale,
- prev->upstream.cache_use_stale,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF));
-
- if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
- conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF;
- }
-
- if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) {
- conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE;
- }
-
- if (conf->upstream.cache_methods == 0) {
- conf->upstream.cache_methods = prev->upstream.cache_methods;
- }
-
- conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD;
-
- ngx_conf_merge_ptr_value(conf->upstream.cache_bypass,
- prev->upstream.cache_bypass, NULL);
-
- ngx_conf_merge_ptr_value(conf->upstream.no_cache,
- prev->upstream.no_cache, NULL);
-
- ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
- prev->upstream.cache_valid, NULL);
-
- if (conf->cache_key.value.data == NULL) {
- conf->cache_key = prev->cache_key;
- }
-
- ngx_conf_merge_value(conf->upstream.cache_lock,
- prev->upstream.cache_lock, 0);
-
- ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout,
- prev->upstream.cache_lock_timeout, 5000);
-
- ngx_conf_merge_value(conf->upstream.cache_revalidate,
- prev->upstream.cache_revalidate, 0);
-
-#endif
-
- ngx_conf_merge_str_value(conf->method, prev->method, "");
-
- if (conf->method.len
- && conf->method.data[conf->method.len - 1] != ' ')
- {
- conf->method.data[conf->method.len] = ' ';
- conf->method.len++;
- }
-
- ngx_conf_merge_value(conf->upstream.pass_request_headers,
- prev->upstream.pass_request_headers, 1);
- ngx_conf_merge_value(conf->upstream.pass_request_body,
- prev->upstream.pass_request_body, 1);
-
- ngx_conf_merge_value(conf->upstream.intercept_errors,
- prev->upstream.intercept_errors, 0);
-
-#if (NGX_HTTP_SSL)
-
- ngx_conf_merge_value(conf->upstream.ssl_session_reuse,
- prev->upstream.ssl_session_reuse, 1);
-
- ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
- (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3
- |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
- |NGX_SSL_TLSv1_2));
-
- ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers,
- "DEFAULT");
-
- if (conf->upstream.ssl_name == NULL) {
- conf->upstream.ssl_name = prev->upstream.ssl_name;
- }
-
- ngx_conf_merge_value(conf->upstream.ssl_server_name,
- prev->upstream.ssl_server_name, 0);
- ngx_conf_merge_value(conf->upstream.ssl_verify,
- prev->upstream.ssl_verify, 0);
- ngx_conf_merge_uint_value(conf->ssl_verify_depth,
- prev->ssl_verify_depth, 1);
- ngx_conf_merge_str_value(conf->ssl_trusted_certificate,
- prev->ssl_trusted_certificate, "");
- ngx_conf_merge_str_value(conf->ssl_crl, prev->ssl_crl, "");
-
- if (conf->ssl && ngx_http_proxy_set_ssl(cf, conf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
-#endif
-
- ngx_conf_merge_value(conf->redirect, prev->redirect, 1);
-
- if (conf->redirect) {
-
- if (conf->redirects == NULL) {
- conf->redirects = prev->redirects;
- }
-
- if (conf->redirects == NULL && conf->url.data) {
-
- conf->redirects = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_proxy_rewrite_t));
- if (conf->redirects == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pr = ngx_array_push(conf->redirects);
- if (pr == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(&pr->pattern.complex,
- sizeof(ngx_http_complex_value_t));
-
- ngx_memzero(&pr->replacement, sizeof(ngx_http_complex_value_t));
-
- pr->handler = ngx_http_proxy_rewrite_complex_handler;
-
- if (conf->vars.uri.len) {
- pr->pattern.complex.value = conf->url;
- pr->replacement.value = conf->location;
-
- } else {
- pr->pattern.complex.value.len = conf->url.len
- + sizeof("/") - 1;
-
- p = ngx_pnalloc(cf->pool, pr->pattern.complex.value.len);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pr->pattern.complex.value.data = p;
-
- p = ngx_cpymem(p, conf->url.data, conf->url.len);
- *p = '/';
-
- ngx_str_set(&pr->replacement.value, "/");
- }
- }
- }
-
- ngx_conf_merge_ptr_value(conf->cookie_domains, prev->cookie_domains, NULL);
-
- ngx_conf_merge_ptr_value(conf->cookie_paths, prev->cookie_paths, NULL);
-
-#if (NGX_HTTP_SSL)
- if (conf->upstream.ssl == NULL) {
- conf->upstream.ssl = prev->upstream.ssl;
- }
-#endif
-
- ngx_conf_merge_uint_value(conf->http_version, prev->http_version,
- NGX_HTTP_VERSION_10);
-
- ngx_conf_merge_uint_value(conf->headers_hash_max_size,
- prev->headers_hash_max_size, 512);
-
- ngx_conf_merge_uint_value(conf->headers_hash_bucket_size,
- prev->headers_hash_bucket_size, 64);
-
- conf->headers_hash_bucket_size = ngx_align(conf->headers_hash_bucket_size,
- ngx_cacheline_size);
-
- hash.max_size = conf->headers_hash_max_size;
- hash.bucket_size = conf->headers_hash_bucket_size;
- hash.name = "proxy_headers_hash";
-
- if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream,
- &prev->upstream, ngx_http_proxy_hide_headers, &hash)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- if (conf->upstream.upstream == NULL) {
- conf->upstream.upstream = prev->upstream.upstream;
- conf->vars = prev->vars;
- }
-
- if (conf->proxy_lengths == NULL) {
- conf->proxy_lengths = prev->proxy_lengths;
- conf->proxy_values = prev->proxy_values;
- }
-
- if (conf->upstream.upstream || conf->proxy_lengths) {
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- if (clcf->handler == NULL && clcf->lmt_excpt) {
- clcf->handler = ngx_http_proxy_handler;
- conf->location = prev->location;
- }
- }
-
- if (conf->body_source.data == NULL) {
- conf->body_source = prev->body_source;
- conf->body_set_len = prev->body_set_len;
- conf->body_set = prev->body_set;
- }
-
- if (conf->body_source.data && conf->body_set_len == NULL) {
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &conf->body_source;
- sc.flushes = &conf->flushes;
- sc.lengths = &conf->body_set_len;
- sc.values = &conf->body_set;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- if (ngx_http_proxy_merge_headers(cf, conf, prev) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_merge_headers(ngx_conf_t *cf, ngx_http_proxy_loc_conf_t *conf,
- ngx_http_proxy_loc_conf_t *prev)
-{
- u_char *p;
- size_t size;
- uintptr_t *code;
- ngx_uint_t i;
- ngx_array_t headers_names, headers_merged;
- ngx_keyval_t *src, *s, *h;
- ngx_hash_key_t *hk;
- ngx_hash_init_t hash;
- ngx_http_script_compile_t sc;
- ngx_http_script_copy_code_t *copy;
-
- if (conf->headers_source == NULL) {
- conf->flushes = prev->flushes;
- conf->headers_set_len = prev->headers_set_len;
- conf->headers_set = prev->headers_set;
- conf->headers_set_hash = prev->headers_set_hash;
- conf->headers_source = prev->headers_source;
- }
-
- if (conf->headers_set_hash.buckets
-#if (NGX_HTTP_CACHE)
- && ((conf->upstream.cache == NULL) == (prev->upstream.cache == NULL))
-#endif
- )
- {
- return NGX_OK;
- }
-
-
- if (ngx_array_init(&headers_names, cf->temp_pool, 4, sizeof(ngx_hash_key_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&headers_merged, cf->temp_pool, 4, sizeof(ngx_keyval_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (conf->headers_source == NULL) {
- conf->headers_source = ngx_array_create(cf->pool, 4,
- sizeof(ngx_keyval_t));
- if (conf->headers_source == NULL) {
- return NGX_ERROR;
- }
- }
-
- conf->headers_set_len = ngx_array_create(cf->pool, 64, 1);
- if (conf->headers_set_len == NULL) {
- return NGX_ERROR;
- }
-
- conf->headers_set = ngx_array_create(cf->pool, 512, 1);
- if (conf->headers_set == NULL) {
- return NGX_ERROR;
- }
-
-
-#if (NGX_HTTP_CACHE)
-
- h = conf->upstream.cache ? ngx_http_proxy_cache_headers:
- ngx_http_proxy_headers;
-#else
-
- h = ngx_http_proxy_headers;
-
-#endif
-
- src = conf->headers_source->elts;
- for (i = 0; i < conf->headers_source->nelts; i++) {
-
- s = ngx_array_push(&headers_merged);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = src[i];
- }
-
- while (h->key.len) {
-
- src = headers_merged.elts;
- for (i = 0; i < headers_merged.nelts; i++) {
- if (ngx_strcasecmp(h->key.data, src[i].key.data) == 0) {
- goto next;
- }
- }
-
- s = ngx_array_push(&headers_merged);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = *h;
-
- next:
-
- h++;
- }
-
-
- src = headers_merged.elts;
- for (i = 0; i < headers_merged.nelts; i++) {
-
- hk = ngx_array_push(&headers_names);
- if (hk == NULL) {
- return NGX_ERROR;
- }
-
- hk->key = src[i].key;
- hk->key_hash = ngx_hash_key_lc(src[i].key.data, src[i].key.len);
- hk->value = (void *) 1;
-
- if (src[i].value.len == 0) {
- continue;
- }
-
- if (ngx_http_script_variables_count(&src[i].value) == 0) {
- copy = ngx_array_push_n(conf->headers_set_len,
- sizeof(ngx_http_script_copy_code_t));
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = (ngx_http_script_code_pt)
- ngx_http_script_copy_len_code;
- copy->len = src[i].key.len + sizeof(": ") - 1
- + src[i].value.len + sizeof(CRLF) - 1;
-
-
- size = (sizeof(ngx_http_script_copy_code_t)
- + src[i].key.len + sizeof(": ") - 1
- + src[i].value.len + sizeof(CRLF) - 1
- + sizeof(uintptr_t) - 1)
- & ~(sizeof(uintptr_t) - 1);
-
- copy = ngx_array_push_n(conf->headers_set, size);
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = ngx_http_script_copy_code;
- copy->len = src[i].key.len + sizeof(": ") - 1
- + src[i].value.len + sizeof(CRLF) - 1;
-
- p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
-
- p = ngx_cpymem(p, src[i].key.data, src[i].key.len);
- *p++ = ':'; *p++ = ' ';
- p = ngx_cpymem(p, src[i].value.data, src[i].value.len);
- *p++ = CR; *p = LF;
-
- } else {
- copy = ngx_array_push_n(conf->headers_set_len,
- sizeof(ngx_http_script_copy_code_t));
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = (ngx_http_script_code_pt)
- ngx_http_script_copy_len_code;
- copy->len = src[i].key.len + sizeof(": ") - 1;
-
-
- size = (sizeof(ngx_http_script_copy_code_t)
- + src[i].key.len + sizeof(": ") - 1 + sizeof(uintptr_t) - 1)
- & ~(sizeof(uintptr_t) - 1);
-
- copy = ngx_array_push_n(conf->headers_set, size);
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = ngx_http_script_copy_code;
- copy->len = src[i].key.len + sizeof(": ") - 1;
-
- p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
- p = ngx_cpymem(p, src[i].key.data, src[i].key.len);
- *p++ = ':'; *p = ' ';
-
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &src[i].value;
- sc.flushes = &conf->flushes;
- sc.lengths = &conf->headers_set_len;
- sc.values = &conf->headers_set;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_ERROR;
- }
-
-
- copy = ngx_array_push_n(conf->headers_set_len,
- sizeof(ngx_http_script_copy_code_t));
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = (ngx_http_script_code_pt)
- ngx_http_script_copy_len_code;
- copy->len = sizeof(CRLF) - 1;
-
-
- size = (sizeof(ngx_http_script_copy_code_t)
- + sizeof(CRLF) - 1 + sizeof(uintptr_t) - 1)
- & ~(sizeof(uintptr_t) - 1);
-
- copy = ngx_array_push_n(conf->headers_set, size);
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = ngx_http_script_copy_code;
- copy->len = sizeof(CRLF) - 1;
-
- p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
- *p++ = CR; *p = LF;
- }
-
- code = ngx_array_push_n(conf->headers_set_len, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
- code = ngx_array_push_n(conf->headers_set, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
- }
-
- code = ngx_array_push_n(conf->headers_set_len, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
-
- hash.hash = &conf->headers_set_hash;
- hash.key = ngx_hash_key_lc;
- hash.max_size = conf->headers_hash_max_size;
- hash.bucket_size = conf->headers_hash_bucket_size;
- hash.name = "proxy_headers_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- return ngx_hash_init(&hash, headers_names.elts, headers_names.nelts);
-}
-
-
-static char *
-ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_proxy_loc_conf_t *plcf = conf;
-
- size_t add;
- u_short port;
- ngx_str_t *value, *url;
- ngx_url_t u;
- ngx_uint_t n;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_script_compile_t sc;
-
- if (plcf->upstream.upstream || plcf->proxy_lengths) {
- return "is duplicate";
- }
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
-
- clcf->handler = ngx_http_proxy_handler;
-
- if (clcf->name.data[clcf->name.len - 1] == '/') {
- clcf->auto_redirect = 1;
- }
-
- value = cf->args->elts;
-
- url = &value[1];
-
- n = ngx_http_script_variables_count(url);
-
- if (n) {
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = url;
- sc.lengths = &plcf->proxy_lengths;
- sc.values = &plcf->proxy_values;
- sc.variables = n;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
-#if (NGX_HTTP_SSL)
- plcf->ssl = 1;
-#endif
-
- return NGX_CONF_OK;
- }
-
- if (ngx_strncasecmp(url->data, (u_char *) "http://", 7) == 0) {
- add = 7;
- port = 80;
-
- } else if (ngx_strncasecmp(url->data, (u_char *) "https://", 8) == 0) {
-
-#if (NGX_HTTP_SSL)
- plcf->ssl = 1;
-
- add = 8;
- port = 443;
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "https protocol requires SSL support");
- return NGX_CONF_ERROR;
-#endif
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid URL prefix");
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url.len = url->len - add;
- u.url.data = url->data + add;
- u.default_port = port;
- u.uri_part = 1;
- u.no_resolve = 1;
-
- plcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0);
- if (plcf->upstream.upstream == NULL) {
- return NGX_CONF_ERROR;
- }
-
- plcf->vars.schema.len = add;
- plcf->vars.schema.data = url->data;
- plcf->vars.key_start = plcf->vars.schema;
-
- ngx_http_proxy_set_vars(&u, &plcf->vars);
-
- plcf->location = clcf->name;
-
- if (clcf->named
-#if (NGX_PCRE)
- || clcf->regex
-#endif
- || clcf->noname)
- {
- if (plcf->vars.uri.len) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_pass\" cannot have URI part in "
- "location given by regular expression, "
- "or inside named location, "
- "or inside \"if\" statement, "
- "or inside \"limit_except\" block");
- return NGX_CONF_ERROR;
- }
-
- plcf->location.len = 0;
- }
-
- plcf->url = *url;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_proxy_redirect(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_proxy_loc_conf_t *plcf = conf;
-
- u_char *p;
- ngx_str_t *value;
- ngx_http_proxy_rewrite_t *pr;
- ngx_http_compile_complex_value_t ccv;
-
- if (plcf->redirect == 0) {
- return NGX_CONF_OK;
- }
-
- plcf->redirect = 1;
-
- value = cf->args->elts;
-
- if (cf->args->nelts == 2) {
- if (ngx_strcmp(value[1].data, "off") == 0) {
- plcf->redirect = 0;
- plcf->redirects = NULL;
- return NGX_CONF_OK;
- }
-
- if (ngx_strcmp(value[1].data, "false") == 0) {
- ngx_conf_log_error(NGX_LOG_ERR, cf, 0,
- "invalid parameter \"false\", use \"off\" instead");
- plcf->redirect = 0;
- plcf->redirects = NULL;
- return NGX_CONF_OK;
- }
-
- if (ngx_strcmp(value[1].data, "default") != 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
- }
-
- if (plcf->redirects == NULL) {
- plcf->redirects = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_proxy_rewrite_t));
- if (plcf->redirects == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- pr = ngx_array_push(plcf->redirects);
- if (pr == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_strcmp(value[1].data, "default") == 0) {
- if (plcf->proxy_lengths) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_redirect default\" cannot be used "
- "with \"proxy_pass\" directive with variables");
- return NGX_CONF_ERROR;
- }
-
- if (plcf->url.data == NULL) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_redirect default\" should be placed "
- "after the \"proxy_pass\" directive");
- return NGX_CONF_ERROR;
- }
-
- pr->handler = ngx_http_proxy_rewrite_complex_handler;
-
- ngx_memzero(&pr->pattern.complex, sizeof(ngx_http_complex_value_t));
-
- ngx_memzero(&pr->replacement, sizeof(ngx_http_complex_value_t));
-
- if (plcf->vars.uri.len) {
- pr->pattern.complex.value = plcf->url;
- pr->replacement.value = plcf->location;
-
- } else {
- pr->pattern.complex.value.len = plcf->url.len + sizeof("/") - 1;
-
- p = ngx_pnalloc(cf->pool, pr->pattern.complex.value.len);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pr->pattern.complex.value.data = p;
-
- p = ngx_cpymem(p, plcf->url.data, plcf->url.len);
- *p = '/';
-
- ngx_str_set(&pr->replacement.value, "/");
- }
-
- return NGX_CONF_OK;
- }
-
-
- if (value[1].data[0] == '~') {
- value[1].len--;
- value[1].data++;
-
- if (value[1].data[0] == '*') {
- value[1].len--;
- value[1].data++;
-
- if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 1) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- } else {
- if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- } else {
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &pr->pattern.complex;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- pr->handler = ngx_http_proxy_rewrite_complex_handler;
- }
-
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[2];
- ccv.complex_value = &pr->replacement;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_proxy_cookie_domain(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_proxy_loc_conf_t *plcf = conf;
-
- ngx_str_t *value;
- ngx_http_proxy_rewrite_t *pr;
- ngx_http_compile_complex_value_t ccv;
-
- if (plcf->cookie_domains == NULL) {
- return NGX_CONF_OK;
- }
-
- value = cf->args->elts;
-
- if (cf->args->nelts == 2) {
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- plcf->cookie_domains = NULL;
- return NGX_CONF_OK;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- if (plcf->cookie_domains == NGX_CONF_UNSET_PTR) {
- plcf->cookie_domains = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_proxy_rewrite_t));
- if (plcf->cookie_domains == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- pr = ngx_array_push(plcf->cookie_domains);
- if (pr == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (value[1].data[0] == '~') {
- value[1].len--;
- value[1].data++;
-
- if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 1) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- } else {
-
- if (value[1].data[0] == '.') {
- value[1].len--;
- value[1].data++;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &pr->pattern.complex;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- pr->handler = ngx_http_proxy_rewrite_domain_handler;
-
- if (value[2].data[0] == '.') {
- value[2].len--;
- value[2].data++;
- }
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[2];
- ccv.complex_value = &pr->replacement;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_proxy_cookie_path(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_proxy_loc_conf_t *plcf = conf;
-
- ngx_str_t *value;
- ngx_http_proxy_rewrite_t *pr;
- ngx_http_compile_complex_value_t ccv;
-
- if (plcf->cookie_paths == NULL) {
- return NGX_CONF_OK;
- }
-
- value = cf->args->elts;
-
- if (cf->args->nelts == 2) {
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- plcf->cookie_paths = NULL;
- return NGX_CONF_OK;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- if (plcf->cookie_paths == NGX_CONF_UNSET_PTR) {
- plcf->cookie_paths = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_proxy_rewrite_t));
- if (plcf->cookie_paths == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- pr = ngx_array_push(plcf->cookie_paths);
- if (pr == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (value[1].data[0] == '~') {
- value[1].len--;
- value[1].data++;
-
- if (value[1].data[0] == '*') {
- value[1].len--;
- value[1].data++;
-
- if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 1) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- } else {
- if (ngx_http_proxy_rewrite_regex(cf, pr, &value[1], 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- } else {
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &pr->pattern.complex;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- pr->handler = ngx_http_proxy_rewrite_complex_handler;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[2];
- ccv.complex_value = &pr->replacement;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_proxy_rewrite_regex(ngx_conf_t *cf, ngx_http_proxy_rewrite_t *pr,
- ngx_str_t *regex, ngx_uint_t caseless)
-{
-#if (NGX_PCRE)
- u_char errstr[NGX_MAX_CONF_ERRSTR];
- ngx_regex_compile_t rc;
-
- ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
-
- rc.pattern = *regex;
- rc.err.len = NGX_MAX_CONF_ERRSTR;
- rc.err.data = errstr;
-
- if (caseless) {
- rc.options = NGX_REGEX_CASELESS;
- }
-
- pr->pattern.regex = ngx_http_regex_compile(cf, &rc);
- if (pr->pattern.regex == NULL) {
- return NGX_ERROR;
- }
-
- pr->handler = ngx_http_proxy_rewrite_regex_handler;
-
- return NGX_OK;
-
-#else
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "using regex \"%V\" requires PCRE library", regex);
- return NGX_ERROR;
-
-#endif
-}
-
-
-static char *
-ngx_http_proxy_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_proxy_loc_conf_t *plcf = conf;
-
- ngx_str_t *value;
- ngx_http_script_compile_t sc;
-
- if (plcf->upstream.store != NGX_CONF_UNSET
- || plcf->upstream.store_lengths)
- {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- plcf->upstream.store = 0;
- return NGX_CONF_OK;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (plcf->upstream.cache != NGX_CONF_UNSET_PTR
- && plcf->upstream.cache != NULL)
- {
- return "is incompatible with \"proxy_cache\"";
- }
-
-#endif
-
- if (ngx_strcmp(value[1].data, "on") == 0) {
- plcf->upstream.store = 1;
- return NGX_CONF_OK;
- }
-
- /* include the terminating '\0' into script */
- value[1].len++;
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &value[1];
- sc.lengths = &plcf->upstream.store_lengths;
- sc.values = &plcf->upstream.store_values;
- sc.variables = ngx_http_script_variables_count(&value[1]);
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-static char *
-ngx_http_proxy_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_proxy_loc_conf_t *plcf = conf;
-
- ngx_str_t *value;
-
- value = cf->args->elts;
-
- if (plcf->upstream.cache != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- plcf->upstream.cache = NULL;
- return NGX_CONF_OK;
- }
-
- if (plcf->upstream.store > 0 || plcf->upstream.store_lengths) {
- return "is incompatible with \"proxy_store\"";
- }
-
- plcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0,
- &ngx_http_proxy_module);
- if (plcf->upstream.cache == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_proxy_cache_key(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_proxy_loc_conf_t *plcf = conf;
-
- ngx_str_t *value;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- if (plcf->cache_key.value.data) {
- return "is duplicate";
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &plcf->cache_key;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-#endif
-
-
-static char *
-ngx_http_proxy_lowat_check(ngx_conf_t *cf, void *post, void *data)
-{
-#if (NGX_FREEBSD)
- ssize_t *np = data;
-
- if ((u_long) *np >= ngx_freebsd_net_inet_tcp_sendspace) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_send_lowat\" must be less than %d "
- "(sysctl net.inet.tcp.sendspace)",
- ngx_freebsd_net_inet_tcp_sendspace);
-
- return NGX_CONF_ERROR;
- }
-
-#elif !(NGX_HAVE_SO_SNDLOWAT)
- ssize_t *np = data;
-
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "\"proxy_send_lowat\" is not supported, ignored");
-
- *np = 0;
-
-#endif
-
- return NGX_CONF_OK;
-}
-
-
-#if (NGX_HTTP_SSL)
-
-static ngx_int_t
-ngx_http_proxy_set_ssl(ngx_conf_t *cf, ngx_http_proxy_loc_conf_t *plcf)
-{
- ngx_pool_cleanup_t *cln;
-
- plcf->upstream.ssl = ngx_pcalloc(cf->pool, sizeof(ngx_ssl_t));
- if (plcf->upstream.ssl == NULL) {
- return NGX_ERROR;
- }
-
- plcf->upstream.ssl->log = cf->log;
-
- if (ngx_ssl_create(plcf->upstream.ssl, plcf->ssl_protocols, NULL)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- cln = ngx_pool_cleanup_add(cf->pool, 0);
- if (cln == NULL) {
- return NGX_ERROR;
- }
-
- cln->handler = ngx_ssl_cleanup_ctx;
- cln->data = plcf->upstream.ssl;
-
- if (SSL_CTX_set_cipher_list(plcf->upstream.ssl->ctx,
- (const char *) plcf->ssl_ciphers.data)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
- "SSL_CTX_set_cipher_list(\"%V\") failed",
- &plcf->ssl_ciphers);
- return NGX_ERROR;
- }
-
- if (plcf->upstream.ssl_verify) {
- if (plcf->ssl_trusted_certificate.len == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no proxy_ssl_trusted_certificate for proxy_ssl_verify");
- return NGX_ERROR;
- }
-
- if (ngx_ssl_trusted_certificate(cf, plcf->upstream.ssl,
- &plcf->ssl_trusted_certificate,
- plcf->ssl_verify_depth)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (ngx_ssl_crl(cf, plcf->upstream.ssl, &plcf->ssl_crl) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
-
-#endif
-
-
-static void
-ngx_http_proxy_set_vars(ngx_url_t *u, ngx_http_proxy_vars_t *v)
-{
- if (u->family != AF_UNIX) {
-
- if (u->no_port || u->port == u->default_port) {
-
- v->host_header = u->host;
-
- if (u->default_port == 80) {
- ngx_str_set(&v->port, "80");
-
- } else {
- ngx_str_set(&v->port, "443");
- }
-
- } else {
- v->host_header.len = u->host.len + 1 + u->port_text.len;
- v->host_header.data = u->host.data;
- v->port = u->port_text;
- }
-
- v->key_start.len += v->host_header.len;
-
- } else {
- ngx_str_set(&v->host_header, "localhost");
- ngx_str_null(&v->port);
- v->key_start.len += sizeof("unix:") - 1 + u->host.len + 1;
- }
-
- v->uri = u->uri;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_random_index_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_random_index_module.c
deleted file mode 100644
index b0f0e080912..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_random_index_module.c
+++ /dev/null
@@ -1,317 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_flag_t enable;
-} ngx_http_random_index_loc_conf_t;
-
-
-#define NGX_HTTP_RANDOM_INDEX_PREALLOCATE 50
-
-
-static ngx_int_t ngx_http_random_index_error(ngx_http_request_t *r,
- ngx_dir_t *dir, ngx_str_t *name);
-static ngx_int_t ngx_http_random_index_init(ngx_conf_t *cf);
-static void *ngx_http_random_index_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_random_index_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-
-
-static ngx_command_t ngx_http_random_index_commands[] = {
-
- { ngx_string("random_index"),
- NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_random_index_loc_conf_t, enable),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_random_index_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_random_index_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_random_index_create_loc_conf, /* create location configuration */
- ngx_http_random_index_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_random_index_module = {
- NGX_MODULE_V1,
- &ngx_http_random_index_module_ctx, /* module context */
- ngx_http_random_index_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_random_index_handler(ngx_http_request_t *r)
-{
- u_char *last, *filename;
- size_t len, allocated, root;
- ngx_err_t err;
- ngx_int_t rc;
- ngx_str_t path, uri, *name;
- ngx_dir_t dir;
- ngx_uint_t n, level;
- ngx_array_t names;
- ngx_http_random_index_loc_conf_t *rlcf;
-
- if (r->uri.data[r->uri.len - 1] != '/') {
- return NGX_DECLINED;
- }
-
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
- return NGX_DECLINED;
- }
-
- rlcf = ngx_http_get_module_loc_conf(r, ngx_http_random_index_module);
-
- if (!rlcf->enable) {
- return NGX_DECLINED;
- }
-
-#if (NGX_HAVE_D_TYPE)
- len = NGX_DIR_MASK_LEN;
-#else
- len = NGX_HTTP_RANDOM_INDEX_PREALLOCATE;
-#endif
-
- last = ngx_http_map_uri_to_path(r, &path, &root, len);
- if (last == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- allocated = path.len;
-
- path.len = last - path.data - 1;
- path.data[path.len] = '\0';
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http random index: \"%s\"", path.data);
-
- if (ngx_open_dir(&path, &dir) == NGX_ERROR) {
- err = ngx_errno;
-
- if (err == NGX_ENOENT
- || err == NGX_ENOTDIR
- || err == NGX_ENAMETOOLONG)
- {
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_NOT_FOUND;
-
- } else if (err == NGX_EACCES) {
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_FORBIDDEN;
-
- } else {
- level = NGX_LOG_CRIT;
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_log_error(level, r->connection->log, err,
- ngx_open_dir_n " \"%s\" failed", path.data);
-
- return rc;
- }
-
- if (ngx_array_init(&names, r->pool, 32, sizeof(ngx_str_t)) != NGX_OK) {
- return ngx_http_random_index_error(r, &dir, &path);
- }
-
- filename = path.data;
- filename[path.len] = '/';
-
- for ( ;; ) {
- ngx_set_errno(0);
-
- if (ngx_read_dir(&dir) == NGX_ERROR) {
- err = ngx_errno;
-
- if (err != NGX_ENOMOREFILES) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
- ngx_read_dir_n " \"%V\" failed", &path);
- return ngx_http_random_index_error(r, &dir, &path);
- }
-
- break;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http random index file: \"%s\"", ngx_de_name(&dir));
-
- if (ngx_de_name(&dir)[0] == '.') {
- continue;
- }
-
- len = ngx_de_namelen(&dir);
-
- if (dir.type == 0 || ngx_de_is_link(&dir)) {
-
- /* 1 byte for '/' and 1 byte for terminating '\0' */
-
- if (path.len + 1 + len + 1 > allocated) {
- allocated = path.len + 1 + len + 1
- + NGX_HTTP_RANDOM_INDEX_PREALLOCATE;
-
- filename = ngx_pnalloc(r->pool, allocated);
- if (filename == NULL) {
- return ngx_http_random_index_error(r, &dir, &path);
- }
-
- last = ngx_cpystrn(filename, path.data, path.len + 1);
- *last++ = '/';
- }
-
- ngx_cpystrn(last, ngx_de_name(&dir), len + 1);
-
- if (ngx_de_info(filename, &dir) == NGX_FILE_ERROR) {
- err = ngx_errno;
-
- if (err != NGX_ENOENT) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
- ngx_de_info_n " \"%s\" failed", filename);
- return ngx_http_random_index_error(r, &dir, &path);
- }
-
- if (ngx_de_link_info(filename, &dir) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- ngx_de_link_info_n " \"%s\" failed",
- filename);
- return ngx_http_random_index_error(r, &dir, &path);
- }
- }
- }
-
- if (!ngx_de_is_file(&dir)) {
- continue;
- }
-
- name = ngx_array_push(&names);
- if (name == NULL) {
- return ngx_http_random_index_error(r, &dir, &path);
- }
-
- name->len = len;
-
- name->data = ngx_pnalloc(r->pool, len);
- if (name->data == NULL) {
- return ngx_http_random_index_error(r, &dir, &path);
- }
-
- ngx_memcpy(name->data, ngx_de_name(&dir), len);
- }
-
- if (ngx_close_dir(&dir) == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
- ngx_close_dir_n " \"%s\" failed", &path);
- }
-
- n = names.nelts;
-
- if (n == 0) {
- return NGX_DECLINED;
- }
-
- name = names.elts;
-
- n = (ngx_uint_t) (((uint64_t) ngx_random() * n) / 0x80000000);
-
- uri.len = r->uri.len + name[n].len;
-
- uri.data = ngx_pnalloc(r->pool, uri.len);
- if (uri.data == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- last = ngx_copy(uri.data, r->uri.data, r->uri.len);
- ngx_memcpy(last, name[n].data, name[n].len);
-
- return ngx_http_internal_redirect(r, &uri, &r->args);
-}
-
-
-static ngx_int_t
-ngx_http_random_index_error(ngx_http_request_t *r, ngx_dir_t *dir,
- ngx_str_t *name)
-{
- if (ngx_close_dir(dir) == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
- ngx_close_dir_n " \"%V\" failed", name);
- }
-
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
-}
-
-
-static void *
-ngx_http_random_index_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_random_index_loc_conf_t *conf;
-
- conf = ngx_palloc(cf->pool, sizeof(ngx_http_random_index_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->enable = NGX_CONF_UNSET;
-
- return conf;
-}
-
-
-static char *
-ngx_http_random_index_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_random_index_loc_conf_t *prev = parent;
- ngx_http_random_index_loc_conf_t *conf = child;
-
- ngx_conf_merge_value(conf->enable, prev->enable, 0);
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_random_index_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_CONTENT_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_random_index_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_range_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_range_filter_module.c
deleted file mode 100644
index 6a65e48498d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_range_filter_module.c
+++ /dev/null
@@ -1,890 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-/*
- * the single part format:
- *
- * "HTTP/1.0 206 Partial Content" CRLF
- * ... header ...
- * "Content-Type: image/jpeg" CRLF
- * "Content-Length: SIZE" CRLF
- * "Content-Range: bytes START-END/SIZE" CRLF
- * CRLF
- * ... data ...
- *
- *
- * the multipart format:
- *
- * "HTTP/1.0 206 Partial Content" CRLF
- * ... header ...
- * "Content-Type: multipart/byteranges; boundary=0123456789" CRLF
- * CRLF
- * CRLF
- * "--0123456789" CRLF
- * "Content-Type: image/jpeg" CRLF
- * "Content-Range: bytes START0-END0/SIZE" CRLF
- * CRLF
- * ... data ...
- * CRLF
- * "--0123456789" CRLF
- * "Content-Type: image/jpeg" CRLF
- * "Content-Range: bytes START1-END1/SIZE" CRLF
- * CRLF
- * ... data ...
- * CRLF
- * "--0123456789--" CRLF
- */
-
-
-typedef struct {
- off_t start;
- off_t end;
- ngx_str_t content_range;
-} ngx_http_range_t;
-
-
-typedef struct {
- off_t offset;
- ngx_str_t boundary_header;
- ngx_array_t ranges;
-} ngx_http_range_filter_ctx_t;
-
-
-static ngx_int_t ngx_http_range_parse(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx, ngx_uint_t ranges);
-static ngx_int_t ngx_http_range_singlepart_header(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx);
-static ngx_int_t ngx_http_range_multipart_header(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx);
-static ngx_int_t ngx_http_range_not_satisfiable(ngx_http_request_t *r);
-static ngx_int_t ngx_http_range_test_overlapped(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx, ngx_chain_t *in);
-static ngx_int_t ngx_http_range_singlepart_body(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx, ngx_chain_t *in);
-static ngx_int_t ngx_http_range_multipart_body(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx, ngx_chain_t *in);
-
-static ngx_int_t ngx_http_range_header_filter_init(ngx_conf_t *cf);
-static ngx_int_t ngx_http_range_body_filter_init(ngx_conf_t *cf);
-
-
-static ngx_http_module_t ngx_http_range_header_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_range_header_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL, /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_range_header_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_range_header_filter_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_module_t ngx_http_range_body_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_range_body_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL, /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_range_body_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_range_body_filter_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_range_header_filter(ngx_http_request_t *r)
-{
- time_t if_range_time;
- ngx_str_t *if_range, *etag;
- ngx_uint_t ranges;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_range_filter_ctx_t *ctx;
-
- if (r->http_version < NGX_HTTP_VERSION_10
- || r->headers_out.status != NGX_HTTP_OK
- || r != r->main
- || r->headers_out.content_length_n == -1
- || !r->allow_ranges)
- {
- return ngx_http_next_header_filter(r);
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->max_ranges == 0) {
- return ngx_http_next_header_filter(r);
- }
-
- if (r->headers_in.range == NULL
- || r->headers_in.range->value.len < 7
- || ngx_strncasecmp(r->headers_in.range->value.data,
- (u_char *) "bytes=", 6)
- != 0)
- {
- goto next_filter;
- }
-
- if (r->headers_in.if_range) {
-
- if_range = &r->headers_in.if_range->value;
-
- if (if_range->len >= 2 && if_range->data[if_range->len - 1] == '"') {
-
- if (r->headers_out.etag == NULL) {
- goto next_filter;
- }
-
- etag = &r->headers_out.etag->value;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http ir:%V etag:%V", if_range, etag);
-
- if (if_range->len != etag->len
- || ngx_strncmp(if_range->data, etag->data, etag->len) != 0)
- {
- goto next_filter;
- }
-
- goto parse;
- }
-
- if (r->headers_out.last_modified_time == (time_t) -1) {
- goto next_filter;
- }
-
- if_range_time = ngx_http_parse_time(if_range->data, if_range->len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http ir:%d lm:%d",
- if_range_time, r->headers_out.last_modified_time);
-
- if (if_range_time != r->headers_out.last_modified_time) {
- goto next_filter;
- }
- }
-
-parse:
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_range_filter_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&ctx->ranges, r->pool, 1, sizeof(ngx_http_range_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- ranges = r->single_range ? 1 : clcf->max_ranges;
-
- switch (ngx_http_range_parse(r, ctx, ranges)) {
-
- case NGX_OK:
- ngx_http_set_ctx(r, ctx, ngx_http_range_body_filter_module);
-
- r->headers_out.status = NGX_HTTP_PARTIAL_CONTENT;
- r->headers_out.status_line.len = 0;
-
- if (ctx->ranges.nelts == 1) {
- return ngx_http_range_singlepart_header(r, ctx);
- }
-
- return ngx_http_range_multipart_header(r, ctx);
-
- case NGX_HTTP_RANGE_NOT_SATISFIABLE:
- return ngx_http_range_not_satisfiable(r);
-
- case NGX_ERROR:
- return NGX_ERROR;
-
- default: /* NGX_DECLINED */
- break;
- }
-
-next_filter:
-
- r->headers_out.accept_ranges = ngx_list_push(&r->headers_out.headers);
- if (r->headers_out.accept_ranges == NULL) {
- return NGX_ERROR;
- }
-
- r->headers_out.accept_ranges->hash = 1;
- ngx_str_set(&r->headers_out.accept_ranges->key, "Accept-Ranges");
- ngx_str_set(&r->headers_out.accept_ranges->value, "bytes");
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_range_parse(ngx_http_request_t *r, ngx_http_range_filter_ctx_t *ctx,
- ngx_uint_t ranges)
-{
- u_char *p;
- off_t start, end, size, content_length;
- ngx_uint_t suffix;
- ngx_http_range_t *range;
-
- p = r->headers_in.range->value.data + 6;
- size = 0;
- content_length = r->headers_out.content_length_n;
-
- for ( ;; ) {
- start = 0;
- end = 0;
- suffix = 0;
-
- while (*p == ' ') { p++; }
-
- if (*p != '-') {
- if (*p < '0' || *p > '9') {
- return NGX_HTTP_RANGE_NOT_SATISFIABLE;
- }
-
- while (*p >= '0' && *p <= '9') {
- start = start * 10 + *p++ - '0';
- }
-
- while (*p == ' ') { p++; }
-
- if (*p++ != '-') {
- return NGX_HTTP_RANGE_NOT_SATISFIABLE;
- }
-
- while (*p == ' ') { p++; }
-
- if (*p == ',' || *p == '\0') {
- end = content_length;
- goto found;
- }
-
- } else {
- suffix = 1;
- p++;
- }
-
- if (*p < '0' || *p > '9') {
- return NGX_HTTP_RANGE_NOT_SATISFIABLE;
- }
-
- while (*p >= '0' && *p <= '9') {
- end = end * 10 + *p++ - '0';
- }
-
- while (*p == ' ') { p++; }
-
- if (*p != ',' && *p != '\0') {
- return NGX_HTTP_RANGE_NOT_SATISFIABLE;
- }
-
- if (suffix) {
- start = content_length - end;
- end = content_length - 1;
- }
-
- if (end >= content_length) {
- end = content_length;
-
- } else {
- end++;
- }
-
- found:
-
- if (start < end) {
- range = ngx_array_push(&ctx->ranges);
- if (range == NULL) {
- return NGX_ERROR;
- }
-
- range->start = start;
- range->end = end;
-
- size += end - start;
-
- if (ranges-- == 0) {
- return NGX_DECLINED;
- }
- }
-
- if (*p++ != ',') {
- break;
- }
- }
-
- if (ctx->ranges.nelts == 0) {
- return NGX_HTTP_RANGE_NOT_SATISFIABLE;
- }
-
- if (size > content_length) {
- return NGX_DECLINED;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_range_singlepart_header(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx)
-{
- ngx_table_elt_t *content_range;
- ngx_http_range_t *range;
-
- content_range = ngx_list_push(&r->headers_out.headers);
- if (content_range == NULL) {
- return NGX_ERROR;
- }
-
- r->headers_out.content_range = content_range;
-
- content_range->hash = 1;
- ngx_str_set(&content_range->key, "Content-Range");
-
- content_range->value.data = ngx_pnalloc(r->pool,
- sizeof("bytes -/") - 1 + 3 * NGX_OFF_T_LEN);
- if (content_range->value.data == NULL) {
- return NGX_ERROR;
- }
-
- /* "Content-Range: bytes SSSS-EEEE/TTTT" header */
-
- range = ctx->ranges.elts;
-
- content_range->value.len = ngx_sprintf(content_range->value.data,
- "bytes %O-%O/%O",
- range->start, range->end - 1,
- r->headers_out.content_length_n)
- - content_range->value.data;
-
- r->headers_out.content_length_n = range->end - range->start;
-
- if (r->headers_out.content_length) {
- r->headers_out.content_length->hash = 0;
- r->headers_out.content_length = NULL;
- }
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_range_multipart_header(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx)
-{
- size_t len;
- ngx_uint_t i;
- ngx_http_range_t *range;
- ngx_atomic_uint_t boundary;
-
- len = sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN
- + sizeof(CRLF "Content-Type: ") - 1
- + r->headers_out.content_type.len
- + sizeof(CRLF "Content-Range: bytes ") - 1;
-
- if (r->headers_out.content_type_len == r->headers_out.content_type.len
- && r->headers_out.charset.len)
- {
- len += sizeof("; charset=") - 1 + r->headers_out.charset.len;
- }
-
- ctx->boundary_header.data = ngx_pnalloc(r->pool, len);
- if (ctx->boundary_header.data == NULL) {
- return NGX_ERROR;
- }
-
- boundary = ngx_next_temp_number(0);
-
- /*
- * The boundary header of the range:
- * CRLF
- * "--0123456789" CRLF
- * "Content-Type: image/jpeg" CRLF
- * "Content-Range: bytes "
- */
-
- if (r->headers_out.content_type_len == r->headers_out.content_type.len
- && r->headers_out.charset.len)
- {
- ctx->boundary_header.len = ngx_sprintf(ctx->boundary_header.data,
- CRLF "--%0muA" CRLF
- "Content-Type: %V; charset=%V" CRLF
- "Content-Range: bytes ",
- boundary,
- &r->headers_out.content_type,
- &r->headers_out.charset)
- - ctx->boundary_header.data;
-
- } else if (r->headers_out.content_type.len) {
- ctx->boundary_header.len = ngx_sprintf(ctx->boundary_header.data,
- CRLF "--%0muA" CRLF
- "Content-Type: %V" CRLF
- "Content-Range: bytes ",
- boundary,
- &r->headers_out.content_type)
- - ctx->boundary_header.data;
-
- } else {
- ctx->boundary_header.len = ngx_sprintf(ctx->boundary_header.data,
- CRLF "--%0muA" CRLF
- "Content-Range: bytes ",
- boundary)
- - ctx->boundary_header.data;
- }
-
- r->headers_out.content_type.data =
- ngx_pnalloc(r->pool,
- sizeof("Content-Type: multipart/byteranges; boundary=") - 1
- + NGX_ATOMIC_T_LEN);
-
- if (r->headers_out.content_type.data == NULL) {
- return NGX_ERROR;
- }
-
- r->headers_out.content_type_lowcase = NULL;
-
- /* "Content-Type: multipart/byteranges; boundary=0123456789" */
-
- r->headers_out.content_type.len =
- ngx_sprintf(r->headers_out.content_type.data,
- "multipart/byteranges; boundary=%0muA",
- boundary)
- - r->headers_out.content_type.data;
-
- r->headers_out.content_type_len = r->headers_out.content_type.len;
-
- r->headers_out.charset.len = 0;
-
- /* the size of the last boundary CRLF "--0123456789--" CRLF */
-
- len = sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN + sizeof("--" CRLF) - 1;
-
- range = ctx->ranges.elts;
- for (i = 0; i < ctx->ranges.nelts; i++) {
-
- /* the size of the range: "SSSS-EEEE/TTTT" CRLF CRLF */
-
- range[i].content_range.data =
- ngx_pnalloc(r->pool, 3 * NGX_OFF_T_LEN + 2 + 4);
-
- if (range[i].content_range.data == NULL) {
- return NGX_ERROR;
- }
-
- range[i].content_range.len = ngx_sprintf(range[i].content_range.data,
- "%O-%O/%O" CRLF CRLF,
- range[i].start, range[i].end - 1,
- r->headers_out.content_length_n)
- - range[i].content_range.data;
-
- len += ctx->boundary_header.len + range[i].content_range.len
- + (size_t) (range[i].end - range[i].start);
- }
-
- r->headers_out.content_length_n = len;
-
- if (r->headers_out.content_length) {
- r->headers_out.content_length->hash = 0;
- r->headers_out.content_length = NULL;
- }
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_range_not_satisfiable(ngx_http_request_t *r)
-{
- ngx_table_elt_t *content_range;
-
- r->headers_out.status = NGX_HTTP_RANGE_NOT_SATISFIABLE;
-
- content_range = ngx_list_push(&r->headers_out.headers);
- if (content_range == NULL) {
- return NGX_ERROR;
- }
-
- r->headers_out.content_range = content_range;
-
- content_range->hash = 1;
- ngx_str_set(&content_range->key, "Content-Range");
-
- content_range->value.data = ngx_pnalloc(r->pool,
- sizeof("bytes */") - 1 + NGX_OFF_T_LEN);
- if (content_range->value.data == NULL) {
- return NGX_ERROR;
- }
-
- content_range->value.len = ngx_sprintf(content_range->value.data,
- "bytes */%O",
- r->headers_out.content_length_n)
- - content_range->value.data;
-
- ngx_http_clear_content_length(r);
-
- return NGX_HTTP_RANGE_NOT_SATISFIABLE;
-}
-
-
-static ngx_int_t
-ngx_http_range_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- ngx_http_range_filter_ctx_t *ctx;
-
- if (in == NULL) {
- return ngx_http_next_body_filter(r, in);
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_range_body_filter_module);
-
- if (ctx == NULL) {
- return ngx_http_next_body_filter(r, in);
- }
-
- if (ctx->ranges.nelts == 1) {
- return ngx_http_range_singlepart_body(r, ctx, in);
- }
-
- /*
- * multipart ranges are supported only if whole body is in a single buffer
- */
-
- if (ngx_buf_special(in->buf)) {
- return ngx_http_next_body_filter(r, in);
- }
-
- if (ngx_http_range_test_overlapped(r, ctx, in) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return ngx_http_range_multipart_body(r, ctx, in);
-}
-
-
-static ngx_int_t
-ngx_http_range_test_overlapped(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx, ngx_chain_t *in)
-{
- off_t start, last;
- ngx_buf_t *buf;
- ngx_uint_t i;
- ngx_http_range_t *range;
-
- if (ctx->offset) {
- goto overlapped;
- }
-
- buf = in->buf;
-
- if (!buf->last_buf) {
- start = ctx->offset;
- last = ctx->offset + ngx_buf_size(buf);
-
- range = ctx->ranges.elts;
- for (i = 0; i < ctx->ranges.nelts; i++) {
- if (start > range[i].start || last < range[i].end) {
- goto overlapped;
- }
- }
- }
-
- ctx->offset = ngx_buf_size(buf);
-
- return NGX_OK;
-
-overlapped:
-
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "range in overlapped buffers");
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_range_singlepart_body(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx, ngx_chain_t *in)
-{
- off_t start, last;
- ngx_buf_t *buf;
- ngx_chain_t *out, *cl, **ll;
- ngx_http_range_t *range;
-
- out = NULL;
- ll = &out;
- range = ctx->ranges.elts;
-
- for (cl = in; cl; cl = cl->next) {
-
- buf = cl->buf;
-
- start = ctx->offset;
- last = ctx->offset + ngx_buf_size(buf);
-
- ctx->offset = last;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http range body buf: %O-%O", start, last);
-
- if (ngx_buf_special(buf)) {
- *ll = cl;
- ll = &cl->next;
- continue;
- }
-
- if (range->end <= start || range->start >= last) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http range body skip");
-
- if (buf->in_file) {
- buf->file_pos = buf->file_last;
- }
-
- buf->pos = buf->last;
- buf->sync = 1;
-
- continue;
- }
-
- if (range->start > start) {
-
- if (buf->in_file) {
- buf->file_pos += range->start - start;
- }
-
- if (ngx_buf_in_memory(buf)) {
- buf->pos += (size_t) (range->start - start);
- }
- }
-
- if (range->end <= last) {
-
- if (buf->in_file) {
- buf->file_last -= last - range->end;
- }
-
- if (ngx_buf_in_memory(buf)) {
- buf->last -= (size_t) (last - range->end);
- }
-
- buf->last_buf = 1;
- *ll = cl;
- cl->next = NULL;
-
- break;
- }
-
- *ll = cl;
- ll = &cl->next;
- }
-
- if (out == NULL) {
- return NGX_OK;
- }
-
- return ngx_http_next_body_filter(r, out);
-}
-
-
-static ngx_int_t
-ngx_http_range_multipart_body(ngx_http_request_t *r,
- ngx_http_range_filter_ctx_t *ctx, ngx_chain_t *in)
-{
- ngx_buf_t *b, *buf;
- ngx_uint_t i;
- ngx_chain_t *out, *hcl, *rcl, *dcl, **ll;
- ngx_http_range_t *range;
-
- ll = &out;
- buf = in->buf;
- range = ctx->ranges.elts;
-
- for (i = 0; i < ctx->ranges.nelts; i++) {
-
- /*
- * The boundary header of the range:
- * CRLF
- * "--0123456789" CRLF
- * "Content-Type: image/jpeg" CRLF
- * "Content-Range: bytes "
- */
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- b->memory = 1;
- b->pos = ctx->boundary_header.data;
- b->last = ctx->boundary_header.data + ctx->boundary_header.len;
-
- hcl = ngx_alloc_chain_link(r->pool);
- if (hcl == NULL) {
- return NGX_ERROR;
- }
-
- hcl->buf = b;
-
-
- /* "SSSS-EEEE/TTTT" CRLF CRLF */
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- b->temporary = 1;
- b->pos = range[i].content_range.data;
- b->last = range[i].content_range.data + range[i].content_range.len;
-
- rcl = ngx_alloc_chain_link(r->pool);
- if (rcl == NULL) {
- return NGX_ERROR;
- }
-
- rcl->buf = b;
-
-
- /* the range data */
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- b->in_file = buf->in_file;
- b->temporary = buf->temporary;
- b->memory = buf->memory;
- b->mmap = buf->mmap;
- b->file = buf->file;
-
- if (buf->in_file) {
- b->file_pos = buf->file_pos + range[i].start;
- b->file_last = buf->file_pos + range[i].end;
- }
-
- if (ngx_buf_in_memory(buf)) {
- b->pos = buf->pos + (size_t) range[i].start;
- b->last = buf->pos + (size_t) range[i].end;
- }
-
- dcl = ngx_alloc_chain_link(r->pool);
- if (dcl == NULL) {
- return NGX_ERROR;
- }
-
- dcl->buf = b;
-
- *ll = hcl;
- hcl->next = rcl;
- rcl->next = dcl;
- ll = &dcl->next;
- }
-
- /* the last boundary CRLF "--0123456789--" CRLF */
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- b->temporary = 1;
- b->last_buf = 1;
-
- b->pos = ngx_pnalloc(r->pool, sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN
- + sizeof("--" CRLF) - 1);
- if (b->pos == NULL) {
- return NGX_ERROR;
- }
-
- b->last = ngx_cpymem(b->pos, ctx->boundary_header.data,
- sizeof(CRLF "--") - 1 + NGX_ATOMIC_T_LEN);
- *b->last++ = '-'; *b->last++ = '-';
- *b->last++ = CR; *b->last++ = LF;
-
- hcl = ngx_alloc_chain_link(r->pool);
- if (hcl == NULL) {
- return NGX_ERROR;
- }
-
- hcl->buf = b;
- hcl->next = NULL;
-
- *ll = hcl;
-
- return ngx_http_next_body_filter(r, out);
-}
-
-
-static ngx_int_t
-ngx_http_range_header_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_range_header_filter;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_range_body_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_range_body_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_realip_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_realip_module.c
deleted file mode 100644
index 7a621180379..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_realip_module.c
+++ /dev/null
@@ -1,442 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_REALIP_XREALIP 0
-#define NGX_HTTP_REALIP_XFWD 1
-#define NGX_HTTP_REALIP_HEADER 2
-#define NGX_HTTP_REALIP_PROXY 3
-
-
-typedef struct {
- ngx_array_t *from; /* array of ngx_cidr_t */
- ngx_uint_t type;
- ngx_uint_t hash;
- ngx_str_t header;
- ngx_flag_t recursive;
-} ngx_http_realip_loc_conf_t;
-
-
-typedef struct {
- ngx_connection_t *connection;
- struct sockaddr *sockaddr;
- socklen_t socklen;
- ngx_str_t addr_text;
-} ngx_http_realip_ctx_t;
-
-
-static ngx_int_t ngx_http_realip_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_realip_set_addr(ngx_http_request_t *r,
- ngx_addr_t *addr);
-static void ngx_http_realip_cleanup(void *data);
-static char *ngx_http_realip_from(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_realip(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static void *ngx_http_realip_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_realip_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_realip_init(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_realip_commands[] = {
-
- { ngx_string("set_real_ip_from"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_realip_from,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("real_ip_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_realip,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("real_ip_recursive"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_realip_loc_conf_t, recursive),
- NULL },
-
- ngx_null_command
-};
-
-
-
-static ngx_http_module_t ngx_http_realip_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_realip_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_realip_create_loc_conf, /* create location configuration */
- ngx_http_realip_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_realip_module = {
- NGX_MODULE_V1,
- &ngx_http_realip_module_ctx, /* module context */
- ngx_http_realip_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_realip_handler(ngx_http_request_t *r)
-{
- u_char *p;
- size_t len;
- ngx_str_t *value;
- ngx_uint_t i, hash;
- ngx_addr_t addr;
- ngx_array_t *xfwd;
- ngx_list_part_t *part;
- ngx_table_elt_t *header;
- ngx_connection_t *c;
- ngx_http_realip_ctx_t *ctx;
- ngx_http_realip_loc_conf_t *rlcf;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_realip_module);
-
- if (ctx) {
- return NGX_DECLINED;
- }
-
- rlcf = ngx_http_get_module_loc_conf(r, ngx_http_realip_module);
-
- if (rlcf->from == NULL) {
- return NGX_DECLINED;
- }
-
- switch (rlcf->type) {
-
- case NGX_HTTP_REALIP_XREALIP:
-
- if (r->headers_in.x_real_ip == NULL) {
- return NGX_DECLINED;
- }
-
- value = &r->headers_in.x_real_ip->value;
- xfwd = NULL;
-
- break;
-
- case NGX_HTTP_REALIP_XFWD:
-
- xfwd = &r->headers_in.x_forwarded_for;
-
- if (xfwd->elts == NULL) {
- return NGX_DECLINED;
- }
-
- value = NULL;
-
- break;
-
- case NGX_HTTP_REALIP_PROXY:
-
- value = &r->connection->proxy_protocol_addr;
-
- if (value->len == 0) {
- return NGX_DECLINED;
- }
-
- xfwd = NULL;
-
- break;
-
- default: /* NGX_HTTP_REALIP_HEADER */
-
- part = &r->headers_in.headers.part;
- header = part->elts;
-
- hash = rlcf->hash;
- len = rlcf->header.len;
- p = rlcf->header.data;
-
- for (i = 0; /* void */ ; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (hash == header[i].hash
- && len == header[i].key.len
- && ngx_strncmp(p, header[i].lowcase_key, len) == 0)
- {
- value = &header[i].value;
- xfwd = NULL;
-
- goto found;
- }
- }
-
- return NGX_DECLINED;
- }
-
-found:
-
- c = r->connection;
-
- addr.sockaddr = c->sockaddr;
- addr.socklen = c->socklen;
- /* addr.name = c->addr_text; */
-
- if (ngx_http_get_forwarded_addr(r, &addr, xfwd, value, rlcf->from,
- rlcf->recursive)
- != NGX_DECLINED)
- {
- return ngx_http_realip_set_addr(r, &addr);
- }
-
- return NGX_DECLINED;
-}
-
-
-static ngx_int_t
-ngx_http_realip_set_addr(ngx_http_request_t *r, ngx_addr_t *addr)
-{
- size_t len;
- u_char *p;
- u_char text[NGX_SOCKADDR_STRLEN];
- ngx_connection_t *c;
- ngx_pool_cleanup_t *cln;
- ngx_http_realip_ctx_t *ctx;
-
- cln = ngx_pool_cleanup_add(r->pool, sizeof(ngx_http_realip_ctx_t));
- if (cln == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ctx = cln->data;
- ngx_http_set_ctx(r, ctx, ngx_http_realip_module);
-
- c = r->connection;
-
- len = ngx_sock_ntop(addr->sockaddr, addr->socklen, text,
- NGX_SOCKADDR_STRLEN, 0);
- if (len == 0) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- p = ngx_pnalloc(c->pool, len);
- if (p == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_memcpy(p, text, len);
-
- cln->handler = ngx_http_realip_cleanup;
-
- ctx->connection = c;
- ctx->sockaddr = c->sockaddr;
- ctx->socklen = c->socklen;
- ctx->addr_text = c->addr_text;
-
- c->sockaddr = addr->sockaddr;
- c->socklen = addr->socklen;
- c->addr_text.len = len;
- c->addr_text.data = p;
-
- return NGX_DECLINED;
-}
-
-
-static void
-ngx_http_realip_cleanup(void *data)
-{
- ngx_http_realip_ctx_t *ctx = data;
-
- ngx_connection_t *c;
-
- c = ctx->connection;
-
- c->sockaddr = ctx->sockaddr;
- c->socklen = ctx->socklen;
- c->addr_text = ctx->addr_text;
-}
-
-
-static char *
-ngx_http_realip_from(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_realip_loc_conf_t *rlcf = conf;
-
- ngx_int_t rc;
- ngx_str_t *value;
- ngx_cidr_t *cidr;
-
- value = cf->args->elts;
-
- if (rlcf->from == NULL) {
- rlcf->from = ngx_array_create(cf->pool, 2,
- sizeof(ngx_cidr_t));
- if (rlcf->from == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- cidr = ngx_array_push(rlcf->from);
- if (cidr == NULL) {
- return NGX_CONF_ERROR;
- }
-
-#if (NGX_HAVE_UNIX_DOMAIN)
-
- if (ngx_strcmp(value[1].data, "unix:") == 0) {
- cidr->family = AF_UNIX;
- return NGX_CONF_OK;
- }
-
-#endif
-
- rc = ngx_ptocidr(&value[1], cidr);
-
- if (rc == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "invalid parameter \"%V\"",
- &value[1]);
- return NGX_CONF_ERROR;
- }
-
- if (rc == NGX_DONE) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "low address bits of %V are meaningless", &value[1]);
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_realip(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_realip_loc_conf_t *rlcf = conf;
-
- ngx_str_t *value;
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "X-Real-IP") == 0) {
- rlcf->type = NGX_HTTP_REALIP_XREALIP;
- return NGX_CONF_OK;
- }
-
- if (ngx_strcmp(value[1].data, "X-Forwarded-For") == 0) {
- rlcf->type = NGX_HTTP_REALIP_XFWD;
- return NGX_CONF_OK;
- }
-
- if (ngx_strcmp(value[1].data, "proxy_protocol") == 0) {
- rlcf->type = NGX_HTTP_REALIP_PROXY;
- return NGX_CONF_OK;
- }
-
- rlcf->type = NGX_HTTP_REALIP_HEADER;
- rlcf->hash = ngx_hash_strlow(value[1].data, value[1].data, value[1].len);
- rlcf->header = value[1];
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_http_realip_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_realip_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_realip_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->from = NULL;
- * conf->hash = 0;
- * conf->header = { 0, NULL };
- */
-
- conf->type = NGX_CONF_UNSET_UINT;
- conf->recursive = NGX_CONF_UNSET;
-
- return conf;
-}
-
-
-static char *
-ngx_http_realip_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_realip_loc_conf_t *prev = parent;
- ngx_http_realip_loc_conf_t *conf = child;
-
- if (conf->from == NULL) {
- conf->from = prev->from;
- }
-
- ngx_conf_merge_uint_value(conf->type, prev->type, NGX_HTTP_REALIP_XREALIP);
- ngx_conf_merge_value(conf->recursive, prev->recursive, 0);
-
- if (conf->header.len == 0) {
- conf->hash = prev->hash;
- conf->header = prev->header;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_realip_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_POST_READ_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_realip_handler;
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_PREACCESS_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_realip_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_referer_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_referer_module.c
deleted file mode 100644
index b417eb227b0..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_referer_module.c
+++ /dev/null
@@ -1,671 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_REFERER_NO_URI_PART ((void *) 4)
-
-
-typedef struct {
- ngx_hash_combined_t hash;
-
-#if (NGX_PCRE)
- ngx_array_t *regex;
- ngx_array_t *server_name_regex;
-#endif
-
- ngx_flag_t no_referer;
- ngx_flag_t blocked_referer;
- ngx_flag_t server_names;
-
- ngx_hash_keys_arrays_t *keys;
-
- ngx_uint_t referer_hash_max_size;
- ngx_uint_t referer_hash_bucket_size;
-} ngx_http_referer_conf_t;
-
-
-static void * ngx_http_referer_create_conf(ngx_conf_t *cf);
-static char * ngx_http_referer_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_http_valid_referers(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static ngx_int_t ngx_http_add_referer(ngx_conf_t *cf,
- ngx_hash_keys_arrays_t *keys, ngx_str_t *value, ngx_str_t *uri);
-static ngx_int_t ngx_http_add_regex_referer(ngx_conf_t *cf,
- ngx_http_referer_conf_t *rlcf, ngx_str_t *name);
-#if (NGX_PCRE)
-static ngx_int_t ngx_http_add_regex_server_name(ngx_conf_t *cf,
- ngx_http_referer_conf_t *rlcf, ngx_http_regex_t *regex);
-#endif
-static int ngx_libc_cdecl ngx_http_cmp_referer_wildcards(const void *one,
- const void *two);
-
-
-static ngx_command_t ngx_http_referer_commands[] = {
-
- { ngx_string("valid_referers"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_valid_referers,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("referer_hash_max_size"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_referer_conf_t, referer_hash_max_size),
- NULL },
-
- { ngx_string("referer_hash_bucket_size"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_referer_conf_t, referer_hash_bucket_size),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_referer_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_referer_create_conf, /* create location configuration */
- ngx_http_referer_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_referer_module = {
- NGX_MODULE_V1,
- &ngx_http_referer_module_ctx, /* module context */
- ngx_http_referer_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_referer_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- u_char *p, *ref, *last;
- size_t len;
- ngx_str_t *uri;
- ngx_uint_t i, key;
- ngx_http_referer_conf_t *rlcf;
- u_char buf[256];
-#if (NGX_PCRE)
- ngx_int_t rc;
- ngx_str_t referer;
-#endif
-
- rlcf = ngx_http_get_module_loc_conf(r, ngx_http_referer_module);
-
- if (rlcf->hash.hash.buckets == NULL
- && rlcf->hash.wc_head == NULL
- && rlcf->hash.wc_tail == NULL
-#if (NGX_PCRE)
- && rlcf->regex == NULL
- && rlcf->server_name_regex == NULL
-#endif
- )
- {
- goto valid;
- }
-
- if (r->headers_in.referer == NULL) {
- if (rlcf->no_referer) {
- goto valid;
- }
-
- goto invalid;
- }
-
- len = r->headers_in.referer->value.len;
- ref = r->headers_in.referer->value.data;
-
- if (len >= sizeof("http://i.ru") - 1) {
- last = ref + len;
-
- if (ngx_strncasecmp(ref, (u_char *) "http://", 7) == 0) {
- ref += 7;
- len -= 7;
- goto valid_scheme;
-
- } else if (ngx_strncasecmp(ref, (u_char *) "https://", 8) == 0) {
- ref += 8;
- len -= 8;
- goto valid_scheme;
- }
- }
-
- if (rlcf->blocked_referer) {
- goto valid;
- }
-
- goto invalid;
-
-valid_scheme:
-
- i = 0;
- key = 0;
-
- for (p = ref; p < last; p++) {
- if (*p == '/' || *p == ':') {
- break;
- }
-
- if (i == 256) {
- goto invalid;
- }
-
- buf[i] = ngx_tolower(*p);
- key = ngx_hash(key, buf[i++]);
- }
-
- uri = ngx_hash_find_combined(&rlcf->hash, key, buf, p - ref);
-
- if (uri) {
- goto uri;
- }
-
-#if (NGX_PCRE)
-
- if (rlcf->server_name_regex) {
- referer.len = p - ref;
- referer.data = buf;
-
- rc = ngx_regex_exec_array(rlcf->server_name_regex, &referer,
- r->connection->log);
-
- if (rc == NGX_OK) {
- goto valid;
- }
-
- if (rc == NGX_ERROR) {
- return rc;
- }
-
- /* NGX_DECLINED */
- }
-
- if (rlcf->regex) {
- referer.len = len;
- referer.data = ref;
-
- rc = ngx_regex_exec_array(rlcf->regex, &referer, r->connection->log);
-
- if (rc == NGX_OK) {
- goto valid;
- }
-
- if (rc == NGX_ERROR) {
- return rc;
- }
-
- /* NGX_DECLINED */
- }
-
-#endif
-
-invalid:
-
- *v = ngx_http_variable_true_value;
-
- return NGX_OK;
-
-uri:
-
- for ( /* void */ ; p < last; p++) {
- if (*p == '/') {
- break;
- }
- }
-
- len = last - p;
-
- if (uri == NGX_HTTP_REFERER_NO_URI_PART) {
- goto valid;
- }
-
- if (len < uri->len || ngx_strncmp(uri->data, p, uri->len) != 0) {
- goto invalid;
- }
-
-valid:
-
- *v = ngx_http_variable_null_value;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_referer_create_conf(ngx_conf_t *cf)
-{
- ngx_http_referer_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_referer_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->hash = { NULL };
- * conf->server_names = 0;
- * conf->keys = NULL;
- */
-
-#if (NGX_PCRE)
- conf->regex = NGX_CONF_UNSET_PTR;
- conf->server_name_regex = NGX_CONF_UNSET_PTR;
-#endif
-
- conf->no_referer = NGX_CONF_UNSET;
- conf->blocked_referer = NGX_CONF_UNSET;
- conf->referer_hash_max_size = NGX_CONF_UNSET_UINT;
- conf->referer_hash_bucket_size = NGX_CONF_UNSET_UINT;
-
- return conf;
-}
-
-
-static char *
-ngx_http_referer_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_referer_conf_t *prev = parent;
- ngx_http_referer_conf_t *conf = child;
-
- ngx_uint_t n;
- ngx_hash_init_t hash;
- ngx_http_server_name_t *sn;
- ngx_http_core_srv_conf_t *cscf;
-
- if (conf->keys == NULL) {
- conf->hash = prev->hash;
-
-#if (NGX_PCRE)
- ngx_conf_merge_ptr_value(conf->regex, prev->regex, NULL);
- ngx_conf_merge_ptr_value(conf->server_name_regex,
- prev->server_name_regex, NULL);
-#endif
- ngx_conf_merge_value(conf->no_referer, prev->no_referer, 0);
- ngx_conf_merge_value(conf->blocked_referer, prev->blocked_referer, 0);
- ngx_conf_merge_uint_value(conf->referer_hash_max_size,
- prev->referer_hash_max_size, 2048);
- ngx_conf_merge_uint_value(conf->referer_hash_bucket_size,
- prev->referer_hash_bucket_size, 64);
-
- return NGX_CONF_OK;
- }
-
- if (conf->server_names == 1) {
- cscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_core_module);
-
- sn = cscf->server_names.elts;
- for (n = 0; n < cscf->server_names.nelts; n++) {
-
-#if (NGX_PCRE)
- if (sn[n].regex) {
-
- if (ngx_http_add_regex_server_name(cf, conf, sn[n].regex)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-#endif
-
- if (ngx_http_add_referer(cf, conf->keys, &sn[n].name, NULL)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
- }
-
- if ((conf->no_referer == 1 || conf->blocked_referer == 1)
- && conf->keys->keys.nelts == 0
- && conf->keys->dns_wc_head.nelts == 0
- && conf->keys->dns_wc_tail.nelts == 0)
- {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "the \"none\" or \"blocked\" referers are specified "
- "in the \"valid_referers\" directive "
- "without any valid referer");
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_uint_value(conf->referer_hash_max_size,
- prev->referer_hash_max_size, 2048);
- ngx_conf_merge_uint_value(conf->referer_hash_bucket_size,
- prev->referer_hash_bucket_size, 64);
- conf->referer_hash_bucket_size = ngx_align(conf->referer_hash_bucket_size,
- ngx_cacheline_size);
-
- hash.key = ngx_hash_key_lc;
- hash.max_size = conf->referer_hash_max_size;
- hash.bucket_size = conf->referer_hash_bucket_size;
- hash.name = "referer_hash";
- hash.pool = cf->pool;
-
- if (conf->keys->keys.nelts) {
- hash.hash = &conf->hash.hash;
- hash.temp_pool = NULL;
-
- if (ngx_hash_init(&hash, conf->keys->keys.elts, conf->keys->keys.nelts)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
-
- if (conf->keys->dns_wc_head.nelts) {
-
- ngx_qsort(conf->keys->dns_wc_head.elts,
- (size_t) conf->keys->dns_wc_head.nelts,
- sizeof(ngx_hash_key_t),
- ngx_http_cmp_referer_wildcards);
-
- hash.hash = NULL;
- hash.temp_pool = cf->temp_pool;
-
- if (ngx_hash_wildcard_init(&hash, conf->keys->dns_wc_head.elts,
- conf->keys->dns_wc_head.nelts)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- conf->hash.wc_head = (ngx_hash_wildcard_t *) hash.hash;
- }
-
- if (conf->keys->dns_wc_tail.nelts) {
-
- ngx_qsort(conf->keys->dns_wc_tail.elts,
- (size_t) conf->keys->dns_wc_tail.nelts,
- sizeof(ngx_hash_key_t),
- ngx_http_cmp_referer_wildcards);
-
- hash.hash = NULL;
- hash.temp_pool = cf->temp_pool;
-
- if (ngx_hash_wildcard_init(&hash, conf->keys->dns_wc_tail.elts,
- conf->keys->dns_wc_tail.nelts)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- conf->hash.wc_tail = (ngx_hash_wildcard_t *) hash.hash;
- }
-
-#if (NGX_PCRE)
- ngx_conf_merge_ptr_value(conf->regex, prev->regex, NULL);
- ngx_conf_merge_ptr_value(conf->server_name_regex, prev->server_name_regex,
- NULL);
-#endif
-
- if (conf->no_referer == NGX_CONF_UNSET) {
- conf->no_referer = 0;
- }
-
- if (conf->blocked_referer == NGX_CONF_UNSET) {
- conf->blocked_referer = 0;
- }
-
- conf->keys = NULL;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_valid_referers(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_referer_conf_t *rlcf = conf;
-
- u_char *p;
- ngx_str_t *value, uri, name;
- ngx_uint_t i;
- ngx_http_variable_t *var;
-
- ngx_str_set(&name, "invalid_referer");
-
- var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
- if (var == NULL) {
- return NGX_CONF_ERROR;
- }
-
- var->get_handler = ngx_http_referer_variable;
-
- if (rlcf->keys == NULL) {
- rlcf->keys = ngx_pcalloc(cf->temp_pool, sizeof(ngx_hash_keys_arrays_t));
- if (rlcf->keys == NULL) {
- return NGX_CONF_ERROR;
- }
-
- rlcf->keys->pool = cf->pool;
- rlcf->keys->temp_pool = cf->pool;
-
- if (ngx_hash_keys_array_init(rlcf->keys, NGX_HASH_SMALL) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
- if (value[i].len == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid referer \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (ngx_strcmp(value[i].data, "none") == 0) {
- rlcf->no_referer = 1;
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "blocked") == 0) {
- rlcf->blocked_referer = 1;
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "server_names") == 0) {
- rlcf->server_names = 1;
- continue;
- }
-
- if (value[i].data[0] == '~') {
- if (ngx_http_add_regex_referer(cf, rlcf, &value[i]) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- ngx_str_null(&uri);
-
- p = (u_char *) ngx_strchr(value[i].data, '/');
-
- if (p) {
- uri.len = (value[i].data + value[i].len) - p;
- uri.data = p;
- value[i].len = p - value[i].data;
- }
-
- if (ngx_http_add_referer(cf, rlcf->keys, &value[i], &uri) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_add_referer(ngx_conf_t *cf, ngx_hash_keys_arrays_t *keys,
- ngx_str_t *value, ngx_str_t *uri)
-{
- ngx_int_t rc;
- ngx_str_t *u;
-
- if (uri == NULL || uri->len == 0) {
- u = NGX_HTTP_REFERER_NO_URI_PART;
-
- } else {
- u = ngx_palloc(cf->pool, sizeof(ngx_str_t));
- if (u == NULL) {
- return NGX_ERROR;
- }
-
- *u = *uri;
- }
-
- rc = ngx_hash_add_key(keys, value, u, NGX_HASH_WILDCARD_KEY);
-
- if (rc == NGX_OK) {
- return NGX_OK;
- }
-
- if (rc == NGX_DECLINED) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid hostname or wildcard \"%V\"", value);
- }
-
- if (rc == NGX_BUSY) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "conflicting parameter \"%V\"", value);
- }
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_add_regex_referer(ngx_conf_t *cf, ngx_http_referer_conf_t *rlcf,
- ngx_str_t *name)
-{
-#if (NGX_PCRE)
- ngx_regex_elt_t *re;
- ngx_regex_compile_t rc;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
-
- if (name->len == 1) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "empty regex in \"%V\"", name);
- return NGX_ERROR;
- }
-
- if (rlcf->regex == NGX_CONF_UNSET_PTR) {
- rlcf->regex = ngx_array_create(cf->pool, 2, sizeof(ngx_regex_elt_t));
- if (rlcf->regex == NULL) {
- return NGX_ERROR;
- }
- }
-
- re = ngx_array_push(rlcf->regex);
- if (re == NULL) {
- return NGX_ERROR;
- }
-
- name->len--;
- name->data++;
-
- ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
-
- rc.pattern = *name;
- rc.pool = cf->pool;
- rc.options = NGX_REGEX_CASELESS;
- rc.err.len = NGX_MAX_CONF_ERRSTR;
- rc.err.data = errstr;
-
- if (ngx_regex_compile(&rc) != NGX_OK) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V", &rc.err);
- return NGX_ERROR;
- }
-
- re->regex = rc.regex;
- re->name = name->data;
-
- return NGX_OK;
-
-#else
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the using of the regex \"%V\" requires PCRE library",
- name);
-
- return NGX_ERROR;
-
-#endif
-}
-
-
-#if (NGX_PCRE)
-
-static ngx_int_t
-ngx_http_add_regex_server_name(ngx_conf_t *cf, ngx_http_referer_conf_t *rlcf,
- ngx_http_regex_t *regex)
-{
- ngx_regex_elt_t *re;
-
- if (rlcf->server_name_regex == NGX_CONF_UNSET_PTR) {
- rlcf->server_name_regex = ngx_array_create(cf->pool, 2,
- sizeof(ngx_regex_elt_t));
- if (rlcf->server_name_regex == NULL) {
- return NGX_ERROR;
- }
- }
-
- re = ngx_array_push(rlcf->server_name_regex);
- if (re == NULL) {
- return NGX_ERROR;
- }
-
- re->regex = regex->regex;
- re->name = regex->name.data;
-
- return NGX_OK;
-}
-
-#endif
-
-
-static int ngx_libc_cdecl
-ngx_http_cmp_referer_wildcards(const void *one, const void *two)
-{
- ngx_hash_key_t *first, *second;
-
- first = (ngx_hash_key_t *) one;
- second = (ngx_hash_key_t *) two;
-
- return ngx_dns_strcmp(first->key.data, second->key.data);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_rewrite_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_rewrite_module.c
deleted file mode 100644
index f24119645bb..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_rewrite_module.c
+++ /dev/null
@@ -1,1029 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_array_t *codes; /* uintptr_t */
-
- ngx_uint_t stack_size;
-
- ngx_flag_t log;
- ngx_flag_t uninitialized_variable_warn;
-} ngx_http_rewrite_loc_conf_t;
-
-
-static void *ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_rewrite_init(ngx_conf_t *cf);
-static char *ngx_http_rewrite(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static char *ngx_http_rewrite_return(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char * ngx_http_rewrite_if_condition(ngx_conf_t *cf,
- ngx_http_rewrite_loc_conf_t *lcf);
-static char *ngx_http_rewrite_variable(ngx_conf_t *cf,
- ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value);
-static char *ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char * ngx_http_rewrite_value(ngx_conf_t *cf,
- ngx_http_rewrite_loc_conf_t *lcf, ngx_str_t *value);
-
-
-static ngx_command_t ngx_http_rewrite_commands[] = {
-
- { ngx_string("rewrite"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE23,
- ngx_http_rewrite,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("return"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE12,
- ngx_http_rewrite_return,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("break"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_NOARGS,
- ngx_http_rewrite_break,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("if"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_1MORE,
- ngx_http_rewrite_if,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("set"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE2,
- ngx_http_rewrite_set,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("rewrite_log"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF
- |NGX_HTTP_LIF_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_rewrite_loc_conf_t, log),
- NULL },
-
- { ngx_string("uninitialized_variable_warn"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_SIF_CONF|NGX_HTTP_LOC_CONF
- |NGX_HTTP_LIF_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_rewrite_loc_conf_t, uninitialized_variable_warn),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_rewrite_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_rewrite_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_rewrite_create_loc_conf, /* create location configuration */
- ngx_http_rewrite_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_rewrite_module = {
- NGX_MODULE_V1,
- &ngx_http_rewrite_module_ctx, /* module context */
- ngx_http_rewrite_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_rewrite_handler(ngx_http_request_t *r)
-{
- ngx_int_t index;
- ngx_http_script_code_pt code;
- ngx_http_script_engine_t *e;
- ngx_http_core_srv_conf_t *cscf;
- ngx_http_core_main_conf_t *cmcf;
- ngx_http_rewrite_loc_conf_t *rlcf;
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
- index = cmcf->phase_engine.location_rewrite_index;
-
- if (r->phase_handler == index && r->loc_conf == cscf->ctx->loc_conf) {
- /* skipping location rewrite phase for server null location */
- return NGX_DECLINED;
- }
-
- rlcf = ngx_http_get_module_loc_conf(r, ngx_http_rewrite_module);
-
- if (rlcf->codes == NULL) {
- return NGX_DECLINED;
- }
-
- e = ngx_pcalloc(r->pool, sizeof(ngx_http_script_engine_t));
- if (e == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- e->sp = ngx_pcalloc(r->pool,
- rlcf->stack_size * sizeof(ngx_http_variable_value_t));
- if (e->sp == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- e->ip = rlcf->codes->elts;
- e->request = r;
- e->quote = 1;
- e->log = rlcf->log;
- e->status = NGX_DECLINED;
-
- while (*(uintptr_t *) e->ip) {
- code = *(ngx_http_script_code_pt *) e->ip;
- code(e);
- }
-
- if (e->status < NGX_HTTP_BAD_REQUEST) {
- return e->status;
- }
-
- if (r->err_status == 0) {
- return e->status;
- }
-
- return r->err_status;
-}
-
-
-static ngx_int_t
-ngx_http_rewrite_var(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_http_variable_t *var;
- ngx_http_core_main_conf_t *cmcf;
- ngx_http_rewrite_loc_conf_t *rlcf;
-
- rlcf = ngx_http_get_module_loc_conf(r, ngx_http_rewrite_module);
-
- if (rlcf->uninitialized_variable_warn == 0) {
- *v = ngx_http_variable_null_value;
- return NGX_OK;
- }
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- var = cmcf->variables.elts;
-
- /*
- * the ngx_http_rewrite_module sets variables directly in r->variables,
- * and they should be handled by ngx_http_get_indexed_variable(),
- * so the handler is called only if the variable is not initialized
- */
-
- ngx_log_error(NGX_LOG_WARN, r->connection->log, 0,
- "using uninitialized \"%V\" variable", &var[data].name);
-
- *v = ngx_http_variable_null_value;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_rewrite_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_rewrite_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_rewrite_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->stack_size = NGX_CONF_UNSET_UINT;
- conf->log = NGX_CONF_UNSET;
- conf->uninitialized_variable_warn = NGX_CONF_UNSET;
-
- return conf;
-}
-
-
-static char *
-ngx_http_rewrite_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_rewrite_loc_conf_t *prev = parent;
- ngx_http_rewrite_loc_conf_t *conf = child;
-
- uintptr_t *code;
-
- ngx_conf_merge_value(conf->log, prev->log, 0);
- ngx_conf_merge_value(conf->uninitialized_variable_warn,
- prev->uninitialized_variable_warn, 1);
- ngx_conf_merge_uint_value(conf->stack_size, prev->stack_size, 10);
-
- if (conf->codes == NULL) {
- return NGX_CONF_OK;
- }
-
- if (conf->codes == prev->codes) {
- return NGX_CONF_OK;
- }
-
- code = ngx_array_push_n(conf->codes, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_rewrite_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_SERVER_REWRITE_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_rewrite_handler;
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_rewrite_handler;
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_rewrite(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_rewrite_loc_conf_t *lcf = conf;
-
- ngx_str_t *value;
- ngx_uint_t last;
- ngx_regex_compile_t rc;
- ngx_http_script_code_pt *code;
- ngx_http_script_compile_t sc;
- ngx_http_script_regex_code_t *regex;
- ngx_http_script_regex_end_code_t *regex_end;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
-
- regex = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_regex_code_t));
- if (regex == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(regex, sizeof(ngx_http_script_regex_code_t));
-
- value = cf->args->elts;
-
- ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
-
- rc.pattern = value[1];
- rc.err.len = NGX_MAX_CONF_ERRSTR;
- rc.err.data = errstr;
-
- /* TODO: NGX_REGEX_CASELESS */
-
- regex->regex = ngx_http_regex_compile(cf, &rc);
- if (regex->regex == NULL) {
- return NGX_CONF_ERROR;
- }
-
- regex->code = ngx_http_script_regex_start_code;
- regex->uri = 1;
- regex->name = value[1];
-
- if (value[2].data[value[2].len - 1] == '?') {
-
- /* the last "?" drops the original arguments */
- value[2].len--;
-
- } else {
- regex->add_args = 1;
- }
-
- last = 0;
-
- if (ngx_strncmp(value[2].data, "http://", sizeof("http://") - 1) == 0
- || ngx_strncmp(value[2].data, "https://", sizeof("https://") - 1) == 0
- || ngx_strncmp(value[2].data, "$scheme", sizeof("$scheme") - 1) == 0)
- {
- regex->status = NGX_HTTP_MOVED_TEMPORARILY;
- regex->redirect = 1;
- last = 1;
- }
-
- if (cf->args->nelts == 4) {
- if (ngx_strcmp(value[3].data, "last") == 0) {
- last = 1;
-
- } else if (ngx_strcmp(value[3].data, "break") == 0) {
- regex->break_cycle = 1;
- last = 1;
-
- } else if (ngx_strcmp(value[3].data, "redirect") == 0) {
- regex->status = NGX_HTTP_MOVED_TEMPORARILY;
- regex->redirect = 1;
- last = 1;
-
- } else if (ngx_strcmp(value[3].data, "permanent") == 0) {
- regex->status = NGX_HTTP_MOVED_PERMANENTLY;
- regex->redirect = 1;
- last = 1;
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[3]);
- return NGX_CONF_ERROR;
- }
- }
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &value[2];
- sc.lengths = &regex->lengths;
- sc.values = &lcf->codes;
- sc.variables = ngx_http_script_variables_count(&value[2]);
- sc.main = regex;
- sc.complete_lengths = 1;
- sc.compile_args = !regex->redirect;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- regex = sc.main;
-
- regex->size = sc.size;
- regex->args = sc.args;
-
- if (sc.variables == 0 && !sc.dup_capture) {
- regex->lengths = NULL;
- }
-
- regex_end = ngx_http_script_add_code(lcf->codes,
- sizeof(ngx_http_script_regex_end_code_t),
- &regex);
- if (regex_end == NULL) {
- return NGX_CONF_ERROR;
- }
-
- regex_end->code = ngx_http_script_regex_end_code;
- regex_end->uri = regex->uri;
- regex_end->args = regex->args;
- regex_end->add_args = regex->add_args;
- regex_end->redirect = regex->redirect;
-
- if (last) {
- code = ngx_http_script_add_code(lcf->codes, sizeof(uintptr_t), &regex);
- if (code == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *code = NULL;
- }
-
- regex->next = (u_char *) lcf->codes->elts + lcf->codes->nelts
- - (u_char *) regex;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_rewrite_return(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_rewrite_loc_conf_t *lcf = conf;
-
- u_char *p;
- ngx_str_t *value, *v;
- ngx_http_script_return_code_t *ret;
- ngx_http_compile_complex_value_t ccv;
-
- ret = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_return_code_t));
- if (ret == NULL) {
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- ngx_memzero(ret, sizeof(ngx_http_script_return_code_t));
-
- ret->code = ngx_http_script_return_code;
-
- p = value[1].data;
-
- ret->status = ngx_atoi(p, value[1].len);
-
- if (ret->status == (uintptr_t) NGX_ERROR) {
-
- if (cf->args->nelts == 2
- && (ngx_strncmp(p, "http://", sizeof("http://") - 1) == 0
- || ngx_strncmp(p, "https://", sizeof("https://") - 1) == 0
- || ngx_strncmp(p, "$scheme", sizeof("$scheme") - 1) == 0))
- {
- ret->status = NGX_HTTP_MOVED_TEMPORARILY;
- v = &value[1];
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid return code \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- } else {
-
- if (ret->status > 999) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid return code \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- if (cf->args->nelts == 2) {
- return NGX_CONF_OK;
- }
-
- v = &value[2];
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = v;
- ccv.complex_value = &ret->text;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_rewrite_break(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_rewrite_loc_conf_t *lcf = conf;
-
- ngx_http_script_code_pt *code;
-
- code = ngx_http_script_start_code(cf->pool, &lcf->codes, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *code = ngx_http_script_break_code;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_rewrite_if(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_rewrite_loc_conf_t *lcf = conf;
-
- void *mconf;
- char *rv;
- u_char *elts;
- ngx_uint_t i;
- ngx_conf_t save;
- ngx_http_module_t *module;
- ngx_http_conf_ctx_t *ctx, *pctx;
- ngx_http_core_loc_conf_t *clcf, *pclcf;
- ngx_http_script_if_code_t *if_code;
- ngx_http_rewrite_loc_conf_t *nlcf;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pctx = cf->ctx;
- ctx->main_conf = pctx->main_conf;
- ctx->srv_conf = pctx->srv_conf;
-
- ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
- if (ctx->loc_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- module = ngx_modules[i]->ctx;
-
- if (module->create_loc_conf) {
-
- mconf = module->create_loc_conf(cf);
- if (mconf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf;
- }
- }
-
- pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index];
-
- clcf = ctx->loc_conf[ngx_http_core_module.ctx_index];
- clcf->loc_conf = ctx->loc_conf;
- clcf->name = pclcf->name;
- clcf->noname = 1;
-
- if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_http_rewrite_if_condition(cf, lcf) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
-
- if_code = ngx_array_push_n(lcf->codes, sizeof(ngx_http_script_if_code_t));
- if (if_code == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if_code->code = ngx_http_script_if_code;
-
- elts = lcf->codes->elts;
-
-
- /* the inner directives must be compiled to the same code array */
-
- nlcf = ctx->loc_conf[ngx_http_rewrite_module.ctx_index];
- nlcf->codes = lcf->codes;
-
-
- save = *cf;
- cf->ctx = ctx;
-
- if (pclcf->name.len == 0) {
- if_code->loc_conf = NULL;
- cf->cmd_type = NGX_HTTP_SIF_CONF;
-
- } else {
- if_code->loc_conf = ctx->loc_conf;
- cf->cmd_type = NGX_HTTP_LIF_CONF;
- }
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = save;
-
- if (rv != NGX_CONF_OK) {
- return rv;
- }
-
-
- if (elts != lcf->codes->elts) {
- if_code = (ngx_http_script_if_code_t *)
- ((u_char *) if_code + ((u_char *) lcf->codes->elts - elts));
- }
-
- if_code->next = (u_char *) lcf->codes->elts + lcf->codes->nelts
- - (u_char *) if_code;
-
- /* the code array belong to parent block */
-
- nlcf->codes = NULL;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_rewrite_if_condition(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf)
-{
- u_char *p;
- size_t len;
- ngx_str_t *value;
- ngx_uint_t cur, last;
- ngx_regex_compile_t rc;
- ngx_http_script_code_pt *code;
- ngx_http_script_file_code_t *fop;
- ngx_http_script_regex_code_t *regex;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
-
- value = cf->args->elts;
- last = cf->args->nelts - 1;
-
- if (value[1].len < 1 || value[1].data[0] != '(') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid condition \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- if (value[1].len == 1) {
- cur = 2;
-
- } else {
- cur = 1;
- value[1].len--;
- value[1].data++;
- }
-
- if (value[last].len < 1 || value[last].data[value[last].len - 1] != ')') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid condition \"%V\"", &value[last]);
- return NGX_CONF_ERROR;
- }
-
- if (value[last].len == 1) {
- last--;
-
- } else {
- value[last].len--;
- value[last].data[value[last].len] = '\0';
- }
-
- len = value[cur].len;
- p = value[cur].data;
-
- if (len > 1 && p[0] == '$') {
-
- if (cur != last && cur + 2 != last) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid condition \"%V\"", &value[cur]);
- return NGX_CONF_ERROR;
- }
-
- if (ngx_http_rewrite_variable(cf, lcf, &value[cur]) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (cur == last) {
- return NGX_CONF_OK;
- }
-
- cur++;
-
- len = value[cur].len;
- p = value[cur].data;
-
- if (len == 1 && p[0] == '=') {
-
- if (ngx_http_rewrite_value(cf, lcf, &value[last]) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
-
- code = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *code = ngx_http_script_equal_code;
-
- return NGX_CONF_OK;
- }
-
- if (len == 2 && p[0] == '!' && p[1] == '=') {
-
- if (ngx_http_rewrite_value(cf, lcf, &value[last]) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
-
- code = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *code = ngx_http_script_not_equal_code;
- return NGX_CONF_OK;
- }
-
- if ((len == 1 && p[0] == '~')
- || (len == 2 && p[0] == '~' && p[1] == '*')
- || (len == 2 && p[0] == '!' && p[1] == '~')
- || (len == 3 && p[0] == '!' && p[1] == '~' && p[2] == '*'))
- {
- regex = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_regex_code_t));
- if (regex == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(regex, sizeof(ngx_http_script_regex_code_t));
-
- ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
-
- rc.pattern = value[last];
- rc.options = (p[len - 1] == '*') ? NGX_REGEX_CASELESS : 0;
- rc.err.len = NGX_MAX_CONF_ERRSTR;
- rc.err.data = errstr;
-
- regex->regex = ngx_http_regex_compile(cf, &rc);
- if (regex->regex == NULL) {
- return NGX_CONF_ERROR;
- }
-
- regex->code = ngx_http_script_regex_start_code;
- regex->next = sizeof(ngx_http_script_regex_code_t);
- regex->test = 1;
- if (p[0] == '!') {
- regex->negative_test = 1;
- }
- regex->name = value[last];
-
- return NGX_CONF_OK;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "unexpected \"%V\" in condition", &value[cur]);
- return NGX_CONF_ERROR;
-
- } else if ((len == 2 && p[0] == '-')
- || (len == 3 && p[0] == '!' && p[1] == '-'))
- {
- if (cur + 1 != last) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid condition \"%V\"", &value[cur]);
- return NGX_CONF_ERROR;
- }
-
- value[last].data[value[last].len] = '\0';
- value[last].len++;
-
- if (ngx_http_rewrite_value(cf, lcf, &value[last]) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
-
- fop = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_file_code_t));
- if (fop == NULL) {
- return NGX_CONF_ERROR;
- }
-
- fop->code = ngx_http_script_file_code;
-
- if (p[1] == 'f') {
- fop->op = ngx_http_script_file_plain;
- return NGX_CONF_OK;
- }
-
- if (p[1] == 'd') {
- fop->op = ngx_http_script_file_dir;
- return NGX_CONF_OK;
- }
-
- if (p[1] == 'e') {
- fop->op = ngx_http_script_file_exists;
- return NGX_CONF_OK;
- }
-
- if (p[1] == 'x') {
- fop->op = ngx_http_script_file_exec;
- return NGX_CONF_OK;
- }
-
- if (p[0] == '!') {
- if (p[2] == 'f') {
- fop->op = ngx_http_script_file_not_plain;
- return NGX_CONF_OK;
- }
-
- if (p[2] == 'd') {
- fop->op = ngx_http_script_file_not_dir;
- return NGX_CONF_OK;
- }
-
- if (p[2] == 'e') {
- fop->op = ngx_http_script_file_not_exists;
- return NGX_CONF_OK;
- }
-
- if (p[2] == 'x') {
- fop->op = ngx_http_script_file_not_exec;
- return NGX_CONF_OK;
- }
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid condition \"%V\"", &value[cur]);
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid condition \"%V\"", &value[cur]);
-
- return NGX_CONF_ERROR;
-}
-
-
-static char *
-ngx_http_rewrite_variable(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,
- ngx_str_t *value)
-{
- ngx_int_t index;
- ngx_http_script_var_code_t *var_code;
-
- value->len--;
- value->data++;
-
- index = ngx_http_get_variable_index(cf, value);
-
- if (index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- var_code = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_var_code_t));
- if (var_code == NULL) {
- return NGX_CONF_ERROR;
- }
-
- var_code->code = ngx_http_script_var_code;
- var_code->index = index;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_rewrite_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_rewrite_loc_conf_t *lcf = conf;
-
- ngx_int_t index;
- ngx_str_t *value;
- ngx_http_variable_t *v;
- ngx_http_script_var_code_t *vcode;
- ngx_http_script_var_handler_code_t *vhcode;
-
- value = cf->args->elts;
-
- if (value[1].data[0] != '$') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- value[1].len--;
- value[1].data++;
-
- v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGEABLE);
- if (v == NULL) {
- return NGX_CONF_ERROR;
- }
-
- index = ngx_http_get_variable_index(cf, &value[1]);
- if (index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- if (v->get_handler == NULL
- && ngx_strncasecmp(value[1].data, (u_char *) "http_", 5) != 0
- && ngx_strncasecmp(value[1].data, (u_char *) "sent_http_", 10) != 0
- && ngx_strncasecmp(value[1].data, (u_char *) "upstream_http_", 14) != 0
- && ngx_strncasecmp(value[1].data, (u_char *) "cookie_", 7) != 0
- && ngx_strncasecmp(value[1].data, (u_char *) "upstream_cookie_", 16)
- != 0
- && ngx_strncasecmp(value[1].data, (u_char *) "arg_", 4) != 0)
- {
- v->get_handler = ngx_http_rewrite_var;
- v->data = index;
- }
-
- if (ngx_http_rewrite_value(cf, lcf, &value[2]) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (v->set_handler) {
- vhcode = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_var_handler_code_t));
- if (vhcode == NULL) {
- return NGX_CONF_ERROR;
- }
-
- vhcode->code = ngx_http_script_var_set_handler_code;
- vhcode->handler = v->set_handler;
- vhcode->data = v->data;
-
- return NGX_CONF_OK;
- }
-
- vcode = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_var_code_t));
- if (vcode == NULL) {
- return NGX_CONF_ERROR;
- }
-
- vcode->code = ngx_http_script_set_var_code;
- vcode->index = (uintptr_t) index;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_rewrite_value(ngx_conf_t *cf, ngx_http_rewrite_loc_conf_t *lcf,
- ngx_str_t *value)
-{
- ngx_int_t n;
- ngx_http_script_compile_t sc;
- ngx_http_script_value_code_t *val;
- ngx_http_script_complex_value_code_t *complex;
-
- n = ngx_http_script_variables_count(value);
-
- if (n == 0) {
- val = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_value_code_t));
- if (val == NULL) {
- return NGX_CONF_ERROR;
- }
-
- n = ngx_atoi(value->data, value->len);
-
- if (n == NGX_ERROR) {
- n = 0;
- }
-
- val->code = ngx_http_script_value_code;
- val->value = (uintptr_t) n;
- val->text_len = (uintptr_t) value->len;
- val->text_data = (uintptr_t) value->data;
-
- return NGX_CONF_OK;
- }
-
- complex = ngx_http_script_start_code(cf->pool, &lcf->codes,
- sizeof(ngx_http_script_complex_value_code_t));
- if (complex == NULL) {
- return NGX_CONF_ERROR;
- }
-
- complex->code = ngx_http_script_complex_value_code;
- complex->lengths = NULL;
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = value;
- sc.lengths = &complex->lengths;
- sc.values = &lcf->codes;
- sc.variables = n;
- sc.complete_lengths = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_scgi_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_scgi_module.c
deleted file mode 100644
index 313f3b3ade9..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_scgi_module.c
+++ /dev/null
@@ -1,1838 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- * Copyright (C) Manlio Perillo (manlio.perillo@gmail.com)
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_http_upstream_conf_t upstream;
-
- ngx_array_t *flushes;
- ngx_array_t *params_len;
- ngx_array_t *params;
- ngx_array_t *params_source;
-
- ngx_hash_t headers_hash;
- ngx_uint_t header_params;
-
- ngx_array_t *scgi_lengths;
- ngx_array_t *scgi_values;
-
-#if (NGX_HTTP_CACHE)
- ngx_http_complex_value_t cache_key;
-#endif
-} ngx_http_scgi_loc_conf_t;
-
-
-static ngx_int_t ngx_http_scgi_eval(ngx_http_request_t *r,
- ngx_http_scgi_loc_conf_t *scf);
-static ngx_int_t ngx_http_scgi_create_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_scgi_reinit_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_scgi_process_status_line(ngx_http_request_t *r);
-static ngx_int_t ngx_http_scgi_process_header(ngx_http_request_t *r);
-static void ngx_http_scgi_abort_request(ngx_http_request_t *r);
-static void ngx_http_scgi_finalize_request(ngx_http_request_t *r, ngx_int_t rc);
-
-static void *ngx_http_scgi_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static ngx_int_t ngx_http_scgi_merge_params(ngx_conf_t *cf,
- ngx_http_scgi_loc_conf_t *conf, ngx_http_scgi_loc_conf_t *prev);
-
-static char *ngx_http_scgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static char *ngx_http_scgi_store(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-#if (NGX_HTTP_CACHE)
-static ngx_int_t ngx_http_scgi_create_key(ngx_http_request_t *r);
-static char *ngx_http_scgi_cache(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_scgi_cache_key(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-#endif
-
-
-static ngx_conf_bitmask_t ngx_http_scgi_next_upstream_masks[] = {
- { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR },
- { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT },
- { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER },
- { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 },
- { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
- { ngx_string("http_403"), NGX_HTTP_UPSTREAM_FT_HTTP_403 },
- { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
- { ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
- { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
- { ngx_null_string, 0 }
-};
-
-
-ngx_module_t ngx_http_scgi_module;
-
-
-static ngx_command_t ngx_http_scgi_commands[] = {
-
- { ngx_string("scgi_pass"),
- NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
- ngx_http_scgi_pass,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("scgi_store"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_scgi_store,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("scgi_store_access"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE123,
- ngx_conf_set_access_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.store_access),
- NULL },
-
- { ngx_string("scgi_buffering"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.buffering),
- NULL },
-
- { ngx_string("scgi_ignore_client_abort"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.ignore_client_abort),
- NULL },
-
- { ngx_string("scgi_bind"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_upstream_bind_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.local),
- NULL },
-
- { ngx_string("scgi_connect_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.connect_timeout),
- NULL },
-
- { ngx_string("scgi_send_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.send_timeout),
- NULL },
-
- { ngx_string("scgi_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.buffer_size),
- NULL },
-
- { ngx_string("scgi_pass_request_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.pass_request_headers),
- NULL },
-
- { ngx_string("scgi_pass_request_body"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.pass_request_body),
- NULL },
-
- { ngx_string("scgi_intercept_errors"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.intercept_errors),
- NULL },
-
- { ngx_string("scgi_read_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.read_timeout),
- NULL },
-
- { ngx_string("scgi_buffers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_conf_set_bufs_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.bufs),
- NULL },
-
- { ngx_string("scgi_busy_buffers_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.busy_buffers_size_conf),
- NULL },
-
-#if (NGX_HTTP_CACHE)
-
- { ngx_string("scgi_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_scgi_cache,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("scgi_cache_key"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_scgi_cache_key,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("scgi_cache_path"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_2MORE,
- ngx_http_file_cache_set_slot,
- 0,
- 0,
- &ngx_http_scgi_module },
-
- { ngx_string("scgi_cache_bypass"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_set_predicate_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_bypass),
- NULL },
-
- { ngx_string("scgi_no_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_set_predicate_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.no_cache),
- NULL },
-
- { ngx_string("scgi_cache_valid"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_file_cache_valid_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_valid),
- NULL },
-
- { ngx_string("scgi_cache_min_uses"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_min_uses),
- NULL },
-
- { ngx_string("scgi_cache_use_stale"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_use_stale),
- &ngx_http_scgi_next_upstream_masks },
-
- { ngx_string("scgi_cache_methods"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_methods),
- &ngx_http_upstream_cache_method_mask },
-
- { ngx_string("scgi_cache_lock"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_lock),
- NULL },
-
- { ngx_string("scgi_cache_lock_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_lock_timeout),
- NULL },
-
- { ngx_string("scgi_cache_revalidate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.cache_revalidate),
- NULL },
-
-#endif
-
- { ngx_string("scgi_temp_path"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
- ngx_conf_set_path_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.temp_path),
- NULL },
-
- { ngx_string("scgi_max_temp_file_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.max_temp_file_size_conf),
- NULL },
-
- { ngx_string("scgi_temp_file_write_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.temp_file_write_size_conf),
- NULL },
-
- { ngx_string("scgi_next_upstream"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.next_upstream),
- &ngx_http_scgi_next_upstream_masks },
-
- { ngx_string("scgi_next_upstream_tries"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.next_upstream_tries),
- NULL },
-
- { ngx_string("scgi_next_upstream_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.next_upstream_timeout),
- NULL },
-
- { ngx_string("scgi_param"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE23,
- ngx_http_upstream_param_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, params_source),
- NULL },
-
- { ngx_string("scgi_pass_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.pass_headers),
- NULL },
-
- { ngx_string("scgi_hide_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.hide_headers),
- NULL },
-
- { ngx_string("scgi_ignore_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_scgi_loc_conf_t, upstream.ignore_headers),
- &ngx_http_upstream_ignore_headers_masks },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_scgi_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_scgi_create_loc_conf, /* create location configuration */
- ngx_http_scgi_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_scgi_module = {
- NGX_MODULE_V1,
- &ngx_http_scgi_module_ctx, /* module context */
- ngx_http_scgi_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_http_scgi_hide_headers[] = {
- ngx_string("Status"),
- ngx_string("X-Accel-Expires"),
- ngx_string("X-Accel-Redirect"),
- ngx_string("X-Accel-Limit-Rate"),
- ngx_string("X-Accel-Buffering"),
- ngx_string("X-Accel-Charset"),
- ngx_null_string
-};
-
-
-#if (NGX_HTTP_CACHE)
-
-static ngx_keyval_t ngx_http_scgi_cache_headers[] = {
- { ngx_string("HTTP_IF_MODIFIED_SINCE"),
- ngx_string("$upstream_cache_last_modified") },
- { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") },
- { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("$upstream_cache_etag") },
- { ngx_string("HTTP_IF_MATCH"), ngx_string("") },
- { ngx_string("HTTP_RANGE"), ngx_string("") },
- { ngx_string("HTTP_IF_RANGE"), ngx_string("") },
- { ngx_null_string, ngx_null_string }
-};
-
-#endif
-
-
-static ngx_path_init_t ngx_http_scgi_temp_path = {
- ngx_string(NGX_HTTP_SCGI_TEMP_PATH), { 1, 2, 0 }
-};
-
-
-static ngx_int_t
-ngx_http_scgi_handler(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_http_status_t *status;
- ngx_http_upstream_t *u;
- ngx_http_scgi_loc_conf_t *scf;
-
- if (ngx_http_upstream_create(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- status = ngx_pcalloc(r->pool, sizeof(ngx_http_status_t));
- if (status == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_http_set_ctx(r, status, ngx_http_scgi_module);
-
- scf = ngx_http_get_module_loc_conf(r, ngx_http_scgi_module);
-
- if (scf->scgi_lengths) {
- if (ngx_http_scgi_eval(r, scf) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
- }
-
- u = r->upstream;
-
- ngx_str_set(&u->schema, "scgi://");
- u->output.tag = (ngx_buf_tag_t) &ngx_http_scgi_module;
-
- u->conf = &scf->upstream;
-
-#if (NGX_HTTP_CACHE)
- u->create_key = ngx_http_scgi_create_key;
-#endif
- u->create_request = ngx_http_scgi_create_request;
- u->reinit_request = ngx_http_scgi_reinit_request;
- u->process_header = ngx_http_scgi_process_status_line;
- u->abort_request = ngx_http_scgi_abort_request;
- u->finalize_request = ngx_http_scgi_finalize_request;
- r->state = 0;
-
- u->buffering = scf->upstream.buffering;
-
- u->pipe = ngx_pcalloc(r->pool, sizeof(ngx_event_pipe_t));
- if (u->pipe == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- u->pipe->input_filter = ngx_event_pipe_copy_input_filter;
- u->pipe->input_ctx = r;
-
- rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init);
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- return rc;
- }
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_http_scgi_eval(ngx_http_request_t *r, ngx_http_scgi_loc_conf_t * scf)
-{
- ngx_url_t url;
- ngx_http_upstream_t *u;
-
- ngx_memzero(&url, sizeof(ngx_url_t));
-
- if (ngx_http_script_run(r, &url.url, scf->scgi_lengths->elts, 0,
- scf->scgi_values->elts)
- == NULL)
- {
- return NGX_ERROR;
- }
-
- url.no_resolve = 1;
-
- if (ngx_parse_url(r->pool, &url) != NGX_OK) {
- if (url.err) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "%s in upstream \"%V\"", url.err, &url.url);
- }
-
- return NGX_ERROR;
- }
-
- u = r->upstream;
-
- u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
- if (u->resolved == NULL) {
- return NGX_ERROR;
- }
-
- if (url.addrs && url.addrs[0].sockaddr) {
- u->resolved->sockaddr = url.addrs[0].sockaddr;
- u->resolved->socklen = url.addrs[0].socklen;
- u->resolved->naddrs = 1;
- u->resolved->host = url.addrs[0].name;
-
- } else {
- u->resolved->host = url.host;
- u->resolved->port = url.port;
- u->resolved->no_port = url.no_port;
- }
-
- return NGX_OK;
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-static ngx_int_t
-ngx_http_scgi_create_key(ngx_http_request_t *r)
-{
- ngx_str_t *key;
- ngx_http_scgi_loc_conf_t *scf;
-
- key = ngx_array_push(&r->cache->keys);
- if (key == NULL) {
- return NGX_ERROR;
- }
-
- scf = ngx_http_get_module_loc_conf(r, ngx_http_scgi_module);
-
- if (ngx_http_complex_value(r, &scf->cache_key, key) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_scgi_create_request(ngx_http_request_t *r)
-{
- off_t content_length_n;
- u_char ch, *key, *val, *lowcase_key;
- size_t len, key_len, val_len, allocated;
- ngx_buf_t *b;
- ngx_str_t content_length;
- ngx_uint_t i, n, hash, skip_empty, header_params;
- ngx_chain_t *cl, *body;
- ngx_list_part_t *part;
- ngx_table_elt_t *header, **ignored;
- ngx_http_script_code_pt code;
- ngx_http_script_engine_t e, le;
- ngx_http_scgi_loc_conf_t *scf;
- ngx_http_script_len_code_pt lcode;
- u_char buffer[NGX_OFF_T_LEN];
-
- content_length_n = 0;
- body = r->upstream->request_bufs;
-
- while (body) {
- content_length_n += ngx_buf_size(body->buf);
- body = body->next;
- }
-
- content_length.data = buffer;
- content_length.len = ngx_sprintf(buffer, "%O", content_length_n) - buffer;
-
- len = sizeof("CONTENT_LENGTH") + content_length.len + 1;
-
- header_params = 0;
- ignored = NULL;
-
- scf = ngx_http_get_module_loc_conf(r, ngx_http_scgi_module);
-
- if (scf->params_len) {
- ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
-
- ngx_http_script_flush_no_cacheable_variables(r, scf->flushes);
- le.flushed = 1;
-
- le.ip = scf->params_len->elts;
- le.request = r;
-
- while (*(uintptr_t *) le.ip) {
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- key_len = lcode(&le);
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- skip_empty = lcode(&le);
-
- for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode(&le)) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- }
- le.ip += sizeof(uintptr_t);
-
- if (skip_empty && val_len == 0) {
- continue;
- }
-
- len += key_len + val_len + 1;
- }
- }
-
- if (scf->upstream.pass_request_headers) {
-
- allocated = 0;
- lowcase_key = NULL;
-
- if (scf->header_params) {
- n = 0;
- part = &r->headers_in.headers.part;
-
- while (part) {
- n += part->nelts;
- part = part->next;
- }
-
- ignored = ngx_palloc(r->pool, n * sizeof(void *));
- if (ignored == NULL) {
- return NGX_ERROR;
- }
- }
-
- part = &r->headers_in.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (scf->header_params) {
- if (allocated < header[i].key.len) {
- allocated = header[i].key.len + 16;
- lowcase_key = ngx_pnalloc(r->pool, allocated);
- if (lowcase_key == NULL) {
- return NGX_ERROR;
- }
- }
-
- hash = 0;
-
- for (n = 0; n < header[i].key.len; n++) {
- ch = header[i].key.data[n];
-
- if (ch >= 'A' && ch <= 'Z') {
- ch |= 0x20;
-
- } else if (ch == '-') {
- ch = '_';
- }
-
- hash = ngx_hash(hash, ch);
- lowcase_key[n] = ch;
- }
-
- if (ngx_hash_find(&scf->headers_hash, hash, lowcase_key, n)) {
- ignored[header_params++] = &header[i];
- continue;
- }
- }
-
- len += sizeof("HTTP_") - 1 + header[i].key.len + 1
- + header[i].value.len + 1;
- }
- }
-
- /* netstring: "length:" + packet + "," */
-
- b = ngx_create_temp_buf(r->pool, NGX_SIZE_T_LEN + 1 + len + 1);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
-
- b->last = ngx_sprintf(b->last, "%ui:CONTENT_LENGTH%Z%V%Z",
- len, &content_length);
-
- if (scf->params_len) {
- ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
-
- e.ip = scf->params->elts;
- e.pos = b->last;
- e.request = r;
- e.flushed = 1;
-
- le.ip = scf->params_len->elts;
-
- while (*(uintptr_t *) le.ip) {
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- lcode(&le); /* key length */
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- skip_empty = lcode(&le);
-
- for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode(&le)) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- }
- le.ip += sizeof(uintptr_t);
-
- if (skip_empty && val_len == 0) {
- e.skip = 1;
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
- e.ip += sizeof(uintptr_t);
-
- e.skip = 0;
-
- continue;
- }
-
-#if (NGX_DEBUG)
- key = e.pos;
-#endif
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) & e);
-
-#if (NGX_DEBUG)
- val = e.pos;
-#endif
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
- *e.pos++ = '\0';
- e.ip += sizeof(uintptr_t);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "scgi param: \"%s: %s\"", key, val);
- }
-
- b->last = e.pos;
- }
-
- if (scf->upstream.pass_request_headers) {
-
- part = &r->headers_in.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- for (n = 0; n < header_params; n++) {
- if (&header[i] == ignored[n]) {
- goto next;
- }
- }
-
- key = b->last;
- b->last = ngx_cpymem(key, "HTTP_", sizeof("HTTP_") - 1);
-
- for (n = 0; n < header[i].key.len; n++) {
- ch = header[i].key.data[n];
-
- if (ch >= 'a' && ch <= 'z') {
- ch &= ~0x20;
-
- } else if (ch == '-') {
- ch = '_';
- }
-
- *b->last++ = ch;
- }
-
- *b->last++ = (u_char) 0;
-
- val = b->last;
- b->last = ngx_copy(val, header[i].value.data, header[i].value.len);
- *b->last++ = (u_char) 0;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "scgi param: \"%s: %s\"", key, val);
-
- next:
-
- continue;
- }
- }
-
- *b->last++ = (u_char) ',';
-
- if (scf->upstream.pass_request_body) {
- body = r->upstream->request_bufs;
- r->upstream->request_bufs = cl;
-
- while (body) {
- b = ngx_alloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(b, body->buf, sizeof(ngx_buf_t));
-
- cl->next = ngx_alloc_chain_link(r->pool);
- if (cl->next == NULL) {
- return NGX_ERROR;
- }
-
- cl = cl->next;
- cl->buf = b;
-
- body = body->next;
- }
-
- } else {
- r->upstream->request_bufs = cl;
- }
-
- cl->next = NULL;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_scgi_reinit_request(ngx_http_request_t *r)
-{
- ngx_http_status_t *status;
-
- status = ngx_http_get_module_ctx(r, ngx_http_scgi_module);
-
- if (status == NULL) {
- return NGX_OK;
- }
-
- status->code = 0;
- status->count = 0;
- status->start = NULL;
- status->end = NULL;
-
- r->upstream->process_header = ngx_http_scgi_process_status_line;
- r->state = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_scgi_process_status_line(ngx_http_request_t *r)
-{
- size_t len;
- ngx_int_t rc;
- ngx_http_status_t *status;
- ngx_http_upstream_t *u;
-
- status = ngx_http_get_module_ctx(r, ngx_http_scgi_module);
-
- if (status == NULL) {
- return NGX_ERROR;
- }
-
- u = r->upstream;
-
- rc = ngx_http_parse_status_line(r, &u->buffer, status);
-
- if (rc == NGX_AGAIN) {
- return rc;
- }
-
- if (rc == NGX_ERROR) {
- u->process_header = ngx_http_scgi_process_header;
- return ngx_http_scgi_process_header(r);
- }
-
- if (u->state && u->state->status == 0) {
- u->state->status = status->code;
- }
-
- u->headers_in.status_n = status->code;
-
- len = status->end - status->start;
- u->headers_in.status_line.len = len;
-
- u->headers_in.status_line.data = ngx_pnalloc(r->pool, len);
- if (u->headers_in.status_line.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(u->headers_in.status_line.data, status->start, len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http scgi status %ui \"%V\"",
- u->headers_in.status_n, &u->headers_in.status_line);
-
- u->process_header = ngx_http_scgi_process_header;
-
- return ngx_http_scgi_process_header(r);
-}
-
-
-static ngx_int_t
-ngx_http_scgi_process_header(ngx_http_request_t *r)
-{
- ngx_str_t *status_line;
- ngx_int_t rc, status;
- ngx_table_elt_t *h;
- ngx_http_upstream_t *u;
- ngx_http_upstream_header_t *hh;
- ngx_http_upstream_main_conf_t *umcf;
-
- umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
-
- for ( ;; ) {
-
- rc = ngx_http_parse_header_line(r, &r->upstream->buffer, 1);
-
- if (rc == NGX_OK) {
-
- /* a header line has been parsed successfully */
-
- h = ngx_list_push(&r->upstream->headers_in.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = r->header_hash;
-
- h->key.len = r->header_name_end - r->header_name_start;
- h->value.len = r->header_end - r->header_start;
-
- h->key.data = ngx_pnalloc(r->pool,
- h->key.len + 1 + h->value.len + 1
- + h->key.len);
- if (h->key.data == NULL) {
- return NGX_ERROR;
- }
-
- h->value.data = h->key.data + h->key.len + 1;
- h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1;
-
- ngx_memcpy(h->key.data, r->header_name_start, h->key.len);
- h->key.data[h->key.len] = '\0';
- ngx_memcpy(h->value.data, r->header_start, h->value.len);
- h->value.data[h->value.len] = '\0';
-
- if (h->key.len == r->lowcase_index) {
- ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
-
- } else {
- ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
- }
-
- hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
- h->lowcase_key, h->key.len);
-
- if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http scgi header: \"%V: %V\"", &h->key, &h->value);
-
- continue;
- }
-
- if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
-
- /* a whole header has been parsed successfully */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http scgi header done");
-
- u = r->upstream;
-
- if (u->headers_in.status_n) {
- goto done;
- }
-
- if (u->headers_in.status) {
- status_line = &u->headers_in.status->value;
-
- status = ngx_atoi(status_line->data, 3);
- if (status == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid status \"%V\"",
- status_line);
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-
- u->headers_in.status_n = status;
- u->headers_in.status_line = *status_line;
-
- } else if (u->headers_in.location) {
- u->headers_in.status_n = 302;
- ngx_str_set(&u->headers_in.status_line,
- "302 Moved Temporarily");
-
- } else {
- u->headers_in.status_n = 200;
- ngx_str_set(&u->headers_in.status_line, "200 OK");
- }
-
- if (u->state && u->state->status == 0) {
- u->state->status = u->headers_in.status_n;
- }
-
- done:
-
- if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS
- && r->headers_in.upgrade)
- {
- u->upgrade = 1;
- }
-
- return NGX_OK;
- }
-
- if (rc == NGX_AGAIN) {
- return NGX_AGAIN;
- }
-
- /* there was error while a header line parsing */
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid header");
-
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-}
-
-
-static void
-ngx_http_scgi_abort_request(ngx_http_request_t *r)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "abort http scgi request");
-
- return;
-}
-
-
-static void
-ngx_http_scgi_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "finalize http scgi request");
-
- return;
-}
-
-
-static void *
-ngx_http_scgi_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_scgi_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_scgi_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->upstream.store = NGX_CONF_UNSET;
- conf->upstream.store_access = NGX_CONF_UNSET_UINT;
- conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
- conf->upstream.buffering = NGX_CONF_UNSET;
- conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
-
- conf->upstream.local = NGX_CONF_UNSET_PTR;
-
- conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
-
- conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
- conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
-
- conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE;
- conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE;
- conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE;
-
- conf->upstream.pass_request_headers = NGX_CONF_UNSET;
- conf->upstream.pass_request_body = NGX_CONF_UNSET;
-
-#if (NGX_HTTP_CACHE)
- conf->upstream.cache = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
- conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
- conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_lock = NGX_CONF_UNSET;
- conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.cache_revalidate = NGX_CONF_UNSET;
-#endif
-
- conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
- conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
-
- conf->upstream.intercept_errors = NGX_CONF_UNSET;
-
- /* "scgi_cyclic_temp_file" is disabled */
- conf->upstream.cyclic_temp_file = 0;
-
- conf->upstream.change_buffering = 1;
-
- ngx_str_set(&conf->upstream.module, "scgi");
-
- return conf;
-}
-
-
-static char *
-ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_scgi_loc_conf_t *prev = parent;
- ngx_http_scgi_loc_conf_t *conf = child;
-
- size_t size;
- ngx_hash_init_t hash;
- ngx_http_core_loc_conf_t *clcf;
-
- if (conf->upstream.store != 0) {
- ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0);
-
- if (conf->upstream.store_lengths == NULL) {
- conf->upstream.store_lengths = prev->upstream.store_lengths;
- conf->upstream.store_values = prev->upstream.store_values;
- }
- }
-
- ngx_conf_merge_uint_value(conf->upstream.store_access,
- prev->upstream.store_access, 0600);
-
- ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
- prev->upstream.next_upstream_tries, 0);
-
- ngx_conf_merge_value(conf->upstream.buffering,
- prev->upstream.buffering, 1);
-
- ngx_conf_merge_value(conf->upstream.ignore_client_abort,
- prev->upstream.ignore_client_abort, 0);
-
- ngx_conf_merge_ptr_value(conf->upstream.local,
- prev->upstream.local, NULL);
-
- ngx_conf_merge_msec_value(conf->upstream.connect_timeout,
- prev->upstream.connect_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.send_timeout,
- prev->upstream.send_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.read_timeout,
- prev->upstream.read_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
- prev->upstream.next_upstream_timeout, 0);
-
- ngx_conf_merge_size_value(conf->upstream.send_lowat,
- prev->upstream.send_lowat, 0);
-
- ngx_conf_merge_size_value(conf->upstream.buffer_size,
- prev->upstream.buffer_size,
- (size_t) ngx_pagesize);
-
-
- ngx_conf_merge_bufs_value(conf->upstream.bufs, prev->upstream.bufs,
- 8, ngx_pagesize);
-
- if (conf->upstream.bufs.num < 2) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "there must be at least 2 \"scgi_buffers\"");
- return NGX_CONF_ERROR;
- }
-
-
- size = conf->upstream.buffer_size;
- if (size < conf->upstream.bufs.size) {
- size = conf->upstream.bufs.size;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.busy_buffers_size_conf,
- prev->upstream.busy_buffers_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.busy_buffers_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.busy_buffers_size = 2 * size;
- } else {
- conf->upstream.busy_buffers_size =
- conf->upstream.busy_buffers_size_conf;
- }
-
- if (conf->upstream.busy_buffers_size < size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"scgi_busy_buffers_size\" must be equal to or greater "
- "than the maximum of the value of \"scgi_buffer_size\" and "
- "one of the \"scgi_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
- if (conf->upstream.busy_buffers_size
- > (conf->upstream.bufs.num - 1) * conf->upstream.bufs.size)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"scgi_busy_buffers_size\" must be less than "
- "the size of all \"scgi_buffers\" minus one buffer");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.temp_file_write_size_conf,
- prev->upstream.temp_file_write_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.temp_file_write_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.temp_file_write_size = 2 * size;
- } else {
- conf->upstream.temp_file_write_size =
- conf->upstream.temp_file_write_size_conf;
- }
-
- if (conf->upstream.temp_file_write_size < size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"scgi_temp_file_write_size\" must be equal to or greater than "
- "the maximum of the value of \"scgi_buffer_size\" and "
- "one of the \"scgi_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.max_temp_file_size_conf,
- prev->upstream.max_temp_file_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.max_temp_file_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.max_temp_file_size = 1024 * 1024 * 1024;
- } else {
- conf->upstream.max_temp_file_size =
- conf->upstream.max_temp_file_size_conf;
- }
-
- if (conf->upstream.max_temp_file_size != 0
- && conf->upstream.max_temp_file_size < size)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"scgi_max_temp_file_size\" must be equal to zero to disable "
- "temporary files usage or must be equal to or greater than "
- "the maximum of the value of \"scgi_buffer_size\" and "
- "one of the \"scgi_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_bitmask_value(conf->upstream.ignore_headers,
- prev->upstream.ignore_headers,
- NGX_CONF_BITMASK_SET);
-
-
- ngx_conf_merge_bitmask_value(conf->upstream.next_upstream,
- prev->upstream.next_upstream,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_ERROR
- |NGX_HTTP_UPSTREAM_FT_TIMEOUT));
-
- if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) {
- conf->upstream.next_upstream = NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF;
- }
-
- if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path,
- prev->upstream.temp_path,
- &ngx_http_scgi_temp_path)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
-#if (NGX_HTTP_CACHE)
-
- ngx_conf_merge_ptr_value(conf->upstream.cache,
- prev->upstream.cache, NULL);
-
- if (conf->upstream.cache && conf->upstream.cache->data == NULL) {
- ngx_shm_zone_t *shm_zone;
-
- shm_zone = conf->upstream.cache;
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"scgi_cache\" zone \"%V\" is unknown",
- &shm_zone->shm.name);
-
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_uint_value(conf->upstream.cache_min_uses,
- prev->upstream.cache_min_uses, 1);
-
- ngx_conf_merge_bitmask_value(conf->upstream.cache_use_stale,
- prev->upstream.cache_use_stale,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF));
-
- if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
- conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF;
- }
-
- if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) {
- conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE;
- }
-
- if (conf->upstream.cache_methods == 0) {
- conf->upstream.cache_methods = prev->upstream.cache_methods;
- }
-
- conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD;
-
- ngx_conf_merge_ptr_value(conf->upstream.cache_bypass,
- prev->upstream.cache_bypass, NULL);
-
- ngx_conf_merge_ptr_value(conf->upstream.no_cache,
- prev->upstream.no_cache, NULL);
-
- ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
- prev->upstream.cache_valid, NULL);
-
- if (conf->cache_key.value.data == NULL) {
- conf->cache_key = prev->cache_key;
- }
-
- if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "no \"scgi_cache_key\" for \"scgi_cache\"");
- }
-
- ngx_conf_merge_value(conf->upstream.cache_lock,
- prev->upstream.cache_lock, 0);
-
- ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout,
- prev->upstream.cache_lock_timeout, 5000);
-
- ngx_conf_merge_value(conf->upstream.cache_revalidate,
- prev->upstream.cache_revalidate, 0);
-
-#endif
-
- ngx_conf_merge_value(conf->upstream.pass_request_headers,
- prev->upstream.pass_request_headers, 1);
- ngx_conf_merge_value(conf->upstream.pass_request_body,
- prev->upstream.pass_request_body, 1);
-
- ngx_conf_merge_value(conf->upstream.intercept_errors,
- prev->upstream.intercept_errors, 0);
-
- hash.max_size = 512;
- hash.bucket_size = ngx_align(64, ngx_cacheline_size);
- hash.name = "scgi_hide_headers_hash";
-
- if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream,
- &prev->upstream, ngx_http_scgi_hide_headers, &hash)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- if (conf->upstream.upstream == NULL) {
- conf->upstream.upstream = prev->upstream.upstream;
- }
-
- if (conf->scgi_lengths == NULL) {
- conf->scgi_lengths = prev->scgi_lengths;
- conf->scgi_values = prev->scgi_values;
- }
-
- if (conf->upstream.upstream || conf->scgi_lengths) {
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- if (clcf->handler == NULL && clcf->lmt_excpt) {
- clcf->handler = ngx_http_scgi_handler;
- }
- }
-
- if (ngx_http_scgi_merge_params(cf, conf, prev) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_scgi_merge_params(ngx_conf_t *cf, ngx_http_scgi_loc_conf_t *conf,
- ngx_http_scgi_loc_conf_t *prev)
-{
- u_char *p;
- size_t size;
- uintptr_t *code;
- ngx_uint_t i, nsrc;
- ngx_array_t headers_names;
-#if (NGX_HTTP_CACHE)
- ngx_array_t params_merged;
-#endif
- ngx_hash_key_t *hk;
- ngx_hash_init_t hash;
- ngx_http_upstream_param_t *src;
- ngx_http_script_compile_t sc;
- ngx_http_script_copy_code_t *copy;
-
- if (conf->params_source == NULL) {
- conf->params_source = prev->params_source;
-
- if (prev->headers_hash.buckets
-#if (NGX_HTTP_CACHE)
- && ((conf->upstream.cache == NULL)
- == (prev->upstream.cache == NULL))
-#endif
- )
- {
- conf->flushes = prev->flushes;
- conf->params_len = prev->params_len;
- conf->params = prev->params;
- conf->headers_hash = prev->headers_hash;
- conf->header_params = prev->header_params;
-
- return NGX_OK;
- }
- }
-
- if (conf->params_source == NULL
-#if (NGX_HTTP_CACHE)
- && (conf->upstream.cache == NULL)
-#endif
- )
- {
- conf->headers_hash.buckets = (void *) 1;
- return NGX_OK;
- }
-
- conf->params_len = ngx_array_create(cf->pool, 64, 1);
- if (conf->params_len == NULL) {
- return NGX_ERROR;
- }
-
- conf->params = ngx_array_create(cf->pool, 512, 1);
- if (conf->params == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&headers_names, cf->temp_pool, 4, sizeof(ngx_hash_key_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (conf->params_source) {
- src = conf->params_source->elts;
- nsrc = conf->params_source->nelts;
-
- } else {
- src = NULL;
- nsrc = 0;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (conf->upstream.cache) {
- ngx_keyval_t *h;
- ngx_http_upstream_param_t *s;
-
- if (ngx_array_init(&params_merged, cf->temp_pool, 4,
- sizeof(ngx_http_upstream_param_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- for (i = 0; i < nsrc; i++) {
-
- s = ngx_array_push(&params_merged);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = src[i];
- }
-
- h = ngx_http_scgi_cache_headers;
-
- while (h->key.len) {
-
- src = params_merged.elts;
- nsrc = params_merged.nelts;
-
- for (i = 0; i < nsrc; i++) {
- if (ngx_strcasecmp(h->key.data, src[i].key.data) == 0) {
- goto next;
- }
- }
-
- s = ngx_array_push(&params_merged);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- s->key = h->key;
- s->value = h->value;
- s->skip_empty = 1;
-
- next:
-
- h++;
- }
-
- src = params_merged.elts;
- nsrc = params_merged.nelts;
- }
-
-#endif
-
- for (i = 0; i < nsrc; i++) {
-
- if (src[i].key.len > sizeof("HTTP_") - 1
- && ngx_strncmp(src[i].key.data, "HTTP_", sizeof("HTTP_") - 1) == 0)
- {
- hk = ngx_array_push(&headers_names);
- if (hk == NULL) {
- return NGX_ERROR;
- }
-
- hk->key.len = src[i].key.len - 5;
- hk->key.data = src[i].key.data + 5;
- hk->key_hash = ngx_hash_key_lc(hk->key.data, hk->key.len);
- hk->value = (void *) 1;
-
- if (src[i].value.len == 0) {
- continue;
- }
- }
-
- copy = ngx_array_push_n(conf->params_len,
- sizeof(ngx_http_script_copy_code_t));
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
- copy->len = src[i].key.len + 1;
-
- copy = ngx_array_push_n(conf->params_len,
- sizeof(ngx_http_script_copy_code_t));
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
- copy->len = src[i].skip_empty;
-
-
- size = (sizeof(ngx_http_script_copy_code_t)
- + src[i].key.len + 1 + sizeof(uintptr_t) - 1)
- & ~(sizeof(uintptr_t) - 1);
-
- copy = ngx_array_push_n(conf->params, size);
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = ngx_http_script_copy_code;
- copy->len = src[i].key.len + 1;
-
- p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
- (void) ngx_cpystrn(p, src[i].key.data, src[i].key.len + 1);
-
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &src[i].value;
- sc.flushes = &conf->flushes;
- sc.lengths = &conf->params_len;
- sc.values = &conf->params;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_ERROR;
- }
-
- code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
-
- code = ngx_array_push_n(conf->params, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
- }
-
- code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
- code = ngx_array_push_n(conf->params, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
- conf->header_params = headers_names.nelts;
-
- hash.hash = &conf->headers_hash;
- hash.key = ngx_hash_key_lc;
- hash.max_size = 512;
- hash.bucket_size = 64;
- hash.name = "scgi_params_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- return ngx_hash_init(&hash, headers_names.elts, headers_names.nelts);
-}
-
-
-static char *
-ngx_http_scgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_scgi_loc_conf_t *scf = conf;
-
- ngx_url_t u;
- ngx_str_t *value, *url;
- ngx_uint_t n;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_script_compile_t sc;
-
- if (scf->upstream.upstream || scf->scgi_lengths) {
- return "is duplicate";
- }
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- clcf->handler = ngx_http_scgi_handler;
-
- value = cf->args->elts;
-
- url = &value[1];
-
- n = ngx_http_script_variables_count(url);
-
- if (n) {
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = url;
- sc.lengths = &scf->scgi_lengths;
- sc.values = &scf->scgi_values;
- sc.variables = n;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
- }
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url = value[1];
- u.no_resolve = 1;
-
- scf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0);
- if (scf->upstream.upstream == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (clcf->name.data[clcf->name.len - 1] == '/') {
- clcf->auto_redirect = 1;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_scgi_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_scgi_loc_conf_t *scf = conf;
-
- ngx_str_t *value;
- ngx_http_script_compile_t sc;
-
- if (scf->upstream.store != NGX_CONF_UNSET || scf->upstream.store_lengths) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- scf->upstream.store = 0;
- return NGX_CONF_OK;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (scf->upstream.cache != NGX_CONF_UNSET_PTR
- && scf->upstream.cache != NULL)
- {
- return "is incompatible with \"scgi_cache\"";
- }
-
-#endif
-
- if (ngx_strcmp(value[1].data, "on") == 0) {
- scf->upstream.store = 1;
- return NGX_CONF_OK;
- }
-
- /* include the terminating '\0' into script */
- value[1].len++;
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &value[1];
- sc.lengths = &scf->upstream.store_lengths;
- sc.values = &scf->upstream.store_values;
- sc.variables = ngx_http_script_variables_count(&value[1]);
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-static char *
-ngx_http_scgi_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_scgi_loc_conf_t *scf = conf;
-
- ngx_str_t *value;
-
- value = cf->args->elts;
-
- if (scf->upstream.cache != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- scf->upstream.cache = NULL;
- return NGX_CONF_OK;
- }
-
- if (scf->upstream.store > 0 || scf->upstream.store_lengths) {
- return "is incompatible with \"scgi_store\"";
- }
-
- scf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0,
- &ngx_http_scgi_module);
- if (scf->upstream.cache == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_scgi_cache_key(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_scgi_loc_conf_t *scf = conf;
-
- ngx_str_t *value;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- if (scf->cache_key.value.data) {
- return "is duplicate";
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &scf->cache_key;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_secure_link_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_secure_link_module.c
deleted file mode 100644
index 907ba6ef50c..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_secure_link_module.c
+++ /dev/null
@@ -1,368 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <ngx_md5.h>
-
-
-typedef struct {
- ngx_http_complex_value_t *variable;
- ngx_http_complex_value_t *md5;
- ngx_str_t secret;
-} ngx_http_secure_link_conf_t;
-
-
-typedef struct {
- ngx_str_t expires;
-} ngx_http_secure_link_ctx_t;
-
-
-static ngx_int_t ngx_http_secure_link_old_variable(ngx_http_request_t *r,
- ngx_http_secure_link_conf_t *conf, ngx_http_variable_value_t *v,
- uintptr_t data);
-static ngx_int_t ngx_http_secure_link_expires_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static void *ngx_http_secure_link_create_conf(ngx_conf_t *cf);
-static char *ngx_http_secure_link_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static ngx_int_t ngx_http_secure_link_add_variables(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_secure_link_commands[] = {
-
- { ngx_string("secure_link"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_set_complex_value_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_secure_link_conf_t, variable),
- NULL },
-
- { ngx_string("secure_link_md5"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_set_complex_value_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_secure_link_conf_t, md5),
- NULL },
-
- { ngx_string("secure_link_secret"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_secure_link_conf_t, secret),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_secure_link_module_ctx = {
- ngx_http_secure_link_add_variables, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_secure_link_create_conf, /* create location configuration */
- ngx_http_secure_link_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_secure_link_module = {
- NGX_MODULE_V1,
- &ngx_http_secure_link_module_ctx, /* module context */
- ngx_http_secure_link_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_http_secure_link_name = ngx_string("secure_link");
-static ngx_str_t ngx_http_secure_link_expires_name =
- ngx_string("secure_link_expires");
-
-
-static ngx_int_t
-ngx_http_secure_link_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p, *last;
- ngx_str_t val, hash;
- time_t expires;
- ngx_md5_t md5;
- ngx_http_secure_link_ctx_t *ctx;
- ngx_http_secure_link_conf_t *conf;
- u_char hash_buf[16], md5_buf[16];
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_secure_link_module);
-
- if (conf->secret.data) {
- return ngx_http_secure_link_old_variable(r, conf, v, data);
- }
-
- if (conf->variable == NULL || conf->md5 == NULL) {
- goto not_found;
- }
-
- if (ngx_http_complex_value(r, conf->variable, &val) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "secure link: \"%V\"", &val);
-
- last = val.data + val.len;
-
- p = ngx_strlchr(val.data, last, ',');
- expires = 0;
-
- if (p) {
- val.len = p++ - val.data;
-
- expires = ngx_atotm(p, last - p);
- if (expires <= 0) {
- goto not_found;
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_secure_link_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_secure_link_module);
-
- ctx->expires.len = last - p;
- ctx->expires.data = p;
- }
-
- if (val.len > 24) {
- goto not_found;
- }
-
- hash.len = 16;
- hash.data = hash_buf;
-
- if (ngx_decode_base64url(&hash, &val) != NGX_OK) {
- goto not_found;
- }
-
- if (hash.len != 16) {
- goto not_found;
- }
-
- if (ngx_http_complex_value(r, conf->md5, &val) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "secure link md5: \"%V\"", &val);
-
- ngx_md5_init(&md5);
- ngx_md5_update(&md5, val.data, val.len);
- ngx_md5_final(md5_buf, &md5);
-
- if (ngx_memcmp(hash_buf, md5_buf, 16) != 0) {
- goto not_found;
- }
-
- v->data = (u_char *) ((expires && expires < ngx_time()) ? "0" : "1");
- v->len = 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
-
-not_found:
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_secure_link_old_variable(ngx_http_request_t *r,
- ngx_http_secure_link_conf_t *conf, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- u_char *p, *start, *end, *last;
- size_t len;
- ngx_int_t n;
- ngx_uint_t i;
- ngx_md5_t md5;
- u_char hash[16];
-
- p = &r->unparsed_uri.data[1];
- last = r->unparsed_uri.data + r->unparsed_uri.len;
-
- while (p < last) {
- if (*p++ == '/') {
- start = p;
- goto md5_start;
- }
- }
-
- goto not_found;
-
-md5_start:
-
- while (p < last) {
- if (*p++ == '/') {
- end = p - 1;
- goto url_start;
- }
- }
-
- goto not_found;
-
-url_start:
-
- len = last - p;
-
- if (end - start != 32 || len == 0) {
- goto not_found;
- }
-
- ngx_md5_init(&md5);
- ngx_md5_update(&md5, p, len);
- ngx_md5_update(&md5, conf->secret.data, conf->secret.len);
- ngx_md5_final(hash, &md5);
-
- for (i = 0; i < 16; i++) {
- n = ngx_hextoi(&start[2 * i], 2);
- if (n == NGX_ERROR || n != hash[i]) {
- goto not_found;
- }
- }
-
- v->len = len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-
-not_found:
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_secure_link_expires_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_secure_link_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_secure_link_module);
-
- if (ctx) {
- v->len = ctx->expires.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = ctx->expires.data;
-
- } else {
- v->not_found = 1;
- }
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_secure_link_create_conf(ngx_conf_t *cf)
-{
- ngx_http_secure_link_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_secure_link_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->variable = NULL;
- * conf->md5 = NULL;
- * conf->secret = { 0, NULL };
- */
-
- return conf;
-}
-
-
-static char *
-ngx_http_secure_link_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_secure_link_conf_t *prev = parent;
- ngx_http_secure_link_conf_t *conf = child;
-
- if (conf->secret.data) {
- if (conf->variable || conf->md5) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"secure_link_secret\" cannot be mixed with "
- "\"secure_link\" and \"secure_link_md5\"");
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
- }
-
- if (conf->variable == NULL) {
- conf->variable = prev->variable;
- }
-
- if (conf->md5 == NULL) {
- conf->md5 = prev->md5;
- }
-
- if (conf->variable == NULL && conf->md5 == NULL) {
- conf->secret = prev->secret;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_secure_link_add_variables(ngx_conf_t *cf)
-{
- ngx_http_variable_t *var;
-
- var = ngx_http_add_variable(cf, &ngx_http_secure_link_name, 0);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = ngx_http_secure_link_variable;
-
- var = ngx_http_add_variable(cf, &ngx_http_secure_link_expires_name, 0);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = ngx_http_secure_link_expires_variable;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_split_clients_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_split_clients_module.c
deleted file mode 100644
index 2f92c9e1a8f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_split_clients_module.c
+++ /dev/null
@@ -1,246 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- uint32_t percent;
- ngx_http_variable_value_t value;
-} ngx_http_split_clients_part_t;
-
-
-typedef struct {
- ngx_http_complex_value_t value;
- ngx_array_t parts;
-} ngx_http_split_clients_ctx_t;
-
-
-static char *ngx_conf_split_clients_block(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_split_clients(ngx_conf_t *cf, ngx_command_t *dummy,
- void *conf);
-
-static ngx_command_t ngx_http_split_clients_commands[] = {
-
- { ngx_string("split_clients"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE2,
- ngx_conf_split_clients_block,
- NGX_HTTP_MAIN_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_split_clients_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_split_clients_module = {
- NGX_MODULE_V1,
- &ngx_http_split_clients_module_ctx, /* module context */
- ngx_http_split_clients_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_split_clients_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_split_clients_ctx_t *ctx = (ngx_http_split_clients_ctx_t *) data;
-
- uint32_t hash;
- ngx_str_t val;
- ngx_uint_t i;
- ngx_http_split_clients_part_t *part;
-
- *v = ngx_http_variable_null_value;
-
- if (ngx_http_complex_value(r, &ctx->value, &val) != NGX_OK) {
- return NGX_OK;
- }
-
- hash = ngx_murmur_hash2(val.data, val.len);
-
- part = ctx->parts.elts;
-
- for (i = 0; i < ctx->parts.nelts; i++) {
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http split: %uD %uD", hash, part[i].percent);
-
- if (hash < part[i].percent || part[i].percent == 0) {
- *v = part[i].value;
- return NGX_OK;
- }
- }
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_conf_split_clients_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *rv;
- uint32_t sum, last;
- ngx_str_t *value, name;
- ngx_uint_t i;
- ngx_conf_t save;
- ngx_http_variable_t *var;
- ngx_http_split_clients_ctx_t *ctx;
- ngx_http_split_clients_part_t *part;
- ngx_http_compile_complex_value_t ccv;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_split_clients_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &ctx->value;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- name = value[2];
-
- if (name.data[0] != '$') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"%V\"", &name);
- return NGX_CONF_ERROR;
- }
-
- name.len--;
- name.data++;
-
- var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
- if (var == NULL) {
- return NGX_CONF_ERROR;
- }
-
- var->get_handler = ngx_http_split_clients_variable;
- var->data = (uintptr_t) ctx;
-
- if (ngx_array_init(&ctx->parts, cf->pool, 2,
- sizeof(ngx_http_split_clients_part_t))
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- save = *cf;
- cf->ctx = ctx;
- cf->handler = ngx_http_split_clients;
- cf->handler_conf = conf;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = save;
-
- if (rv != NGX_CONF_OK) {
- return rv;
- }
-
- sum = 0;
- last = 0;
- part = ctx->parts.elts;
-
- for (i = 0; i < ctx->parts.nelts; i++) {
- sum = part[i].percent ? sum + part[i].percent : 10000;
- if (sum > 10000) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "percent total is greater than 100%%");
- return NGX_CONF_ERROR;
- }
-
- if (part[i].percent) {
- last += part[i].percent * (uint64_t) 0xffffffff / 10000;
- part[i].percent = last;
- }
- }
-
- return rv;
-}
-
-
-static char *
-ngx_http_split_clients(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
-{
- ngx_int_t n;
- ngx_str_t *value;
- ngx_http_split_clients_ctx_t *ctx;
- ngx_http_split_clients_part_t *part;
-
- ctx = cf->ctx;
- value = cf->args->elts;
-
- part = ngx_array_push(&ctx->parts);
- if (part == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (value[0].len == 1 && value[0].data[0] == '*') {
- part->percent = 0;
-
- } else {
- if (value[0].len == 0 || value[0].data[value[0].len - 1] != '%') {
- goto invalid;
- }
-
- n = ngx_atofp(value[0].data, value[0].len - 1, 2);
- if (n == NGX_ERROR || n == 0) {
- goto invalid;
- }
-
- part->percent = (uint32_t) n;
- }
-
- part->value.len = value[1].len;
- part->value.valid = 1;
- part->value.no_cacheable = 0;
- part->value.not_found = 0;
- part->value.data = value[1].data;
-
- return NGX_CONF_OK;
-
-invalid:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid percent value \"%V\"", &value[0]);
- return NGX_CONF_ERROR;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.c
deleted file mode 100644
index 8236320c295..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.c
+++ /dev/null
@@ -1,2930 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-#define NGX_HTTP_SSI_ERROR 1
-
-#define NGX_HTTP_SSI_DATE_LEN 2048
-
-#define NGX_HTTP_SSI_ADD_PREFIX 1
-#define NGX_HTTP_SSI_ADD_ZERO 2
-
-
-typedef struct {
- ngx_flag_t enable;
- ngx_flag_t silent_errors;
- ngx_flag_t ignore_recycled_buffers;
- ngx_flag_t last_modified;
-
- ngx_hash_t types;
-
- size_t min_file_chunk;
- size_t value_len;
-
- ngx_array_t *types_keys;
-} ngx_http_ssi_loc_conf_t;
-
-
-typedef struct {
- ngx_str_t name;
- ngx_uint_t key;
- ngx_str_t value;
-} ngx_http_ssi_var_t;
-
-
-typedef struct {
- ngx_str_t name;
- ngx_chain_t *bufs;
- ngx_uint_t count;
-} ngx_http_ssi_block_t;
-
-
-typedef enum {
- ssi_start_state = 0,
- ssi_tag_state,
- ssi_comment0_state,
- ssi_comment1_state,
- ssi_sharp_state,
- ssi_precommand_state,
- ssi_command_state,
- ssi_preparam_state,
- ssi_param_state,
- ssi_preequal_state,
- ssi_prevalue_state,
- ssi_double_quoted_value_state,
- ssi_quoted_value_state,
- ssi_quoted_symbol_state,
- ssi_postparam_state,
- ssi_comment_end0_state,
- ssi_comment_end1_state,
- ssi_error_state,
- ssi_error_end0_state,
- ssi_error_end1_state
-} ngx_http_ssi_state_e;
-
-
-static ngx_int_t ngx_http_ssi_output(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx);
-static void ngx_http_ssi_buffered(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx);
-static ngx_int_t ngx_http_ssi_parse(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx);
-static ngx_str_t *ngx_http_ssi_get_variable(ngx_http_request_t *r,
- ngx_str_t *name, ngx_uint_t key);
-static ngx_int_t ngx_http_ssi_evaluate_string(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t *text, ngx_uint_t flags);
-static ngx_int_t ngx_http_ssi_regex_match(ngx_http_request_t *r,
- ngx_str_t *pattern, ngx_str_t *str);
-
-static ngx_int_t ngx_http_ssi_include(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **params);
-static ngx_int_t ngx_http_ssi_stub_output(ngx_http_request_t *r, void *data,
- ngx_int_t rc);
-static ngx_int_t ngx_http_ssi_set_variable(ngx_http_request_t *r, void *data,
- ngx_int_t rc);
-static ngx_int_t ngx_http_ssi_echo(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **params);
-static ngx_int_t ngx_http_ssi_config(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **params);
-static ngx_int_t ngx_http_ssi_set(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **params);
-static ngx_int_t ngx_http_ssi_if(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **params);
-static ngx_int_t ngx_http_ssi_else(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **params);
-static ngx_int_t ngx_http_ssi_endif(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **params);
-static ngx_int_t ngx_http_ssi_block(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **params);
-static ngx_int_t ngx_http_ssi_endblock(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **params);
-
-static ngx_int_t ngx_http_ssi_date_gmt_local_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t gmt);
-
-static ngx_int_t ngx_http_ssi_preconfiguration(ngx_conf_t *cf);
-static void *ngx_http_ssi_create_main_conf(ngx_conf_t *cf);
-static char *ngx_http_ssi_init_main_conf(ngx_conf_t *cf, void *conf);
-static void *ngx_http_ssi_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_ssi_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_ssi_filter_init(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_ssi_filter_commands[] = {
-
- { ngx_string("ssi"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_ssi_loc_conf_t, enable),
- NULL },
-
- { ngx_string("ssi_silent_errors"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_ssi_loc_conf_t, silent_errors),
- NULL },
-
- { ngx_string("ssi_ignore_recycled_buffers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_ssi_loc_conf_t, ignore_recycled_buffers),
- NULL },
-
- { ngx_string("ssi_min_file_chunk"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_ssi_loc_conf_t, min_file_chunk),
- NULL },
-
- { ngx_string("ssi_value_length"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_ssi_loc_conf_t, value_len),
- NULL },
-
- { ngx_string("ssi_types"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_types_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_ssi_loc_conf_t, types_keys),
- &ngx_http_html_default_types[0] },
-
- { ngx_string("ssi_last_modified"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_ssi_loc_conf_t, last_modified),
- NULL },
-
- ngx_null_command
-};
-
-
-
-static ngx_http_module_t ngx_http_ssi_filter_module_ctx = {
- ngx_http_ssi_preconfiguration, /* preconfiguration */
- ngx_http_ssi_filter_init, /* postconfiguration */
-
- ngx_http_ssi_create_main_conf, /* create main configuration */
- ngx_http_ssi_init_main_conf, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_ssi_create_loc_conf, /* create location configuration */
- ngx_http_ssi_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_ssi_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_ssi_filter_module_ctx, /* module context */
- ngx_http_ssi_filter_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static u_char ngx_http_ssi_string[] = "<!--";
-
-static ngx_str_t ngx_http_ssi_none = ngx_string("(none)");
-static ngx_str_t ngx_http_ssi_timefmt = ngx_string("%A, %d-%b-%Y %H:%M:%S %Z");
-static ngx_str_t ngx_http_ssi_null_string = ngx_null_string;
-
-
-#define NGX_HTTP_SSI_INCLUDE_VIRTUAL 0
-#define NGX_HTTP_SSI_INCLUDE_FILE 1
-#define NGX_HTTP_SSI_INCLUDE_WAIT 2
-#define NGX_HTTP_SSI_INCLUDE_SET 3
-#define NGX_HTTP_SSI_INCLUDE_STUB 4
-
-#define NGX_HTTP_SSI_ECHO_VAR 0
-#define NGX_HTTP_SSI_ECHO_DEFAULT 1
-#define NGX_HTTP_SSI_ECHO_ENCODING 2
-
-#define NGX_HTTP_SSI_CONFIG_ERRMSG 0
-#define NGX_HTTP_SSI_CONFIG_TIMEFMT 1
-
-#define NGX_HTTP_SSI_SET_VAR 0
-#define NGX_HTTP_SSI_SET_VALUE 1
-
-#define NGX_HTTP_SSI_IF_EXPR 0
-
-#define NGX_HTTP_SSI_BLOCK_NAME 0
-
-
-static ngx_http_ssi_param_t ngx_http_ssi_include_params[] = {
- { ngx_string("virtual"), NGX_HTTP_SSI_INCLUDE_VIRTUAL, 0, 0 },
- { ngx_string("file"), NGX_HTTP_SSI_INCLUDE_FILE, 0, 0 },
- { ngx_string("wait"), NGX_HTTP_SSI_INCLUDE_WAIT, 0, 0 },
- { ngx_string("set"), NGX_HTTP_SSI_INCLUDE_SET, 0, 0 },
- { ngx_string("stub"), NGX_HTTP_SSI_INCLUDE_STUB, 0, 0 },
- { ngx_null_string, 0, 0, 0 }
-};
-
-
-static ngx_http_ssi_param_t ngx_http_ssi_echo_params[] = {
- { ngx_string("var"), NGX_HTTP_SSI_ECHO_VAR, 1, 0 },
- { ngx_string("default"), NGX_HTTP_SSI_ECHO_DEFAULT, 0, 0 },
- { ngx_string("encoding"), NGX_HTTP_SSI_ECHO_ENCODING, 0, 0 },
- { ngx_null_string, 0, 0, 0 }
-};
-
-
-static ngx_http_ssi_param_t ngx_http_ssi_config_params[] = {
- { ngx_string("errmsg"), NGX_HTTP_SSI_CONFIG_ERRMSG, 0, 0 },
- { ngx_string("timefmt"), NGX_HTTP_SSI_CONFIG_TIMEFMT, 0, 0 },
- { ngx_null_string, 0, 0, 0 }
-};
-
-
-static ngx_http_ssi_param_t ngx_http_ssi_set_params[] = {
- { ngx_string("var"), NGX_HTTP_SSI_SET_VAR, 1, 0 },
- { ngx_string("value"), NGX_HTTP_SSI_SET_VALUE, 1, 0 },
- { ngx_null_string, 0, 0, 0 }
-};
-
-
-static ngx_http_ssi_param_t ngx_http_ssi_if_params[] = {
- { ngx_string("expr"), NGX_HTTP_SSI_IF_EXPR, 1, 0 },
- { ngx_null_string, 0, 0, 0 }
-};
-
-
-static ngx_http_ssi_param_t ngx_http_ssi_block_params[] = {
- { ngx_string("name"), NGX_HTTP_SSI_BLOCK_NAME, 1, 0 },
- { ngx_null_string, 0, 0, 0 }
-};
-
-
-static ngx_http_ssi_param_t ngx_http_ssi_no_params[] = {
- { ngx_null_string, 0, 0, 0 }
-};
-
-
-static ngx_http_ssi_command_t ngx_http_ssi_commands[] = {
- { ngx_string("include"), ngx_http_ssi_include,
- ngx_http_ssi_include_params, 0, 0, 1 },
- { ngx_string("echo"), ngx_http_ssi_echo,
- ngx_http_ssi_echo_params, 0, 0, 0 },
- { ngx_string("config"), ngx_http_ssi_config,
- ngx_http_ssi_config_params, 0, 0, 0 },
- { ngx_string("set"), ngx_http_ssi_set, ngx_http_ssi_set_params, 0, 0, 0 },
-
- { ngx_string("if"), ngx_http_ssi_if, ngx_http_ssi_if_params, 0, 0, 0 },
- { ngx_string("elif"), ngx_http_ssi_if, ngx_http_ssi_if_params,
- NGX_HTTP_SSI_COND_IF, 0, 0 },
- { ngx_string("else"), ngx_http_ssi_else, ngx_http_ssi_no_params,
- NGX_HTTP_SSI_COND_IF, 0, 0 },
- { ngx_string("endif"), ngx_http_ssi_endif, ngx_http_ssi_no_params,
- NGX_HTTP_SSI_COND_ELSE, 0, 0 },
-
- { ngx_string("block"), ngx_http_ssi_block,
- ngx_http_ssi_block_params, 0, 0, 0 },
- { ngx_string("endblock"), ngx_http_ssi_endblock,
- ngx_http_ssi_no_params, 0, 1, 0 },
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-static ngx_http_variable_t ngx_http_ssi_vars[] = {
-
- { ngx_string("date_local"), NULL, ngx_http_ssi_date_gmt_local_variable, 0,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("date_gmt"), NULL, ngx_http_ssi_date_gmt_local_variable, 1,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-
-static ngx_int_t
-ngx_http_ssi_header_filter(ngx_http_request_t *r)
-{
- ngx_http_ssi_ctx_t *ctx;
- ngx_http_ssi_loc_conf_t *slcf;
-
- slcf = ngx_http_get_module_loc_conf(r, ngx_http_ssi_filter_module);
-
- if (!slcf->enable
- || r->headers_out.content_length_n == 0
- || ngx_http_test_content_type(r, &slcf->types) == NULL)
- {
- return ngx_http_next_header_filter(r);
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_ssi_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_ssi_filter_module);
-
-
- ctx->value_len = slcf->value_len;
- ctx->last_out = &ctx->out;
-
- ctx->encoding = NGX_HTTP_SSI_ENTITY_ENCODING;
- ctx->output = 1;
-
- ctx->params.elts = ctx->params_array;
- ctx->params.size = sizeof(ngx_table_elt_t);
- ctx->params.nalloc = NGX_HTTP_SSI_PARAMS_N;
- ctx->params.pool = r->pool;
-
- ctx->timefmt = ngx_http_ssi_timefmt;
- ngx_str_set(&ctx->errmsg,
- "[an error occurred while processing the directive]");
-
- r->filter_need_in_memory = 1;
-
- if (r == r->main) {
- ngx_http_clear_content_length(r);
- ngx_http_clear_accept_ranges(r);
-
- if (!slcf->last_modified) {
- ngx_http_clear_last_modified(r);
- ngx_http_clear_etag(r);
-
- } else {
- ngx_http_weak_etag(r);
- }
- }
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_ssi_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- size_t len;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_uint_t i, index;
- ngx_chain_t *cl, **ll;
- ngx_table_elt_t *param;
- ngx_http_ssi_ctx_t *ctx, *mctx;
- ngx_http_ssi_block_t *bl;
- ngx_http_ssi_param_t *prm;
- ngx_http_ssi_command_t *cmd;
- ngx_http_ssi_loc_conf_t *slcf;
- ngx_http_ssi_main_conf_t *smcf;
- ngx_str_t *params[NGX_HTTP_SSI_MAX_PARAMS + 1];
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_ssi_filter_module);
-
- if (ctx == NULL
- || (in == NULL
- && ctx->buf == NULL
- && ctx->in == NULL
- && ctx->busy == NULL))
- {
- return ngx_http_next_body_filter(r, in);
- }
-
- /* add the incoming chain to the chain ctx->in */
-
- if (in) {
- if (ngx_chain_add_copy(r->pool, &ctx->in, in) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http ssi filter \"%V?%V\"", &r->uri, &r->args);
-
- if (ctx->wait) {
-
- if (r != r->connection->data) {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http ssi filter wait \"%V?%V\" non-active",
- &ctx->wait->uri, &ctx->wait->args);
-
- return NGX_AGAIN;
- }
-
- if (ctx->wait->done) {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http ssi filter wait \"%V?%V\" done",
- &ctx->wait->uri, &ctx->wait->args);
-
- ctx->wait = NULL;
-
- } else {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http ssi filter wait \"%V?%V\"",
- &ctx->wait->uri, &ctx->wait->args);
-
- return ngx_http_next_body_filter(r, NULL);
- }
- }
-
- slcf = ngx_http_get_module_loc_conf(r, ngx_http_ssi_filter_module);
-
- while (ctx->in || ctx->buf) {
-
- if (ctx->buf == NULL) {
- ctx->buf = ctx->in->buf;
- ctx->in = ctx->in->next;
- ctx->pos = ctx->buf->pos;
- }
-
- if (ctx->state == ssi_start_state) {
- ctx->copy_start = ctx->pos;
- ctx->copy_end = ctx->pos;
- }
-
- b = NULL;
-
- while (ctx->pos < ctx->buf->last) {
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "saved: %d state: %d", ctx->saved, ctx->state);
-
- rc = ngx_http_ssi_parse(r, ctx);
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "parse: %d, looked: %d %p-%p",
- rc, ctx->looked, ctx->copy_start, ctx->copy_end);
-
- if (rc == NGX_ERROR) {
- return rc;
- }
-
- if (ctx->copy_start != ctx->copy_end) {
-
- if (ctx->output) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "saved: %d", ctx->saved);
-
- if (ctx->saved) {
-
- if (ctx->free) {
- cl = ctx->free;
- ctx->free = ctx->free->next;
- b = cl->buf;
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- } else {
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- }
-
- b->memory = 1;
- b->pos = ngx_http_ssi_string;
- b->last = ngx_http_ssi_string + ctx->saved;
-
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- ctx->saved = 0;
- }
-
- if (ctx->free) {
- cl = ctx->free;
- ctx->free = ctx->free->next;
- b = cl->buf;
-
- } else {
- b = ngx_alloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- }
-
- ngx_memcpy(b, ctx->buf, sizeof(ngx_buf_t));
-
- b->pos = ctx->copy_start;
- b->last = ctx->copy_end;
- b->shadow = NULL;
- b->last_buf = 0;
- b->recycled = 0;
-
- if (b->in_file) {
- if (slcf->min_file_chunk < (size_t) (b->last - b->pos))
- {
- b->file_last = b->file_pos
- + (b->last - ctx->buf->pos);
- b->file_pos += b->pos - ctx->buf->pos;
-
- } else {
- b->in_file = 0;
- }
- }
-
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- } else {
- if (ctx->block
- && ctx->saved + (ctx->copy_end - ctx->copy_start))
- {
- b = ngx_create_temp_buf(r->pool,
- ctx->saved + (ctx->copy_end - ctx->copy_start));
-
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- if (ctx->saved) {
- b->last = ngx_cpymem(b->pos, ngx_http_ssi_string,
- ctx->saved);
- }
-
- b->last = ngx_cpymem(b->last, ctx->copy_start,
- ctx->copy_end - ctx->copy_start);
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- cl->next = NULL;
-
- b = NULL;
-
- mctx = ngx_http_get_module_ctx(r->main,
- ngx_http_ssi_filter_module);
- bl = mctx->blocks->elts;
- for (ll = &bl[mctx->blocks->nelts - 1].bufs;
- *ll;
- ll = &(*ll)->next)
- {
- /* void */
- }
-
- *ll = cl;
- }
-
- ctx->saved = 0;
- }
- }
-
- if (ctx->state == ssi_start_state) {
- ctx->copy_start = ctx->pos;
- ctx->copy_end = ctx->pos;
-
- } else {
- ctx->copy_start = NULL;
- ctx->copy_end = NULL;
- }
-
- if (rc == NGX_AGAIN) {
- continue;
- }
-
-
- b = NULL;
-
- if (rc == NGX_OK) {
-
- smcf = ngx_http_get_module_main_conf(r,
- ngx_http_ssi_filter_module);
-
- cmd = ngx_hash_find(&smcf->hash, ctx->key, ctx->command.data,
- ctx->command.len);
-
- if (cmd == NULL) {
- if (ctx->output) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid SSI command: \"%V\"",
- &ctx->command);
- goto ssi_error;
- }
-
- continue;
- }
-
- if (!ctx->output && !cmd->block) {
-
- if (ctx->block) {
-
- /* reconstruct the SSI command text */
-
- len = 5 + ctx->command.len + 4;
-
- param = ctx->params.elts;
- for (i = 0; i < ctx->params.nelts; i++) {
- len += 1 + param[i].key.len + 2
- + param[i].value.len + 1;
- }
-
- b = ngx_create_temp_buf(r->pool, len);
-
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- cl->next = NULL;
-
- *b->last++ = '<';
- *b->last++ = '!';
- *b->last++ = '-';
- *b->last++ = '-';
- *b->last++ = '#';
-
- b->last = ngx_cpymem(b->last, ctx->command.data,
- ctx->command.len);
-
- for (i = 0; i < ctx->params.nelts; i++) {
- *b->last++ = ' ';
- b->last = ngx_cpymem(b->last, param[i].key.data,
- param[i].key.len);
- *b->last++ = '=';
- *b->last++ = '"';
- b->last = ngx_cpymem(b->last, param[i].value.data,
- param[i].value.len);
- *b->last++ = '"';
- }
-
- *b->last++ = ' ';
- *b->last++ = '-';
- *b->last++ = '-';
- *b->last++ = '>';
-
- mctx = ngx_http_get_module_ctx(r->main,
- ngx_http_ssi_filter_module);
- bl = mctx->blocks->elts;
- for (ll = &bl[mctx->blocks->nelts - 1].bufs;
- *ll;
- ll = &(*ll)->next)
- {
- /* void */
- }
-
- *ll = cl;
-
- b = NULL;
-
- continue;
- }
-
- if (cmd->conditional == 0) {
- continue;
- }
- }
-
- if (cmd->conditional
- && (ctx->conditional == 0
- || ctx->conditional > cmd->conditional))
- {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid context of SSI command: \"%V\"",
- &ctx->command);
- goto ssi_error;
- }
-
- if (ctx->params.nelts > NGX_HTTP_SSI_MAX_PARAMS) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "too many SSI command parameters: \"%V\"",
- &ctx->command);
- goto ssi_error;
- }
-
- ngx_memzero(params,
- (NGX_HTTP_SSI_MAX_PARAMS + 1) * sizeof(ngx_str_t *));
-
- param = ctx->params.elts;
-
- for (i = 0; i < ctx->params.nelts; i++) {
-
- for (prm = cmd->params; prm->name.len; prm++) {
-
- if (param[i].key.len != prm->name.len
- || ngx_strncmp(param[i].key.data, prm->name.data,
- prm->name.len) != 0)
- {
- continue;
- }
-
- if (!prm->multiple) {
- if (params[prm->index]) {
- ngx_log_error(NGX_LOG_ERR,
- r->connection->log, 0,
- "duplicate \"%V\" parameter "
- "in \"%V\" SSI command",
- &param[i].key, &ctx->command);
-
- goto ssi_error;
- }
-
- params[prm->index] = &param[i].value;
-
- break;
- }
-
- for (index = prm->index; params[index]; index++) {
- /* void */
- }
-
- params[index] = &param[i].value;
-
- break;
- }
-
- if (prm->name.len == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid parameter name: \"%V\" "
- "in \"%V\" SSI command",
- &param[i].key, &ctx->command);
-
- goto ssi_error;
- }
- }
-
- for (prm = cmd->params; prm->name.len; prm++) {
- if (prm->mandatory && params[prm->index] == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "mandatory \"%V\" parameter is absent "
- "in \"%V\" SSI command",
- &prm->name, &ctx->command);
-
- goto ssi_error;
- }
- }
-
- if (cmd->flush && ctx->out) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi flush");
-
- if (ngx_http_ssi_output(r, ctx) == NGX_ERROR) {
- return NGX_ERROR;
- }
- }
-
- rc = cmd->handler(r, ctx, params);
-
- if (rc == NGX_OK) {
- continue;
- }
-
- if (rc == NGX_DONE || rc == NGX_AGAIN || rc == NGX_ERROR) {
- ngx_http_ssi_buffered(r, ctx);
- return rc;
- }
- }
-
-
- /* rc == NGX_HTTP_SSI_ERROR */
-
- ssi_error:
-
- if (slcf->silent_errors) {
- continue;
- }
-
- if (ctx->free) {
- cl = ctx->free;
- ctx->free = ctx->free->next;
- b = cl->buf;
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- } else {
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- }
-
- b->memory = 1;
- b->pos = ctx->errmsg.data;
- b->last = ctx->errmsg.data + ctx->errmsg.len;
-
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- continue;
- }
-
- if (ctx->buf->last_buf || ngx_buf_in_memory(ctx->buf)) {
- if (b == NULL) {
- if (ctx->free) {
- cl = ctx->free;
- ctx->free = ctx->free->next;
- b = cl->buf;
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- } else {
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- }
-
- b->sync = 1;
-
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
- }
-
- b->last_buf = ctx->buf->last_buf;
- b->shadow = ctx->buf;
-
- if (slcf->ignore_recycled_buffers == 0) {
- b->recycled = ctx->buf->recycled;
- }
- }
-
- ctx->buf = NULL;
-
- ctx->saved = ctx->looked;
- }
-
- if (ctx->out == NULL && ctx->busy == NULL) {
- return NGX_OK;
- }
-
- return ngx_http_ssi_output(r, ctx);
-}
-
-
-static ngx_int_t
-ngx_http_ssi_output(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx)
-{
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t *cl;
-
-#if 1
- b = NULL;
- for (cl = ctx->out; cl; cl = cl->next) {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi out: %p %p", cl->buf, cl->buf->pos);
- if (cl->buf == b) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "the same buf was used in ssi");
- ngx_debug_point();
- return NGX_ERROR;
- }
- b = cl->buf;
- }
-#endif
-
- rc = ngx_http_next_body_filter(r, ctx->out);
-
- if (ctx->busy == NULL) {
- ctx->busy = ctx->out;
-
- } else {
- for (cl = ctx->busy; cl->next; cl = cl->next) { /* void */ }
- cl->next = ctx->out;
- }
-
- ctx->out = NULL;
- ctx->last_out = &ctx->out;
-
- while (ctx->busy) {
-
- cl = ctx->busy;
- b = cl->buf;
-
- if (ngx_buf_size(b) != 0) {
- break;
- }
-
- if (b->shadow) {
- b->shadow->pos = b->shadow->last;
- }
-
- ctx->busy = cl->next;
-
- if (ngx_buf_in_memory(b) || b->in_file) {
- /* add data bufs only to the free buf chain */
-
- cl->next = ctx->free;
- ctx->free = cl;
- }
- }
-
- ngx_http_ssi_buffered(r, ctx);
-
- return rc;
-}
-
-
-static void
-ngx_http_ssi_buffered(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx)
-{
- if (ctx->in || ctx->buf) {
- r->buffered |= NGX_HTTP_SSI_BUFFERED;
-
- } else {
- r->buffered &= ~NGX_HTTP_SSI_BUFFERED;
- }
-}
-
-
-static ngx_int_t
-ngx_http_ssi_parse(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx)
-{
- u_char *p, *value, *last, *copy_end, ch;
- size_t looked;
- ngx_http_ssi_state_e state;
-
- state = ctx->state;
- looked = ctx->looked;
- last = ctx->buf->last;
- copy_end = ctx->copy_end;
-
- for (p = ctx->pos; p < last; p++) {
-
- ch = *p;
-
- if (state == ssi_start_state) {
-
- /* the tight loop */
-
- for ( ;; ) {
- if (ch == '<') {
- copy_end = p;
- looked = 1;
- state = ssi_tag_state;
-
- goto tag_started;
- }
-
- if (++p == last) {
- break;
- }
-
- ch = *p;
- }
-
- ctx->state = state;
- ctx->pos = p;
- ctx->looked = looked;
- ctx->copy_end = p;
-
- if (ctx->copy_start == NULL) {
- ctx->copy_start = ctx->buf->pos;
- }
-
- return NGX_AGAIN;
-
- tag_started:
-
- continue;
- }
-
- switch (state) {
-
- case ssi_start_state:
- /* not reached */
- break;
-
- case ssi_tag_state:
- switch (ch) {
- case '!':
- looked = 2;
- state = ssi_comment0_state;
- break;
-
- case '<':
- copy_end = p;
- break;
-
- default:
- copy_end = p;
- looked = 0;
- state = ssi_start_state;
- break;
- }
-
- break;
-
- case ssi_comment0_state:
- switch (ch) {
- case '-':
- looked = 3;
- state = ssi_comment1_state;
- break;
-
- case '<':
- copy_end = p;
- looked = 1;
- state = ssi_tag_state;
- break;
-
- default:
- copy_end = p;
- looked = 0;
- state = ssi_start_state;
- break;
- }
-
- break;
-
- case ssi_comment1_state:
- switch (ch) {
- case '-':
- looked = 4;
- state = ssi_sharp_state;
- break;
-
- case '<':
- copy_end = p;
- looked = 1;
- state = ssi_tag_state;
- break;
-
- default:
- copy_end = p;
- looked = 0;
- state = ssi_start_state;
- break;
- }
-
- break;
-
- case ssi_sharp_state:
- switch (ch) {
- case '#':
- if (p - ctx->pos < 4) {
- ctx->saved = 0;
- }
- looked = 0;
- state = ssi_precommand_state;
- break;
-
- case '<':
- copy_end = p;
- looked = 1;
- state = ssi_tag_state;
- break;
-
- default:
- copy_end = p;
- looked = 0;
- state = ssi_start_state;
- break;
- }
-
- break;
-
- case ssi_precommand_state:
- switch (ch) {
- case ' ':
- case CR:
- case LF:
- case '\t':
- break;
-
- default:
- ctx->command.len = 1;
- ctx->command.data = ngx_pnalloc(r->pool,
- NGX_HTTP_SSI_COMMAND_LEN);
- if (ctx->command.data == NULL) {
- return NGX_ERROR;
- }
-
- ctx->command.data[0] = ch;
-
- ctx->key = 0;
- ctx->key = ngx_hash(ctx->key, ch);
-
- ctx->params.nelts = 0;
-
- state = ssi_command_state;
- break;
- }
-
- break;
-
- case ssi_command_state:
- switch (ch) {
- case ' ':
- case CR:
- case LF:
- case '\t':
- state = ssi_preparam_state;
- break;
-
- case '-':
- state = ssi_comment_end0_state;
- break;
-
- default:
- if (ctx->command.len == NGX_HTTP_SSI_COMMAND_LEN) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "the \"%V%c...\" SSI command is too long",
- &ctx->command, ch);
-
- state = ssi_error_state;
- break;
- }
-
- ctx->command.data[ctx->command.len++] = ch;
- ctx->key = ngx_hash(ctx->key, ch);
- }
-
- break;
-
- case ssi_preparam_state:
- switch (ch) {
- case ' ':
- case CR:
- case LF:
- case '\t':
- break;
-
- case '-':
- state = ssi_comment_end0_state;
- break;
-
- default:
- ctx->param = ngx_array_push(&ctx->params);
- if (ctx->param == NULL) {
- return NGX_ERROR;
- }
-
- ctx->param->key.len = 1;
- ctx->param->key.data = ngx_pnalloc(r->pool,
- NGX_HTTP_SSI_PARAM_LEN);
- if (ctx->param->key.data == NULL) {
- return NGX_ERROR;
- }
-
- ctx->param->key.data[0] = ch;
-
- ctx->param->value.len = 0;
-
- if (ctx->value_buf == NULL) {
- ctx->param->value.data = ngx_pnalloc(r->pool,
- ctx->value_len + 1);
- if (ctx->param->value.data == NULL) {
- return NGX_ERROR;
- }
-
- } else {
- ctx->param->value.data = ctx->value_buf;
- }
-
- state = ssi_param_state;
- break;
- }
-
- break;
-
- case ssi_param_state:
- switch (ch) {
- case ' ':
- case CR:
- case LF:
- case '\t':
- state = ssi_preequal_state;
- break;
-
- case '=':
- state = ssi_prevalue_state;
- break;
-
- case '-':
- state = ssi_error_end0_state;
-
- ctx->param->key.data[ctx->param->key.len++] = ch;
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid \"%V\" parameter in \"%V\" SSI command",
- &ctx->param->key, &ctx->command);
- break;
-
- default:
- if (ctx->param->key.len == NGX_HTTP_SSI_PARAM_LEN) {
- state = ssi_error_state;
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "too long \"%V%c...\" parameter in "
- "\"%V\" SSI command",
- &ctx->param->key, ch, &ctx->command);
- break;
- }
-
- ctx->param->key.data[ctx->param->key.len++] = ch;
- }
-
- break;
-
- case ssi_preequal_state:
- switch (ch) {
- case ' ':
- case CR:
- case LF:
- case '\t':
- break;
-
- case '=':
- state = ssi_prevalue_state;
- break;
-
- default:
- if (ch == '-') {
- state = ssi_error_end0_state;
- } else {
- state = ssi_error_state;
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "unexpected \"%c\" symbol after \"%V\" "
- "parameter in \"%V\" SSI command",
- ch, &ctx->param->key, &ctx->command);
- break;
- }
-
- break;
-
- case ssi_prevalue_state:
- switch (ch) {
- case ' ':
- case CR:
- case LF:
- case '\t':
- break;
-
- case '"':
- state = ssi_double_quoted_value_state;
- break;
-
- case '\'':
- state = ssi_quoted_value_state;
- break;
-
- default:
- if (ch == '-') {
- state = ssi_error_end0_state;
- } else {
- state = ssi_error_state;
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "unexpected \"%c\" symbol before value of "
- "\"%V\" parameter in \"%V\" SSI command",
- ch, &ctx->param->key, &ctx->command);
- break;
- }
-
- break;
-
- case ssi_double_quoted_value_state:
- switch (ch) {
- case '"':
- state = ssi_postparam_state;
- break;
-
- case '\\':
- ctx->saved_state = ssi_double_quoted_value_state;
- state = ssi_quoted_symbol_state;
-
- /* fall through */
-
- default:
- if (ctx->param->value.len == ctx->value_len) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "too long \"%V%c...\" value of \"%V\" "
- "parameter in \"%V\" SSI command",
- &ctx->param->value, ch, &ctx->param->key,
- &ctx->command);
- state = ssi_error_state;
- break;
- }
-
- ctx->param->value.data[ctx->param->value.len++] = ch;
- }
-
- break;
-
- case ssi_quoted_value_state:
- switch (ch) {
- case '\'':
- state = ssi_postparam_state;
- break;
-
- case '\\':
- ctx->saved_state = ssi_quoted_value_state;
- state = ssi_quoted_symbol_state;
-
- /* fall through */
-
- default:
- if (ctx->param->value.len == ctx->value_len) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "too long \"%V%c...\" value of \"%V\" "
- "parameter in \"%V\" SSI command",
- &ctx->param->value, ch, &ctx->param->key,
- &ctx->command);
- state = ssi_error_state;
- break;
- }
-
- ctx->param->value.data[ctx->param->value.len++] = ch;
- }
-
- break;
-
- case ssi_quoted_symbol_state:
- state = ctx->saved_state;
-
- if (ctx->param->value.len == ctx->value_len) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "too long \"%V%c...\" value of \"%V\" "
- "parameter in \"%V\" SSI command",
- &ctx->param->value, ch, &ctx->param->key,
- &ctx->command);
- state = ssi_error_state;
- break;
- }
-
- ctx->param->value.data[ctx->param->value.len++] = ch;
-
- break;
-
- case ssi_postparam_state:
-
- if (ctx->param->value.len + 1 < ctx->value_len / 2) {
- value = ngx_pnalloc(r->pool, ctx->param->value.len + 1);
- if (value == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(value, ctx->param->value.data,
- ctx->param->value.len);
-
- ctx->value_buf = ctx->param->value.data;
- ctx->param->value.data = value;
-
- } else {
- ctx->value_buf = NULL;
- }
-
- switch (ch) {
- case ' ':
- case CR:
- case LF:
- case '\t':
- state = ssi_preparam_state;
- break;
-
- case '-':
- state = ssi_comment_end0_state;
- break;
-
- default:
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "unexpected \"%c\" symbol after \"%V\" value "
- "of \"%V\" parameter in \"%V\" SSI command",
- ch, &ctx->param->value, &ctx->param->key,
- &ctx->command);
- state = ssi_error_state;
- break;
- }
-
- break;
-
- case ssi_comment_end0_state:
- switch (ch) {
- case '-':
- state = ssi_comment_end1_state;
- break;
-
- default:
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "unexpected \"%c\" symbol in \"%V\" SSI command",
- ch, &ctx->command);
- state = ssi_error_state;
- break;
- }
-
- break;
-
- case ssi_comment_end1_state:
- switch (ch) {
- case '>':
- ctx->state = ssi_start_state;
- ctx->pos = p + 1;
- ctx->looked = looked;
- ctx->copy_end = copy_end;
-
- if (ctx->copy_start == NULL && copy_end) {
- ctx->copy_start = ctx->buf->pos;
- }
-
- return NGX_OK;
-
- default:
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "unexpected \"%c\" symbol in \"%V\" SSI command",
- ch, &ctx->command);
- state = ssi_error_state;
- break;
- }
-
- break;
-
- case ssi_error_state:
- switch (ch) {
- case '-':
- state = ssi_error_end0_state;
- break;
-
- default:
- break;
- }
-
- break;
-
- case ssi_error_end0_state:
- switch (ch) {
- case '-':
- state = ssi_error_end1_state;
- break;
-
- default:
- state = ssi_error_state;
- break;
- }
-
- break;
-
- case ssi_error_end1_state:
- switch (ch) {
- case '>':
- ctx->state = ssi_start_state;
- ctx->pos = p + 1;
- ctx->looked = looked;
- ctx->copy_end = copy_end;
-
- if (ctx->copy_start == NULL && copy_end) {
- ctx->copy_start = ctx->buf->pos;
- }
-
- return NGX_HTTP_SSI_ERROR;
-
- default:
- state = ssi_error_state;
- break;
- }
-
- break;
- }
- }
-
- ctx->state = state;
- ctx->pos = p;
- ctx->looked = looked;
-
- ctx->copy_end = (state == ssi_start_state) ? p : copy_end;
-
- if (ctx->copy_start == NULL && ctx->copy_end) {
- ctx->copy_start = ctx->buf->pos;
- }
-
- return NGX_AGAIN;
-}
-
-
-static ngx_str_t *
-ngx_http_ssi_get_variable(ngx_http_request_t *r, ngx_str_t *name,
- ngx_uint_t key)
-{
- ngx_uint_t i;
- ngx_list_part_t *part;
- ngx_http_ssi_var_t *var;
- ngx_http_ssi_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r->main, ngx_http_ssi_filter_module);
-
-#if (NGX_PCRE)
- {
- ngx_str_t *value;
-
- if (key >= '0' && key <= '9') {
- i = key - '0';
-
- if (i < ctx->ncaptures) {
- value = ngx_palloc(r->pool, sizeof(ngx_str_t));
- if (value == NULL) {
- return NULL;
- }
-
- i *= 2;
-
- value->data = ctx->captures_data + ctx->captures[i];
- value->len = ctx->captures[i + 1] - ctx->captures[i];
-
- return value;
- }
- }
- }
-#endif
-
- if (ctx->variables == NULL) {
- return NULL;
- }
-
- part = &ctx->variables->part;
- var = part->elts;
-
- for (i = 0; /* void */ ; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- var = part->elts;
- i = 0;
- }
-
- if (name->len != var[i].name.len) {
- continue;
- }
-
- if (key != var[i].key) {
- continue;
- }
-
- if (ngx_strncmp(name->data, var[i].name.data, name->len) == 0) {
- return &var[i].value;
- }
- }
-
- return NULL;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_evaluate_string(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t *text, ngx_uint_t flags)
-{
- u_char ch, *p, **value, *data, *part_data;
- size_t *size, len, prefix, part_len;
- ngx_str_t var, *val;
- ngx_int_t key;
- ngx_uint_t i, n, bracket, quoted;
- ngx_array_t lengths, values;
- ngx_http_variable_value_t *vv;
-
- n = ngx_http_script_variables_count(text);
-
- if (n == 0) {
-
- data = text->data;
- p = data;
-
- if ((flags & NGX_HTTP_SSI_ADD_PREFIX) && text->data[0] != '/') {
-
- for (prefix = r->uri.len; prefix; prefix--) {
- if (r->uri.data[prefix - 1] == '/') {
- break;
- }
- }
-
- if (prefix) {
- len = prefix + text->len;
-
- data = ngx_pnalloc(r->pool, len);
- if (data == NULL) {
- return NGX_ERROR;
- }
-
- p = ngx_copy(data, r->uri.data, prefix);
- }
- }
-
- quoted = 0;
-
- for (i = 0; i < text->len; i++) {
- ch = text->data[i];
-
- if (!quoted) {
-
- if (ch == '\\') {
- quoted = 1;
- continue;
- }
-
- } else {
- quoted = 0;
-
- if (ch != '\\' && ch != '\'' && ch != '"' && ch != '$') {
- *p++ = '\\';
- }
- }
-
- *p++ = ch;
- }
-
- text->len = p - data;
- text->data = data;
-
- return NGX_OK;
- }
-
- if (ngx_array_init(&lengths, r->pool, 8, sizeof(size_t *)) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&values, r->pool, 8, sizeof(u_char *)) != NGX_OK) {
- return NGX_ERROR;
- }
-
- len = 0;
- i = 0;
-
- while (i < text->len) {
-
- if (text->data[i] == '$') {
-
- var.len = 0;
-
- if (++i == text->len) {
- goto invalid_variable;
- }
-
- if (text->data[i] == '{') {
- bracket = 1;
-
- if (++i == text->len) {
- goto invalid_variable;
- }
-
- var.data = &text->data[i];
-
- } else {
- bracket = 0;
- var.data = &text->data[i];
- }
-
- for ( /* void */ ; i < text->len; i++, var.len++) {
- ch = text->data[i];
-
- if (ch == '}' && bracket) {
- i++;
- bracket = 0;
- break;
- }
-
- if ((ch >= 'A' && ch <= 'Z')
- || (ch >= 'a' && ch <= 'z')
- || (ch >= '0' && ch <= '9')
- || ch == '_')
- {
- continue;
- }
-
- break;
- }
-
- if (bracket) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "the closing bracket in \"%V\" "
- "variable is missing", &var);
- return NGX_HTTP_SSI_ERROR;
- }
-
- if (var.len == 0) {
- goto invalid_variable;
- }
-
- key = ngx_hash_strlow(var.data, var.data, var.len);
-
- val = ngx_http_ssi_get_variable(r, &var, key);
-
- if (val == NULL) {
- vv = ngx_http_get_variable(r, &var, key);
- if (vv == NULL) {
- return NGX_ERROR;
- }
-
- if (vv->not_found) {
- continue;
- }
-
- part_data = vv->data;
- part_len = vv->len;
-
- } else {
- part_data = val->data;
- part_len = val->len;
- }
-
- } else {
- part_data = &text->data[i];
- quoted = 0;
-
- for (p = part_data; i < text->len; i++) {
- ch = text->data[i];
-
- if (!quoted) {
-
- if (ch == '\\') {
- quoted = 1;
- continue;
- }
-
- if (ch == '$') {
- break;
- }
-
- } else {
- quoted = 0;
-
- if (ch != '\\' && ch != '\'' && ch != '"' && ch != '$') {
- *p++ = '\\';
- }
- }
-
- *p++ = ch;
- }
-
- part_len = p - part_data;
- }
-
- len += part_len;
-
- size = ngx_array_push(&lengths);
- if (size == NULL) {
- return NGX_ERROR;
- }
-
- *size = part_len;
-
- value = ngx_array_push(&values);
- if (value == NULL) {
- return NGX_ERROR;
- }
-
- *value = part_data;
- }
-
- prefix = 0;
-
- size = lengths.elts;
- value = values.elts;
-
- if (flags & NGX_HTTP_SSI_ADD_PREFIX) {
- for (i = 0; i < values.nelts; i++) {
- if (size[i] != 0) {
- if (*value[i] != '/') {
- for (prefix = r->uri.len; prefix; prefix--) {
- if (r->uri.data[prefix - 1] == '/') {
- len += prefix;
- break;
- }
- }
- }
-
- break;
- }
- }
- }
-
- p = ngx_pnalloc(r->pool, len + ((flags & NGX_HTTP_SSI_ADD_ZERO) ? 1 : 0));
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- text->len = len;
- text->data = p;
-
- p = ngx_copy(p, r->uri.data, prefix);
-
- for (i = 0; i < values.nelts; i++) {
- p = ngx_copy(p, value[i], size[i]);
- }
-
- return NGX_OK;
-
-invalid_variable:
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid variable name in \"%V\"", text);
-
- return NGX_HTTP_SSI_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_regex_match(ngx_http_request_t *r, ngx_str_t *pattern,
- ngx_str_t *str)
-{
-#if (NGX_PCRE)
- int rc, *captures;
- u_char *p, errstr[NGX_MAX_CONF_ERRSTR];
- size_t size;
- ngx_int_t key;
- ngx_str_t *vv, name, value;
- ngx_uint_t i, n;
- ngx_http_ssi_ctx_t *ctx;
- ngx_http_ssi_var_t *var;
- ngx_regex_compile_t rgc;
-
- ngx_memzero(&rgc, sizeof(ngx_regex_compile_t));
-
- rgc.pattern = *pattern;
- rgc.pool = r->pool;
- rgc.err.len = NGX_MAX_CONF_ERRSTR;
- rgc.err.data = errstr;
-
- if (ngx_regex_compile(&rgc) != NGX_OK) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "%V", &rgc.err);
- return NGX_HTTP_SSI_ERROR;
- }
-
- n = (rgc.captures + 1) * 3;
-
- captures = ngx_palloc(r->pool, n * sizeof(int));
- if (captures == NULL) {
- return NGX_ERROR;
- }
-
- rc = ngx_regex_exec(rgc.regex, str, captures, n);
-
- if (rc < NGX_REGEX_NO_MATCHED) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- ngx_regex_exec_n " failed: %i on \"%V\" using \"%V\"",
- rc, str, pattern);
- return NGX_HTTP_SSI_ERROR;
- }
-
- if (rc == NGX_REGEX_NO_MATCHED) {
- return NGX_DECLINED;
- }
-
- ctx = ngx_http_get_module_ctx(r->main, ngx_http_ssi_filter_module);
-
- ctx->ncaptures = rc;
- ctx->captures = captures;
- ctx->captures_data = str->data;
-
- if (rgc.named_captures > 0) {
-
- if (ctx->variables == NULL) {
- ctx->variables = ngx_list_create(r->pool, 4,
- sizeof(ngx_http_ssi_var_t));
- if (ctx->variables == NULL) {
- return NGX_ERROR;
- }
- }
-
- size = rgc.name_size;
- p = rgc.names;
-
- for (i = 0; i < (ngx_uint_t) rgc.named_captures; i++, p += size) {
-
- name.data = &p[2];
- name.len = ngx_strlen(name.data);
-
- n = 2 * ((p[0] << 8) + p[1]);
-
- value.data = &str->data[captures[n]];
- value.len = captures[n + 1] - captures[n];
-
- key = ngx_hash_strlow(name.data, name.data, name.len);
-
- vv = ngx_http_ssi_get_variable(r, &name, key);
-
- if (vv) {
- *vv = value;
- continue;
- }
-
- var = ngx_list_push(ctx->variables);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->name = name;
- var->key = key;
- var->value = value;
- }
- }
-
- return NGX_OK;
-
-#else
-
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "the using of the regex \"%V\" in SSI requires PCRE library",
- pattern);
- return NGX_HTTP_SSI_ERROR;
-
-#endif
-}
-
-
-static ngx_int_t
-ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t **params)
-{
- ngx_int_t rc, key;
- ngx_str_t *uri, *file, *wait, *set, *stub, args;
- ngx_buf_t *b;
- ngx_uint_t flags, i;
- ngx_chain_t *cl, *tl, **ll, *out;
- ngx_http_request_t *sr;
- ngx_http_ssi_var_t *var;
- ngx_http_ssi_ctx_t *mctx;
- ngx_http_ssi_block_t *bl;
- ngx_http_post_subrequest_t *psr;
-
- uri = params[NGX_HTTP_SSI_INCLUDE_VIRTUAL];
- file = params[NGX_HTTP_SSI_INCLUDE_FILE];
- wait = params[NGX_HTTP_SSI_INCLUDE_WAIT];
- set = params[NGX_HTTP_SSI_INCLUDE_SET];
- stub = params[NGX_HTTP_SSI_INCLUDE_STUB];
-
- if (uri && file) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "inlcusion may be either virtual=\"%V\" or file=\"%V\"",
- uri, file);
- return NGX_HTTP_SSI_ERROR;
- }
-
- if (uri == NULL && file == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "no parameter in \"include\" SSI command");
- return NGX_HTTP_SSI_ERROR;
- }
-
- if (set && stub) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"set\" and \"stub\" cannot be used together "
- "in \"include\" SSI command");
- return NGX_HTTP_SSI_ERROR;
- }
-
- if (wait) {
- if (uri == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"wait\" cannot be used with file=\"%V\"", file);
- return NGX_HTTP_SSI_ERROR;
- }
-
- if (wait->len == 2
- && ngx_strncasecmp(wait->data, (u_char *) "no", 2) == 0)
- {
- wait = NULL;
-
- } else if (wait->len != 3
- || ngx_strncasecmp(wait->data, (u_char *) "yes", 3) != 0)
- {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid value \"%V\" in the \"wait\" parameter",
- wait);
- return NGX_HTTP_SSI_ERROR;
- }
- }
-
- if (uri == NULL) {
- uri = file;
- wait = (ngx_str_t *) -1;
- }
-
- rc = ngx_http_ssi_evaluate_string(r, ctx, uri, NGX_HTTP_SSI_ADD_PREFIX);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi include: \"%V\"", uri);
-
- ngx_str_null(&args);
- flags = NGX_HTTP_LOG_UNSAFE;
-
- if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) {
- return NGX_HTTP_SSI_ERROR;
- }
-
- psr = NULL;
-
- mctx = ngx_http_get_module_ctx(r->main, ngx_http_ssi_filter_module);
-
- if (stub) {
- if (mctx->blocks) {
- bl = mctx->blocks->elts;
- for (i = 0; i < mctx->blocks->nelts; i++) {
- if (stub->len == bl[i].name.len
- && ngx_strncmp(stub->data, bl[i].name.data, stub->len) == 0)
- {
- goto found;
- }
- }
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"stub\"=\"%V\" for \"include\" not found", stub);
- return NGX_HTTP_SSI_ERROR;
-
- found:
-
- psr = ngx_palloc(r->pool, sizeof(ngx_http_post_subrequest_t));
- if (psr == NULL) {
- return NGX_ERROR;
- }
-
- psr->handler = ngx_http_ssi_stub_output;
-
- if (bl[i].count++) {
-
- out = NULL;
- ll = &out;
-
- for (tl = bl[i].bufs; tl; tl = tl->next) {
-
- if (ctx->free) {
- cl = ctx->free;
- ctx->free = ctx->free->next;
- b = cl->buf;
-
- } else {
- b = ngx_alloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- }
-
- ngx_memcpy(b, tl->buf, sizeof(ngx_buf_t));
-
- b->pos = b->start;
-
- *ll = cl;
- cl->next = NULL;
- ll = &cl->next;
- }
-
- psr->data = out;
-
- } else {
- psr->data = bl[i].bufs;
- }
- }
-
- if (wait) {
- flags |= NGX_HTTP_SUBREQUEST_WAITED;
- }
-
- if (set) {
- key = ngx_hash_strlow(set->data, set->data, set->len);
-
- psr = ngx_palloc(r->pool, sizeof(ngx_http_post_subrequest_t));
- if (psr == NULL) {
- return NGX_ERROR;
- }
-
- psr->handler = ngx_http_ssi_set_variable;
- psr->data = ngx_http_ssi_get_variable(r, set, key);
-
- if (psr->data == NULL) {
-
- if (mctx->variables == NULL) {
- mctx->variables = ngx_list_create(r->pool, 4,
- sizeof(ngx_http_ssi_var_t));
- if (mctx->variables == NULL) {
- return NGX_ERROR;
- }
- }
-
- var = ngx_list_push(mctx->variables);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->name = *set;
- var->key = key;
- var->value = ngx_http_ssi_null_string;
- psr->data = &var->value;
- }
-
- flags |= NGX_HTTP_SUBREQUEST_IN_MEMORY|NGX_HTTP_SUBREQUEST_WAITED;
- }
-
- if (ngx_http_subrequest(r, uri, &args, &sr, psr, flags) != NGX_OK) {
- return NGX_HTTP_SSI_ERROR;
- }
-
- if (wait == NULL && set == NULL) {
- return NGX_OK;
- }
-
- if (ctx->wait == NULL) {
- ctx->wait = sr;
-
- return NGX_AGAIN;
-
- } else {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "can only wait for one subrequest at a time");
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_stub_output(ngx_http_request_t *r, void *data, ngx_int_t rc)
-{
- ngx_chain_t *out;
-
- if (rc == NGX_ERROR || r->connection->error || r->request_output) {
- return rc;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi stub output: \"%V?%V\"", &r->uri, &r->args);
-
- out = data;
-
- if (!r->header_sent) {
- r->headers_out.content_type_len =
- r->parent->headers_out.content_type_len;
- r->headers_out.content_type = r->parent->headers_out.content_type;
-
- if (ngx_http_send_header(r) == NGX_ERROR) {
- return NGX_ERROR;
- }
- }
-
- return ngx_http_output_filter(r, out);
-}
-
-
-static ngx_int_t
-ngx_http_ssi_set_variable(ngx_http_request_t *r, void *data, ngx_int_t rc)
-{
- ngx_str_t *value = data;
-
- if (r->upstream) {
- value->len = r->upstream->buffer.last - r->upstream->buffer.pos;
- value->data = r->upstream->buffer.pos;
- }
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t **params)
-{
- u_char *p;
- uintptr_t len;
- ngx_int_t key;
- ngx_buf_t *b;
- ngx_str_t *var, *value, *enc, text;
- ngx_chain_t *cl;
- ngx_http_variable_value_t *vv;
-
- var = params[NGX_HTTP_SSI_ECHO_VAR];
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi echo \"%V\"", var);
-
- key = ngx_hash_strlow(var->data, var->data, var->len);
-
- value = ngx_http_ssi_get_variable(r, var, key);
-
- if (value == NULL) {
- vv = ngx_http_get_variable(r, var, key);
-
- if (vv == NULL) {
- return NGX_HTTP_SSI_ERROR;
- }
-
- if (!vv->not_found) {
- text.data = vv->data;
- text.len = vv->len;
- value = &text;
- }
- }
-
- if (value == NULL) {
- value = params[NGX_HTTP_SSI_ECHO_DEFAULT];
-
- if (value == NULL) {
- value = &ngx_http_ssi_none;
-
- } else if (value->len == 0) {
- return NGX_OK;
- }
-
- } else {
- if (value->len == 0) {
- return NGX_OK;
- }
- }
-
- enc = params[NGX_HTTP_SSI_ECHO_ENCODING];
-
- if (enc) {
- if (enc->len == 4 && ngx_strncmp(enc->data, "none", 4) == 0) {
-
- ctx->encoding = NGX_HTTP_SSI_NO_ENCODING;
-
- } else if (enc->len == 3 && ngx_strncmp(enc->data, "url", 3) == 0) {
-
- ctx->encoding = NGX_HTTP_SSI_URL_ENCODING;
-
- } else if (enc->len == 6 && ngx_strncmp(enc->data, "entity", 6) == 0) {
-
- ctx->encoding = NGX_HTTP_SSI_ENTITY_ENCODING;
-
- } else {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "unknown encoding \"%V\" in the \"echo\" command",
- enc);
- }
- }
-
- p = value->data;
-
- switch (ctx->encoding) {
-
- case NGX_HTTP_SSI_URL_ENCODING:
- len = 2 * ngx_escape_uri(NULL, value->data, value->len,
- NGX_ESCAPE_HTML);
-
- if (len) {
- p = ngx_pnalloc(r->pool, value->len + len);
- if (p == NULL) {
- return NGX_HTTP_SSI_ERROR;
- }
-
- (void) ngx_escape_uri(p, value->data, value->len, NGX_ESCAPE_HTML);
- }
-
- len += value->len;
- break;
-
- case NGX_HTTP_SSI_ENTITY_ENCODING:
- len = ngx_escape_html(NULL, value->data, value->len);
-
- if (len) {
- p = ngx_pnalloc(r->pool, value->len + len);
- if (p == NULL) {
- return NGX_HTTP_SSI_ERROR;
- }
-
- (void) ngx_escape_html(p, value->data, value->len);
- }
-
- len += value->len;
- break;
-
- default: /* NGX_HTTP_SSI_NO_ENCODING */
- len = value->len;
- break;
- }
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_HTTP_SSI_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_HTTP_SSI_ERROR;
- }
-
- b->memory = 1;
- b->pos = p;
- b->last = p + len;
-
- cl->buf = b;
- cl->next = NULL;
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_config(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t **params)
-{
- ngx_str_t *value;
-
- value = params[NGX_HTTP_SSI_CONFIG_TIMEFMT];
-
- if (value) {
- ctx->timefmt.len = value->len;
- ctx->timefmt.data = ngx_pnalloc(r->pool, value->len + 1);
- if (ctx->timefmt.data == NULL) {
- return NGX_HTTP_SSI_ERROR;
- }
-
- ngx_cpystrn(ctx->timefmt.data, value->data, value->len + 1);
- }
-
- value = params[NGX_HTTP_SSI_CONFIG_ERRMSG];
-
- if (value) {
- ctx->errmsg = *value;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_set(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t **params)
-{
- ngx_int_t key, rc;
- ngx_str_t *name, *value, *vv;
- ngx_http_ssi_var_t *var;
- ngx_http_ssi_ctx_t *mctx;
-
- mctx = ngx_http_get_module_ctx(r->main, ngx_http_ssi_filter_module);
-
- if (mctx->variables == NULL) {
- mctx->variables = ngx_list_create(r->pool, 4,
- sizeof(ngx_http_ssi_var_t));
- if (mctx->variables == NULL) {
- return NGX_ERROR;
- }
- }
-
- name = params[NGX_HTTP_SSI_SET_VAR];
- value = params[NGX_HTTP_SSI_SET_VALUE];
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi set \"%V\" \"%V\"", name, value);
-
- rc = ngx_http_ssi_evaluate_string(r, ctx, value, 0);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- key = ngx_hash_strlow(name->data, name->data, name->len);
-
- vv = ngx_http_ssi_get_variable(r, name, key);
-
- if (vv) {
- *vv = *value;
- return NGX_OK;
- }
-
- var = ngx_list_push(mctx->variables);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->name = *name;
- var->key = key;
- var->value = *value;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "set: \"%V\"=\"%V\"", name, value);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_if(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t **params)
-{
- u_char *p, *last;
- ngx_str_t *expr, left, right;
- ngx_int_t rc;
- ngx_uint_t negative, noregex, flags;
-
- if (ctx->command.len == 2) {
- if (ctx->conditional) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "the \"if\" command inside the \"if\" command");
- return NGX_HTTP_SSI_ERROR;
- }
- }
-
- if (ctx->output_chosen) {
- ctx->output = 0;
- return NGX_OK;
- }
-
- expr = params[NGX_HTTP_SSI_IF_EXPR];
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi if expr=\"%V\"", expr);
-
- left.data = expr->data;
- last = expr->data + expr->len;
-
- for (p = left.data; p < last; p++) {
- if (*p >= 'A' && *p <= 'Z') {
- *p |= 0x20;
- continue;
- }
-
- if ((*p >= 'a' && *p <= 'z')
- || (*p >= '0' && *p <= '9')
- || *p == '$' || *p == '{' || *p == '}' || *p == '_'
- || *p == '"' || *p == '\'')
- {
- continue;
- }
-
- break;
- }
-
- left.len = p - left.data;
-
- while (p < last && *p == ' ') {
- p++;
- }
-
- flags = 0;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "left: \"%V\"", &left);
-
- rc = ngx_http_ssi_evaluate_string(r, ctx, &left, flags);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "evaluted left: \"%V\"", &left);
-
- if (p == last) {
- if (left.len) {
- ctx->output = 1;
- ctx->output_chosen = 1;
-
- } else {
- ctx->output = 0;
- }
-
- ctx->conditional = NGX_HTTP_SSI_COND_IF;
-
- return NGX_OK;
- }
-
- if (p < last && *p == '=') {
- negative = 0;
- p++;
-
- } else if (p + 1 < last && *p == '!' && *(p + 1) == '=') {
- negative = 1;
- p += 2;
-
- } else {
- goto invalid_expression;
- }
-
- while (p < last && *p == ' ') {
- p++;
- }
-
- if (p < last - 1 && *p == '/') {
- if (*(last - 1) != '/') {
- goto invalid_expression;
- }
-
- noregex = 0;
- flags = NGX_HTTP_SSI_ADD_ZERO;
- last--;
- p++;
-
- } else {
- noregex = 1;
- flags = 0;
-
- if (p < last - 1 && p[0] == '\\' && p[1] == '/') {
- p++;
- }
- }
-
- right.len = last - p;
- right.data = p;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "right: \"%V\"", &right);
-
- rc = ngx_http_ssi_evaluate_string(r, ctx, &right, flags);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "evaluted right: \"%V\"", &right);
-
- if (noregex) {
- if (left.len != right.len) {
- rc = -1;
-
- } else {
- rc = ngx_strncmp(left.data, right.data, right.len);
- }
-
- } else {
- right.data[right.len] = '\0';
-
- rc = ngx_http_ssi_regex_match(r, &right, &left);
-
- if (rc == NGX_OK) {
- rc = 0;
- } else if (rc == NGX_DECLINED) {
- rc = -1;
- } else {
- return rc;
- }
- }
-
- if ((rc == 0 && !negative) || (rc != 0 && negative)) {
- ctx->output = 1;
- ctx->output_chosen = 1;
-
- } else {
- ctx->output = 0;
- }
-
- ctx->conditional = NGX_HTTP_SSI_COND_IF;
-
- return NGX_OK;
-
-invalid_expression:
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid expression in \"%V\"", expr);
-
- return NGX_HTTP_SSI_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_else(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t **params)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi else");
-
- if (ctx->output_chosen) {
- ctx->output = 0;
- } else {
- ctx->output = 1;
- }
-
- ctx->conditional = NGX_HTTP_SSI_COND_ELSE;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_endif(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t **params)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi endif");
-
- ctx->output = 1;
- ctx->output_chosen = 0;
- ctx->conditional = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_block(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t **params)
-{
- ngx_http_ssi_ctx_t *mctx;
- ngx_http_ssi_block_t *bl;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi block");
-
- mctx = ngx_http_get_module_ctx(r->main, ngx_http_ssi_filter_module);
-
- if (mctx->blocks == NULL) {
- mctx->blocks = ngx_array_create(r->pool, 4,
- sizeof(ngx_http_ssi_block_t));
- if (mctx->blocks == NULL) {
- return NGX_HTTP_SSI_ERROR;
- }
- }
-
- bl = ngx_array_push(mctx->blocks);
- if (bl == NULL) {
- return NGX_HTTP_SSI_ERROR;
- }
-
- bl->name = *params[NGX_HTTP_SSI_BLOCK_NAME];
- bl->bufs = NULL;
- bl->count = 0;
-
- ctx->output = 0;
- ctx->block = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_endblock(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
- ngx_str_t **params)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "ssi endblock");
-
- ctx->output = 1;
- ctx->block = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_date_gmt_local_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t gmt)
-{
- ngx_http_ssi_ctx_t *ctx;
- ngx_time_t *tp;
- ngx_str_t *timefmt;
- struct tm tm;
- char buf[NGX_HTTP_SSI_DATE_LEN];
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- tp = ngx_timeofday();
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_ssi_filter_module);
-
- timefmt = ctx ? &ctx->timefmt : &ngx_http_ssi_timefmt;
-
- if (timefmt->len == sizeof("%s") - 1
- && timefmt->data[0] == '%' && timefmt->data[1] == 's')
- {
- v->data = ngx_pnalloc(r->pool, NGX_TIME_T_LEN);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(v->data, "%T", tp->sec) - v->data;
-
- return NGX_OK;
- }
-
- if (gmt) {
- ngx_libc_gmtime(tp->sec, &tm);
- } else {
- ngx_libc_localtime(tp->sec, &tm);
- }
-
- v->len = strftime(buf, NGX_HTTP_SSI_DATE_LEN,
- (char *) timefmt->data, &tm);
- if (v->len == 0) {
- return NGX_ERROR;
- }
-
- v->data = ngx_pnalloc(r->pool, v->len);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(v->data, buf, v->len);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_preconfiguration(ngx_conf_t *cf)
-{
- ngx_int_t rc;
- ngx_http_variable_t *var, *v;
- ngx_http_ssi_command_t *cmd;
- ngx_http_ssi_main_conf_t *smcf;
-
- for (v = ngx_http_ssi_vars; v->name.len; v++) {
- var = ngx_http_add_variable(cf, &v->name, v->flags);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = v->get_handler;
- var->data = v->data;
- }
-
- smcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_ssi_filter_module);
-
- for (cmd = ngx_http_ssi_commands; cmd->name.len; cmd++) {
- rc = ngx_hash_add_key(&smcf->commands, &cmd->name, cmd,
- NGX_HASH_READONLY_KEY);
-
- if (rc == NGX_OK) {
- continue;
- }
-
- if (rc == NGX_BUSY) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "conflicting SSI command \"%V\"", &cmd->name);
- }
-
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_ssi_create_main_conf(ngx_conf_t *cf)
-{
- ngx_http_ssi_main_conf_t *smcf;
-
- smcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_ssi_main_conf_t));
- if (smcf == NULL) {
- return NULL;
- }
-
- smcf->commands.pool = cf->pool;
- smcf->commands.temp_pool = cf->temp_pool;
-
- if (ngx_hash_keys_array_init(&smcf->commands, NGX_HASH_SMALL) != NGX_OK) {
- return NULL;
- }
-
- return smcf;
-}
-
-
-static char *
-ngx_http_ssi_init_main_conf(ngx_conf_t *cf, void *conf)
-{
- ngx_http_ssi_main_conf_t *smcf = conf;
-
- ngx_hash_init_t hash;
-
- hash.hash = &smcf->hash;
- hash.key = ngx_hash_key;
- hash.max_size = 1024;
- hash.bucket_size = ngx_cacheline_size;
- hash.name = "ssi_command_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- if (ngx_hash_init(&hash, smcf->commands.keys.elts,
- smcf->commands.keys.nelts)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_http_ssi_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_ssi_loc_conf_t *slcf;
-
- slcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_ssi_loc_conf_t));
- if (slcf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->types = { NULL };
- * conf->types_keys = NULL;
- */
-
- slcf->enable = NGX_CONF_UNSET;
- slcf->silent_errors = NGX_CONF_UNSET;
- slcf->ignore_recycled_buffers = NGX_CONF_UNSET;
- slcf->last_modified = NGX_CONF_UNSET;
-
- slcf->min_file_chunk = NGX_CONF_UNSET_SIZE;
- slcf->value_len = NGX_CONF_UNSET_SIZE;
-
- return slcf;
-}
-
-
-static char *
-ngx_http_ssi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_ssi_loc_conf_t *prev = parent;
- ngx_http_ssi_loc_conf_t *conf = child;
-
- ngx_conf_merge_value(conf->enable, prev->enable, 0);
- ngx_conf_merge_value(conf->silent_errors, prev->silent_errors, 0);
- ngx_conf_merge_value(conf->ignore_recycled_buffers,
- prev->ignore_recycled_buffers, 0);
- ngx_conf_merge_value(conf->last_modified, prev->last_modified, 0);
-
- ngx_conf_merge_size_value(conf->min_file_chunk, prev->min_file_chunk, 1024);
- ngx_conf_merge_size_value(conf->value_len, prev->value_len, 255);
-
- if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
- &prev->types_keys, &prev->types,
- ngx_http_html_default_types)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssi_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_ssi_header_filter;
-
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_ssi_body_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.h
deleted file mode 100644
index 0bd01a06775..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssi_filter_module.h
+++ /dev/null
@@ -1,114 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_SSI_FILTER_H_INCLUDED_
-#define _NGX_HTTP_SSI_FILTER_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_SSI_MAX_PARAMS 16
-
-#define NGX_HTTP_SSI_COMMAND_LEN 32
-#define NGX_HTTP_SSI_PARAM_LEN 32
-#define NGX_HTTP_SSI_PARAMS_N 4
-
-
-#define NGX_HTTP_SSI_COND_IF 1
-#define NGX_HTTP_SSI_COND_ELSE 2
-
-
-#define NGX_HTTP_SSI_NO_ENCODING 0
-#define NGX_HTTP_SSI_URL_ENCODING 1
-#define NGX_HTTP_SSI_ENTITY_ENCODING 2
-
-
-typedef struct {
- ngx_hash_t hash;
- ngx_hash_keys_arrays_t commands;
-} ngx_http_ssi_main_conf_t;
-
-
-typedef struct {
- ngx_buf_t *buf;
-
- u_char *pos;
- u_char *copy_start;
- u_char *copy_end;
-
- ngx_uint_t key;
- ngx_str_t command;
- ngx_array_t params;
- ngx_table_elt_t *param;
- ngx_table_elt_t params_array[NGX_HTTP_SSI_PARAMS_N];
-
- ngx_chain_t *in;
- ngx_chain_t *out;
- ngx_chain_t **last_out;
- ngx_chain_t *busy;
- ngx_chain_t *free;
-
- ngx_uint_t state;
- ngx_uint_t saved_state;
- size_t saved;
- size_t looked;
-
- size_t value_len;
-
- ngx_list_t *variables;
- ngx_array_t *blocks;
-
-#if (NGX_PCRE)
- ngx_uint_t ncaptures;
- int *captures;
- u_char *captures_data;
-#endif
-
- unsigned conditional:2;
- unsigned encoding:2;
- unsigned block:1;
- unsigned output:1;
- unsigned output_chosen:1;
-
- ngx_http_request_t *wait;
- void *value_buf;
- ngx_str_t timefmt;
- ngx_str_t errmsg;
-} ngx_http_ssi_ctx_t;
-
-
-typedef ngx_int_t (*ngx_http_ssi_command_pt) (ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ctx, ngx_str_t **);
-
-
-typedef struct {
- ngx_str_t name;
- ngx_uint_t index;
-
- unsigned mandatory:1;
- unsigned multiple:1;
-} ngx_http_ssi_param_t;
-
-
-typedef struct {
- ngx_str_t name;
- ngx_http_ssi_command_pt handler;
- ngx_http_ssi_param_t *params;
-
- unsigned conditional:2;
- unsigned block:1;
- unsigned flush:1;
-} ngx_http_ssi_command_t;
-
-
-extern ngx_module_t ngx_http_ssi_filter_module;
-
-
-#endif /* _NGX_HTTP_SSI_FILTER_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.c
deleted file mode 100644
index 4c69091d60a..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.c
+++ /dev/null
@@ -1,962 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef ngx_int_t (*ngx_ssl_variable_handler_pt)(ngx_connection_t *c,
- ngx_pool_t *pool, ngx_str_t *s);
-
-
-#define NGX_DEFAULT_CIPHERS "HIGH:!aNULL:!MD5"
-#define NGX_DEFAULT_ECDH_CURVE "prime256v1"
-
-#define NGX_HTTP_NPN_ADVERTISE "\x08http/1.1"
-
-
-#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
-static int ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn,
- const unsigned char **out, unsigned char *outlen,
- const unsigned char *in, unsigned int inlen, void *arg);
-#endif
-
-#ifdef TLSEXT_TYPE_next_proto_neg
-static int ngx_http_ssl_npn_advertised(ngx_ssl_conn_t *ssl_conn,
- const unsigned char **out, unsigned int *outlen, void *arg);
-#endif
-
-static ngx_int_t ngx_http_ssl_static_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_ssl_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-static ngx_int_t ngx_http_ssl_add_variables(ngx_conf_t *cf);
-static void *ngx_http_ssl_create_srv_conf(ngx_conf_t *cf);
-static char *ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf,
- void *parent, void *child);
-
-static char *ngx_http_ssl_enable(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_ssl_password_file(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-static ngx_int_t ngx_http_ssl_init(ngx_conf_t *cf);
-
-
-static ngx_conf_bitmask_t ngx_http_ssl_protocols[] = {
- { ngx_string("SSLv2"), NGX_SSL_SSLv2 },
- { ngx_string("SSLv3"), NGX_SSL_SSLv3 },
- { ngx_string("TLSv1"), NGX_SSL_TLSv1 },
- { ngx_string("TLSv1.1"), NGX_SSL_TLSv1_1 },
- { ngx_string("TLSv1.2"), NGX_SSL_TLSv1_2 },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_conf_enum_t ngx_http_ssl_verify[] = {
- { ngx_string("off"), 0 },
- { ngx_string("on"), 1 },
- { ngx_string("optional"), 2 },
- { ngx_string("optional_no_ca"), 3 },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_command_t ngx_http_ssl_commands[] = {
-
- { ngx_string("ssl"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_http_ssl_enable,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, enable),
- NULL },
-
- { ngx_string("ssl_certificate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, certificate),
- NULL },
-
- { ngx_string("ssl_certificate_key"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, certificate_key),
- NULL },
-
- { ngx_string("ssl_password_file"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_http_ssl_password_file,
- NGX_HTTP_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("ssl_dhparam"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, dhparam),
- NULL },
-
- { ngx_string("ssl_ecdh_curve"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, ecdh_curve),
- NULL },
-
- { ngx_string("ssl_protocols"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, protocols),
- &ngx_http_ssl_protocols },
-
- { ngx_string("ssl_ciphers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, ciphers),
- NULL },
-
- { ngx_string("ssl_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, buffer_size),
- NULL },
-
- { ngx_string("ssl_verify_client"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, verify),
- &ngx_http_ssl_verify },
-
- { ngx_string("ssl_verify_depth"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, verify_depth),
- NULL },
-
- { ngx_string("ssl_client_certificate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, client_certificate),
- NULL },
-
- { ngx_string("ssl_trusted_certificate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, trusted_certificate),
- NULL },
-
- { ngx_string("ssl_prefer_server_ciphers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, prefer_server_ciphers),
- NULL },
-
- { ngx_string("ssl_session_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE12,
- ngx_http_ssl_session_cache,
- NGX_HTTP_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("ssl_session_tickets"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, session_tickets),
- NULL },
-
- { ngx_string("ssl_session_ticket_key"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, session_ticket_keys),
- NULL },
-
- { ngx_string("ssl_session_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_sec_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, session_timeout),
- NULL },
-
- { ngx_string("ssl_crl"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, crl),
- NULL },
-
- { ngx_string("ssl_stapling"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, stapling),
- NULL },
-
- { ngx_string("ssl_stapling_file"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, stapling_file),
- NULL },
-
- { ngx_string("ssl_stapling_responder"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, stapling_responder),
- NULL },
-
- { ngx_string("ssl_stapling_verify"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_ssl_srv_conf_t, stapling_verify),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_ssl_module_ctx = {
- ngx_http_ssl_add_variables, /* preconfiguration */
- ngx_http_ssl_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_http_ssl_create_srv_conf, /* create server configuration */
- ngx_http_ssl_merge_srv_conf, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_ssl_module = {
- NGX_MODULE_V1,
- &ngx_http_ssl_module_ctx, /* module context */
- ngx_http_ssl_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_variable_t ngx_http_ssl_vars[] = {
-
- { ngx_string("ssl_protocol"), NULL, ngx_http_ssl_static_variable,
- (uintptr_t) ngx_ssl_get_protocol, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_cipher"), NULL, ngx_http_ssl_static_variable,
- (uintptr_t) ngx_ssl_get_cipher_name, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_session_id"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_session_id, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_session_reused"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_session_reused, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_server_name"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_server_name, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_client_cert"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_certificate, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_client_raw_cert"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_raw_certificate,
- NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_client_s_dn"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_subject_dn, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_client_i_dn"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_issuer_dn, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_client_serial"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_serial_number, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_client_fingerprint"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_fingerprint, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_string("ssl_client_verify"), NULL, ngx_http_ssl_variable,
- (uintptr_t) ngx_ssl_get_client_verify, NGX_HTTP_VAR_CHANGEABLE, 0 },
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-static ngx_str_t ngx_http_ssl_sess_id_ctx = ngx_string("HTTP");
-
-
-#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
-
-static int
-ngx_http_ssl_alpn_select(ngx_ssl_conn_t *ssl_conn, const unsigned char **out,
- unsigned char *outlen, const unsigned char *in, unsigned int inlen,
- void *arg)
-{
- unsigned int srvlen;
- unsigned char *srv;
-#if (NGX_DEBUG)
- unsigned int i;
-#endif
-#if (NGX_HTTP_SPDY)
- ngx_http_connection_t *hc;
-#endif
-#if (NGX_HTTP_SPDY || NGX_DEBUG)
- ngx_connection_t *c;
-
- c = ngx_ssl_get_connection(ssl_conn);
-#endif
-
-#if (NGX_DEBUG)
- for (i = 0; i < inlen; i += in[i] + 1) {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "SSL ALPN supported by client: %*s", in[i], &in[i + 1]);
- }
-#endif
-
-#if (NGX_HTTP_SPDY)
- hc = c->data;
-
- if (hc->addr_conf->spdy) {
- srv = (unsigned char *) NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
- srvlen = sizeof(NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;
-
- } else
-#endif
- {
- srv = (unsigned char *) NGX_HTTP_NPN_ADVERTISE;
- srvlen = sizeof(NGX_HTTP_NPN_ADVERTISE) - 1;
- }
-
- if (SSL_select_next_proto((unsigned char **) out, outlen, srv, srvlen,
- in, inlen)
- != OPENSSL_NPN_NEGOTIATED)
- {
- return SSL_TLSEXT_ERR_NOACK;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "SSL ALPN selected: %*s", *outlen, *out);
-
- return SSL_TLSEXT_ERR_OK;
-}
-
-#endif
-
-
-#ifdef TLSEXT_TYPE_next_proto_neg
-
-static int
-ngx_http_ssl_npn_advertised(ngx_ssl_conn_t *ssl_conn,
- const unsigned char **out, unsigned int *outlen, void *arg)
-{
-#if (NGX_HTTP_SPDY || NGX_DEBUG)
- ngx_connection_t *c;
-
- c = ngx_ssl_get_connection(ssl_conn);
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "SSL NPN advertised");
-#endif
-
-#if (NGX_HTTP_SPDY)
- {
- ngx_http_connection_t *hc;
-
- hc = c->data;
-
- if (hc->addr_conf->spdy) {
- *out = (unsigned char *) NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE;
- *outlen = sizeof(NGX_SPDY_NPN_ADVERTISE NGX_HTTP_NPN_ADVERTISE) - 1;
-
- return SSL_TLSEXT_ERR_OK;
- }
- }
-#endif
-
- *out = (unsigned char *) NGX_HTTP_NPN_ADVERTISE;
- *outlen = sizeof(NGX_HTTP_NPN_ADVERTISE) - 1;
-
- return SSL_TLSEXT_ERR_OK;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_ssl_static_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_ssl_variable_handler_pt handler = (ngx_ssl_variable_handler_pt) data;
-
- size_t len;
- ngx_str_t s;
-
- if (r->connection->ssl) {
-
- (void) handler(r->connection, NULL, &s);
-
- v->data = s.data;
-
- for (len = 0; v->data[len]; len++) { /* void */ }
-
- v->len = len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
- }
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssl_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_ssl_variable_handler_pt handler = (ngx_ssl_variable_handler_pt) data;
-
- ngx_str_t s;
-
- if (r->connection->ssl) {
-
- if (handler(r->connection, r->pool, &s) != NGX_OK) {
- return NGX_ERROR;
- }
-
- v->len = s.len;
- v->data = s.data;
-
- if (v->len) {
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
- }
- }
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_ssl_add_variables(ngx_conf_t *cf)
-{
- ngx_http_variable_t *var, *v;
-
- for (v = ngx_http_ssl_vars; v->name.len; v++) {
- var = ngx_http_add_variable(cf, &v->name, v->flags);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = v->get_handler;
- var->data = v->data;
- }
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_ssl_create_srv_conf(ngx_conf_t *cf)
-{
- ngx_http_ssl_srv_conf_t *sscf;
-
- sscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_ssl_srv_conf_t));
- if (sscf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * sscf->protocols = 0;
- * sscf->certificate = { 0, NULL };
- * sscf->certificate_key = { 0, NULL };
- * sscf->dhparam = { 0, NULL };
- * sscf->ecdh_curve = { 0, NULL };
- * sscf->client_certificate = { 0, NULL };
- * sscf->trusted_certificate = { 0, NULL };
- * sscf->crl = { 0, NULL };
- * sscf->ciphers = { 0, NULL };
- * sscf->shm_zone = NULL;
- * sscf->stapling_file = { 0, NULL };
- * sscf->stapling_responder = { 0, NULL };
- */
-
- sscf->enable = NGX_CONF_UNSET;
- sscf->prefer_server_ciphers = NGX_CONF_UNSET;
- sscf->buffer_size = NGX_CONF_UNSET_SIZE;
- sscf->verify = NGX_CONF_UNSET_UINT;
- sscf->verify_depth = NGX_CONF_UNSET_UINT;
- sscf->passwords = NGX_CONF_UNSET_PTR;
- sscf->builtin_session_cache = NGX_CONF_UNSET;
- sscf->session_timeout = NGX_CONF_UNSET;
- sscf->session_tickets = NGX_CONF_UNSET;
- sscf->session_ticket_keys = NGX_CONF_UNSET_PTR;
- sscf->stapling = NGX_CONF_UNSET;
- sscf->stapling_verify = NGX_CONF_UNSET;
-
- return sscf;
-}
-
-
-static char *
-ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_ssl_srv_conf_t *prev = parent;
- ngx_http_ssl_srv_conf_t *conf = child;
-
- ngx_pool_cleanup_t *cln;
-
- if (conf->enable == NGX_CONF_UNSET) {
- if (prev->enable == NGX_CONF_UNSET) {
- conf->enable = 0;
-
- } else {
- conf->enable = prev->enable;
- conf->file = prev->file;
- conf->line = prev->line;
- }
- }
-
- ngx_conf_merge_value(conf->session_timeout,
- prev->session_timeout, 300);
-
- ngx_conf_merge_value(conf->prefer_server_ciphers,
- prev->prefer_server_ciphers, 0);
-
- ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
- (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3|NGX_SSL_TLSv1
- |NGX_SSL_TLSv1_1|NGX_SSL_TLSv1_2));
-
- ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size,
- NGX_SSL_BUFSIZE);
-
- ngx_conf_merge_uint_value(conf->verify, prev->verify, 0);
- ngx_conf_merge_uint_value(conf->verify_depth, prev->verify_depth, 1);
-
- ngx_conf_merge_str_value(conf->certificate, prev->certificate, "");
- ngx_conf_merge_str_value(conf->certificate_key, prev->certificate_key, "");
-
- ngx_conf_merge_ptr_value(conf->passwords, prev->passwords, NULL);
-
- ngx_conf_merge_str_value(conf->dhparam, prev->dhparam, "");
-
- ngx_conf_merge_str_value(conf->client_certificate, prev->client_certificate,
- "");
- ngx_conf_merge_str_value(conf->trusted_certificate,
- prev->trusted_certificate, "");
- ngx_conf_merge_str_value(conf->crl, prev->crl, "");
-
- ngx_conf_merge_str_value(conf->ecdh_curve, prev->ecdh_curve,
- NGX_DEFAULT_ECDH_CURVE);
-
- ngx_conf_merge_str_value(conf->ciphers, prev->ciphers, NGX_DEFAULT_CIPHERS);
-
- ngx_conf_merge_value(conf->stapling, prev->stapling, 0);
- ngx_conf_merge_value(conf->stapling_verify, prev->stapling_verify, 0);
- ngx_conf_merge_str_value(conf->stapling_file, prev->stapling_file, "");
- ngx_conf_merge_str_value(conf->stapling_responder,
- prev->stapling_responder, "");
-
- conf->ssl.log = cf->log;
-
- if (conf->enable) {
-
- if (conf->certificate.len == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no \"ssl_certificate\" is defined for "
- "the \"ssl\" directive in %s:%ui",
- conf->file, conf->line);
- return NGX_CONF_ERROR;
- }
-
- if (conf->certificate_key.len == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no \"ssl_certificate_key\" is defined for "
- "the \"ssl\" directive in %s:%ui",
- conf->file, conf->line);
- return NGX_CONF_ERROR;
- }
-
- } else {
-
- if (conf->certificate.len == 0) {
- return NGX_CONF_OK;
- }
-
- if (conf->certificate_key.len == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no \"ssl_certificate_key\" is defined "
- "for certificate \"%V\"", &conf->certificate);
- return NGX_CONF_ERROR;
- }
- }
-
- if (ngx_ssl_create(&conf->ssl, conf->protocols, conf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
-#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
-
- if (SSL_CTX_set_tlsext_servername_callback(conf->ssl.ctx,
- ngx_http_ssl_servername)
- == 0)
- {
- ngx_log_error(NGX_LOG_WARN, cf->log, 0,
- "nginx was built with SNI support, however, now it is linked "
- "dynamically to an OpenSSL library which has no tlsext support, "
- "therefore SNI is not available");
- }
-
-#endif
-
-#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
- SSL_CTX_set_alpn_select_cb(conf->ssl.ctx, ngx_http_ssl_alpn_select, NULL);
-#endif
-
-#ifdef TLSEXT_TYPE_next_proto_neg
- SSL_CTX_set_next_protos_advertised_cb(conf->ssl.ctx,
- ngx_http_ssl_npn_advertised, NULL);
-#endif
-
- cln = ngx_pool_cleanup_add(cf->pool, 0);
- if (cln == NULL) {
- return NGX_CONF_ERROR;
- }
-
- cln->handler = ngx_ssl_cleanup_ctx;
- cln->data = &conf->ssl;
-
- if (ngx_ssl_certificate(cf, &conf->ssl, &conf->certificate,
- &conf->certificate_key, conf->passwords)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- if (SSL_CTX_set_cipher_list(conf->ssl.ctx,
- (const char *) conf->ciphers.data)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
- "SSL_CTX_set_cipher_list(\"%V\") failed",
- &conf->ciphers);
- return NGX_CONF_ERROR;
- }
-
- conf->ssl.buffer_size = conf->buffer_size;
-
- if (conf->verify) {
-
- if (conf->client_certificate.len == 0 && conf->verify != 3) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no ssl_client_certificate for ssl_client_verify");
- return NGX_CONF_ERROR;
- }
-
- if (ngx_ssl_client_certificate(cf, &conf->ssl,
- &conf->client_certificate,
- conf->verify_depth)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
-
- if (ngx_ssl_trusted_certificate(cf, &conf->ssl,
- &conf->trusted_certificate,
- conf->verify_depth)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_ssl_crl(cf, &conf->ssl, &conf->crl) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (conf->prefer_server_ciphers) {
- SSL_CTX_set_options(conf->ssl.ctx, SSL_OP_CIPHER_SERVER_PREFERENCE);
- }
-
- /* a temporary 512-bit RSA key is required for export versions of MSIE */
- SSL_CTX_set_tmp_rsa_callback(conf->ssl.ctx, ngx_ssl_rsa512_key_callback);
-
- if (ngx_ssl_dhparam(cf, &conf->ssl, &conf->dhparam) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_ssl_ecdh_curve(cf, &conf->ssl, &conf->ecdh_curve) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_value(conf->builtin_session_cache,
- prev->builtin_session_cache, NGX_SSL_NONE_SCACHE);
-
- if (conf->shm_zone == NULL) {
- conf->shm_zone = prev->shm_zone;
- }
-
- if (ngx_ssl_session_cache(&conf->ssl, &ngx_http_ssl_sess_id_ctx,
- conf->builtin_session_cache,
- conf->shm_zone, conf->session_timeout)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_value(conf->session_tickets, prev->session_tickets, 1);
-
-#ifdef SSL_OP_NO_TICKET
- if (!conf->session_tickets) {
- SSL_CTX_set_options(conf->ssl.ctx, SSL_OP_NO_TICKET);
- }
-#endif
-
- ngx_conf_merge_ptr_value(conf->session_ticket_keys,
- prev->session_ticket_keys, NULL);
-
- if (ngx_ssl_session_ticket_keys(cf, &conf->ssl, conf->session_ticket_keys)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- if (conf->stapling) {
-
- if (ngx_ssl_stapling(cf, &conf->ssl, &conf->stapling_file,
- &conf->stapling_responder, conf->stapling_verify)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_ssl_enable(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_ssl_srv_conf_t *sscf = conf;
-
- char *rv;
-
- rv = ngx_conf_set_flag_slot(cf, cmd, conf);
-
- if (rv != NGX_CONF_OK) {
- return rv;
- }
-
- sscf->file = cf->conf_file->file.name.data;
- sscf->line = cf->conf_file->line;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_ssl_password_file(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_ssl_srv_conf_t *sscf = conf;
-
- ngx_str_t *value;
-
- if (sscf->passwords != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- sscf->passwords = ngx_ssl_read_password_file(cf, &value[1]);
-
- if (sscf->passwords == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_ssl_srv_conf_t *sscf = conf;
-
- size_t len;
- ngx_str_t *value, name, size;
- ngx_int_t n;
- ngx_uint_t i, j;
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (ngx_strcmp(value[i].data, "off") == 0) {
- sscf->builtin_session_cache = NGX_SSL_NO_SCACHE;
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "none") == 0) {
- sscf->builtin_session_cache = NGX_SSL_NONE_SCACHE;
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "builtin") == 0) {
- sscf->builtin_session_cache = NGX_SSL_DFLT_BUILTIN_SCACHE;
- continue;
- }
-
- if (value[i].len > sizeof("builtin:") - 1
- && ngx_strncmp(value[i].data, "builtin:", sizeof("builtin:") - 1)
- == 0)
- {
- n = ngx_atoi(value[i].data + sizeof("builtin:") - 1,
- value[i].len - (sizeof("builtin:") - 1));
-
- if (n == NGX_ERROR) {
- goto invalid;
- }
-
- sscf->builtin_session_cache = n;
-
- continue;
- }
-
- if (value[i].len > sizeof("shared:") - 1
- && ngx_strncmp(value[i].data, "shared:", sizeof("shared:") - 1)
- == 0)
- {
- len = 0;
-
- for (j = sizeof("shared:") - 1; j < value[i].len; j++) {
- if (value[i].data[j] == ':') {
- break;
- }
-
- len++;
- }
-
- if (len == 0) {
- goto invalid;
- }
-
- name.len = len;
- name.data = value[i].data + sizeof("shared:") - 1;
-
- size.len = value[i].len - j - 1;
- size.data = name.data + len + 1;
-
- n = ngx_parse_size(&size);
-
- if (n == NGX_ERROR) {
- goto invalid;
- }
-
- if (n < (ngx_int_t) (8 * ngx_pagesize)) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "session cache \"%V\" is too small",
- &value[i]);
-
- return NGX_CONF_ERROR;
- }
-
- sscf->shm_zone = ngx_shared_memory_add(cf, &name, n,
- &ngx_http_ssl_module);
- if (sscf->shm_zone == NULL) {
- return NGX_CONF_ERROR;
- }
-
- sscf->shm_zone->init = ngx_ssl_session_cache_init;
-
- continue;
- }
-
- goto invalid;
- }
-
- if (sscf->shm_zone && sscf->builtin_session_cache == NGX_CONF_UNSET) {
- sscf->builtin_session_cache = NGX_SSL_NO_BUILTIN_SCACHE;
- }
-
- return NGX_CONF_OK;
-
-invalid:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid session cache \"%V\"", &value[i]);
-
- return NGX_CONF_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_ssl_init(ngx_conf_t *cf)
-{
- ngx_uint_t s;
- ngx_http_ssl_srv_conf_t *sscf;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t **cscfp;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
- cscfp = cmcf->servers.elts;
-
- for (s = 0; s < cmcf->servers.nelts; s++) {
-
- sscf = cscfp[s]->ctx->srv_conf[ngx_http_ssl_module.ctx_index];
-
- if (sscf->ssl.ctx == NULL || !sscf->stapling) {
- continue;
- }
-
- clcf = cscfp[s]->ctx->loc_conf[ngx_http_core_module.ctx_index];
-
- if (ngx_ssl_stapling_resolver(cf, &sscf->ssl, clcf->resolver,
- clcf->resolver_timeout)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.h
deleted file mode 100644
index 8e69e9e4d0d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_ssl_module.h
+++ /dev/null
@@ -1,65 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_SSL_H_INCLUDED_
-#define _NGX_HTTP_SSL_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_flag_t enable;
-
- ngx_ssl_t ssl;
-
- ngx_flag_t prefer_server_ciphers;
-
- ngx_uint_t protocols;
-
- ngx_uint_t verify;
- ngx_uint_t verify_depth;
-
- size_t buffer_size;
-
- ssize_t builtin_session_cache;
-
- time_t session_timeout;
-
- ngx_str_t certificate;
- ngx_str_t certificate_key;
- ngx_str_t dhparam;
- ngx_str_t ecdh_curve;
- ngx_str_t client_certificate;
- ngx_str_t trusted_certificate;
- ngx_str_t crl;
-
- ngx_str_t ciphers;
-
- ngx_array_t *passwords;
-
- ngx_shm_zone_t *shm_zone;
-
- ngx_flag_t session_tickets;
- ngx_array_t *session_ticket_keys;
-
- ngx_flag_t stapling;
- ngx_flag_t stapling_verify;
- ngx_str_t stapling_file;
- ngx_str_t stapling_responder;
-
- u_char *file;
- ngx_uint_t line;
-} ngx_http_ssl_srv_conf_t;
-
-
-extern ngx_module_t ngx_http_ssl_module;
-
-
-#endif /* _NGX_HTTP_SSL_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_static_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_static_module.c
deleted file mode 100644
index 631eb17b267..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_static_module.c
+++ /dev/null
@@ -1,290 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static ngx_int_t ngx_http_static_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_static_init(ngx_conf_t *cf);
-
-
-ngx_http_module_t ngx_http_static_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_static_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_static_module = {
- NGX_MODULE_V1,
- &ngx_http_static_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_static_handler(ngx_http_request_t *r)
-{
- u_char *last, *location;
- size_t root, len;
- ngx_str_t path;
- ngx_int_t rc;
- ngx_uint_t level;
- ngx_log_t *log;
- ngx_buf_t *b;
- ngx_chain_t out;
- ngx_open_file_info_t of;
- ngx_http_core_loc_conf_t *clcf;
-
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD|NGX_HTTP_POST))) {
- return NGX_HTTP_NOT_ALLOWED;
- }
-
- if (r->uri.data[r->uri.len - 1] == '/') {
- return NGX_DECLINED;
- }
-
- log = r->connection->log;
-
- /*
- * ngx_http_map_uri_to_path() allocates memory for terminating '\0'
- * so we do not need to reserve memory for '/' for possible redirect
- */
-
- last = ngx_http_map_uri_to_path(r, &path, &root, 0);
- if (last == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- path.len = last - path.data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0,
- "http filename: \"%s\"", path.data);
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.read_ahead = clcf->read_ahead;
- of.directio = clcf->directio;
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.errors = clcf->open_file_cache_errors;
- of.events = clcf->open_file_cache_events;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- != NGX_OK)
- {
- switch (of.err) {
-
- case 0:
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
-
- case NGX_ENOENT:
- case NGX_ENOTDIR:
- case NGX_ENAMETOOLONG:
-
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_NOT_FOUND;
- break;
-
- case NGX_EACCES:
-#if (NGX_HAVE_OPENAT)
- case NGX_EMLINK:
- case NGX_ELOOP:
-#endif
-
- level = NGX_LOG_ERR;
- rc = NGX_HTTP_FORBIDDEN;
- break;
-
- default:
-
- level = NGX_LOG_CRIT;
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- break;
- }
-
- if (rc != NGX_HTTP_NOT_FOUND || clcf->log_not_found) {
- ngx_log_error(level, log, of.err,
- "%s \"%s\" failed", of.failed, path.data);
- }
-
- return rc;
- }
-
- r->root_tested = !r->error_page;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, log, 0, "http static fd: %d", of.fd);
-
- if (of.is_dir) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http dir");
-
- ngx_http_clear_location(r);
-
- r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t));
- if (r->headers_out.location == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- len = r->uri.len + 1;
-
- if (!clcf->alias && clcf->root_lengths == NULL && r->args.len == 0) {
- location = path.data + clcf->root.len;
-
- *last = '/';
-
- } else {
- if (r->args.len) {
- len += r->args.len + 1;
- }
-
- location = ngx_pnalloc(r->pool, len);
- if (location == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- last = ngx_copy(location, r->uri.data, r->uri.len);
-
- *last = '/';
-
- if (r->args.len) {
- *++last = '?';
- ngx_memcpy(++last, r->args.data, r->args.len);
- }
- }
-
- /*
- * we do not need to set the r->headers_out.location->hash and
- * r->headers_out.location->key fields
- */
-
- r->headers_out.location->value.len = len;
- r->headers_out.location->value.data = location;
-
- return NGX_HTTP_MOVED_PERMANENTLY;
- }
-
-#if !(NGX_WIN32) /* the not regular files are probably Unix specific */
-
- if (!of.is_file) {
- ngx_log_error(NGX_LOG_CRIT, log, 0,
- "\"%s\" is not a regular file", path.data);
-
- return NGX_HTTP_NOT_FOUND;
- }
-
-#endif
-
- if (r->method & NGX_HTTP_POST) {
- return NGX_HTTP_NOT_ALLOWED;
- }
-
- rc = ngx_http_discard_request_body(r);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- log->action = "sending response to client";
-
- r->headers_out.status = NGX_HTTP_OK;
- r->headers_out.content_length_n = of.size;
- r->headers_out.last_modified_time = of.mtime;
-
- if (ngx_http_set_etag(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (ngx_http_set_content_type(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (r != r->main && of.size == 0) {
- return ngx_http_send_header(r);
- }
-
- r->allow_ranges = 1;
-
- /* we need to allocate all before the header would be sent */
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t));
- if (b->file == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- return rc;
- }
-
- b->file_pos = 0;
- b->file_last = of.size;
-
- b->in_file = b->file_last ? 1: 0;
- b->last_buf = (r == r->main) ? 1: 0;
- b->last_in_chain = 1;
-
- b->file->fd = of.fd;
- b->file->name = path;
- b->file->log = log;
- b->file->directio = of.is_directio;
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_output_filter(r, &out);
-}
-
-
-static ngx_int_t
-ngx_http_static_init(ngx_conf_t *cf)
-{
- ngx_http_handler_pt *h;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- h = ngx_array_push(&cmcf->phases[NGX_HTTP_CONTENT_PHASE].handlers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- *h = ngx_http_static_handler;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_stub_status_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_stub_status_module.c
deleted file mode 100644
index dd683589803..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_stub_status_module.c
+++ /dev/null
@@ -1,236 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static ngx_int_t ngx_http_stub_status_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_stub_status_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_stub_status_add_variables(ngx_conf_t *cf);
-static char *ngx_http_set_stub_status(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_http_status_commands[] = {
-
- { ngx_string("stub_status"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS|NGX_CONF_TAKE1,
- ngx_http_set_stub_status,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_stub_status_module_ctx = {
- ngx_http_stub_status_add_variables, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_stub_status_module = {
- NGX_MODULE_V1,
- &ngx_http_stub_status_module_ctx, /* module context */
- ngx_http_status_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_variable_t ngx_http_stub_status_vars[] = {
-
- { ngx_string("connections_active"), NULL, ngx_http_stub_status_variable,
- 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("connections_reading"), NULL, ngx_http_stub_status_variable,
- 1, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("connections_writing"), NULL, ngx_http_stub_status_variable,
- 2, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("connections_waiting"), NULL, ngx_http_stub_status_variable,
- 3, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-static ngx_int_t
-ngx_http_stub_status_handler(ngx_http_request_t *r)
-{
- size_t size;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t out;
- ngx_atomic_int_t ap, hn, ac, rq, rd, wr, wa;
-
- if (r->method != NGX_HTTP_GET && r->method != NGX_HTTP_HEAD) {
- return NGX_HTTP_NOT_ALLOWED;
- }
-
- rc = ngx_http_discard_request_body(r);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- r->headers_out.content_type_len = sizeof("text/plain") - 1;
- ngx_str_set(&r->headers_out.content_type, "text/plain");
- r->headers_out.content_type_lowcase = NULL;
-
- if (r->method == NGX_HTTP_HEAD) {
- r->headers_out.status = NGX_HTTP_OK;
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- return rc;
- }
- }
-
- size = sizeof("Active connections: \n") + NGX_ATOMIC_T_LEN
- + sizeof("server accepts handled requests\n") - 1
- + 6 + 3 * NGX_ATOMIC_T_LEN
- + sizeof("Reading: Writing: Waiting: \n") + 3 * NGX_ATOMIC_T_LEN;
-
- b = ngx_create_temp_buf(r->pool, size);
- if (b == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- out.buf = b;
- out.next = NULL;
-
- ap = *ngx_stat_accepted;
- hn = *ngx_stat_handled;
- ac = *ngx_stat_active;
- rq = *ngx_stat_requests;
- rd = *ngx_stat_reading;
- wr = *ngx_stat_writing;
- wa = *ngx_stat_waiting;
-
- b->last = ngx_sprintf(b->last, "Active connections: %uA \n", ac);
-
- b->last = ngx_cpymem(b->last, "server accepts handled requests\n",
- sizeof("server accepts handled requests\n") - 1);
-
- b->last = ngx_sprintf(b->last, " %uA %uA %uA \n", ap, hn, rq);
-
- b->last = ngx_sprintf(b->last, "Reading: %uA Writing: %uA Waiting: %uA \n",
- rd, wr, wa);
-
- r->headers_out.status = NGX_HTTP_OK;
- r->headers_out.content_length_n = b->last - b->pos;
-
- b->last_buf = (r == r->main) ? 1 : 0;
- b->last_in_chain = 1;
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- return rc;
- }
-
- return ngx_http_output_filter(r, &out);
-}
-
-
-static ngx_int_t
-ngx_http_stub_status_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- ngx_atomic_int_t value;
-
- p = ngx_pnalloc(r->pool, NGX_ATOMIC_T_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- switch (data) {
- case 0:
- value = *ngx_stat_active;
- break;
-
- case 1:
- value = *ngx_stat_reading;
- break;
-
- case 2:
- value = *ngx_stat_writing;
- break;
-
- case 3:
- value = *ngx_stat_waiting;
- break;
-
- /* suppress warning */
- default:
- value = 0;
- break;
- }
-
- v->len = ngx_sprintf(p, "%uA", value) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_stub_status_add_variables(ngx_conf_t *cf)
-{
- ngx_http_variable_t *var, *v;
-
- for (v = ngx_http_stub_status_vars; v->name.len; v++) {
- var = ngx_http_add_variable(cf, &v->name, v->flags);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = v->get_handler;
- var->data = v->data;
- }
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_set_stub_status(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- clcf->handler = ngx_http_stub_status_handler;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_sub_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_sub_filter_module.c
deleted file mode 100644
index e6a34a763b9..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_sub_filter_module.c
+++ /dev/null
@@ -1,764 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_str_t match;
- ngx_http_complex_value_t value;
-
- ngx_hash_t types;
-
- ngx_flag_t once;
- ngx_flag_t last_modified;
-
- ngx_array_t *types_keys;
-} ngx_http_sub_loc_conf_t;
-
-
-typedef enum {
- sub_start_state = 0,
- sub_match_state,
-} ngx_http_sub_state_e;
-
-
-typedef struct {
- ngx_str_t match;
- ngx_str_t saved;
- ngx_str_t looked;
-
- ngx_uint_t once; /* unsigned once:1 */
-
- ngx_buf_t *buf;
-
- u_char *pos;
- u_char *copy_start;
- u_char *copy_end;
-
- ngx_chain_t *in;
- ngx_chain_t *out;
- ngx_chain_t **last_out;
- ngx_chain_t *busy;
- ngx_chain_t *free;
-
- ngx_str_t sub;
-
- ngx_uint_t state;
-} ngx_http_sub_ctx_t;
-
-
-static ngx_int_t ngx_http_sub_output(ngx_http_request_t *r,
- ngx_http_sub_ctx_t *ctx);
-static ngx_int_t ngx_http_sub_parse(ngx_http_request_t *r,
- ngx_http_sub_ctx_t *ctx);
-
-static char * ngx_http_sub_filter(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static void *ngx_http_sub_create_conf(ngx_conf_t *cf);
-static char *ngx_http_sub_merge_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_sub_filter_init(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_sub_filter_commands[] = {
-
- { ngx_string("sub_filter"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_http_sub_filter,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("sub_filter_types"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_types_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_sub_loc_conf_t, types_keys),
- &ngx_http_html_default_types[0] },
-
- { ngx_string("sub_filter_once"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_sub_loc_conf_t, once),
- NULL },
-
- { ngx_string("sub_filter_last_modified"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_sub_loc_conf_t, last_modified),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_sub_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_sub_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_sub_create_conf, /* create location configuration */
- ngx_http_sub_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_sub_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_sub_filter_module_ctx, /* module context */
- ngx_http_sub_filter_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_sub_header_filter(ngx_http_request_t *r)
-{
- ngx_http_sub_ctx_t *ctx;
- ngx_http_sub_loc_conf_t *slcf;
-
- slcf = ngx_http_get_module_loc_conf(r, ngx_http_sub_filter_module);
-
- if (slcf->match.len == 0
- || r->headers_out.content_length_n == 0
- || ngx_http_test_content_type(r, &slcf->types) == NULL)
- {
- return ngx_http_next_header_filter(r);
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_sub_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ctx->saved.data = ngx_pnalloc(r->pool, slcf->match.len);
- if (ctx->saved.data == NULL) {
- return NGX_ERROR;
- }
-
- ctx->looked.data = ngx_pnalloc(r->pool, slcf->match.len);
- if (ctx->looked.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_sub_filter_module);
-
- ctx->match = slcf->match;
- ctx->last_out = &ctx->out;
-
- r->filter_need_in_memory = 1;
-
- if (r == r->main) {
- ngx_http_clear_content_length(r);
-
- if (!slcf->last_modified) {
- ngx_http_clear_last_modified(r);
- ngx_http_clear_etag(r);
-
- } else {
- ngx_http_weak_etag(r);
- }
- }
-
- return ngx_http_next_header_filter(r);
-}
-
-
-static ngx_int_t
-ngx_http_sub_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t *cl;
- ngx_http_sub_ctx_t *ctx;
- ngx_http_sub_loc_conf_t *slcf;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_sub_filter_module);
-
- if (ctx == NULL) {
- return ngx_http_next_body_filter(r, in);
- }
-
- if ((in == NULL
- && ctx->buf == NULL
- && ctx->in == NULL
- && ctx->busy == NULL))
- {
- return ngx_http_next_body_filter(r, in);
- }
-
- if (ctx->once && (ctx->buf == NULL || ctx->in == NULL)) {
-
- if (ctx->busy) {
- if (ngx_http_sub_output(r, ctx) == NGX_ERROR) {
- return NGX_ERROR;
- }
- }
-
- return ngx_http_next_body_filter(r, in);
- }
-
- /* add the incoming chain to the chain ctx->in */
-
- if (in) {
- if (ngx_chain_add_copy(r->pool, &ctx->in, in) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http sub filter \"%V\"", &r->uri);
-
- while (ctx->in || ctx->buf) {
-
- if (ctx->buf == NULL) {
- ctx->buf = ctx->in->buf;
- ctx->in = ctx->in->next;
- ctx->pos = ctx->buf->pos;
- }
-
- if (ctx->state == sub_start_state) {
- ctx->copy_start = ctx->pos;
- ctx->copy_end = ctx->pos;
- }
-
- b = NULL;
-
- while (ctx->pos < ctx->buf->last) {
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "saved: \"%V\" state: %d", &ctx->saved, ctx->state);
-
- rc = ngx_http_sub_parse(r, ctx);
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "parse: %d, looked: \"%V\" %p-%p",
- rc, &ctx->looked, ctx->copy_start, ctx->copy_end);
-
- if (rc == NGX_ERROR) {
- return rc;
- }
-
- if (ctx->saved.len) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "saved: \"%V\"", &ctx->saved);
-
- cl = ngx_chain_get_free_buf(r->pool, &ctx->free);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->pos = ngx_pnalloc(r->pool, ctx->saved.len);
- if (b->pos == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(b->pos, ctx->saved.data, ctx->saved.len);
- b->last = b->pos + ctx->saved.len;
- b->memory = 1;
-
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- ctx->saved.len = 0;
- }
-
- if (ctx->copy_start != ctx->copy_end) {
-
- cl = ngx_chain_get_free_buf(r->pool, &ctx->free);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memcpy(b, ctx->buf, sizeof(ngx_buf_t));
-
- b->pos = ctx->copy_start;
- b->last = ctx->copy_end;
- b->shadow = NULL;
- b->last_buf = 0;
- b->last_in_chain = 0;
- b->recycled = 0;
-
- if (b->in_file) {
- b->file_last = b->file_pos + (b->last - ctx->buf->pos);
- b->file_pos += b->pos - ctx->buf->pos;
- }
-
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
- }
-
- if (ctx->state == sub_start_state) {
- ctx->copy_start = ctx->pos;
- ctx->copy_end = ctx->pos;
-
- } else {
- ctx->copy_start = NULL;
- ctx->copy_end = NULL;
- }
-
- if (ctx->looked.len > (size_t) (ctx->pos - ctx->buf->pos)) {
- ctx->saved.len = ctx->looked.len - (ctx->pos - ctx->buf->pos);
- ngx_memcpy(ctx->saved.data, ctx->looked.data, ctx->saved.len);
- }
-
- if (rc == NGX_AGAIN) {
- continue;
- }
-
-
- /* rc == NGX_OK */
-
- cl = ngx_chain_get_free_buf(r->pool, &ctx->free);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- slcf = ngx_http_get_module_loc_conf(r, ngx_http_sub_filter_module);
-
- if (ctx->sub.data == NULL) {
-
- if (ngx_http_complex_value(r, &slcf->value, &ctx->sub)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
-
- if (ctx->sub.len) {
- b->memory = 1;
- b->pos = ctx->sub.data;
- b->last = ctx->sub.data + ctx->sub.len;
-
- } else {
- b->sync = 1;
- }
-
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- ctx->once = slcf->once;
-
- continue;
- }
-
- if (ctx->looked.len
- && (ctx->buf->last_buf || ctx->buf->last_in_chain))
- {
- cl = ngx_chain_get_free_buf(r->pool, &ctx->free);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->pos = ctx->looked.data;
- b->last = b->pos + ctx->looked.len;
- b->memory = 1;
-
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
-
- ctx->looked.len = 0;
- }
-
- if (ctx->buf->last_buf || ctx->buf->flush || ctx->buf->sync
- || ngx_buf_in_memory(ctx->buf))
- {
- if (b == NULL) {
- cl = ngx_chain_get_free_buf(r->pool, &ctx->free);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->sync = 1;
-
- *ctx->last_out = cl;
- ctx->last_out = &cl->next;
- }
-
- b->last_buf = ctx->buf->last_buf;
- b->last_in_chain = ctx->buf->last_in_chain;
- b->flush = ctx->buf->flush;
- b->shadow = ctx->buf;
-
- b->recycled = ctx->buf->recycled;
- }
-
- ctx->buf = NULL;
-
- ctx->saved.len = ctx->looked.len;
- ngx_memcpy(ctx->saved.data, ctx->looked.data, ctx->looked.len);
- }
-
- if (ctx->out == NULL && ctx->busy == NULL) {
- return NGX_OK;
- }
-
- return ngx_http_sub_output(r, ctx);
-}
-
-
-static ngx_int_t
-ngx_http_sub_output(ngx_http_request_t *r, ngx_http_sub_ctx_t *ctx)
-{
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t *cl;
-
-#if 1
- b = NULL;
- for (cl = ctx->out; cl; cl = cl->next) {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "sub out: %p %p", cl->buf, cl->buf->pos);
- if (cl->buf == b) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "the same buf was used in sub");
- ngx_debug_point();
- return NGX_ERROR;
- }
- b = cl->buf;
- }
-#endif
-
- rc = ngx_http_next_body_filter(r, ctx->out);
-
- if (ctx->busy == NULL) {
- ctx->busy = ctx->out;
-
- } else {
- for (cl = ctx->busy; cl->next; cl = cl->next) { /* void */ }
- cl->next = ctx->out;
- }
-
- ctx->out = NULL;
- ctx->last_out = &ctx->out;
-
- while (ctx->busy) {
-
- cl = ctx->busy;
- b = cl->buf;
-
- if (ngx_buf_size(b) != 0) {
- break;
- }
-
- if (b->shadow) {
- b->shadow->pos = b->shadow->last;
- }
-
- ctx->busy = cl->next;
-
- if (ngx_buf_in_memory(b) || b->in_file) {
- /* add data bufs only to the free buf chain */
-
- cl->next = ctx->free;
- ctx->free = cl;
- }
- }
-
- if (ctx->in || ctx->buf) {
- r->buffered |= NGX_HTTP_SUB_BUFFERED;
-
- } else {
- r->buffered &= ~NGX_HTTP_SUB_BUFFERED;
- }
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_sub_parse(ngx_http_request_t *r, ngx_http_sub_ctx_t *ctx)
-{
- u_char *p, *last, *copy_end, ch, match;
- size_t looked, i;
- ngx_http_sub_state_e state;
-
- if (ctx->once) {
- ctx->copy_start = ctx->pos;
- ctx->copy_end = ctx->buf->last;
- ctx->pos = ctx->buf->last;
- ctx->looked.len = 0;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "once");
-
- return NGX_AGAIN;
- }
-
- state = ctx->state;
- looked = ctx->looked.len;
- last = ctx->buf->last;
- copy_end = ctx->copy_end;
-
- for (p = ctx->pos; p < last; p++) {
-
- ch = *p;
- ch = ngx_tolower(ch);
-
- if (state == sub_start_state) {
-
- /* the tight loop */
-
- match = ctx->match.data[0];
-
- for ( ;; ) {
- if (ch == match) {
-
- if (ctx->match.len == 1) {
- ctx->pos = p + 1;
- ctx->copy_end = p;
-
- return NGX_OK;
- }
-
- copy_end = p;
- ctx->looked.data[0] = *p;
- looked = 1;
- state = sub_match_state;
-
- goto match_started;
- }
-
- if (++p == last) {
- break;
- }
-
- ch = *p;
- ch = ngx_tolower(ch);
- }
-
- ctx->state = state;
- ctx->pos = p;
- ctx->looked.len = looked;
- ctx->copy_end = p;
-
- if (ctx->copy_start == NULL) {
- ctx->copy_start = ctx->buf->pos;
- }
-
- return NGX_AGAIN;
-
- match_started:
-
- continue;
- }
-
- /* state == sub_match_state */
-
- if (ch == ctx->match.data[looked]) {
- ctx->looked.data[looked] = *p;
- looked++;
-
- if (looked == ctx->match.len) {
-
- ctx->state = sub_start_state;
- ctx->pos = p + 1;
- ctx->looked.len = 0;
- ctx->saved.len = 0;
- ctx->copy_end = copy_end;
-
- if (ctx->copy_start == NULL && copy_end) {
- ctx->copy_start = ctx->buf->pos;
- }
-
- return NGX_OK;
- }
-
- } else {
- /*
- * check if there is another partial match in previously
- * matched substring to catch cases like "aab" in "aaab"
- */
-
- ctx->looked.data[looked] = *p;
- looked++;
-
- for (i = 1; i < looked; i++) {
- if (ngx_strncasecmp(ctx->looked.data + i,
- ctx->match.data, looked - i)
- == 0)
- {
- break;
- }
- }
-
- if (i < looked) {
- if (ctx->saved.len > i) {
- ctx->saved.len = i;
- }
-
- if ((size_t) (p + 1 - ctx->buf->pos) >= looked - i) {
- copy_end = p + 1 - (looked - i);
- }
-
- ngx_memmove(ctx->looked.data, ctx->looked.data + i, looked - i);
- looked = looked - i;
-
- } else {
- copy_end = p;
- looked = 0;
- state = sub_start_state;
- }
-
- if (ctx->saved.len) {
- p++;
- goto out;
- }
- }
- }
-
- ctx->saved.len = 0;
-
-out:
-
- ctx->state = state;
- ctx->pos = p;
- ctx->looked.len = looked;
-
- ctx->copy_end = (state == sub_start_state) ? p : copy_end;
-
- if (ctx->copy_start == NULL && ctx->copy_end) {
- ctx->copy_start = ctx->buf->pos;
- }
-
- return NGX_AGAIN;
-}
-
-
-static char *
-ngx_http_sub_filter(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_sub_loc_conf_t *slcf = conf;
-
- ngx_str_t *value;
- ngx_http_compile_complex_value_t ccv;
-
- if (slcf->match.data) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- ngx_strlow(value[1].data, value[1].data, value[1].len);
-
- slcf->match = value[1];
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[2];
- ccv.complex_value = &slcf->value;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_http_sub_create_conf(ngx_conf_t *cf)
-{
- ngx_http_sub_loc_conf_t *slcf;
-
- slcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_sub_loc_conf_t));
- if (slcf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->match = { 0, NULL };
- * conf->types = { NULL };
- * conf->types_keys = NULL;
- */
-
- slcf->once = NGX_CONF_UNSET;
- slcf->last_modified = NGX_CONF_UNSET;
-
- return slcf;
-}
-
-
-static char *
-ngx_http_sub_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_sub_loc_conf_t *prev = parent;
- ngx_http_sub_loc_conf_t *conf = child;
-
- ngx_conf_merge_value(conf->once, prev->once, 1);
- ngx_conf_merge_str_value(conf->match, prev->match, "");
- ngx_conf_merge_value(conf->last_modified, prev->last_modified, 0);
-
- if (conf->value.value.data == NULL) {
- conf->value = prev->value;
- }
-
- if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
- &prev->types_keys, &prev->types,
- ngx_http_html_default_types)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_sub_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_sub_header_filter;
-
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_sub_body_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_hash_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_hash_module.c
deleted file mode 100644
index 777e180a59f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_hash_module.c
+++ /dev/null
@@ -1,631 +0,0 @@
-
-/*
- * Copyright (C) Roman Arutyunyan
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- uint32_t hash;
- ngx_str_t *server;
-} ngx_http_upstream_chash_point_t;
-
-
-typedef struct {
- ngx_uint_t number;
- ngx_http_upstream_chash_point_t point[1];
-} ngx_http_upstream_chash_points_t;
-
-
-typedef struct {
- ngx_http_complex_value_t key;
- ngx_http_upstream_chash_points_t *points;
-} ngx_http_upstream_hash_srv_conf_t;
-
-
-typedef struct {
- /* the round robin data must be first */
- ngx_http_upstream_rr_peer_data_t rrp;
- ngx_http_upstream_hash_srv_conf_t *conf;
- ngx_str_t key;
- ngx_uint_t tries;
- ngx_uint_t rehash;
- uint32_t hash;
- ngx_event_get_peer_pt get_rr_peer;
-} ngx_http_upstream_hash_peer_data_t;
-
-
-static ngx_int_t ngx_http_upstream_init_hash(ngx_conf_t *cf,
- ngx_http_upstream_srv_conf_t *us);
-static ngx_int_t ngx_http_upstream_init_hash_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us);
-static ngx_int_t ngx_http_upstream_get_hash_peer(ngx_peer_connection_t *pc,
- void *data);
-
-static ngx_int_t ngx_http_upstream_init_chash(ngx_conf_t *cf,
- ngx_http_upstream_srv_conf_t *us);
-static void ngx_http_upstream_add_chash_point(
- ngx_http_upstream_chash_points_t *points, uint32_t hash, ngx_str_t *server);
-static ngx_uint_t ngx_http_upstream_find_chash_point(
- ngx_http_upstream_chash_points_t *points, uint32_t hash);
-static ngx_int_t ngx_http_upstream_init_chash_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us);
-static ngx_int_t ngx_http_upstream_get_chash_peer(ngx_peer_connection_t *pc,
- void *data);
-
-static void *ngx_http_upstream_hash_create_conf(ngx_conf_t *cf);
-static char *ngx_http_upstream_hash(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_http_upstream_hash_commands[] = {
-
- { ngx_string("hash"),
- NGX_HTTP_UPS_CONF|NGX_CONF_TAKE12,
- ngx_http_upstream_hash,
- NGX_HTTP_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_upstream_hash_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_http_upstream_hash_create_conf, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_upstream_hash_module = {
- NGX_MODULE_V1,
- &ngx_http_upstream_hash_module_ctx, /* module context */
- ngx_http_upstream_hash_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_upstream_init_hash(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
-{
- if (ngx_http_upstream_init_round_robin(cf, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- us->peer.init = ngx_http_upstream_init_hash_peer;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_init_hash_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us)
-{
- ngx_http_upstream_hash_srv_conf_t *hcf;
- ngx_http_upstream_hash_peer_data_t *hp;
-
- hp = ngx_palloc(r->pool, sizeof(ngx_http_upstream_hash_peer_data_t));
- if (hp == NULL) {
- return NGX_ERROR;
- }
-
- r->upstream->peer.data = &hp->rrp;
-
- if (ngx_http_upstream_init_round_robin_peer(r, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- r->upstream->peer.get = ngx_http_upstream_get_hash_peer;
-
- hcf = ngx_http_conf_upstream_srv_conf(us, ngx_http_upstream_hash_module);
-
- if (ngx_http_complex_value(r, &hcf->key, &hp->key) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "upstream hash key:\"%V\"", &hp->key);
-
- hp->conf = hcf;
- hp->tries = 0;
- hp->rehash = 0;
- hp->hash = 0;
- hp->get_rr_peer = ngx_http_upstream_get_round_robin_peer;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_get_hash_peer(ngx_peer_connection_t *pc, void *data)
-{
- ngx_http_upstream_hash_peer_data_t *hp = data;
-
- time_t now;
- u_char buf[NGX_INT_T_LEN];
- size_t size;
- uint32_t hash;
- ngx_int_t w;
- uintptr_t m;
- ngx_uint_t i, n, p;
- ngx_http_upstream_rr_peer_t *peer;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get hash peer, try: %ui", pc->tries);
-
- if (hp->tries > 20 || hp->rrp.peers->single) {
- return hp->get_rr_peer(pc, &hp->rrp);
- }
-
- now = ngx_time();
-
- pc->cached = 0;
- pc->connection = NULL;
-
- for ( ;; ) {
-
- /*
- * Hash expression is compatible with Cache::Memcached:
- * ((crc32([REHASH] KEY) >> 16) & 0x7fff) + PREV_HASH
- * with REHASH omitted at the first iteration.
- */
-
- ngx_crc32_init(hash);
-
- if (hp->rehash > 0) {
- size = ngx_sprintf(buf, "%ui", hp->rehash) - buf;
- ngx_crc32_update(&hash, buf, size);
- }
-
- ngx_crc32_update(&hash, hp->key.data, hp->key.len);
- ngx_crc32_final(hash);
-
- hash = (hash >> 16) & 0x7fff;
-
- hp->hash += hash;
- hp->rehash++;
-
- if (!hp->rrp.peers->weighted) {
- p = hp->hash % hp->rrp.peers->number;
-
- } else {
- w = hp->hash % hp->rrp.peers->total_weight;
-
- for (i = 0; i < hp->rrp.peers->number; i++) {
- w -= hp->rrp.peers->peer[i].weight;
- if (w < 0) {
- break;
- }
- }
-
- p = i;
- }
-
- n = p / (8 * sizeof(uintptr_t));
- m = (uintptr_t) 1 << p % (8 * sizeof(uintptr_t));
-
- if (hp->rrp.tried[n] & m) {
- goto next;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get hash peer, value:%uD, peer:%ui", hp->hash, p);
-
- peer = &hp->rrp.peers->peer[p];
-
- if (peer->down) {
- goto next;
- }
-
- if (peer->max_fails
- && peer->fails >= peer->max_fails
- && now - peer->checked <= peer->fail_timeout)
- {
- goto next;
- }
-
- break;
-
- next:
-
- if (++hp->tries > 20) {
- return hp->get_rr_peer(pc, &hp->rrp);
- }
- }
-
- hp->rrp.current = p;
-
- pc->sockaddr = peer->sockaddr;
- pc->socklen = peer->socklen;
- pc->name = &peer->name;
-
- if (now - peer->checked > peer->fail_timeout) {
- peer->checked = now;
- }
-
- hp->rrp.tried[n] |= m;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_init_chash(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
-{
- u_char *host, *port, c;
- size_t host_len, port_len, size;
- uint32_t hash, base_hash, prev_hash;
- ngx_str_t *server;
- ngx_uint_t npoints, i, j;
- ngx_http_upstream_rr_peer_t *peer;
- ngx_http_upstream_rr_peers_t *peers;
- ngx_http_upstream_chash_points_t *points;
- ngx_http_upstream_hash_srv_conf_t *hcf;
-
- if (ngx_http_upstream_init_round_robin(cf, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- us->peer.init = ngx_http_upstream_init_chash_peer;
-
- peers = us->peer.data;
- npoints = peers->total_weight * 160;
-
- size = sizeof(ngx_http_upstream_chash_points_t)
- + sizeof(ngx_http_upstream_chash_point_t) * (npoints - 1);
-
- points = ngx_palloc(cf->pool, size);
- if (points == NULL) {
- return NGX_ERROR;
- }
-
- points->number = 0;
-
- for (i = 0; i < peers->number; i++) {
- peer = &peers->peer[i];
- server = &peer->server;
-
- /*
- * Hash expression is compatible with Cache::Memcached::Fast:
- * crc32(HOST \0 PORT PREV_HASH).
- */
-
- if (server->len >= 5
- && ngx_strncasecmp(server->data, (u_char *) "unix:", 5) == 0)
- {
- host = server->data + 5;
- host_len = server->len - 5;
- port = NULL;
- port_len = 0;
- goto done;
- }
-
- for (j = 0; j < server->len; j++) {
- c = server->data[server->len - j - 1];
-
- if (c == ':') {
- host = server->data;
- host_len = server->len - j - 1;
- port = server->data + server->len - j;
- port_len = j;
- goto done;
- }
-
- if (c < '0' || c > '9') {
- break;
- }
- }
-
- host = server->data;
- host_len = server->len;
- port = NULL;
- port_len = 0;
-
- done:
-
- ngx_crc32_init(base_hash);
- ngx_crc32_update(&base_hash, host, host_len);
- ngx_crc32_update(&base_hash, (u_char *) "", 1);
- ngx_crc32_update(&base_hash, port, port_len);
-
- prev_hash = 0;
- npoints = peer->weight * 160;
-
- for (j = 0; j < npoints; j++) {
- hash = base_hash;
-
- ngx_crc32_update(&hash, (u_char *) &prev_hash, sizeof(uint32_t));
- ngx_crc32_final(hash);
-
- ngx_http_upstream_add_chash_point(points, hash, &peer->server);
-
- prev_hash = hash;
- }
- }
-
- hcf = ngx_http_conf_upstream_srv_conf(us, ngx_http_upstream_hash_module);
- hcf->points = points;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_upstream_add_chash_point(ngx_http_upstream_chash_points_t *points,
- uint32_t hash, ngx_str_t *server)
-{
- size_t size;
- ngx_uint_t i;
- ngx_http_upstream_chash_point_t *point;
-
- i = ngx_http_upstream_find_chash_point(points, hash);
- point = &points->point[i];
-
- if (point->hash == hash) {
- return;
- }
-
- size = (points->number - i) * sizeof(ngx_http_upstream_chash_point_t);
-
- ngx_memmove(point + 1, point, size);
-
- points->number++;
- point->hash = hash;
- point->server = server;
-}
-
-
-static ngx_uint_t
-ngx_http_upstream_find_chash_point(ngx_http_upstream_chash_points_t *points,
- uint32_t hash)
-{
- ngx_uint_t i, j, k;
- ngx_http_upstream_chash_point_t *point;
-
- /* find first point >= hash */
-
- point = &points->point[0];
-
- i = 0;
- j = points->number;
-
- while (i < j) {
- k = (i + j) / 2;
-
- if (hash > point[k].hash) {
- i = k + 1;
-
- } else if (hash < point[k].hash) {
- j = k;
-
- } else {
- return k;
- }
- }
-
- return i;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_init_chash_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us)
-{
- uint32_t hash;
- ngx_http_upstream_hash_srv_conf_t *hcf;
- ngx_http_upstream_hash_peer_data_t *hp;
-
- if (ngx_http_upstream_init_hash_peer(r, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- r->upstream->peer.get = ngx_http_upstream_get_chash_peer;
-
- hp = r->upstream->peer.data;
- hcf = ngx_http_conf_upstream_srv_conf(us, ngx_http_upstream_hash_module);
-
- hash = ngx_crc32_long(hp->key.data, hp->key.len);
- hp->hash = ngx_http_upstream_find_chash_point(hcf->points, hash);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_get_chash_peer(ngx_peer_connection_t *pc, void *data)
-{
- ngx_http_upstream_hash_peer_data_t *hp = data;
-
- time_t now;
- intptr_t m;
- ngx_str_t *server;
- ngx_int_t total;
- ngx_uint_t i, n;
- ngx_http_upstream_rr_peer_t *peer, *best;
- ngx_http_upstream_chash_point_t *point;
- ngx_http_upstream_chash_points_t *points;
- ngx_http_upstream_hash_srv_conf_t *hcf;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get consistent hash peer, try: %ui", pc->tries);
-
- pc->cached = 0;
- pc->connection = NULL;
-
- now = ngx_time();
- hcf = hp->conf;
-
- points = hcf->points;
- point = &points->point[0];
-
- for ( ;; ) {
- server = point[hp->hash % points->number].server;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "consistent hash peer:%uD, server:\"%V\"",
- hp->hash, server);
-
- best = NULL;
- total = 0;
-
- for (i = 0; i < hp->rrp.peers->number; i++) {
-
- n = i / (8 * sizeof(uintptr_t));
- m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t));
-
- if (hp->rrp.tried[n] & m) {
- continue;
- }
-
- peer = &hp->rrp.peers->peer[i];
-
- if (peer->down) {
- continue;
- }
-
- if (peer->server.len != server->len
- || ngx_strncmp(peer->server.data, server->data, server->len)
- != 0)
- {
- continue;
- }
-
- if (peer->max_fails
- && peer->fails >= peer->max_fails
- && now - peer->checked <= peer->fail_timeout)
- {
- continue;
- }
-
- peer->current_weight += peer->effective_weight;
- total += peer->effective_weight;
-
- if (peer->effective_weight < peer->weight) {
- peer->effective_weight++;
- }
-
- if (best == NULL || peer->current_weight > best->current_weight) {
- best = peer;
- }
- }
-
- if (best) {
- best->current_weight -= total;
-
- i = best - &hp->rrp.peers->peer[0];
-
- hp->rrp.current = i;
-
- n = i / (8 * sizeof(uintptr_t));
- m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t));
-
- hp->rrp.tried[n] |= m;
-
- if (now - best->checked > best->fail_timeout) {
- best->checked = now;
- }
-
- pc->sockaddr = best->sockaddr;
- pc->socklen = best->socklen;
- pc->name = &best->name;
-
- return NGX_OK;
- }
-
- hp->hash++;
- hp->tries++;
-
- if (hp->tries >= points->number) {
- return NGX_BUSY;
- }
- }
-}
-
-
-static void *
-ngx_http_upstream_hash_create_conf(ngx_conf_t *cf)
-{
- ngx_http_upstream_hash_srv_conf_t *conf;
-
- conf = ngx_palloc(cf->pool, sizeof(ngx_http_upstream_hash_srv_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->points = NULL;
-
- return conf;
-}
-
-
-static char *
-ngx_http_upstream_hash(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_upstream_hash_srv_conf_t *hcf = conf;
-
- ngx_str_t *value;
- ngx_http_upstream_srv_conf_t *uscf;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &hcf->key;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
-
- if (uscf->peer.init_upstream) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "load balancing method redefined");
- }
-
- uscf->flags = NGX_HTTP_UPSTREAM_CREATE
- |NGX_HTTP_UPSTREAM_WEIGHT
- |NGX_HTTP_UPSTREAM_MAX_FAILS
- |NGX_HTTP_UPSTREAM_FAIL_TIMEOUT
- |NGX_HTTP_UPSTREAM_DOWN;
-
- if (cf->args->nelts == 2) {
- uscf->peer.init_upstream = ngx_http_upstream_init_hash;
-
- } else if (ngx_strcmp(value[2].data, "consistent") == 0) {
- uscf->peer.init_upstream = ngx_http_upstream_init_chash;
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[2]);
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_ip_hash_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_ip_hash_module.c
deleted file mode 100644
index 148d73a8472..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_ip_hash_module.c
+++ /dev/null
@@ -1,279 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- /* the round robin data must be first */
- ngx_http_upstream_rr_peer_data_t rrp;
-
- ngx_uint_t hash;
-
- u_char addrlen;
- u_char *addr;
-
- u_char tries;
-
- ngx_event_get_peer_pt get_rr_peer;
-} ngx_http_upstream_ip_hash_peer_data_t;
-
-
-static ngx_int_t ngx_http_upstream_init_ip_hash_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us);
-static ngx_int_t ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc,
- void *data);
-static char *ngx_http_upstream_ip_hash(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_http_upstream_ip_hash_commands[] = {
-
- { ngx_string("ip_hash"),
- NGX_HTTP_UPS_CONF|NGX_CONF_NOARGS,
- ngx_http_upstream_ip_hash,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_upstream_ip_hash_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_upstream_ip_hash_module = {
- NGX_MODULE_V1,
- &ngx_http_upstream_ip_hash_module_ctx, /* module context */
- ngx_http_upstream_ip_hash_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static u_char ngx_http_upstream_ip_hash_pseudo_addr[3];
-
-
-static ngx_int_t
-ngx_http_upstream_init_ip_hash(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
-{
- if (ngx_http_upstream_init_round_robin(cf, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- us->peer.init = ngx_http_upstream_init_ip_hash_peer;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_init_ip_hash_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us)
-{
- struct sockaddr_in *sin;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
- ngx_http_upstream_ip_hash_peer_data_t *iphp;
-
- iphp = ngx_palloc(r->pool, sizeof(ngx_http_upstream_ip_hash_peer_data_t));
- if (iphp == NULL) {
- return NGX_ERROR;
- }
-
- r->upstream->peer.data = &iphp->rrp;
-
- if (ngx_http_upstream_init_round_robin_peer(r, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- r->upstream->peer.get = ngx_http_upstream_get_ip_hash_peer;
-
- switch (r->connection->sockaddr->sa_family) {
-
- case AF_INET:
- sin = (struct sockaddr_in *) r->connection->sockaddr;
- iphp->addr = (u_char *) &sin->sin_addr.s_addr;
- iphp->addrlen = 3;
- break;
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) r->connection->sockaddr;
- iphp->addr = (u_char *) &sin6->sin6_addr.s6_addr;
- iphp->addrlen = 16;
- break;
-#endif
-
- default:
- iphp->addr = ngx_http_upstream_ip_hash_pseudo_addr;
- iphp->addrlen = 3;
- }
-
- iphp->hash = 89;
- iphp->tries = 0;
- iphp->get_rr_peer = ngx_http_upstream_get_round_robin_peer;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_get_ip_hash_peer(ngx_peer_connection_t *pc, void *data)
-{
- ngx_http_upstream_ip_hash_peer_data_t *iphp = data;
-
- time_t now;
- ngx_int_t w;
- uintptr_t m;
- ngx_uint_t i, n, p, hash;
- ngx_http_upstream_rr_peer_t *peer;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get ip hash peer, try: %ui", pc->tries);
-
- /* TODO: cached */
-
- if (iphp->tries > 20 || iphp->rrp.peers->single) {
- return iphp->get_rr_peer(pc, &iphp->rrp);
- }
-
- now = ngx_time();
-
- pc->cached = 0;
- pc->connection = NULL;
-
- hash = iphp->hash;
-
- for ( ;; ) {
-
- for (i = 0; i < (ngx_uint_t) iphp->addrlen; i++) {
- hash = (hash * 113 + iphp->addr[i]) % 6271;
- }
-
- if (!iphp->rrp.peers->weighted) {
- p = hash % iphp->rrp.peers->number;
-
- } else {
- w = hash % iphp->rrp.peers->total_weight;
-
- for (i = 0; i < iphp->rrp.peers->number; i++) {
- w -= iphp->rrp.peers->peer[i].weight;
- if (w < 0) {
- break;
- }
- }
-
- p = i;
- }
-
- n = p / (8 * sizeof(uintptr_t));
- m = (uintptr_t) 1 << p % (8 * sizeof(uintptr_t));
-
- if (iphp->rrp.tried[n] & m) {
- goto next;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get ip hash peer, hash: %ui %04XA", p, m);
-
- peer = &iphp->rrp.peers->peer[p];
-
- /* ngx_lock_mutex(iphp->rrp.peers->mutex); */
-
- if (peer->down) {
- goto next_try;
- }
-
- if (peer->max_fails
- && peer->fails >= peer->max_fails
- && now - peer->checked <= peer->fail_timeout)
- {
- goto next_try;
- }
-
- break;
-
- next_try:
-
- iphp->rrp.tried[n] |= m;
-
- /* ngx_unlock_mutex(iphp->rrp.peers->mutex); */
-
- pc->tries--;
-
- next:
-
- if (++iphp->tries > 20) {
- return iphp->get_rr_peer(pc, &iphp->rrp);
- }
- }
-
- iphp->rrp.current = p;
-
- pc->sockaddr = peer->sockaddr;
- pc->socklen = peer->socklen;
- pc->name = &peer->name;
-
- if (now - peer->checked > peer->fail_timeout) {
- peer->checked = now;
- }
-
- /* ngx_unlock_mutex(iphp->rrp.peers->mutex); */
-
- iphp->rrp.tried[n] |= m;
- iphp->hash = hash;
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_upstream_ip_hash(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_upstream_srv_conf_t *uscf;
-
- uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
-
- if (uscf->peer.init_upstream) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "load balancing method redefined");
- }
-
- uscf->peer.init_upstream = ngx_http_upstream_init_ip_hash;
-
- uscf->flags = NGX_HTTP_UPSTREAM_CREATE
- |NGX_HTTP_UPSTREAM_WEIGHT
- |NGX_HTTP_UPSTREAM_MAX_FAILS
- |NGX_HTTP_UPSTREAM_FAIL_TIMEOUT
- |NGX_HTTP_UPSTREAM_DOWN;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_keepalive_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_keepalive_module.c
deleted file mode 100644
index f738f0cc18e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_keepalive_module.c
+++ /dev/null
@@ -1,518 +0,0 @@
-
-/*
- * Copyright (C) Maxim Dounin
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_uint_t max_cached;
-
- ngx_queue_t cache;
- ngx_queue_t free;
-
- ngx_http_upstream_init_pt original_init_upstream;
- ngx_http_upstream_init_peer_pt original_init_peer;
-
-} ngx_http_upstream_keepalive_srv_conf_t;
-
-
-typedef struct {
- ngx_http_upstream_keepalive_srv_conf_t *conf;
-
- ngx_http_upstream_t *upstream;
-
- void *data;
-
- ngx_event_get_peer_pt original_get_peer;
- ngx_event_free_peer_pt original_free_peer;
-
-#if (NGX_HTTP_SSL)
- ngx_event_set_peer_session_pt original_set_session;
- ngx_event_save_peer_session_pt original_save_session;
-#endif
-
-} ngx_http_upstream_keepalive_peer_data_t;
-
-
-typedef struct {
- ngx_http_upstream_keepalive_srv_conf_t *conf;
-
- ngx_queue_t queue;
- ngx_connection_t *connection;
-
- socklen_t socklen;
- u_char sockaddr[NGX_SOCKADDRLEN];
-
-} ngx_http_upstream_keepalive_cache_t;
-
-
-static ngx_int_t ngx_http_upstream_init_keepalive_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us);
-static ngx_int_t ngx_http_upstream_get_keepalive_peer(ngx_peer_connection_t *pc,
- void *data);
-static void ngx_http_upstream_free_keepalive_peer(ngx_peer_connection_t *pc,
- void *data, ngx_uint_t state);
-
-static void ngx_http_upstream_keepalive_dummy_handler(ngx_event_t *ev);
-static void ngx_http_upstream_keepalive_close_handler(ngx_event_t *ev);
-static void ngx_http_upstream_keepalive_close(ngx_connection_t *c);
-
-
-#if (NGX_HTTP_SSL)
-static ngx_int_t ngx_http_upstream_keepalive_set_session(
- ngx_peer_connection_t *pc, void *data);
-static void ngx_http_upstream_keepalive_save_session(ngx_peer_connection_t *pc,
- void *data);
-#endif
-
-static void *ngx_http_upstream_keepalive_create_conf(ngx_conf_t *cf);
-static char *ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_http_upstream_keepalive_commands[] = {
-
- { ngx_string("keepalive"),
- NGX_HTTP_UPS_CONF|NGX_CONF_TAKE1,
- ngx_http_upstream_keepalive,
- NGX_HTTP_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_upstream_keepalive_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_http_upstream_keepalive_create_conf, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_upstream_keepalive_module = {
- NGX_MODULE_V1,
- &ngx_http_upstream_keepalive_module_ctx, /* module context */
- ngx_http_upstream_keepalive_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_upstream_init_keepalive(ngx_conf_t *cf,
- ngx_http_upstream_srv_conf_t *us)
-{
- ngx_uint_t i;
- ngx_http_upstream_keepalive_srv_conf_t *kcf;
- ngx_http_upstream_keepalive_cache_t *cached;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cf->log, 0,
- "init keepalive");
-
- kcf = ngx_http_conf_upstream_srv_conf(us,
- ngx_http_upstream_keepalive_module);
-
- if (kcf->original_init_upstream(cf, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- kcf->original_init_peer = us->peer.init;
-
- us->peer.init = ngx_http_upstream_init_keepalive_peer;
-
- /* allocate cache items and add to free queue */
-
- cached = ngx_pcalloc(cf->pool,
- sizeof(ngx_http_upstream_keepalive_cache_t) * kcf->max_cached);
- if (cached == NULL) {
- return NGX_ERROR;
- }
-
- ngx_queue_init(&kcf->cache);
- ngx_queue_init(&kcf->free);
-
- for (i = 0; i < kcf->max_cached; i++) {
- ngx_queue_insert_head(&kcf->free, &cached[i].queue);
- cached[i].conf = kcf;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_init_keepalive_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us)
-{
- ngx_http_upstream_keepalive_peer_data_t *kp;
- ngx_http_upstream_keepalive_srv_conf_t *kcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "init keepalive peer");
-
- kcf = ngx_http_conf_upstream_srv_conf(us,
- ngx_http_upstream_keepalive_module);
-
- kp = ngx_palloc(r->pool, sizeof(ngx_http_upstream_keepalive_peer_data_t));
- if (kp == NULL) {
- return NGX_ERROR;
- }
-
- if (kcf->original_init_peer(r, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- kp->conf = kcf;
- kp->upstream = r->upstream;
- kp->data = r->upstream->peer.data;
- kp->original_get_peer = r->upstream->peer.get;
- kp->original_free_peer = r->upstream->peer.free;
-
- r->upstream->peer.data = kp;
- r->upstream->peer.get = ngx_http_upstream_get_keepalive_peer;
- r->upstream->peer.free = ngx_http_upstream_free_keepalive_peer;
-
-#if (NGX_HTTP_SSL)
- kp->original_set_session = r->upstream->peer.set_session;
- kp->original_save_session = r->upstream->peer.save_session;
- r->upstream->peer.set_session = ngx_http_upstream_keepalive_set_session;
- r->upstream->peer.save_session = ngx_http_upstream_keepalive_save_session;
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_get_keepalive_peer(ngx_peer_connection_t *pc, void *data)
-{
- ngx_http_upstream_keepalive_peer_data_t *kp = data;
- ngx_http_upstream_keepalive_cache_t *item;
-
- ngx_int_t rc;
- ngx_queue_t *q, *cache;
- ngx_connection_t *c;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get keepalive peer");
-
- /* ask balancer */
-
- rc = kp->original_get_peer(pc, kp->data);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- /* search cache for suitable connection */
-
- cache = &kp->conf->cache;
-
- for (q = ngx_queue_head(cache);
- q != ngx_queue_sentinel(cache);
- q = ngx_queue_next(q))
- {
- item = ngx_queue_data(q, ngx_http_upstream_keepalive_cache_t, queue);
- c = item->connection;
-
- if (ngx_memn2cmp((u_char *) &item->sockaddr, (u_char *) pc->sockaddr,
- item->socklen, pc->socklen)
- == 0)
- {
- ngx_queue_remove(q);
- ngx_queue_insert_head(&kp->conf->free, q);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get keepalive peer: using connection %p", c);
-
- c->idle = 0;
- c->sent = 0;
- c->log = pc->log;
- c->read->log = pc->log;
- c->write->log = pc->log;
- c->pool->log = pc->log;
-
- pc->connection = c;
- pc->cached = 1;
-
- return NGX_DONE;
- }
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_upstream_free_keepalive_peer(ngx_peer_connection_t *pc, void *data,
- ngx_uint_t state)
-{
- ngx_http_upstream_keepalive_peer_data_t *kp = data;
- ngx_http_upstream_keepalive_cache_t *item;
-
- ngx_queue_t *q;
- ngx_connection_t *c;
- ngx_http_upstream_t *u;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "free keepalive peer");
-
- /* cache valid connections */
-
- u = kp->upstream;
- c = pc->connection;
-
- if (state & NGX_PEER_FAILED
- || c == NULL
- || c->read->eof
- || c->read->error
- || c->read->timedout
- || c->write->error
- || c->write->timedout)
- {
- goto invalid;
- }
-
- if (!u->keepalive) {
- goto invalid;
- }
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- goto invalid;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "free keepalive peer: saving connection %p", c);
-
- if (ngx_queue_empty(&kp->conf->free)) {
-
- q = ngx_queue_last(&kp->conf->cache);
- ngx_queue_remove(q);
-
- item = ngx_queue_data(q, ngx_http_upstream_keepalive_cache_t, queue);
-
- ngx_http_upstream_keepalive_close(item->connection);
-
- } else {
- q = ngx_queue_head(&kp->conf->free);
- ngx_queue_remove(q);
-
- item = ngx_queue_data(q, ngx_http_upstream_keepalive_cache_t, queue);
- }
-
- item->connection = c;
- ngx_queue_insert_head(&kp->conf->cache, q);
-
- pc->connection = NULL;
-
- if (c->read->timer_set) {
- ngx_del_timer(c->read);
- }
- if (c->write->timer_set) {
- ngx_del_timer(c->write);
- }
-
- c->write->handler = ngx_http_upstream_keepalive_dummy_handler;
- c->read->handler = ngx_http_upstream_keepalive_close_handler;
-
- c->data = item;
- c->idle = 1;
- c->log = ngx_cycle->log;
- c->read->log = ngx_cycle->log;
- c->write->log = ngx_cycle->log;
- c->pool->log = ngx_cycle->log;
-
- item->socklen = pc->socklen;
- ngx_memcpy(&item->sockaddr, pc->sockaddr, pc->socklen);
-
- if (c->read->ready) {
- ngx_http_upstream_keepalive_close_handler(c->read);
- }
-
-invalid:
-
- kp->original_free_peer(pc, kp->data, state);
-}
-
-
-static void
-ngx_http_upstream_keepalive_dummy_handler(ngx_event_t *ev)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ev->log, 0,
- "keepalive dummy handler");
-}
-
-
-static void
-ngx_http_upstream_keepalive_close_handler(ngx_event_t *ev)
-{
- ngx_http_upstream_keepalive_srv_conf_t *conf;
- ngx_http_upstream_keepalive_cache_t *item;
-
- int n;
- char buf[1];
- ngx_connection_t *c;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ev->log, 0,
- "keepalive close handler");
-
- c = ev->data;
-
- if (c->close) {
- goto close;
- }
-
- n = recv(c->fd, buf, 1, MSG_PEEK);
-
- if (n == -1 && ngx_socket_errno == NGX_EAGAIN) {
- /* stale event */
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- goto close;
- }
-
- return;
- }
-
-close:
-
- item = c->data;
- conf = item->conf;
-
- ngx_http_upstream_keepalive_close(c);
-
- ngx_queue_remove(&item->queue);
- ngx_queue_insert_head(&conf->free, &item->queue);
-}
-
-
-static void
-ngx_http_upstream_keepalive_close(ngx_connection_t *c)
-{
-
-#if (NGX_HTTP_SSL)
-
- if (c->ssl) {
- c->ssl->no_wait_shutdown = 1;
- c->ssl->no_send_shutdown = 1;
-
- if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
- c->ssl->handler = ngx_http_upstream_keepalive_close;
- return;
- }
- }
-
-#endif
-
- ngx_destroy_pool(c->pool);
- ngx_close_connection(c);
-}
-
-
-#if (NGX_HTTP_SSL)
-
-static ngx_int_t
-ngx_http_upstream_keepalive_set_session(ngx_peer_connection_t *pc, void *data)
-{
- ngx_http_upstream_keepalive_peer_data_t *kp = data;
-
- return kp->original_set_session(pc, kp->data);
-}
-
-
-static void
-ngx_http_upstream_keepalive_save_session(ngx_peer_connection_t *pc, void *data)
-{
- ngx_http_upstream_keepalive_peer_data_t *kp = data;
-
- kp->original_save_session(pc, kp->data);
- return;
-}
-
-#endif
-
-
-static void *
-ngx_http_upstream_keepalive_create_conf(ngx_conf_t *cf)
-{
- ngx_http_upstream_keepalive_srv_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool,
- sizeof(ngx_http_upstream_keepalive_srv_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->original_init_upstream = NULL;
- * conf->original_init_peer = NULL;
- */
-
- conf->max_cached = 1;
-
- return conf;
-}
-
-
-static char *
-ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_upstream_srv_conf_t *uscf;
- ngx_http_upstream_keepalive_srv_conf_t *kcf = conf;
-
- ngx_int_t n;
- ngx_str_t *value;
-
- uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
-
- if (kcf->original_init_upstream) {
- return "is duplicate";
- }
-
- kcf->original_init_upstream = uscf->peer.init_upstream
- ? uscf->peer.init_upstream
- : ngx_http_upstream_init_round_robin;
-
- uscf->peer.init_upstream = ngx_http_upstream_init_keepalive;
-
- /* read options */
-
- value = cf->args->elts;
-
- n = ngx_atoi(value[1].data, value[1].len);
-
- if (n == NGX_ERROR || n == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\" in \"%V\" directive",
- &value[1], &cmd->name);
- return NGX_CONF_ERROR;
- }
-
- kcf->max_cached = n;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_least_conn_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_least_conn_module.c
deleted file mode 100644
index 623bc9b1053..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_upstream_least_conn_module.c
+++ /dev/null
@@ -1,403 +0,0 @@
-
-/*
- * Copyright (C) Maxim Dounin
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_uint_t *conns;
-} ngx_http_upstream_least_conn_conf_t;
-
-
-typedef struct {
- /* the round robin data must be first */
- ngx_http_upstream_rr_peer_data_t rrp;
-
- ngx_uint_t *conns;
-
- ngx_event_get_peer_pt get_rr_peer;
- ngx_event_free_peer_pt free_rr_peer;
-} ngx_http_upstream_lc_peer_data_t;
-
-
-static ngx_int_t ngx_http_upstream_init_least_conn_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us);
-static ngx_int_t ngx_http_upstream_get_least_conn_peer(
- ngx_peer_connection_t *pc, void *data);
-static void ngx_http_upstream_free_least_conn_peer(ngx_peer_connection_t *pc,
- void *data, ngx_uint_t state);
-static void *ngx_http_upstream_least_conn_create_conf(ngx_conf_t *cf);
-static char *ngx_http_upstream_least_conn(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_http_upstream_least_conn_commands[] = {
-
- { ngx_string("least_conn"),
- NGX_HTTP_UPS_CONF|NGX_CONF_NOARGS,
- ngx_http_upstream_least_conn,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_upstream_least_conn_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_http_upstream_least_conn_create_conf, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_upstream_least_conn_module = {
- NGX_MODULE_V1,
- &ngx_http_upstream_least_conn_module_ctx, /* module context */
- ngx_http_upstream_least_conn_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_int_t
-ngx_http_upstream_init_least_conn(ngx_conf_t *cf,
- ngx_http_upstream_srv_conf_t *us)
-{
- ngx_uint_t n;
- ngx_http_upstream_rr_peers_t *peers;
- ngx_http_upstream_least_conn_conf_t *lcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cf->log, 0,
- "init least conn");
-
- if (ngx_http_upstream_init_round_robin(cf, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- peers = us->peer.data;
-
- n = peers->number;
-
- if (peers->next) {
- n += peers->next->number;
- }
-
- lcf = ngx_http_conf_upstream_srv_conf(us,
- ngx_http_upstream_least_conn_module);
-
- lcf->conns = ngx_pcalloc(cf->pool, sizeof(ngx_uint_t) * n);
- if (lcf->conns == NULL) {
- return NGX_ERROR;
- }
-
- us->peer.init = ngx_http_upstream_init_least_conn_peer;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_init_least_conn_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us)
-{
- ngx_http_upstream_lc_peer_data_t *lcp;
- ngx_http_upstream_least_conn_conf_t *lcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "init least conn peer");
-
- lcf = ngx_http_conf_upstream_srv_conf(us,
- ngx_http_upstream_least_conn_module);
-
- lcp = ngx_palloc(r->pool, sizeof(ngx_http_upstream_lc_peer_data_t));
- if (lcp == NULL) {
- return NGX_ERROR;
- }
-
- lcp->conns = lcf->conns;
-
- r->upstream->peer.data = &lcp->rrp;
-
- if (ngx_http_upstream_init_round_robin_peer(r, us) != NGX_OK) {
- return NGX_ERROR;
- }
-
- r->upstream->peer.get = ngx_http_upstream_get_least_conn_peer;
- r->upstream->peer.free = ngx_http_upstream_free_least_conn_peer;
-
- lcp->get_rr_peer = ngx_http_upstream_get_round_robin_peer;
- lcp->free_rr_peer = ngx_http_upstream_free_round_robin_peer;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_get_least_conn_peer(ngx_peer_connection_t *pc, void *data)
-{
- ngx_http_upstream_lc_peer_data_t *lcp = data;
-
- time_t now;
- uintptr_t m;
- ngx_int_t rc, total;
- ngx_uint_t i, n, p, many;
- ngx_http_upstream_rr_peer_t *peer, *best;
- ngx_http_upstream_rr_peers_t *peers;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get least conn peer, try: %ui", pc->tries);
-
- if (lcp->rrp.peers->single) {
- return lcp->get_rr_peer(pc, &lcp->rrp);
- }
-
- pc->cached = 0;
- pc->connection = NULL;
-
- now = ngx_time();
-
- peers = lcp->rrp.peers;
-
- best = NULL;
- total = 0;
-
-#if (NGX_SUPPRESS_WARN)
- many = 0;
- p = 0;
-#endif
-
- for (i = 0; i < peers->number; i++) {
-
- n = i / (8 * sizeof(uintptr_t));
- m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t));
-
- if (lcp->rrp.tried[n] & m) {
- continue;
- }
-
- peer = &peers->peer[i];
-
- if (peer->down) {
- continue;
- }
-
- if (peer->max_fails
- && peer->fails >= peer->max_fails
- && now - peer->checked <= peer->fail_timeout)
- {
- continue;
- }
-
- /*
- * select peer with least number of connections; if there are
- * multiple peers with the same number of connections, select
- * based on round-robin
- */
-
- if (best == NULL
- || lcp->conns[i] * best->weight < lcp->conns[p] * peer->weight)
- {
- best = peer;
- many = 0;
- p = i;
-
- } else if (lcp->conns[i] * best->weight
- == lcp->conns[p] * peer->weight)
- {
- many = 1;
- }
- }
-
- if (best == NULL) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get least conn peer, no peer found");
-
- goto failed;
- }
-
- if (many) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get least conn peer, many");
-
- for (i = p; i < peers->number; i++) {
-
- n = i / (8 * sizeof(uintptr_t));
- m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t));
-
- if (lcp->rrp.tried[n] & m) {
- continue;
- }
-
- peer = &peers->peer[i];
-
- if (peer->down) {
- continue;
- }
-
- if (lcp->conns[i] * best->weight != lcp->conns[p] * peer->weight) {
- continue;
- }
-
- if (peer->max_fails
- && peer->fails >= peer->max_fails
- && now - peer->checked <= peer->fail_timeout)
- {
- continue;
- }
-
- peer->current_weight += peer->effective_weight;
- total += peer->effective_weight;
-
- if (peer->effective_weight < peer->weight) {
- peer->effective_weight++;
- }
-
- if (peer->current_weight > best->current_weight) {
- best = peer;
- p = i;
- }
- }
- }
-
- best->current_weight -= total;
-
- if (now - best->checked > best->fail_timeout) {
- best->checked = now;
- }
-
- pc->sockaddr = best->sockaddr;
- pc->socklen = best->socklen;
- pc->name = &best->name;
-
- lcp->rrp.current = p;
-
- n = p / (8 * sizeof(uintptr_t));
- m = (uintptr_t) 1 << p % (8 * sizeof(uintptr_t));
-
- lcp->rrp.tried[n] |= m;
- lcp->conns[p]++;
-
- return NGX_OK;
-
-failed:
-
- if (peers->next) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get least conn peer, backup servers");
-
- lcp->conns += peers->number;
-
- lcp->rrp.peers = peers->next;
-
- n = (lcp->rrp.peers->number + (8 * sizeof(uintptr_t) - 1))
- / (8 * sizeof(uintptr_t));
-
- for (i = 0; i < n; i++) {
- lcp->rrp.tried[i] = 0;
- }
-
- rc = ngx_http_upstream_get_least_conn_peer(pc, lcp);
-
- if (rc != NGX_BUSY) {
- return rc;
- }
- }
-
- /* all peers failed, mark them as live for quick recovery */
-
- for (i = 0; i < peers->number; i++) {
- peers->peer[i].fails = 0;
- }
-
- pc->name = peers->name;
-
- return NGX_BUSY;
-}
-
-
-static void
-ngx_http_upstream_free_least_conn_peer(ngx_peer_connection_t *pc,
- void *data, ngx_uint_t state)
-{
- ngx_http_upstream_lc_peer_data_t *lcp = data;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "free least conn peer %ui %ui", pc->tries, state);
-
- if (lcp->rrp.peers->single) {
- lcp->free_rr_peer(pc, &lcp->rrp, state);
- return;
- }
-
- lcp->conns[lcp->rrp.current]--;
-
- lcp->free_rr_peer(pc, &lcp->rrp, state);
-}
-
-
-static void *
-ngx_http_upstream_least_conn_create_conf(ngx_conf_t *cf)
-{
- ngx_http_upstream_least_conn_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool,
- sizeof(ngx_http_upstream_least_conn_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->conns = NULL;
- */
-
- return conf;
-}
-
-
-static char *
-ngx_http_upstream_least_conn(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_upstream_srv_conf_t *uscf;
-
- uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module);
-
- if (uscf->peer.init_upstream) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "load balancing method redefined");
- }
-
- uscf->peer.init_upstream = ngx_http_upstream_init_least_conn;
-
- uscf->flags = NGX_HTTP_UPSTREAM_CREATE
- |NGX_HTTP_UPSTREAM_WEIGHT
- |NGX_HTTP_UPSTREAM_MAX_FAILS
- |NGX_HTTP_UPSTREAM_FAIL_TIMEOUT
- |NGX_HTTP_UPSTREAM_DOWN
- |NGX_HTTP_UPSTREAM_BACKUP;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_userid_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_userid_filter_module.c
deleted file mode 100644
index 1487c091eee..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_userid_filter_module.c
+++ /dev/null
@@ -1,842 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_USERID_OFF 0
-#define NGX_HTTP_USERID_LOG 1
-#define NGX_HTTP_USERID_V1 2
-#define NGX_HTTP_USERID_ON 3
-
-/* 31 Dec 2037 23:55:55 GMT */
-#define NGX_HTTP_USERID_MAX_EXPIRES 2145916555
-
-
-typedef struct {
- ngx_uint_t enable;
-
- ngx_int_t service;
-
- ngx_str_t name;
- ngx_str_t domain;
- ngx_str_t path;
- ngx_str_t p3p;
-
- time_t expires;
-
- u_char mark;
-} ngx_http_userid_conf_t;
-
-
-typedef struct {
- uint32_t uid_got[4];
- uint32_t uid_set[4];
- ngx_str_t cookie;
- ngx_uint_t reset;
-} ngx_http_userid_ctx_t;
-
-
-static ngx_http_userid_ctx_t *ngx_http_userid_get_uid(ngx_http_request_t *r,
- ngx_http_userid_conf_t *conf);
-static ngx_int_t ngx_http_userid_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, ngx_str_t *name, uint32_t *uid);
-static ngx_int_t ngx_http_userid_set_uid(ngx_http_request_t *r,
- ngx_http_userid_ctx_t *ctx, ngx_http_userid_conf_t *conf);
-static ngx_int_t ngx_http_userid_create_uid(ngx_http_request_t *r,
- ngx_http_userid_ctx_t *ctx, ngx_http_userid_conf_t *conf);
-
-static ngx_int_t ngx_http_userid_add_variables(ngx_conf_t *cf);
-static ngx_int_t ngx_http_userid_init(ngx_conf_t *cf);
-static void *ngx_http_userid_create_conf(ngx_conf_t *cf);
-static char *ngx_http_userid_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_http_userid_domain(ngx_conf_t *cf, void *post, void *data);
-static char *ngx_http_userid_path(ngx_conf_t *cf, void *post, void *data);
-static char *ngx_http_userid_expires(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_userid_p3p(ngx_conf_t *cf, void *post, void *data);
-static char *ngx_http_userid_mark(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static ngx_int_t ngx_http_userid_init_worker(ngx_cycle_t *cycle);
-
-
-
-static uint32_t start_value;
-static uint32_t sequencer_v1 = 1;
-static uint32_t sequencer_v2 = 0x03030302;
-
-
-static u_char expires[] = "; expires=Thu, 31-Dec-37 23:55:55 GMT";
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-
-
-static ngx_conf_enum_t ngx_http_userid_state[] = {
- { ngx_string("off"), NGX_HTTP_USERID_OFF },
- { ngx_string("log"), NGX_HTTP_USERID_LOG },
- { ngx_string("v1"), NGX_HTTP_USERID_V1 },
- { ngx_string("on"), NGX_HTTP_USERID_ON },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_conf_post_handler_pt ngx_http_userid_domain_p =
- ngx_http_userid_domain;
-static ngx_conf_post_handler_pt ngx_http_userid_path_p = ngx_http_userid_path;
-static ngx_conf_post_handler_pt ngx_http_userid_p3p_p = ngx_http_userid_p3p;
-
-
-static ngx_command_t ngx_http_userid_commands[] = {
-
- { ngx_string("userid"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_userid_conf_t, enable),
- ngx_http_userid_state },
-
- { ngx_string("userid_service"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_userid_conf_t, service),
- NULL },
-
- { ngx_string("userid_name"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_userid_conf_t, name),
- NULL },
-
- { ngx_string("userid_domain"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_userid_conf_t, domain),
- &ngx_http_userid_domain_p },
-
- { ngx_string("userid_path"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_userid_conf_t, path),
- &ngx_http_userid_path_p },
-
- { ngx_string("userid_expires"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_userid_expires,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("userid_p3p"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_userid_conf_t, p3p),
- &ngx_http_userid_p3p_p },
-
- { ngx_string("userid_mark"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_userid_mark,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_userid_filter_module_ctx = {
- ngx_http_userid_add_variables, /* preconfiguration */
- ngx_http_userid_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_userid_create_conf, /* create location configuration */
- ngx_http_userid_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_userid_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_userid_filter_module_ctx, /* module context */
- ngx_http_userid_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- ngx_http_userid_init_worker, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_http_userid_got = ngx_string("uid_got");
-static ngx_str_t ngx_http_userid_set = ngx_string("uid_set");
-static ngx_str_t ngx_http_userid_reset = ngx_string("uid_reset");
-static ngx_uint_t ngx_http_userid_reset_index;
-
-
-static ngx_int_t
-ngx_http_userid_filter(ngx_http_request_t *r)
-{
- ngx_http_userid_ctx_t *ctx;
- ngx_http_userid_conf_t *conf;
-
- if (r != r->main) {
- return ngx_http_next_header_filter(r);
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_userid_filter_module);
-
- if (conf->enable < NGX_HTTP_USERID_V1) {
- return ngx_http_next_header_filter(r);
- }
-
- ctx = ngx_http_userid_get_uid(r, conf);
-
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_http_userid_set_uid(r, ctx, conf) == NGX_OK) {
- return ngx_http_next_header_filter(r);
- }
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_userid_got_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_userid_ctx_t *ctx;
- ngx_http_userid_conf_t *conf;
-
- conf = ngx_http_get_module_loc_conf(r->main, ngx_http_userid_filter_module);
-
- if (conf->enable == NGX_HTTP_USERID_OFF) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- ctx = ngx_http_userid_get_uid(r->main, conf);
-
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- if (ctx->uid_got[3] != 0) {
- return ngx_http_userid_variable(r->main, v, &conf->name, ctx->uid_got);
- }
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_userid_set_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_userid_ctx_t *ctx;
- ngx_http_userid_conf_t *conf;
-
- conf = ngx_http_get_module_loc_conf(r->main, ngx_http_userid_filter_module);
-
- if (conf->enable < NGX_HTTP_USERID_V1) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- ctx = ngx_http_userid_get_uid(r->main, conf);
-
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_http_userid_create_uid(r->main, ctx, conf) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ctx->uid_set[3] == 0) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- return ngx_http_userid_variable(r->main, v, &conf->name, ctx->uid_set);
-}
-
-
-static ngx_http_userid_ctx_t *
-ngx_http_userid_get_uid(ngx_http_request_t *r, ngx_http_userid_conf_t *conf)
-{
- ngx_int_t n;
- ngx_str_t src, dst;
- ngx_table_elt_t **cookies;
- ngx_http_userid_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_userid_filter_module);
-
- if (ctx) {
- return ctx;
- }
-
- if (ctx == NULL) {
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_userid_ctx_t));
- if (ctx == NULL) {
- return NULL;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_userid_filter_module);
- }
-
- n = ngx_http_parse_multi_header_lines(&r->headers_in.cookies, &conf->name,
- &ctx->cookie);
- if (n == NGX_DECLINED) {
- return ctx;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "uid cookie: \"%V\"", &ctx->cookie);
-
- if (ctx->cookie.len < 22) {
- cookies = r->headers_in.cookies.elts;
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client sent too short userid cookie \"%V\"",
- &cookies[n]->value);
- return ctx;
- }
-
- src = ctx->cookie;
-
- /*
- * we have to limit the encoded string to 22 characters because
- * 1) cookie may be marked by "userid_mark",
- * 2) and there are already the millions cookies with a garbage
- * instead of the correct base64 trail "=="
- */
-
- src.len = 22;
-
- dst.data = (u_char *) ctx->uid_got;
-
- if (ngx_decode_base64(&dst, &src) == NGX_ERROR) {
- cookies = r->headers_in.cookies.elts;
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client sent invalid userid cookie \"%V\"",
- &cookies[n]->value);
- return ctx;
- }
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "uid: %08XD%08XD%08XD%08XD",
- ctx->uid_got[0], ctx->uid_got[1],
- ctx->uid_got[2], ctx->uid_got[3]);
-
- return ctx;
-}
-
-
-static ngx_int_t
-ngx_http_userid_set_uid(ngx_http_request_t *r, ngx_http_userid_ctx_t *ctx,
- ngx_http_userid_conf_t *conf)
-{
- u_char *cookie, *p;
- size_t len;
- ngx_str_t src, dst;
- ngx_table_elt_t *set_cookie, *p3p;
-
- if (ngx_http_userid_create_uid(r, ctx, conf) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (ctx->uid_set[3] == 0) {
- return NGX_OK;
- }
-
- len = conf->name.len + 1 + ngx_base64_encoded_length(16) + conf->path.len;
-
- if (conf->expires) {
- len += sizeof(expires) - 1 + 2;
- }
-
- if (conf->domain.len) {
- len += conf->domain.len;
- }
-
- cookie = ngx_pnalloc(r->pool, len);
- if (cookie == NULL) {
- return NGX_ERROR;
- }
-
- p = ngx_copy(cookie, conf->name.data, conf->name.len);
- *p++ = '=';
-
- if (ctx->uid_got[3] == 0 || ctx->reset) {
- src.len = 16;
- src.data = (u_char *) ctx->uid_set;
- dst.data = p;
-
- ngx_encode_base64(&dst, &src);
-
- p += dst.len;
-
- if (conf->mark) {
- *(p - 2) = conf->mark;
- }
-
- } else {
- p = ngx_cpymem(p, ctx->cookie.data, 22);
- *p++ = conf->mark;
- *p++ = '=';
- }
-
- if (conf->expires == NGX_HTTP_USERID_MAX_EXPIRES) {
- p = ngx_cpymem(p, expires, sizeof(expires) - 1);
-
- } else if (conf->expires) {
- p = ngx_cpymem(p, expires, sizeof("; expires=") - 1);
- p = ngx_http_cookie_time(p, ngx_time() + conf->expires);
- }
-
- p = ngx_copy(p, conf->domain.data, conf->domain.len);
-
- p = ngx_copy(p, conf->path.data, conf->path.len);
-
- set_cookie = ngx_list_push(&r->headers_out.headers);
- if (set_cookie == NULL) {
- return NGX_ERROR;
- }
-
- set_cookie->hash = 1;
- ngx_str_set(&set_cookie->key, "Set-Cookie");
- set_cookie->value.len = p - cookie;
- set_cookie->value.data = cookie;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "uid cookie: \"%V\"", &set_cookie->value);
-
- if (conf->p3p.len == 0) {
- return NGX_OK;
- }
-
- p3p = ngx_list_push(&r->headers_out.headers);
- if (p3p == NULL) {
- return NGX_ERROR;
- }
-
- p3p->hash = 1;
- ngx_str_set(&p3p->key, "P3P");
- p3p->value = conf->p3p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_userid_create_uid(ngx_http_request_t *r, ngx_http_userid_ctx_t *ctx,
- ngx_http_userid_conf_t *conf)
-{
- ngx_connection_t *c;
- struct sockaddr_in *sin;
- ngx_http_variable_value_t *vv;
-#if (NGX_HAVE_INET6)
- u_char *p;
- struct sockaddr_in6 *sin6;
-#endif
-
- if (ctx->uid_set[3] != 0) {
- return NGX_OK;
- }
-
- if (ctx->uid_got[3] != 0) {
-
- vv = ngx_http_get_indexed_variable(r, ngx_http_userid_reset_index);
-
- if (vv->len == 0 || (vv->len == 1 && vv->data[0] == '0')) {
-
- if (conf->mark == '\0'
- || (ctx->cookie.len > 23
- && ctx->cookie.data[22] == conf->mark
- && ctx->cookie.data[23] == '='))
- {
- return NGX_OK;
- }
-
- ctx->uid_set[0] = ctx->uid_got[0];
- ctx->uid_set[1] = ctx->uid_got[1];
- ctx->uid_set[2] = ctx->uid_got[2];
- ctx->uid_set[3] = ctx->uid_got[3];
-
- return NGX_OK;
-
- } else {
- ctx->reset = 1;
-
- if (vv->len == 3 && ngx_strncmp(vv->data, "log", 3) == 0) {
- ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
- "userid cookie \"%V=%08XD%08XD%08XD%08XD\" was reset",
- &conf->name, ctx->uid_got[0], ctx->uid_got[1],
- ctx->uid_got[2], ctx->uid_got[3]);
- }
- }
- }
-
- /*
- * TODO: in the threaded mode the sequencers should be in TLS and their
- * ranges should be divided between threads
- */
-
- if (conf->enable == NGX_HTTP_USERID_V1) {
- if (conf->service == NGX_CONF_UNSET) {
- ctx->uid_set[0] = 0;
- } else {
- ctx->uid_set[0] = conf->service;
- }
- ctx->uid_set[1] = (uint32_t) ngx_time();
- ctx->uid_set[2] = start_value;
- ctx->uid_set[3] = sequencer_v1;
- sequencer_v1 += 0x100;
-
- } else {
- if (conf->service == NGX_CONF_UNSET) {
-
- c = r->connection;
-
- if (ngx_connection_local_sockaddr(c, NULL, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- switch (c->local_sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) c->local_sockaddr;
-
- p = (u_char *) &ctx->uid_set[0];
-
- *p++ = sin6->sin6_addr.s6_addr[12];
- *p++ = sin6->sin6_addr.s6_addr[13];
- *p++ = sin6->sin6_addr.s6_addr[14];
- *p = sin6->sin6_addr.s6_addr[15];
-
- break;
-#endif
- default: /* AF_INET */
- sin = (struct sockaddr_in *) c->local_sockaddr;
- ctx->uid_set[0] = sin->sin_addr.s_addr;
- break;
- }
-
- } else {
- ctx->uid_set[0] = htonl(conf->service);
- }
-
- ctx->uid_set[1] = htonl((uint32_t) ngx_time());
- ctx->uid_set[2] = htonl(start_value);
- ctx->uid_set[3] = htonl(sequencer_v2);
- sequencer_v2 += 0x100;
- if (sequencer_v2 < 0x03030302) {
- sequencer_v2 = 0x03030302;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_userid_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- ngx_str_t *name, uint32_t *uid)
-{
- v->len = name->len + sizeof("=00001111222233334444555566667777") - 1;
- v->data = ngx_pnalloc(r->pool, v->len);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- ngx_sprintf(v->data, "%V=%08XD%08XD%08XD%08XD",
- name, uid[0], uid[1], uid[2], uid[3]);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_userid_reset_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- *v = ngx_http_variable_null_value;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_userid_add_variables(ngx_conf_t *cf)
-{
- ngx_int_t n;
- ngx_http_variable_t *var;
-
- var = ngx_http_add_variable(cf, &ngx_http_userid_got, 0);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = ngx_http_userid_got_variable;
-
- var = ngx_http_add_variable(cf, &ngx_http_userid_set, 0);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = ngx_http_userid_set_variable;
-
- var = ngx_http_add_variable(cf, &ngx_http_userid_reset,
- NGX_HTTP_VAR_CHANGEABLE);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = ngx_http_userid_reset_variable;
-
- n = ngx_http_get_variable_index(cf, &ngx_http_userid_reset);
- if (n == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- ngx_http_userid_reset_index = n;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_userid_create_conf(ngx_conf_t *cf)
-{
- ngx_http_userid_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_userid_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->name = { 0, NULL };
- * conf->domain = { 0, NULL };
- * conf->path = { 0, NULL };
- * conf->p3p = { 0, NULL };
- */
-
- conf->enable = NGX_CONF_UNSET_UINT;
- conf->service = NGX_CONF_UNSET;
- conf->expires = NGX_CONF_UNSET;
- conf->mark = (u_char) '\xFF';
-
- return conf;
-}
-
-
-static char *
-ngx_http_userid_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_userid_conf_t *prev = parent;
- ngx_http_userid_conf_t *conf = child;
-
- ngx_conf_merge_uint_value(conf->enable, prev->enable,
- NGX_HTTP_USERID_OFF);
-
- ngx_conf_merge_str_value(conf->name, prev->name, "uid");
- ngx_conf_merge_str_value(conf->domain, prev->domain, "");
- ngx_conf_merge_str_value(conf->path, prev->path, "; path=/");
- ngx_conf_merge_str_value(conf->p3p, prev->p3p, "");
-
- ngx_conf_merge_value(conf->service, prev->service, NGX_CONF_UNSET);
- ngx_conf_merge_sec_value(conf->expires, prev->expires, 0);
-
- if (conf->mark == (u_char) '\xFF') {
- if (prev->mark == (u_char) '\xFF') {
- conf->mark = '\0';
- } else {
- conf->mark = prev->mark;
- }
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_userid_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_userid_filter;
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_userid_domain(ngx_conf_t *cf, void *post, void *data)
-{
- ngx_str_t *domain = data;
-
- u_char *p, *new;
-
- if (ngx_strcmp(domain->data, "none") == 0) {
- ngx_str_set(domain, "");
- return NGX_CONF_OK;
- }
-
- new = ngx_pnalloc(cf->pool, sizeof("; domain=") - 1 + domain->len);
- if (new == NULL) {
- return NGX_CONF_ERROR;
- }
-
- p = ngx_cpymem(new, "; domain=", sizeof("; domain=") - 1);
- ngx_memcpy(p, domain->data, domain->len);
-
- domain->len += sizeof("; domain=") - 1;
- domain->data = new;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_userid_path(ngx_conf_t *cf, void *post, void *data)
-{
- ngx_str_t *path = data;
-
- u_char *p, *new;
-
- new = ngx_pnalloc(cf->pool, sizeof("; path=") - 1 + path->len);
- if (new == NULL) {
- return NGX_CONF_ERROR;
- }
-
- p = ngx_cpymem(new, "; path=", sizeof("; path=") - 1);
- ngx_memcpy(p, path->data, path->len);
-
- path->len += sizeof("; path=") - 1;
- path->data = new;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_userid_expires(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_userid_conf_t *ucf = conf;
-
- ngx_str_t *value;
-
- if (ucf->expires != NGX_CONF_UNSET) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "max") == 0) {
- ucf->expires = NGX_HTTP_USERID_MAX_EXPIRES;
- return NGX_CONF_OK;
- }
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- ucf->expires = 0;
- return NGX_CONF_OK;
- }
-
- ucf->expires = ngx_parse_time(&value[1], 1);
- if (ucf->expires == (time_t) NGX_ERROR) {
- return "invalid value";
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_userid_p3p(ngx_conf_t *cf, void *post, void *data)
-{
- ngx_str_t *p3p = data;
-
- if (ngx_strcmp(p3p->data, "none") == 0) {
- ngx_str_set(p3p, "");
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_userid_mark(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_userid_conf_t *ucf = conf;
-
- ngx_str_t *value;
-
- if (ucf->mark != (u_char) '\xFF') {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- ucf->mark = '\0';
- return NGX_CONF_OK;
- }
-
- if (value[1].len != 1
- || !((value[1].data[0] >= '0' && value[1].data[0] <= '9')
- || (value[1].data[0] >= 'A' && value[1].data[0] <= 'Z')
- || (value[1].data[0] >= 'a' && value[1].data[0] <= 'z')
- || value[1].data[0] == '='))
- {
- return "value must be \"off\" or a single letter, digit or \"=\"";
- }
-
- ucf->mark = value[1].data[0];
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_userid_init_worker(ngx_cycle_t *cycle)
-{
- struct timeval tp;
-
- ngx_gettimeofday(&tp);
-
- /* use the most significant usec part that fits to 16 bits */
- start_value = ((tp.tv_usec / 20) << 16) | ngx_pid;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_uwsgi_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_uwsgi_module.c
deleted file mode 100644
index 9556aa4a062..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_uwsgi_module.c
+++ /dev/null
@@ -1,2149 +0,0 @@
-
-/*
- * Copyright (C) Unbit S.a.s. 2009-2010
- * Copyright (C) 2008 Manlio Perillo (manlio.perillo@gmail.com)
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_http_upstream_conf_t upstream;
-
- ngx_array_t *flushes;
- ngx_array_t *params_len;
- ngx_array_t *params;
- ngx_array_t *params_source;
-
- ngx_hash_t headers_hash;
- ngx_uint_t header_params;
-
- ngx_array_t *uwsgi_lengths;
- ngx_array_t *uwsgi_values;
-
-#if (NGX_HTTP_CACHE)
- ngx_http_complex_value_t cache_key;
-#endif
-
- ngx_str_t uwsgi_string;
-
- ngx_uint_t modifier1;
- ngx_uint_t modifier2;
-
-#if (NGX_HTTP_SSL)
- ngx_uint_t ssl;
- ngx_uint_t ssl_protocols;
- ngx_str_t ssl_ciphers;
- ngx_uint_t ssl_verify_depth;
- ngx_str_t ssl_trusted_certificate;
- ngx_str_t ssl_crl;
-#endif
-} ngx_http_uwsgi_loc_conf_t;
-
-
-static ngx_int_t ngx_http_uwsgi_eval(ngx_http_request_t *r,
- ngx_http_uwsgi_loc_conf_t *uwcf);
-static ngx_int_t ngx_http_uwsgi_create_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_uwsgi_reinit_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_uwsgi_process_status_line(ngx_http_request_t *r);
-static ngx_int_t ngx_http_uwsgi_process_header(ngx_http_request_t *r);
-static void ngx_http_uwsgi_abort_request(ngx_http_request_t *r);
-static void ngx_http_uwsgi_finalize_request(ngx_http_request_t *r,
- ngx_int_t rc);
-
-static void *ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static ngx_int_t ngx_http_uwsgi_merge_params(ngx_conf_t *cf,
- ngx_http_uwsgi_loc_conf_t *conf, ngx_http_uwsgi_loc_conf_t *prev);
-
-static char *ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_uwsgi_store(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-#if (NGX_HTTP_CACHE)
-static ngx_int_t ngx_http_uwsgi_create_key(ngx_http_request_t *r);
-static char *ngx_http_uwsgi_cache(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_uwsgi_cache_key(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-#endif
-
-#if (NGX_HTTP_SSL)
-static ngx_int_t ngx_http_uwsgi_set_ssl(ngx_conf_t *cf,
- ngx_http_uwsgi_loc_conf_t *uwcf);
-#endif
-
-
-static ngx_conf_num_bounds_t ngx_http_uwsgi_modifier_bounds = {
- ngx_conf_check_num_bounds, 0, 255
-};
-
-
-static ngx_conf_bitmask_t ngx_http_uwsgi_next_upstream_masks[] = {
- { ngx_string("error"), NGX_HTTP_UPSTREAM_FT_ERROR },
- { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT },
- { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER },
- { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 },
- { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
- { ngx_string("http_403"), NGX_HTTP_UPSTREAM_FT_HTTP_403 },
- { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
- { ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
- { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
- { ngx_null_string, 0 }
-};
-
-
-#if (NGX_HTTP_SSL)
-
-static ngx_conf_bitmask_t ngx_http_uwsgi_ssl_protocols[] = {
- { ngx_string("SSLv2"), NGX_SSL_SSLv2 },
- { ngx_string("SSLv3"), NGX_SSL_SSLv3 },
- { ngx_string("TLSv1"), NGX_SSL_TLSv1 },
- { ngx_string("TLSv1.1"), NGX_SSL_TLSv1_1 },
- { ngx_string("TLSv1.2"), NGX_SSL_TLSv1_2 },
- { ngx_null_string, 0 }
-};
-
-#endif
-
-
-ngx_module_t ngx_http_uwsgi_module;
-
-
-static ngx_command_t ngx_http_uwsgi_commands[] = {
-
- { ngx_string("uwsgi_pass"),
- NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF|NGX_CONF_TAKE1,
- ngx_http_uwsgi_pass,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("uwsgi_modifier1"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, modifier1),
- &ngx_http_uwsgi_modifier_bounds },
-
- { ngx_string("uwsgi_modifier2"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, modifier2),
- &ngx_http_uwsgi_modifier_bounds },
-
- { ngx_string("uwsgi_store"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_uwsgi_store,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("uwsgi_store_access"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE123,
- ngx_conf_set_access_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.store_access),
- NULL },
-
- { ngx_string("uwsgi_buffering"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.buffering),
- NULL },
-
- { ngx_string("uwsgi_ignore_client_abort"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ignore_client_abort),
- NULL },
-
- { ngx_string("uwsgi_bind"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_upstream_bind_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.local),
- NULL },
-
- { ngx_string("uwsgi_connect_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.connect_timeout),
- NULL },
-
- { ngx_string("uwsgi_send_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.send_timeout),
- NULL },
-
- { ngx_string("uwsgi_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.buffer_size),
- NULL },
-
- { ngx_string("uwsgi_pass_request_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.pass_request_headers),
- NULL },
-
- { ngx_string("uwsgi_pass_request_body"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.pass_request_body),
- NULL },
-
- { ngx_string("uwsgi_intercept_errors"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.intercept_errors),
- NULL },
-
- { ngx_string("uwsgi_read_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.read_timeout),
- NULL },
-
- { ngx_string("uwsgi_buffers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_conf_set_bufs_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.bufs),
- NULL },
-
- { ngx_string("uwsgi_busy_buffers_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.busy_buffers_size_conf),
- NULL },
-
-#if (NGX_HTTP_CACHE)
-
- { ngx_string("uwsgi_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_uwsgi_cache,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("uwsgi_cache_key"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_uwsgi_cache_key,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("uwsgi_cache_path"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_2MORE,
- ngx_http_file_cache_set_slot,
- 0,
- 0,
- &ngx_http_uwsgi_module },
-
- { ngx_string("uwsgi_cache_bypass"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_set_predicate_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_bypass),
- NULL },
-
- { ngx_string("uwsgi_no_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_set_predicate_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.no_cache),
- NULL },
-
- { ngx_string("uwsgi_cache_valid"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_file_cache_valid_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_valid),
- NULL },
-
- { ngx_string("uwsgi_cache_min_uses"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_min_uses),
- NULL },
-
- { ngx_string("uwsgi_cache_use_stale"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_use_stale),
- &ngx_http_uwsgi_next_upstream_masks },
-
- { ngx_string("uwsgi_cache_methods"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_methods),
- &ngx_http_upstream_cache_method_mask },
-
- { ngx_string("uwsgi_cache_lock"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_lock),
- NULL },
-
- { ngx_string("uwsgi_cache_lock_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_lock_timeout),
- NULL },
-
- { ngx_string("uwsgi_cache_revalidate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.cache_revalidate),
- NULL },
-
-#endif
-
- { ngx_string("uwsgi_temp_path"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
- ngx_conf_set_path_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.temp_path),
- NULL },
-
- { ngx_string("uwsgi_max_temp_file_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.max_temp_file_size_conf),
- NULL },
-
- { ngx_string("uwsgi_temp_file_write_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.temp_file_write_size_conf),
- NULL },
-
- { ngx_string("uwsgi_next_upstream"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream),
- &ngx_http_uwsgi_next_upstream_masks },
-
- { ngx_string("uwsgi_next_upstream_tries"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream_tries),
- NULL },
-
- { ngx_string("uwsgi_next_upstream_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.next_upstream_timeout),
- NULL },
-
- { ngx_string("uwsgi_param"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE23,
- ngx_http_upstream_param_set_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, params_source),
- NULL },
-
- { ngx_string("uwsgi_string"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, uwsgi_string),
- NULL },
-
- { ngx_string("uwsgi_pass_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.pass_headers),
- NULL },
-
- { ngx_string("uwsgi_hide_header"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.hide_headers),
- NULL },
-
- { ngx_string("uwsgi_ignore_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ignore_headers),
- &ngx_http_upstream_ignore_headers_masks },
-
-#if (NGX_HTTP_SSL)
-
- { ngx_string("uwsgi_ssl_session_reuse"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ssl_session_reuse),
- NULL },
-
- { ngx_string("uwsgi_ssl_protocols"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, ssl_protocols),
- &ngx_http_uwsgi_ssl_protocols },
-
- { ngx_string("uwsgi_ssl_ciphers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, ssl_ciphers),
- NULL },
-
- { ngx_string("uwsgi_ssl_name"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_set_complex_value_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ssl_name),
- NULL },
-
- { ngx_string("uwsgi_ssl_server_name"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ssl_server_name),
- NULL },
-
- { ngx_string("uwsgi_ssl_verify"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, upstream.ssl_verify),
- NULL },
-
- { ngx_string("uwsgi_ssl_verify_depth"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, ssl_verify_depth),
- NULL },
-
- { ngx_string("uwsgi_ssl_trusted_certificate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, ssl_trusted_certificate),
- NULL },
-
- { ngx_string("uwsgi_ssl_crl"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_uwsgi_loc_conf_t, ssl_crl),
- NULL },
-
-#endif
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_uwsgi_module_ctx = {
- NULL, /* preconfiguration */
- NULL, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_uwsgi_create_loc_conf, /* create location configuration */
- ngx_http_uwsgi_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_uwsgi_module = {
- NGX_MODULE_V1,
- &ngx_http_uwsgi_module_ctx, /* module context */
- ngx_http_uwsgi_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_http_uwsgi_hide_headers[] = {
- ngx_string("X-Accel-Expires"),
- ngx_string("X-Accel-Redirect"),
- ngx_string("X-Accel-Limit-Rate"),
- ngx_string("X-Accel-Buffering"),
- ngx_string("X-Accel-Charset"),
- ngx_null_string
-};
-
-
-#if (NGX_HTTP_CACHE)
-
-static ngx_keyval_t ngx_http_uwsgi_cache_headers[] = {
- { ngx_string("HTTP_IF_MODIFIED_SINCE"),
- ngx_string("$upstream_cache_last_modified") },
- { ngx_string("HTTP_IF_UNMODIFIED_SINCE"), ngx_string("") },
- { ngx_string("HTTP_IF_NONE_MATCH"), ngx_string("$upstream_cache_etag") },
- { ngx_string("HTTP_IF_MATCH"), ngx_string("") },
- { ngx_string("HTTP_RANGE"), ngx_string("") },
- { ngx_string("HTTP_IF_RANGE"), ngx_string("") },
- { ngx_null_string, ngx_null_string }
-};
-
-#endif
-
-
-static ngx_path_init_t ngx_http_uwsgi_temp_path = {
- ngx_string(NGX_HTTP_UWSGI_TEMP_PATH), { 1, 2, 0 }
-};
-
-
-static ngx_int_t
-ngx_http_uwsgi_handler(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_http_status_t *status;
- ngx_http_upstream_t *u;
- ngx_http_uwsgi_loc_conf_t *uwcf;
-
- if (ngx_http_upstream_create(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- status = ngx_pcalloc(r->pool, sizeof(ngx_http_status_t));
- if (status == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_http_set_ctx(r, status, ngx_http_uwsgi_module);
-
- uwcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module);
-
- u = r->upstream;
-
- if (uwcf->uwsgi_lengths == NULL) {
-
-#if (NGX_HTTP_SSL)
- u->ssl = (uwcf->upstream.ssl != NULL);
-
- if (u->ssl) {
- ngx_str_set(&u->schema, "suwsgi://");
-
- } else {
- ngx_str_set(&u->schema, "uwsgi://");
- }
-#else
- ngx_str_set(&u->schema, "uwsgi://");
-#endif
-
- } else {
- if (ngx_http_uwsgi_eval(r, uwcf) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
- }
-
- u->output.tag = (ngx_buf_tag_t) &ngx_http_uwsgi_module;
-
- u->conf = &uwcf->upstream;
-
-#if (NGX_HTTP_CACHE)
- u->create_key = ngx_http_uwsgi_create_key;
-#endif
- u->create_request = ngx_http_uwsgi_create_request;
- u->reinit_request = ngx_http_uwsgi_reinit_request;
- u->process_header = ngx_http_uwsgi_process_status_line;
- u->abort_request = ngx_http_uwsgi_abort_request;
- u->finalize_request = ngx_http_uwsgi_finalize_request;
- r->state = 0;
-
- u->buffering = uwcf->upstream.buffering;
-
- u->pipe = ngx_pcalloc(r->pool, sizeof(ngx_event_pipe_t));
- if (u->pipe == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- u->pipe->input_filter = ngx_event_pipe_copy_input_filter;
- u->pipe->input_ctx = r;
-
- rc = ngx_http_read_client_request_body(r, ngx_http_upstream_init);
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- return rc;
- }
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_http_uwsgi_eval(ngx_http_request_t *r, ngx_http_uwsgi_loc_conf_t * uwcf)
-{
- size_t add;
- ngx_url_t url;
- ngx_http_upstream_t *u;
-
- ngx_memzero(&url, sizeof(ngx_url_t));
-
- if (ngx_http_script_run(r, &url.url, uwcf->uwsgi_lengths->elts, 0,
- uwcf->uwsgi_values->elts)
- == NULL)
- {
- return NGX_ERROR;
- }
-
- if (url.url.len > 8
- && ngx_strncasecmp(url.url.data, (u_char *) "uwsgi://", 8) == 0)
- {
- add = 8;
-
- } else if (url.url.len > 9
- && ngx_strncasecmp(url.url.data, (u_char *) "suwsgi://", 9) == 0)
- {
-
-#if (NGX_HTTP_SSL)
- add = 9;
- r->upstream->ssl = 1;
-#else
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "suwsgi protocol requires SSL support");
- return NGX_ERROR;
-#endif
-
- } else {
- add = 0;
- }
-
- u = r->upstream;
-
- if (add) {
- u->schema.len = add;
- u->schema.data = url.url.data;
-
- url.url.data += add;
- url.url.len -= add;
-
- } else {
- ngx_str_set(&u->schema, "uwsgi://");
- }
-
- url.no_resolve = 1;
-
- if (ngx_parse_url(r->pool, &url) != NGX_OK) {
- if (url.err) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "%s in upstream \"%V\"", url.err, &url.url);
- }
-
- return NGX_ERROR;
- }
-
- u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));
- if (u->resolved == NULL) {
- return NGX_ERROR;
- }
-
- if (url.addrs && url.addrs[0].sockaddr) {
- u->resolved->sockaddr = url.addrs[0].sockaddr;
- u->resolved->socklen = url.addrs[0].socklen;
- u->resolved->naddrs = 1;
- u->resolved->host = url.addrs[0].name;
-
- } else {
- u->resolved->host = url.host;
- u->resolved->port = url.port;
- u->resolved->no_port = url.no_port;
- }
-
- return NGX_OK;
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-static ngx_int_t
-ngx_http_uwsgi_create_key(ngx_http_request_t *r)
-{
- ngx_str_t *key;
- ngx_http_uwsgi_loc_conf_t *uwcf;
-
- key = ngx_array_push(&r->cache->keys);
- if (key == NULL) {
- return NGX_ERROR;
- }
-
- uwcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module);
-
- if (ngx_http_complex_value(r, &uwcf->cache_key, key) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_uwsgi_create_request(ngx_http_request_t *r)
-{
- u_char ch, *lowcase_key;
- size_t key_len, val_len, len, allocated;
- ngx_uint_t i, n, hash, skip_empty, header_params;
- ngx_buf_t *b;
- ngx_chain_t *cl, *body;
- ngx_list_part_t *part;
- ngx_table_elt_t *header, **ignored;
- ngx_http_script_code_pt code;
- ngx_http_script_engine_t e, le;
- ngx_http_uwsgi_loc_conf_t *uwcf;
- ngx_http_script_len_code_pt lcode;
-
- len = 0;
- header_params = 0;
- ignored = NULL;
-
- uwcf = ngx_http_get_module_loc_conf(r, ngx_http_uwsgi_module);
-
- if (uwcf->params_len) {
- ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
-
- ngx_http_script_flush_no_cacheable_variables(r, uwcf->flushes);
- le.flushed = 1;
-
- le.ip = uwcf->params_len->elts;
- le.request = r;
-
- while (*(uintptr_t *) le.ip) {
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- key_len = lcode(&le);
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- skip_empty = lcode(&le);
-
- for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode (&le)) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- }
- le.ip += sizeof(uintptr_t);
-
- if (skip_empty && val_len == 0) {
- continue;
- }
-
- len += 2 + key_len + 2 + val_len;
- }
- }
-
- if (uwcf->upstream.pass_request_headers) {
-
- allocated = 0;
- lowcase_key = NULL;
-
- if (uwcf->header_params) {
- n = 0;
- part = &r->headers_in.headers.part;
-
- while (part) {
- n += part->nelts;
- part = part->next;
- }
-
- ignored = ngx_palloc(r->pool, n * sizeof(void *));
- if (ignored == NULL) {
- return NGX_ERROR;
- }
- }
-
- part = &r->headers_in.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */ ; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (uwcf->header_params) {
- if (allocated < header[i].key.len) {
- allocated = header[i].key.len + 16;
- lowcase_key = ngx_pnalloc(r->pool, allocated);
- if (lowcase_key == NULL) {
- return NGX_ERROR;
- }
- }
-
- hash = 0;
-
- for (n = 0; n < header[i].key.len; n++) {
- ch = header[i].key.data[n];
-
- if (ch >= 'A' && ch <= 'Z') {
- ch |= 0x20;
-
- } else if (ch == '-') {
- ch = '_';
- }
-
- hash = ngx_hash(hash, ch);
- lowcase_key[n] = ch;
- }
-
- if (ngx_hash_find(&uwcf->headers_hash, hash, lowcase_key, n)) {
- ignored[header_params++] = &header[i];
- continue;
- }
- }
-
- len += 2 + sizeof("HTTP_") - 1 + header[i].key.len
- + 2 + header[i].value.len;
- }
- }
-
- len += uwcf->uwsgi_string.len;
-
-#if 0
- /* allow custom uwsgi packet */
- if (len > 0 && len < 2) {
- ngx_log_error (NGX_LOG_ALERT, r->connection->log, 0,
- "uwsgi request is too little: %uz", len);
- return NGX_ERROR;
- }
-#endif
-
- b = ngx_create_temp_buf(r->pool, len + 4);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
-
- *b->last++ = (u_char) uwcf->modifier1;
- *b->last++ = (u_char) (len & 0xff);
- *b->last++ = (u_char) ((len >> 8) & 0xff);
- *b->last++ = (u_char) uwcf->modifier2;
-
- if (uwcf->params_len) {
- ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
-
- e.ip = uwcf->params->elts;
- e.pos = b->last;
- e.request = r;
- e.flushed = 1;
-
- le.ip = uwcf->params_len->elts;
-
- while (*(uintptr_t *) le.ip) {
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- key_len = (u_char) lcode (&le);
-
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- skip_empty = lcode(&le);
-
- for (val_len = 0; *(uintptr_t *) le.ip; val_len += lcode(&le)) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- }
- le.ip += sizeof(uintptr_t);
-
- if (skip_empty && val_len == 0) {
- e.skip = 1;
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
- e.ip += sizeof(uintptr_t);
-
- e.skip = 0;
-
- continue;
- }
-
- *e.pos++ = (u_char) (key_len & 0xff);
- *e.pos++ = (u_char) ((key_len >> 8) & 0xff);
-
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) & e);
-
- *e.pos++ = (u_char) (val_len & 0xff);
- *e.pos++ = (u_char) ((val_len >> 8) & 0xff);
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) & e);
- }
-
- e.ip += sizeof(uintptr_t);
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "uwsgi param: \"%*s: %*s\"",
- key_len, e.pos - (key_len + 2 + val_len),
- val_len, e.pos - val_len);
- }
-
- b->last = e.pos;
- }
-
- if (uwcf->upstream.pass_request_headers) {
-
- part = &r->headers_in.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */ ; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- for (n = 0; n < header_params; n++) {
- if (&header[i] == ignored[n]) {
- goto next;
- }
- }
-
- key_len = sizeof("HTTP_") - 1 + header[i].key.len;
- *b->last++ = (u_char) (key_len & 0xff);
- *b->last++ = (u_char) ((key_len >> 8) & 0xff);
-
- b->last = ngx_cpymem(b->last, "HTTP_", sizeof("HTTP_") - 1);
- for (n = 0; n < header[i].key.len; n++) {
- ch = header[i].key.data[n];
-
- if (ch >= 'a' && ch <= 'z') {
- ch &= ~0x20;
-
- } else if (ch == '-') {
- ch = '_';
- }
-
- *b->last++ = ch;
- }
-
- val_len = header[i].value.len;
- *b->last++ = (u_char) (val_len & 0xff);
- *b->last++ = (u_char) ((val_len >> 8) & 0xff);
- b->last = ngx_copy(b->last, header[i].value.data, val_len);
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "uwsgi param: \"%*s: %*s\"",
- key_len, b->last - (key_len + 2 + val_len),
- val_len, b->last - val_len);
- next:
-
- continue;
- }
- }
-
- b->last = ngx_copy(b->last, uwcf->uwsgi_string.data,
- uwcf->uwsgi_string.len);
-
- if (uwcf->upstream.pass_request_body) {
- body = r->upstream->request_bufs;
- r->upstream->request_bufs = cl;
-
- while (body) {
- b = ngx_alloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(b, body->buf, sizeof(ngx_buf_t));
-
- cl->next = ngx_alloc_chain_link(r->pool);
- if (cl->next == NULL) {
- return NGX_ERROR;
- }
-
- cl = cl->next;
- cl->buf = b;
-
- body = body->next;
- }
-
- } else {
- r->upstream->request_bufs = cl;
- }
-
- cl->next = NULL;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_uwsgi_reinit_request(ngx_http_request_t *r)
-{
- ngx_http_status_t *status;
-
- status = ngx_http_get_module_ctx(r, ngx_http_uwsgi_module);
-
- if (status == NULL) {
- return NGX_OK;
- }
-
- status->code = 0;
- status->count = 0;
- status->start = NULL;
- status->end = NULL;
-
- r->upstream->process_header = ngx_http_uwsgi_process_status_line;
- r->state = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_uwsgi_process_status_line(ngx_http_request_t *r)
-{
- size_t len;
- ngx_int_t rc;
- ngx_http_status_t *status;
- ngx_http_upstream_t *u;
-
- status = ngx_http_get_module_ctx(r, ngx_http_uwsgi_module);
-
- if (status == NULL) {
- return NGX_ERROR;
- }
-
- u = r->upstream;
-
- rc = ngx_http_parse_status_line(r, &u->buffer, status);
-
- if (rc == NGX_AGAIN) {
- return rc;
- }
-
- if (rc == NGX_ERROR) {
- u->process_header = ngx_http_uwsgi_process_header;
- return ngx_http_uwsgi_process_header(r);
- }
-
- if (u->state && u->state->status == 0) {
- u->state->status = status->code;
- }
-
- u->headers_in.status_n = status->code;
-
- len = status->end - status->start;
- u->headers_in.status_line.len = len;
-
- u->headers_in.status_line.data = ngx_pnalloc(r->pool, len);
- if (u->headers_in.status_line.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(u->headers_in.status_line.data, status->start, len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http uwsgi status %ui \"%V\"",
- u->headers_in.status_n, &u->headers_in.status_line);
-
- u->process_header = ngx_http_uwsgi_process_header;
-
- return ngx_http_uwsgi_process_header(r);
-}
-
-
-static ngx_int_t
-ngx_http_uwsgi_process_header(ngx_http_request_t *r)
-{
- ngx_str_t *status_line;
- ngx_int_t rc, status;
- ngx_table_elt_t *h;
- ngx_http_upstream_t *u;
- ngx_http_upstream_header_t *hh;
- ngx_http_upstream_main_conf_t *umcf;
-
- umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
-
- for ( ;; ) {
-
- rc = ngx_http_parse_header_line(r, &r->upstream->buffer, 1);
-
- if (rc == NGX_OK) {
-
- /* a header line has been parsed successfully */
-
- h = ngx_list_push(&r->upstream->headers_in.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = r->header_hash;
-
- h->key.len = r->header_name_end - r->header_name_start;
- h->value.len = r->header_end - r->header_start;
-
- h->key.data = ngx_pnalloc(r->pool,
- h->key.len + 1 + h->value.len + 1
- + h->key.len);
- if (h->key.data == NULL) {
- return NGX_ERROR;
- }
-
- h->value.data = h->key.data + h->key.len + 1;
- h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1;
-
- ngx_memcpy(h->key.data, r->header_name_start, h->key.len);
- h->key.data[h->key.len] = '\0';
- ngx_memcpy(h->value.data, r->header_start, h->value.len);
- h->value.data[h->value.len] = '\0';
-
- if (h->key.len == r->lowcase_index) {
- ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
-
- } else {
- ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
- }
-
- hh = ngx_hash_find(&umcf->headers_in_hash, h->hash,
- h->lowcase_key, h->key.len);
-
- if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http uwsgi header: \"%V: %V\"", &h->key, &h->value);
-
- continue;
- }
-
- if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
-
- /* a whole header has been parsed successfully */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http uwsgi header done");
-
- u = r->upstream;
-
- if (u->headers_in.status_n) {
- goto done;
- }
-
- if (u->headers_in.status) {
- status_line = &u->headers_in.status->value;
-
- status = ngx_atoi(status_line->data, 3);
- if (status == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid status \"%V\"",
- status_line);
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-
- u->headers_in.status_n = status;
- u->headers_in.status_line = *status_line;
-
- } else if (u->headers_in.location) {
- u->headers_in.status_n = 302;
- ngx_str_set(&u->headers_in.status_line,
- "302 Moved Temporarily");
-
- } else {
- u->headers_in.status_n = 200;
- ngx_str_set(&u->headers_in.status_line, "200 OK");
- }
-
- if (u->state && u->state->status == 0) {
- u->state->status = u->headers_in.status_n;
- }
-
- done:
-
- if (u->headers_in.status_n == NGX_HTTP_SWITCHING_PROTOCOLS
- && r->headers_in.upgrade)
- {
- u->upgrade = 1;
- }
-
- return NGX_OK;
- }
-
- if (rc == NGX_AGAIN) {
- return NGX_AGAIN;
- }
-
- /* there was error while a header line parsing */
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream sent invalid header");
-
- return NGX_HTTP_UPSTREAM_INVALID_HEADER;
- }
-}
-
-
-static void
-ngx_http_uwsgi_abort_request(ngx_http_request_t *r)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "abort http uwsgi request");
-
- return;
-}
-
-
-static void
-ngx_http_uwsgi_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "finalize http uwsgi request");
-
- return;
-}
-
-
-static void *
-ngx_http_uwsgi_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_uwsgi_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_uwsgi_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->modifier1 = NGX_CONF_UNSET_UINT;
- conf->modifier2 = NGX_CONF_UNSET_UINT;
-
- conf->upstream.store = NGX_CONF_UNSET;
- conf->upstream.store_access = NGX_CONF_UNSET_UINT;
- conf->upstream.next_upstream_tries = NGX_CONF_UNSET_UINT;
- conf->upstream.buffering = NGX_CONF_UNSET;
- conf->upstream.ignore_client_abort = NGX_CONF_UNSET;
-
- conf->upstream.local = NGX_CONF_UNSET_PTR;
-
- conf->upstream.connect_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.send_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.read_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.next_upstream_timeout = NGX_CONF_UNSET_MSEC;
-
- conf->upstream.send_lowat = NGX_CONF_UNSET_SIZE;
- conf->upstream.buffer_size = NGX_CONF_UNSET_SIZE;
-
- conf->upstream.busy_buffers_size_conf = NGX_CONF_UNSET_SIZE;
- conf->upstream.max_temp_file_size_conf = NGX_CONF_UNSET_SIZE;
- conf->upstream.temp_file_write_size_conf = NGX_CONF_UNSET_SIZE;
-
- conf->upstream.pass_request_headers = NGX_CONF_UNSET;
- conf->upstream.pass_request_body = NGX_CONF_UNSET;
-
-#if (NGX_HTTP_CACHE)
- conf->upstream.cache = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
- conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
- conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_valid = NGX_CONF_UNSET_PTR;
- conf->upstream.cache_lock = NGX_CONF_UNSET;
- conf->upstream.cache_lock_timeout = NGX_CONF_UNSET_MSEC;
- conf->upstream.cache_revalidate = NGX_CONF_UNSET;
-#endif
-
- conf->upstream.hide_headers = NGX_CONF_UNSET_PTR;
- conf->upstream.pass_headers = NGX_CONF_UNSET_PTR;
-
- conf->upstream.intercept_errors = NGX_CONF_UNSET;
-
-#if (NGX_HTTP_SSL)
- conf->upstream.ssl_session_reuse = NGX_CONF_UNSET;
- conf->upstream.ssl_server_name = NGX_CONF_UNSET;
- conf->upstream.ssl_verify = NGX_CONF_UNSET;
- conf->ssl_verify_depth = NGX_CONF_UNSET_UINT;
-#endif
-
- /* "uwsgi_cyclic_temp_file" is disabled */
- conf->upstream.cyclic_temp_file = 0;
-
- conf->upstream.change_buffering = 1;
-
- ngx_str_set(&conf->upstream.module, "uwsgi");
-
- return conf;
-}
-
-
-static char *
-ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_uwsgi_loc_conf_t *prev = parent;
- ngx_http_uwsgi_loc_conf_t *conf = child;
-
- size_t size;
- ngx_hash_init_t hash;
- ngx_http_core_loc_conf_t *clcf;
-
- if (conf->upstream.store != 0) {
- ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0);
-
- if (conf->upstream.store_lengths == NULL) {
- conf->upstream.store_lengths = prev->upstream.store_lengths;
- conf->upstream.store_values = prev->upstream.store_values;
- }
- }
-
- ngx_conf_merge_uint_value(conf->upstream.store_access,
- prev->upstream.store_access, 0600);
-
- ngx_conf_merge_uint_value(conf->upstream.next_upstream_tries,
- prev->upstream.next_upstream_tries, 0);
-
- ngx_conf_merge_value(conf->upstream.buffering,
- prev->upstream.buffering, 1);
-
- ngx_conf_merge_value(conf->upstream.ignore_client_abort,
- prev->upstream.ignore_client_abort, 0);
-
- ngx_conf_merge_ptr_value(conf->upstream.local,
- prev->upstream.local, NULL);
-
- ngx_conf_merge_msec_value(conf->upstream.connect_timeout,
- prev->upstream.connect_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.send_timeout,
- prev->upstream.send_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.read_timeout,
- prev->upstream.read_timeout, 60000);
-
- ngx_conf_merge_msec_value(conf->upstream.next_upstream_timeout,
- prev->upstream.next_upstream_timeout, 0);
-
- ngx_conf_merge_size_value(conf->upstream.send_lowat,
- prev->upstream.send_lowat, 0);
-
- ngx_conf_merge_size_value(conf->upstream.buffer_size,
- prev->upstream.buffer_size,
- (size_t) ngx_pagesize);
-
-
- ngx_conf_merge_bufs_value(conf->upstream.bufs, prev->upstream.bufs,
- 8, ngx_pagesize);
-
- if (conf->upstream.bufs.num < 2) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "there must be at least 2 \"uwsgi_buffers\"");
- return NGX_CONF_ERROR;
- }
-
-
- size = conf->upstream.buffer_size;
- if (size < conf->upstream.bufs.size) {
- size = conf->upstream.bufs.size;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.busy_buffers_size_conf,
- prev->upstream.busy_buffers_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.busy_buffers_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.busy_buffers_size = 2 * size;
- } else {
- conf->upstream.busy_buffers_size =
- conf->upstream.busy_buffers_size_conf;
- }
-
- if (conf->upstream.busy_buffers_size < size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"uwsgi_busy_buffers_size\" must be equal to or greater "
- "than the maximum of the value of \"uwsgi_buffer_size\" and "
- "one of the \"uwsgi_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
- if (conf->upstream.busy_buffers_size
- > (conf->upstream.bufs.num - 1) * conf->upstream.bufs.size)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"uwsgi_busy_buffers_size\" must be less than "
- "the size of all \"uwsgi_buffers\" minus one buffer");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.temp_file_write_size_conf,
- prev->upstream.temp_file_write_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.temp_file_write_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.temp_file_write_size = 2 * size;
- } else {
- conf->upstream.temp_file_write_size =
- conf->upstream.temp_file_write_size_conf;
- }
-
- if (conf->upstream.temp_file_write_size < size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"uwsgi_temp_file_write_size\" must be equal to or greater than "
- "the maximum of the value of \"uwsgi_buffer_size\" and "
- "one of the \"uwsgi_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_size_value(conf->upstream.max_temp_file_size_conf,
- prev->upstream.max_temp_file_size_conf,
- NGX_CONF_UNSET_SIZE);
-
- if (conf->upstream.max_temp_file_size_conf == NGX_CONF_UNSET_SIZE) {
- conf->upstream.max_temp_file_size = 1024 * 1024 * 1024;
- } else {
- conf->upstream.max_temp_file_size =
- conf->upstream.max_temp_file_size_conf;
- }
-
- if (conf->upstream.max_temp_file_size != 0
- && conf->upstream.max_temp_file_size < size)
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"uwsgi_max_temp_file_size\" must be equal to zero to disable "
- "temporary files usage or must be equal to or greater than "
- "the maximum of the value of \"uwsgi_buffer_size\" and "
- "one of the \"uwsgi_buffers\"");
-
- return NGX_CONF_ERROR;
- }
-
-
- ngx_conf_merge_bitmask_value(conf->upstream.ignore_headers,
- prev->upstream.ignore_headers,
- NGX_CONF_BITMASK_SET);
-
-
- ngx_conf_merge_bitmask_value(conf->upstream.next_upstream,
- prev->upstream.next_upstream,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_ERROR
- |NGX_HTTP_UPSTREAM_FT_TIMEOUT));
-
- if (conf->upstream.next_upstream & NGX_HTTP_UPSTREAM_FT_OFF) {
- conf->upstream.next_upstream = NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF;
- }
-
- if (ngx_conf_merge_path_value(cf, &conf->upstream.temp_path,
- prev->upstream.temp_path,
- &ngx_http_uwsgi_temp_path)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
-#if (NGX_HTTP_CACHE)
-
- ngx_conf_merge_ptr_value(conf->upstream.cache,
- prev->upstream.cache, NULL);
-
- if (conf->upstream.cache && conf->upstream.cache->data == NULL) {
- ngx_shm_zone_t *shm_zone;
-
- shm_zone = conf->upstream.cache;
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"uwsgi_cache\" zone \"%V\" is unknown",
- &shm_zone->shm.name);
-
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_uint_value(conf->upstream.cache_min_uses,
- prev->upstream.cache_min_uses, 1);
-
- ngx_conf_merge_bitmask_value(conf->upstream.cache_use_stale,
- prev->upstream.cache_use_stale,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF));
-
- if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_OFF) {
- conf->upstream.cache_use_stale = NGX_CONF_BITMASK_SET
- |NGX_HTTP_UPSTREAM_FT_OFF;
- }
-
- if (conf->upstream.cache_use_stale & NGX_HTTP_UPSTREAM_FT_ERROR) {
- conf->upstream.cache_use_stale |= NGX_HTTP_UPSTREAM_FT_NOLIVE;
- }
-
- if (conf->upstream.cache_methods == 0) {
- conf->upstream.cache_methods = prev->upstream.cache_methods;
- }
-
- conf->upstream.cache_methods |= NGX_HTTP_GET|NGX_HTTP_HEAD;
-
- ngx_conf_merge_ptr_value(conf->upstream.cache_bypass,
- prev->upstream.cache_bypass, NULL);
-
- ngx_conf_merge_ptr_value(conf->upstream.no_cache,
- prev->upstream.no_cache, NULL);
-
- ngx_conf_merge_ptr_value(conf->upstream.cache_valid,
- prev->upstream.cache_valid, NULL);
-
- if (conf->cache_key.value.data == NULL) {
- conf->cache_key = prev->cache_key;
- }
-
- if (conf->upstream.cache && conf->cache_key.value.data == NULL) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "no \"uwsgi_cache_key\" for \"uwsgi_cache\"");
- }
-
- ngx_conf_merge_value(conf->upstream.cache_lock,
- prev->upstream.cache_lock, 0);
-
- ngx_conf_merge_msec_value(conf->upstream.cache_lock_timeout,
- prev->upstream.cache_lock_timeout, 5000);
-
- ngx_conf_merge_value(conf->upstream.cache_revalidate,
- prev->upstream.cache_revalidate, 0);
-
-#endif
-
- ngx_conf_merge_value(conf->upstream.pass_request_headers,
- prev->upstream.pass_request_headers, 1);
- ngx_conf_merge_value(conf->upstream.pass_request_body,
- prev->upstream.pass_request_body, 1);
-
- ngx_conf_merge_value(conf->upstream.intercept_errors,
- prev->upstream.intercept_errors, 0);
-
-#if (NGX_HTTP_SSL)
-
- ngx_conf_merge_value(conf->upstream.ssl_session_reuse,
- prev->upstream.ssl_session_reuse, 1);
-
- ngx_conf_merge_bitmask_value(conf->ssl_protocols, prev->ssl_protocols,
- (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3
- |NGX_SSL_TLSv1|NGX_SSL_TLSv1_1
- |NGX_SSL_TLSv1_2));
-
- ngx_conf_merge_str_value(conf->ssl_ciphers, prev->ssl_ciphers,
- "DEFAULT");
-
- if (conf->upstream.ssl_name == NULL) {
- conf->upstream.ssl_name = prev->upstream.ssl_name;
- }
-
- ngx_conf_merge_value(conf->upstream.ssl_server_name,
- prev->upstream.ssl_server_name, 0);
- ngx_conf_merge_value(conf->upstream.ssl_verify,
- prev->upstream.ssl_verify, 0);
- ngx_conf_merge_uint_value(conf->ssl_verify_depth,
- prev->ssl_verify_depth, 1);
- ngx_conf_merge_str_value(conf->ssl_trusted_certificate,
- prev->ssl_trusted_certificate, "");
- ngx_conf_merge_str_value(conf->ssl_crl, prev->ssl_crl, "");
-
- if (conf->ssl && ngx_http_uwsgi_set_ssl(cf, conf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (conf->upstream.ssl == NULL) {
- conf->upstream.ssl = prev->upstream.ssl;
- }
-
-#endif
-
- ngx_conf_merge_str_value(conf->uwsgi_string, prev->uwsgi_string, "");
-
- hash.max_size = 512;
- hash.bucket_size = ngx_align(64, ngx_cacheline_size);
- hash.name = "uwsgi_hide_headers_hash";
-
- if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream,
- &prev->upstream, ngx_http_uwsgi_hide_headers, &hash)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- if (conf->upstream.upstream == NULL) {
- conf->upstream.upstream = prev->upstream.upstream;
- }
-
- if (conf->uwsgi_lengths == NULL) {
- conf->uwsgi_lengths = prev->uwsgi_lengths;
- conf->uwsgi_values = prev->uwsgi_values;
- }
-
- if (conf->upstream.upstream || conf->uwsgi_lengths) {
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- if (clcf->handler == NULL && clcf->lmt_excpt) {
- clcf->handler = ngx_http_uwsgi_handler;
- }
- }
-
- ngx_conf_merge_uint_value(conf->modifier1, prev->modifier1, 0);
- ngx_conf_merge_uint_value(conf->modifier2, prev->modifier2, 0);
-
- if (ngx_http_uwsgi_merge_params(cf, conf, prev) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_uwsgi_merge_params(ngx_conf_t *cf, ngx_http_uwsgi_loc_conf_t *conf,
- ngx_http_uwsgi_loc_conf_t *prev)
-{
- u_char *p;
- size_t size;
- uintptr_t *code;
- ngx_uint_t i, nsrc;
- ngx_array_t headers_names;
-#if (NGX_HTTP_CACHE)
- ngx_array_t params_merged;
-#endif
- ngx_hash_key_t *hk;
- ngx_hash_init_t hash;
- ngx_http_upstream_param_t *src;
- ngx_http_script_compile_t sc;
- ngx_http_script_copy_code_t *copy;
-
- if (conf->params_source == NULL) {
- conf->params_source = prev->params_source;
-
- if (prev->headers_hash.buckets
-#if (NGX_HTTP_CACHE)
- && ((conf->upstream.cache == NULL)
- == (prev->upstream.cache == NULL))
-#endif
- )
- {
- conf->flushes = prev->flushes;
- conf->params_len = prev->params_len;
- conf->params = prev->params;
- conf->headers_hash = prev->headers_hash;
- conf->header_params = prev->header_params;
-
- return NGX_OK;
- }
- }
-
- if (conf->params_source == NULL
-#if (NGX_HTTP_CACHE)
- && (conf->upstream.cache == NULL)
-#endif
- )
- {
- conf->headers_hash.buckets = (void *) 1;
- return NGX_OK;
- }
-
- conf->params_len = ngx_array_create(cf->pool, 64, 1);
- if (conf->params_len == NULL) {
- return NGX_ERROR;
- }
-
- conf->params = ngx_array_create(cf->pool, 512, 1);
- if (conf->params == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&headers_names, cf->temp_pool, 4, sizeof(ngx_hash_key_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (conf->params_source) {
- src = conf->params_source->elts;
- nsrc = conf->params_source->nelts;
-
- } else {
- src = NULL;
- nsrc = 0;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (conf->upstream.cache) {
- ngx_keyval_t *h;
- ngx_http_upstream_param_t *s;
-
- if (ngx_array_init(&params_merged, cf->temp_pool, 4,
- sizeof(ngx_http_upstream_param_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- for (i = 0; i < nsrc; i++) {
-
- s = ngx_array_push(&params_merged);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = src[i];
- }
-
- h = ngx_http_uwsgi_cache_headers;
-
- while (h->key.len) {
-
- src = params_merged.elts;
- nsrc = params_merged.nelts;
-
- for (i = 0; i < nsrc; i++) {
- if (ngx_strcasecmp(h->key.data, src[i].key.data) == 0) {
- goto next;
- }
- }
-
- s = ngx_array_push(&params_merged);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- s->key = h->key;
- s->value = h->value;
- s->skip_empty = 1;
-
- next:
-
- h++;
- }
-
- src = params_merged.elts;
- nsrc = params_merged.nelts;
- }
-
-#endif
-
- for (i = 0; i < nsrc; i++) {
-
- if (src[i].key.len > sizeof("HTTP_") - 1
- && ngx_strncmp(src[i].key.data, "HTTP_", sizeof("HTTP_") - 1) == 0)
- {
- hk = ngx_array_push(&headers_names);
- if (hk == NULL) {
- return NGX_ERROR;
- }
-
- hk->key.len = src[i].key.len - 5;
- hk->key.data = src[i].key.data + 5;
- hk->key_hash = ngx_hash_key_lc(hk->key.data, hk->key.len);
- hk->value = (void *) 1;
-
- if (src[i].value.len == 0) {
- continue;
- }
- }
-
- copy = ngx_array_push_n(conf->params_len,
- sizeof(ngx_http_script_copy_code_t));
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
- copy->len = src[i].key.len;
-
- copy = ngx_array_push_n(conf->params_len,
- sizeof(ngx_http_script_copy_code_t));
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
- copy->len = src[i].skip_empty;
-
-
- size = (sizeof(ngx_http_script_copy_code_t)
- + src[i].key.len + sizeof(uintptr_t) - 1)
- & ~(sizeof(uintptr_t) - 1);
-
- copy = ngx_array_push_n(conf->params, size);
- if (copy == NULL) {
- return NGX_ERROR;
- }
-
- copy->code = ngx_http_script_copy_code;
- copy->len = src[i].key.len;
-
- p = (u_char *) copy + sizeof(ngx_http_script_copy_code_t);
- ngx_memcpy(p, src[i].key.data, src[i].key.len);
-
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &src[i].value;
- sc.flushes = &conf->flushes;
- sc.lengths = &conf->params_len;
- sc.values = &conf->params;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_ERROR;
- }
-
- code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
-
- code = ngx_array_push_n(conf->params, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
- }
-
- code = ngx_array_push_n(conf->params_len, sizeof(uintptr_t));
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
-
- conf->header_params = headers_names.nelts;
-
- hash.hash = &conf->headers_hash;
- hash.key = ngx_hash_key_lc;
- hash.max_size = 512;
- hash.bucket_size = 64;
- hash.name = "uwsgi_params_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- return ngx_hash_init(&hash, headers_names.elts, headers_names.nelts);
-}
-
-
-static char *
-ngx_http_uwsgi_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_uwsgi_loc_conf_t *uwcf = conf;
-
- size_t add;
- ngx_url_t u;
- ngx_str_t *value, *url;
- ngx_uint_t n;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_script_compile_t sc;
-
- if (uwcf->upstream.upstream || uwcf->uwsgi_lengths) {
- return "is duplicate";
- }
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- clcf->handler = ngx_http_uwsgi_handler;
-
- value = cf->args->elts;
-
- url = &value[1];
-
- n = ngx_http_script_variables_count(url);
-
- if (n) {
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = url;
- sc.lengths = &uwcf->uwsgi_lengths;
- sc.values = &uwcf->uwsgi_values;
- sc.variables = n;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
-#if (NGX_HTTP_SSL)
- uwcf->ssl = 1;
-#endif
-
- return NGX_CONF_OK;
- }
-
- if (ngx_strncasecmp(url->data, (u_char *) "uwsgi://", 8) == 0) {
- add = 8;
-
- } else if (ngx_strncasecmp(url->data, (u_char *) "suwsgi://", 9) == 0) {
-
-#if (NGX_HTTP_SSL)
- add = 9;
- uwcf->ssl = 1;
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "suwsgi protocol requires SSL support");
- return NGX_CONF_ERROR;
-#endif
-
- } else {
- add = 0;
- }
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url.len = url->len - add;
- u.url.data = url->data + add;
- u.no_resolve = 1;
-
- uwcf->upstream.upstream = ngx_http_upstream_add(cf, &u, 0);
- if (uwcf->upstream.upstream == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (clcf->name.data[clcf->name.len - 1] == '/') {
- clcf->auto_redirect = 1;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_uwsgi_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_uwsgi_loc_conf_t *uwcf = conf;
-
- ngx_str_t *value;
- ngx_http_script_compile_t sc;
-
- if (uwcf->upstream.store != NGX_CONF_UNSET || uwcf->upstream.store_lengths)
- {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- uwcf->upstream.store = 0;
- return NGX_CONF_OK;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (uwcf->upstream.cache != NGX_CONF_UNSET_PTR
- && uwcf->upstream.cache != NULL)
- {
- return "is incompatible with \"uwsgi_cache\"";
- }
-
-#endif
-
- if (ngx_strcmp(value[1].data, "on") == 0) {
- uwcf->upstream.store = 1;
- return NGX_CONF_OK;
- }
-
- /* include the terminating '\0' into script */
- value[1].len++;
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &value[1];
- sc.lengths = &uwcf->upstream.store_lengths;
- sc.values = &uwcf->upstream.store_values;
- sc.variables = ngx_http_script_variables_count(&value[1]);
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-static char *
-ngx_http_uwsgi_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_uwsgi_loc_conf_t *uwcf = conf;
-
- ngx_str_t *value;
-
- value = cf->args->elts;
-
- if (uwcf->upstream.cache != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- uwcf->upstream.cache = NULL;
- return NGX_CONF_OK;
- }
-
- if (uwcf->upstream.store > 0 || uwcf->upstream.store_lengths) {
- return "is incompatible with \"uwsgi_store\"";
- }
-
- uwcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0,
- &ngx_http_uwsgi_module);
- if (uwcf->upstream.cache == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_uwsgi_cache_key(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_uwsgi_loc_conf_t *uwcf = conf;
-
- ngx_str_t *value;
- ngx_http_compile_complex_value_t ccv;
-
- value = cf->args->elts;
-
- if (uwcf->cache_key.value.data) {
- return "is duplicate";
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &uwcf->cache_key;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-#endif
-
-
-#if (NGX_HTTP_SSL)
-
-static ngx_int_t
-ngx_http_uwsgi_set_ssl(ngx_conf_t *cf, ngx_http_uwsgi_loc_conf_t *uwcf)
-{
- ngx_pool_cleanup_t *cln;
-
- uwcf->upstream.ssl = ngx_pcalloc(cf->pool, sizeof(ngx_ssl_t));
- if (uwcf->upstream.ssl == NULL) {
- return NGX_ERROR;
- }
-
- uwcf->upstream.ssl->log = cf->log;
-
- if (ngx_ssl_create(uwcf->upstream.ssl, uwcf->ssl_protocols, NULL)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- cln = ngx_pool_cleanup_add(cf->pool, 0);
- if (cln == NULL) {
- return NGX_ERROR;
- }
-
- cln->handler = ngx_ssl_cleanup_ctx;
- cln->data = uwcf->upstream.ssl;
-
- if (SSL_CTX_set_cipher_list(uwcf->upstream.ssl->ctx,
- (const char *) uwcf->ssl_ciphers.data)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
- "SSL_CTX_set_cipher_list(\"%V\") failed",
- &uwcf->ssl_ciphers);
- return NGX_ERROR;
- }
-
- if (uwcf->upstream.ssl_verify) {
- if (uwcf->ssl_trusted_certificate.len == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no uwsgi_ssl_trusted_certificate for uwsgi_ssl_verify");
- return NGX_ERROR;
- }
-
- if (ngx_ssl_trusted_certificate(cf, uwcf->upstream.ssl,
- &uwcf->ssl_trusted_certificate,
- uwcf->ssl_verify_depth)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (ngx_ssl_crl(cf, uwcf->upstream.ssl, &uwcf->ssl_crl) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_xslt_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_xslt_filter_module.c
deleted file mode 100644
index 315081e47bd..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/ngx_http_xslt_filter_module.c
+++ /dev/null
@@ -1,1147 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-#include <libxml/parser.h>
-#include <libxml/tree.h>
-#include <libxslt/xslt.h>
-#include <libxslt/xsltInternals.h>
-#include <libxslt/transform.h>
-#include <libxslt/variables.h>
-#include <libxslt/xsltutils.h>
-
-#if (NGX_HAVE_EXSLT)
-#include <libexslt/exslt.h>
-#endif
-
-
-#ifndef NGX_HTTP_XSLT_REUSE_DTD
-#define NGX_HTTP_XSLT_REUSE_DTD 1
-#endif
-
-
-typedef struct {
- u_char *name;
- void *data;
-} ngx_http_xslt_file_t;
-
-
-typedef struct {
- ngx_array_t dtd_files; /* ngx_http_xslt_file_t */
- ngx_array_t sheet_files; /* ngx_http_xslt_file_t */
-} ngx_http_xslt_filter_main_conf_t;
-
-
-typedef struct {
- u_char *name;
- ngx_http_complex_value_t value;
- ngx_uint_t quote; /* unsigned quote:1; */
-} ngx_http_xslt_param_t;
-
-
-typedef struct {
- xsltStylesheetPtr stylesheet;
- ngx_array_t params; /* ngx_http_xslt_param_t */
-} ngx_http_xslt_sheet_t;
-
-
-typedef struct {
- xmlDtdPtr dtd;
- ngx_array_t sheets; /* ngx_http_xslt_sheet_t */
- ngx_hash_t types;
- ngx_array_t *types_keys;
- ngx_array_t *params; /* ngx_http_xslt_param_t */
- ngx_flag_t last_modified;
-} ngx_http_xslt_filter_loc_conf_t;
-
-
-typedef struct {
- xmlDocPtr doc;
- xmlParserCtxtPtr ctxt;
- xsltTransformContextPtr transform;
- ngx_http_request_t *request;
- ngx_array_t params;
-
- ngx_uint_t done; /* unsigned done:1; */
-} ngx_http_xslt_filter_ctx_t;
-
-
-static ngx_int_t ngx_http_xslt_send(ngx_http_request_t *r,
- ngx_http_xslt_filter_ctx_t *ctx, ngx_buf_t *b);
-static ngx_int_t ngx_http_xslt_add_chunk(ngx_http_request_t *r,
- ngx_http_xslt_filter_ctx_t *ctx, ngx_buf_t *b);
-
-
-static void ngx_http_xslt_sax_external_subset(void *data, const xmlChar *name,
- const xmlChar *externalId, const xmlChar *systemId);
-static void ngx_cdecl ngx_http_xslt_sax_error(void *data, const char *msg, ...);
-
-
-static ngx_buf_t *ngx_http_xslt_apply_stylesheet(ngx_http_request_t *r,
- ngx_http_xslt_filter_ctx_t *ctx);
-static ngx_int_t ngx_http_xslt_params(ngx_http_request_t *r,
- ngx_http_xslt_filter_ctx_t *ctx, ngx_array_t *params, ngx_uint_t final);
-static u_char *ngx_http_xslt_content_type(xsltStylesheetPtr s);
-static u_char *ngx_http_xslt_encoding(xsltStylesheetPtr s);
-static void ngx_http_xslt_cleanup(void *data);
-
-static char *ngx_http_xslt_entities(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_xslt_stylesheet(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_xslt_param(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static void ngx_http_xslt_cleanup_dtd(void *data);
-static void ngx_http_xslt_cleanup_stylesheet(void *data);
-static void *ngx_http_xslt_filter_create_main_conf(ngx_conf_t *cf);
-static void *ngx_http_xslt_filter_create_conf(ngx_conf_t *cf);
-static char *ngx_http_xslt_filter_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static ngx_int_t ngx_http_xslt_filter_preconfiguration(ngx_conf_t *cf);
-static ngx_int_t ngx_http_xslt_filter_init(ngx_conf_t *cf);
-static void ngx_http_xslt_filter_exit(ngx_cycle_t *cycle);
-
-
-ngx_str_t ngx_http_xslt_default_types[] = {
- ngx_string("text/xml"),
- ngx_null_string
-};
-
-
-static ngx_command_t ngx_http_xslt_filter_commands[] = {
-
- { ngx_string("xml_entities"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_xslt_entities,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("xslt_stylesheet"),
- NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_xslt_stylesheet,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("xslt_param"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_http_xslt_param,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("xslt_string_param"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_http_xslt_param,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- (void *) 1 },
-
- { ngx_string("xslt_types"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_types_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_xslt_filter_loc_conf_t, types_keys),
- &ngx_http_xslt_default_types[0] },
-
- { ngx_string("xslt_last_modified"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_xslt_filter_loc_conf_t, last_modified),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_xslt_filter_module_ctx = {
- ngx_http_xslt_filter_preconfiguration, /* preconfiguration */
- ngx_http_xslt_filter_init, /* postconfiguration */
-
- ngx_http_xslt_filter_create_main_conf, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_xslt_filter_create_conf, /* create location configuration */
- ngx_http_xslt_filter_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_xslt_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_xslt_filter_module_ctx, /* module context */
- ngx_http_xslt_filter_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- ngx_http_xslt_filter_exit, /* exit process */
- ngx_http_xslt_filter_exit, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_xslt_header_filter(ngx_http_request_t *r)
-{
- ngx_http_xslt_filter_ctx_t *ctx;
- ngx_http_xslt_filter_loc_conf_t *conf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "xslt filter header");
-
- if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED) {
- return ngx_http_next_header_filter(r);
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_xslt_filter_module);
-
- if (conf->sheets.nelts == 0
- || ngx_http_test_content_type(r, &conf->types) == NULL)
- {
- return ngx_http_next_header_filter(r);
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_xslt_filter_module);
-
- if (ctx) {
- return ngx_http_next_header_filter(r);
- }
-
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_xslt_filter_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_xslt_filter_module);
-
- r->main_filter_need_in_memory = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_xslt_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- int wellFormed;
- ngx_chain_t *cl;
- ngx_http_xslt_filter_ctx_t *ctx;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "xslt filter body");
-
- if (in == NULL) {
- return ngx_http_next_body_filter(r, in);
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_xslt_filter_module);
-
- if (ctx == NULL || ctx->done) {
- return ngx_http_next_body_filter(r, in);
- }
-
- for (cl = in; cl; cl = cl->next) {
-
- if (ngx_http_xslt_add_chunk(r, ctx, cl->buf) != NGX_OK) {
-
- if (ctx->ctxt->myDoc) {
-
-#if (NGX_HTTP_XSLT_REUSE_DTD)
- ctx->ctxt->myDoc->extSubset = NULL;
-#endif
- xmlFreeDoc(ctx->ctxt->myDoc);
- }
-
- xmlFreeParserCtxt(ctx->ctxt);
-
- return ngx_http_xslt_send(r, ctx, NULL);
- }
-
- if (cl->buf->last_buf || cl->buf->last_in_chain) {
-
- ctx->doc = ctx->ctxt->myDoc;
-
-#if (NGX_HTTP_XSLT_REUSE_DTD)
- ctx->doc->extSubset = NULL;
-#endif
-
- wellFormed = ctx->ctxt->wellFormed;
-
- xmlFreeParserCtxt(ctx->ctxt);
-
- if (wellFormed) {
- return ngx_http_xslt_send(r, ctx,
- ngx_http_xslt_apply_stylesheet(r, ctx));
- }
-
- xmlFreeDoc(ctx->doc);
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "not well formed XML document");
-
- return ngx_http_xslt_send(r, ctx, NULL);
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_xslt_send(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t *ctx,
- ngx_buf_t *b)
-{
- ngx_int_t rc;
- ngx_chain_t out;
- ngx_pool_cleanup_t *cln;
- ngx_http_xslt_filter_loc_conf_t *conf;
-
- ctx->done = 1;
-
- if (b == NULL) {
- return ngx_http_filter_finalize_request(r, &ngx_http_xslt_filter_module,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- }
-
- cln = ngx_pool_cleanup_add(r->pool, 0);
-
- if (cln == NULL) {
- ngx_free(b->pos);
- return ngx_http_filter_finalize_request(r, &ngx_http_xslt_filter_module,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- }
-
- if (r == r->main) {
- r->headers_out.content_length_n = b->last - b->pos;
-
- if (r->headers_out.content_length) {
- r->headers_out.content_length->hash = 0;
- r->headers_out.content_length = NULL;
- }
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_xslt_filter_module);
-
- if (!conf->last_modified) {
- ngx_http_clear_last_modified(r);
- ngx_http_clear_etag(r);
-
- } else {
- ngx_http_weak_etag(r);
- }
- }
-
- rc = ngx_http_next_header_filter(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- ngx_free(b->pos);
- return rc;
- }
-
- cln->handler = ngx_http_xslt_cleanup;
- cln->data = b->pos;
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_next_body_filter(r, &out);
-}
-
-
-static ngx_int_t
-ngx_http_xslt_add_chunk(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t *ctx,
- ngx_buf_t *b)
-{
- int err;
- xmlParserCtxtPtr ctxt;
-
- if (ctx->ctxt == NULL) {
-
- ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL);
- if (ctxt == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "xmlCreatePushParserCtxt() failed");
- return NGX_ERROR;
- }
- xmlCtxtUseOptions(ctxt, XML_PARSE_NOENT|XML_PARSE_DTDLOAD
- |XML_PARSE_NOWARNING);
-
- ctxt->sax->externalSubset = ngx_http_xslt_sax_external_subset;
- ctxt->sax->setDocumentLocator = NULL;
- ctxt->sax->error = ngx_http_xslt_sax_error;
- ctxt->sax->fatalError = ngx_http_xslt_sax_error;
- ctxt->sax->_private = ctx;
-
- ctx->ctxt = ctxt;
- ctx->request = r;
- }
-
- err = xmlParseChunk(ctx->ctxt, (char *) b->pos, (int) (b->last - b->pos),
- (b->last_buf) || (b->last_in_chain));
-
- if (err == 0) {
- b->pos = b->last;
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "xmlParseChunk() failed, error:%d", err);
-
- return NGX_ERROR;
-}
-
-
-static void
-ngx_http_xslt_sax_external_subset(void *data, const xmlChar *name,
- const xmlChar *externalId, const xmlChar *systemId)
-{
- xmlParserCtxtPtr ctxt = data;
-
- xmlDocPtr doc;
- xmlDtdPtr dtd;
- ngx_http_request_t *r;
- ngx_http_xslt_filter_ctx_t *ctx;
- ngx_http_xslt_filter_loc_conf_t *conf;
-
- ctx = ctxt->sax->_private;
- r = ctx->request;
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_xslt_filter_module);
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "xslt filter extSubset: \"%s\" \"%s\" \"%s\"",
- name ? name : (xmlChar *) "",
- externalId ? externalId : (xmlChar *) "",
- systemId ? systemId : (xmlChar *) "");
-
- doc = ctxt->myDoc;
-
-#if (NGX_HTTP_XSLT_REUSE_DTD)
-
- dtd = conf->dtd;
-
-#else
-
- dtd = xmlCopyDtd(conf->dtd);
- if (dtd == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "xmlCopyDtd() failed");
- return;
- }
-
- if (doc->children == NULL) {
- xmlAddChild((xmlNodePtr) doc, (xmlNodePtr) dtd);
-
- } else {
- xmlAddPrevSibling(doc->children, (xmlNodePtr) dtd);
- }
-
-#endif
-
- doc->extSubset = dtd;
-}
-
-
-static void ngx_cdecl
-ngx_http_xslt_sax_error(void *data, const char *msg, ...)
-{
- xmlParserCtxtPtr ctxt = data;
-
- size_t n;
- va_list args;
- ngx_http_xslt_filter_ctx_t *ctx;
- u_char buf[NGX_MAX_ERROR_STR];
-
- ctx = ctxt->sax->_private;
-
- buf[0] = '\0';
-
- va_start(args, msg);
- n = (size_t) vsnprintf((char *) buf, NGX_MAX_ERROR_STR, msg, args);
- va_end(args);
-
- while (--n && (buf[n] == CR || buf[n] == LF)) { /* void */ }
-
- ngx_log_error(NGX_LOG_ERR, ctx->request->connection->log, 0,
- "libxml2 error: \"%*s\"", n + 1, buf);
-}
-
-
-static ngx_buf_t *
-ngx_http_xslt_apply_stylesheet(ngx_http_request_t *r,
- ngx_http_xslt_filter_ctx_t *ctx)
-{
- int len, rc, doc_type;
- u_char *type, *encoding;
- ngx_buf_t *b;
- ngx_uint_t i;
- xmlChar *buf;
- xmlDocPtr doc, res;
- ngx_http_xslt_sheet_t *sheet;
- ngx_http_xslt_filter_loc_conf_t *conf;
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_xslt_filter_module);
- sheet = conf->sheets.elts;
- doc = ctx->doc;
-
- /* preallocate array for 4 params */
-
- if (ngx_array_init(&ctx->params, r->pool, 4 * 2 + 1, sizeof(char *))
- != NGX_OK)
- {
- xmlFreeDoc(doc);
- return NULL;
- }
-
- for (i = 0; i < conf->sheets.nelts; i++) {
-
- ctx->transform = xsltNewTransformContext(sheet[i].stylesheet, doc);
- if (ctx->transform == NULL) {
- xmlFreeDoc(doc);
- return NULL;
- }
-
- if (conf->params
- && ngx_http_xslt_params(r, ctx, conf->params, 0) != NGX_OK)
- {
- xsltFreeTransformContext(ctx->transform);
- xmlFreeDoc(doc);
- return NULL;
- }
-
- if (ngx_http_xslt_params(r, ctx, &sheet[i].params, 1) != NGX_OK) {
- xsltFreeTransformContext(ctx->transform);
- xmlFreeDoc(doc);
- return NULL;
- }
-
- res = xsltApplyStylesheetUser(sheet[i].stylesheet, doc,
- ctx->params.elts, NULL, NULL,
- ctx->transform);
-
- xsltFreeTransformContext(ctx->transform);
- xmlFreeDoc(doc);
-
- if (res == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "xsltApplyStylesheet() failed");
- return NULL;
- }
-
- doc = res;
-
- /* reset array elements */
- ctx->params.nelts = 0;
- }
-
- /* there must be at least one stylesheet */
-
- if (r == r->main) {
- type = ngx_http_xslt_content_type(sheet[i - 1].stylesheet);
-
- } else {
- type = NULL;
- }
-
- encoding = ngx_http_xslt_encoding(sheet[i - 1].stylesheet);
- doc_type = doc->type;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "xslt filter type: %d t:%s e:%s",
- doc_type, type ? type : (u_char *) "(null)",
- encoding ? encoding : (u_char *) "(null)");
-
- rc = xsltSaveResultToString(&buf, &len, doc, sheet[i - 1].stylesheet);
-
- xmlFreeDoc(doc);
-
- if (rc != 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "xsltSaveResultToString() failed");
- return NULL;
- }
-
- if (len == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "xsltSaveResultToString() returned zero-length result");
- return NULL;
- }
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- ngx_free(buf);
- return NULL;
- }
-
- b->pos = buf;
- b->last = buf + len;
- b->memory = 1;
-
- if (encoding) {
- r->headers_out.charset.len = ngx_strlen(encoding);
- r->headers_out.charset.data = encoding;
- }
-
- if (r != r->main) {
- return b;
- }
-
- b->last_buf = 1;
-
- if (type) {
- len = ngx_strlen(type);
-
- r->headers_out.content_type_len = len;
- r->headers_out.content_type.len = len;
- r->headers_out.content_type.data = type;
-
- } else if (doc_type == XML_HTML_DOCUMENT_NODE) {
-
- r->headers_out.content_type_len = sizeof("text/html") - 1;
- ngx_str_set(&r->headers_out.content_type, "text/html");
- }
-
- r->headers_out.content_type_lowcase = NULL;
-
- return b;
-}
-
-
-static ngx_int_t
-ngx_http_xslt_params(ngx_http_request_t *r, ngx_http_xslt_filter_ctx_t *ctx,
- ngx_array_t *params, ngx_uint_t final)
-{
- u_char *p, *last, *value, *dst, *src, **s;
- size_t len;
- ngx_uint_t i;
- ngx_str_t string;
- ngx_http_xslt_param_t *param;
-
- param = params->elts;
-
- for (i = 0; i < params->nelts; i++) {
-
- if (ngx_http_complex_value(r, &param[i].value, &string) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "xslt filter param: \"%s\"", string.data);
-
- if (param[i].name) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "xslt filter param name: \"%s\"", param[i].name);
-
- if (param[i].quote) {
- if (xsltQuoteOneUserParam(ctx->transform, param[i].name,
- string.data)
- != 0)
- {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "xsltQuoteOneUserParam(\"%s\", \"%s\") failed",
- param[i].name, string.data);
- return NGX_ERROR;
- }
-
- continue;
- }
-
- s = ngx_array_push(&ctx->params);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = param[i].name;
-
- s = ngx_array_push(&ctx->params);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = string.data;
-
- continue;
- }
-
- /*
- * parse param1=value1:param2=value2 syntax as used by parameters
- * specified in xslt_stylesheet directives
- */
-
- p = string.data;
- last = string.data + string.len;
-
- while (p && *p) {
-
- value = p;
- p = (u_char *) ngx_strchr(p, '=');
- if (p == NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid libxslt parameter \"%s\"", value);
- return NGX_ERROR;
- }
- *p++ = '\0';
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "xslt filter param name: \"%s\"", value);
-
- s = ngx_array_push(&ctx->params);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = value;
-
- value = p;
- p = (u_char *) ngx_strchr(p, ':');
-
- if (p) {
- len = p - value;
- *p++ = '\0';
-
- } else {
- len = last - value;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "xslt filter param value: \"%s\"", value);
-
- dst = value;
- src = value;
-
- ngx_unescape_uri(&dst, &src, len, 0);
-
- *dst = '\0';
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "xslt filter param unescaped: \"%s\"", value);
-
- s = ngx_array_push(&ctx->params);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = value;
- }
- }
-
- if (final) {
- s = ngx_array_push(&ctx->params);
- if (s == NULL) {
- return NGX_ERROR;
- }
-
- *s = NULL;
- }
-
- return NGX_OK;
-}
-
-
-static u_char *
-ngx_http_xslt_content_type(xsltStylesheetPtr s)
-{
- u_char *type;
-
- if (s->mediaType) {
- return s->mediaType;
- }
-
- for (s = s->imports; s; s = s->next) {
-
- type = ngx_http_xslt_content_type(s);
-
- if (type) {
- return type;
- }
- }
-
- return NULL;
-}
-
-
-static u_char *
-ngx_http_xslt_encoding(xsltStylesheetPtr s)
-{
- u_char *encoding;
-
- if (s->encoding) {
- return s->encoding;
- }
-
- for (s = s->imports; s; s = s->next) {
-
- encoding = ngx_http_xslt_encoding(s);
-
- if (encoding) {
- return encoding;
- }
- }
-
- return NULL;
-}
-
-
-static void
-ngx_http_xslt_cleanup(void *data)
-{
- ngx_free(data);
-}
-
-
-static char *
-ngx_http_xslt_entities(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_xslt_filter_loc_conf_t *xlcf = conf;
-
- ngx_str_t *value;
- ngx_uint_t i;
- ngx_pool_cleanup_t *cln;
- ngx_http_xslt_file_t *file;
- ngx_http_xslt_filter_main_conf_t *xmcf;
-
- if (xlcf->dtd) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- xmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_xslt_filter_module);
-
- file = xmcf->dtd_files.elts;
- for (i = 0; i < xmcf->dtd_files.nelts; i++) {
- if (ngx_strcmp(file[i].name, value[1].data) == 0) {
- xlcf->dtd = file[i].data;
- return NGX_CONF_OK;
- }
- }
-
- cln = ngx_pool_cleanup_add(cf->pool, 0);
- if (cln == NULL) {
- return NGX_CONF_ERROR;
- }
-
- xlcf->dtd = xmlParseDTD(NULL, (xmlChar *) value[1].data);
-
- if (xlcf->dtd == NULL) {
- ngx_conf_log_error(NGX_LOG_ERR, cf, 0, "xmlParseDTD() failed");
- return NGX_CONF_ERROR;
- }
-
- cln->handler = ngx_http_xslt_cleanup_dtd;
- cln->data = xlcf->dtd;
-
- file = ngx_array_push(&xmcf->dtd_files);
- if (file == NULL) {
- return NGX_CONF_ERROR;
- }
-
- file->name = value[1].data;
- file->data = xlcf->dtd;
-
- return NGX_CONF_OK;
-}
-
-
-
-static char *
-ngx_http_xslt_stylesheet(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_xslt_filter_loc_conf_t *xlcf = conf;
-
- ngx_str_t *value;
- ngx_uint_t i, n;
- ngx_pool_cleanup_t *cln;
- ngx_http_xslt_file_t *file;
- ngx_http_xslt_sheet_t *sheet;
- ngx_http_xslt_param_t *param;
- ngx_http_compile_complex_value_t ccv;
- ngx_http_xslt_filter_main_conf_t *xmcf;
-
- value = cf->args->elts;
-
- if (xlcf->sheets.elts == NULL) {
- if (ngx_array_init(&xlcf->sheets, cf->pool, 1,
- sizeof(ngx_http_xslt_sheet_t))
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
-
- sheet = ngx_array_push(&xlcf->sheets);
- if (sheet == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(sheet, sizeof(ngx_http_xslt_sheet_t));
-
- if (ngx_conf_full_name(cf->cycle, &value[1], 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- xmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_xslt_filter_module);
-
- file = xmcf->sheet_files.elts;
- for (i = 0; i < xmcf->sheet_files.nelts; i++) {
- if (ngx_strcmp(file[i].name, value[1].data) == 0) {
- sheet->stylesheet = file[i].data;
- goto found;
- }
- }
-
- cln = ngx_pool_cleanup_add(cf->pool, 0);
- if (cln == NULL) {
- return NGX_CONF_ERROR;
- }
-
- sheet->stylesheet = xsltParseStylesheetFile(value[1].data);
- if (sheet->stylesheet == NULL) {
- ngx_conf_log_error(NGX_LOG_ERR, cf, 0,
- "xsltParseStylesheetFile(\"%s\") failed",
- value[1].data);
- return NGX_CONF_ERROR;
- }
-
- cln->handler = ngx_http_xslt_cleanup_stylesheet;
- cln->data = sheet->stylesheet;
-
- file = ngx_array_push(&xmcf->sheet_files);
- if (file == NULL) {
- return NGX_CONF_ERROR;
- }
-
- file->name = value[1].data;
- file->data = sheet->stylesheet;
-
-found:
-
- n = cf->args->nelts;
-
- if (n == 2) {
- return NGX_CONF_OK;
- }
-
- if (ngx_array_init(&sheet->params, cf->pool, n - 2,
- sizeof(ngx_http_xslt_param_t))
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- for (i = 2; i < n; i++) {
-
- param = ngx_array_push(&sheet->params);
- if (param == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(param, sizeof(ngx_http_xslt_param_t));
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[i];
- ccv.complex_value = &param->value;
- ccv.zero = 1;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_xslt_param(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_xslt_filter_loc_conf_t *xlcf = conf;
-
- ngx_http_xslt_param_t *param;
- ngx_http_compile_complex_value_t ccv;
- ngx_str_t *value;
-
- value = cf->args->elts;
-
- if (xlcf->params == NULL) {
- xlcf->params = ngx_array_create(cf->pool, 2,
- sizeof(ngx_http_xslt_param_t));
- if (xlcf->params == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- param = ngx_array_push(xlcf->params);
- if (param == NULL) {
- return NGX_CONF_ERROR;
- }
-
- param->name = value[1].data;
- param->quote = (cmd->post == NULL) ? 0 : 1;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[2];
- ccv.complex_value = &param->value;
- ccv.zero = 1;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static void
-ngx_http_xslt_cleanup_dtd(void *data)
-{
- xmlFreeDtd(data);
-}
-
-
-static void
-ngx_http_xslt_cleanup_stylesheet(void *data)
-{
- xsltFreeStylesheet(data);
-}
-
-
-static void *
-ngx_http_xslt_filter_create_main_conf(ngx_conf_t *cf)
-{
- ngx_http_xslt_filter_main_conf_t *conf;
-
- conf = ngx_palloc(cf->pool, sizeof(ngx_http_xslt_filter_main_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- if (ngx_array_init(&conf->dtd_files, cf->pool, 1,
- sizeof(ngx_http_xslt_file_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- if (ngx_array_init(&conf->sheet_files, cf->pool, 1,
- sizeof(ngx_http_xslt_file_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- return conf;
-}
-
-
-static void *
-ngx_http_xslt_filter_create_conf(ngx_conf_t *cf)
-{
- ngx_http_xslt_filter_loc_conf_t *conf;
-
- conf = ngx_pcalloc(cf->pool, sizeof(ngx_http_xslt_filter_loc_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->dtd = NULL;
- * conf->sheets = { NULL };
- * conf->types = { NULL };
- * conf->types_keys = NULL;
- * conf->params = NULL;
- */
-
- conf->last_modified = NGX_CONF_UNSET;
-
- return conf;
-}
-
-
-static char *
-ngx_http_xslt_filter_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_xslt_filter_loc_conf_t *prev = parent;
- ngx_http_xslt_filter_loc_conf_t *conf = child;
-
- if (conf->dtd == NULL) {
- conf->dtd = prev->dtd;
- }
-
- if (conf->sheets.nelts == 0) {
- conf->sheets = prev->sheets;
- }
-
- if (conf->params == NULL) {
- conf->params = prev->params;
- }
-
- if (ngx_http_merge_types(cf, &conf->types_keys, &conf->types,
- &prev->types_keys, &prev->types,
- ngx_http_xslt_default_types)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_value(conf->last_modified, prev->last_modified, 0);
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_xslt_filter_preconfiguration(ngx_conf_t *cf)
-{
- xmlInitParser();
-
-#if (NGX_HAVE_EXSLT)
- exsltRegisterAll();
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_xslt_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_xslt_header_filter;
-
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_xslt_body_filter;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_xslt_filter_exit(ngx_cycle_t *cycle)
-{
- xsltCleanupGlobals();
- xmlCleanupParser();
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/Makefile.PL b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/Makefile.PL
deleted file mode 100644
index 03348b555fc..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/Makefile.PL
+++ /dev/null
@@ -1,33 +0,0 @@
-
-# Copyright (C) Igor Sysoev
-# Copyright (C) Nginx, Inc.
-
-use 5.006001;
-use ExtUtils::MakeMaker;
-
-WriteMakefile(
- NAME => 'nginx',
- VERSION_FROM => 'nginx.pm', # finds $VERSION
- PREREQ_PM => {}, # e.g., Module::Name => 1.1
-
- ABSTRACT_FROM => 'nginx.pm', # retrieve abstract from module
- AUTHOR => 'Igor Sysoev',
-
- CCFLAGS => "$ENV{NGX_PM_CFLAGS}",
- OPTIMIZE => '-O',
-
- INC => join(" ", map {
- m#^/# ? "-I $_" : "-I ../../../../../$_"
- } (split /\s+/, $ENV{NGX_INCS})),
-
- depend => {
- 'nginx.c' => join(" ", map {
- m#^/# ? $_ : "../../../../../$_"
- } (split(/\s+/, $ENV{NGX_DEPS}),
- "src/http/modules/perl/ngx_http_perl_module.h"))
- },
-
- PM => {
- 'nginx.pm' => '$(INST_LIBDIR)/nginx.pm'
- }
-);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.pm b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.pm
deleted file mode 100644
index e3f73611025..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.pm
+++ /dev/null
@@ -1,138 +0,0 @@
-package nginx;
-
-use 5.006001;
-use strict;
-use warnings;
-
-require Exporter;
-
-our @ISA = qw(Exporter);
-
-our @EXPORT = qw(
- OK
- DECLINED
-
- HTTP_OK
- HTTP_CREATED
- HTTP_ACCEPTED
- HTTP_NO_CONTENT
- HTTP_PARTIAL_CONTENT
-
- HTTP_MOVED_PERMANENTLY
- HTTP_MOVED_TEMPORARILY
- HTTP_REDIRECT
- HTTP_SEE_OTHER
- HTTP_NOT_MODIFIED
- HTTP_TEMPORARY_REDIRECT
-
- HTTP_BAD_REQUEST
- HTTP_UNAUTHORIZED
- HTTP_PAYMENT_REQUIRED
- HTTP_FORBIDDEN
- HTTP_NOT_FOUND
- HTTP_NOT_ALLOWED
- HTTP_NOT_ACCEPTABLE
- HTTP_REQUEST_TIME_OUT
- HTTP_CONFLICT
- HTTP_GONE
- HTTP_LENGTH_REQUIRED
- HTTP_REQUEST_ENTITY_TOO_LARGE
- HTTP_REQUEST_URI_TOO_LARGE
- HTTP_UNSUPPORTED_MEDIA_TYPE
- HTTP_RANGE_NOT_SATISFIABLE
-
- HTTP_INTERNAL_SERVER_ERROR
- HTTP_SERVER_ERROR
- HTTP_NOT_IMPLEMENTED
- HTTP_BAD_GATEWAY
- HTTP_SERVICE_UNAVAILABLE
- HTTP_GATEWAY_TIME_OUT
- HTTP_INSUFFICIENT_STORAGE
-);
-
-our $VERSION = '%%VERSION%%';
-
-require XSLoader;
-XSLoader::load('nginx', $VERSION);
-
-# Preloaded methods go here.
-
-use constant OK => 0;
-use constant DECLINED => -5;
-
-use constant HTTP_OK => 200;
-use constant HTTP_CREATED => 201;
-use constant HTTP_ACCEPTED => 202;
-use constant HTTP_NO_CONTENT => 204;
-use constant HTTP_PARTIAL_CONTENT => 206;
-
-use constant HTTP_MOVED_PERMANENTLY => 301;
-use constant HTTP_MOVED_TEMPORARILY => 302;
-use constant HTTP_REDIRECT => 302;
-use constant HTTP_SEE_OTHER => 303;
-use constant HTTP_NOT_MODIFIED => 304;
-use constant HTTP_TEMPORARY_REDIRECT => 307;
-
-use constant HTTP_BAD_REQUEST => 400;
-use constant HTTP_UNAUTHORIZED => 401;
-use constant HTTP_PAYMENT_REQUIRED => 402;
-use constant HTTP_FORBIDDEN => 403;
-use constant HTTP_NOT_FOUND => 404;
-use constant HTTP_NOT_ALLOWED => 405;
-use constant HTTP_NOT_ACCEPTABLE => 406;
-use constant HTTP_REQUEST_TIME_OUT => 408;
-use constant HTTP_CONFLICT => 409;
-use constant HTTP_GONE => 410;
-use constant HTTP_LENGTH_REQUIRED => 411;
-use constant HTTP_REQUEST_ENTITY_TOO_LARGE => 413;
-use constant HTTP_REQUEST_URI_TOO_LARGE => 414;
-use constant HTTP_UNSUPPORTED_MEDIA_TYPE => 415;
-use constant HTTP_RANGE_NOT_SATISFIABLE => 416;
-
-use constant HTTP_INTERNAL_SERVER_ERROR => 500;
-use constant HTTP_SERVER_ERROR => 500;
-use constant HTTP_NOT_IMPLEMENTED => 501;
-use constant HTTP_BAD_GATEWAY => 502;
-use constant HTTP_SERVICE_UNAVAILABLE => 503;
-use constant HTTP_GATEWAY_TIME_OUT => 504;
-use constant HTTP_INSUFFICIENT_STORAGE => 507;
-
-
-sub rflush {
- my $r = shift;
-
- $r->flush;
-}
-
-
-1;
-__END__
-
-=head1 NAME
-
-nginx - Perl interface to the nginx HTTP server API
-
-=head1 SYNOPSIS
-
- use nginx;
-
-=head1 DESCRIPTION
-
-This module provides a Perl interface to the nginx HTTP server API.
-
-
-=head1 SEE ALSO
-
-http://nginx.org/en/docs/http/ngx_http_perl_module.html
-
-=head1 AUTHOR
-
-Igor Sysoev
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright (C) Igor Sysoev
-Copyright (C) Nginx, Inc.
-
-
-=cut
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.xs b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.xs
deleted file mode 100644
index 71f17a8bb45..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/nginx.xs
+++ /dev/null
@@ -1,1038 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#define PERL_NO_GET_CONTEXT
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <ngx_http_perl_module.h>
-
-#include "XSUB.h"
-
-
-#define ngx_http_perl_set_request(r) \
- r = INT2PTR(ngx_http_request_t *, SvIV((SV *) SvRV(ST(0))))
-
-
-#define ngx_http_perl_set_targ(p, len) \
- \
- SvUPGRADE(TARG, SVt_PV); \
- SvPOK_on(TARG); \
- sv_setpvn(TARG, (char *) p, len)
-
-
-static ngx_int_t
-ngx_http_perl_sv2str(pTHX_ ngx_http_request_t *r, ngx_str_t *s, SV *sv)
-{
- u_char *p;
- STRLEN len;
-
- if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PV) {
- sv = SvRV(sv);
- }
-
- p = (u_char *) SvPV(sv, len);
-
- s->len = len;
-
- if (SvREADONLY(sv) && SvPOK(sv)) {
- s->data = p;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl sv2str: %08XD \"%V\"", sv->sv_flags, s);
-
- return NGX_OK;
- }
-
- s->data = ngx_pnalloc(r->pool, len);
- if (s->data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->data, p, len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl sv2str: %08XD \"%V\"", sv->sv_flags, s);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_perl_output(ngx_http_request_t *r, ngx_buf_t *b)
-{
- ngx_chain_t out;
-#if (NGX_HTTP_SSI)
- ngx_chain_t *cl;
- ngx_http_perl_ctx_t *ctx;
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
-
- if (ctx->ssi) {
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- cl->next = NULL;
- *ctx->ssi->last_out = cl;
- ctx->ssi->last_out = &cl->next;
-
- return NGX_OK;
- }
-#endif
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_output_filter(r, &out);
-}
-
-
-MODULE = nginx PACKAGE = nginx
-
-
-void
-status(r, code)
- CODE:
-
- ngx_http_request_t *r;
-
- ngx_http_perl_set_request(r);
-
- r->headers_out.status = SvIV(ST(1));
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl status: %d", r->headers_out.status);
-
- XSRETURN_UNDEF;
-
-
-void
-send_http_header(r, ...)
- CODE:
-
- ngx_http_request_t *r;
- SV *sv;
-
- ngx_http_perl_set_request(r);
-
- if (r->headers_out.status == 0) {
- r->headers_out.status = NGX_HTTP_OK;
- }
-
- if (items != 1) {
- sv = ST(1);
-
- if (ngx_http_perl_sv2str(aTHX_ r, &r->headers_out.content_type, sv)
- != NGX_OK)
- {
- XSRETURN_EMPTY;
- }
-
- r->headers_out.content_type_len = r->headers_out.content_type.len;
-
- } else {
- if (ngx_http_set_content_type(r) != NGX_OK) {
- XSRETURN_EMPTY;
- }
- }
-
- (void) ngx_http_send_header(r);
-
-
-void
-header_only(r)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
-
- ngx_http_perl_set_request(r);
-
- sv_upgrade(TARG, SVt_IV);
- sv_setiv(TARG, r->header_only);
-
- ST(0) = TARG;
-
-
-void
-uri(r)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
-
- ngx_http_perl_set_request(r);
- ngx_http_perl_set_targ(r->uri.data, r->uri.len);
-
- ST(0) = TARG;
-
-
-void
-args(r)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
-
- ngx_http_perl_set_request(r);
- ngx_http_perl_set_targ(r->args.data, r->args.len);
-
- ST(0) = TARG;
-
-
-void
-request_method(r)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
-
- ngx_http_perl_set_request(r);
- ngx_http_perl_set_targ(r->method_name.data, r->method_name.len);
-
- ST(0) = TARG;
-
-
-void
-remote_addr(r)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
-
- ngx_http_perl_set_request(r);
- ngx_http_perl_set_targ(r->connection->addr_text.data,
- r->connection->addr_text.len);
-
- ST(0) = TARG;
-
-
-void
-header_in(r, key)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
- SV *key;
- u_char *p, *lowcase_key, *value, sep;
- STRLEN len;
- ssize_t size;
- ngx_uint_t i, n, hash;
- ngx_array_t *a;
- ngx_list_part_t *part;
- ngx_table_elt_t *h, **ph;
- ngx_http_header_t *hh;
- ngx_http_core_main_conf_t *cmcf;
-
- ngx_http_perl_set_request(r);
-
- key = ST(1);
-
- if (SvROK(key) && SvTYPE(SvRV(key)) == SVt_PV) {
- key = SvRV(key);
- }
-
- p = (u_char *) SvPV(key, len);
-
- /* look up hashed headers */
-
- lowcase_key = ngx_pnalloc(r->pool, len);
- if (lowcase_key == NULL) {
- XSRETURN_UNDEF;
- }
-
- hash = ngx_hash_strlow(lowcase_key, p, len);
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- hh = ngx_hash_find(&cmcf->headers_in_hash, hash, lowcase_key, len);
-
- if (hh) {
-
- if (hh->offset == offsetof(ngx_http_headers_in_t, cookies)) {
- sep = ';';
- goto multi;
- }
-#if (NGX_HTTP_X_FORWARDED_FOR)
- if (hh->offset == offsetof(ngx_http_headers_in_t, x_forwarded_for)) {
- sep = ',';
- goto multi;
- }
-#endif
-
- if (hh->offset) {
-
- ph = (ngx_table_elt_t **) ((char *) &r->headers_in + hh->offset);
-
- if (*ph) {
- ngx_http_perl_set_targ((*ph)->value.data, (*ph)->value.len);
-
- goto done;
- }
-
- XSRETURN_UNDEF;
- }
-
- multi:
-
- /* Cookie, X-Forwarded-For */
-
- a = (ngx_array_t *) ((char *) &r->headers_in + hh->offset);
-
- n = a->nelts;
-
- if (n == 0) {
- XSRETURN_UNDEF;
- }
-
- ph = a->elts;
-
- if (n == 1) {
- ngx_http_perl_set_targ((*ph)->value.data, (*ph)->value.len);
-
- goto done;
- }
-
- size = - (ssize_t) (sizeof("; ") - 1);
-
- for (i = 0; i < n; i++) {
- size += ph[i]->value.len + sizeof("; ") - 1;
- }
-
- value = ngx_pnalloc(r->pool, size);
- if (value == NULL) {
- XSRETURN_UNDEF;
- }
-
- p = value;
-
- for (i = 0; /* void */ ; i++) {
- p = ngx_copy(p, ph[i]->value.data, ph[i]->value.len);
-
- if (i == n - 1) {
- break;
- }
-
- *p++ = sep; *p++ = ' ';
- }
-
- ngx_http_perl_set_targ(value, size);
-
- goto done;
- }
-
- /* iterate over all headers */
-
- part = &r->headers_in.headers.part;
- h = part->elts;
-
- for (i = 0; /* void */ ; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- h = part->elts;
- i = 0;
- }
-
- if (len != h[i].key.len
- || ngx_strcasecmp(p, h[i].key.data) != 0)
- {
- continue;
- }
-
- ngx_http_perl_set_targ(h[i].value.data, h[i].value.len);
-
- goto done;
- }
-
- XSRETURN_UNDEF;
-
- done:
-
- ST(0) = TARG;
-
-
-void
-has_request_body(r, next)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
- ngx_http_perl_ctx_t *ctx;
-
- ngx_http_perl_set_request(r);
-
- if (r->headers_in.content_length_n <= 0 && !r->headers_in.chunked) {
- XSRETURN_UNDEF;
- }
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
- ctx->next = SvRV(ST(1));
-
- r->request_body_in_single_buf = 1;
- r->request_body_in_persistent_file = 1;
- r->request_body_in_clean_file = 1;
-
- if (r->request_body_in_file_only) {
- r->request_body_file_log_level = 0;
- }
-
- ngx_http_read_client_request_body(r, ngx_http_perl_handle_request);
-
- sv_upgrade(TARG, SVt_IV);
- sv_setiv(TARG, 1);
-
- ST(0) = TARG;
-
-
-void
-request_body(r)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
- u_char *p, *data;
- size_t len;
- ngx_buf_t *buf;
- ngx_chain_t *cl;
-
- ngx_http_perl_set_request(r);
-
- if (r->request_body == NULL
- || r->request_body->temp_file
- || r->request_body->bufs == NULL)
- {
- XSRETURN_UNDEF;
- }
-
- cl = r->request_body->bufs;
- buf = cl->buf;
-
- if (cl->next == NULL) {
- len = buf->last - buf->pos;
- data = buf->pos;
- goto done;
- }
-
- len = buf->last - buf->pos;
- cl = cl->next;
-
- for ( /* void */ ; cl; cl = cl->next) {
- buf = cl->buf;
- len += buf->last - buf->pos;
- }
-
- p = ngx_pnalloc(r->pool, len);
- if (p == NULL) {
- XSRETURN_UNDEF;
- }
-
- data = p;
- cl = r->request_body->bufs;
-
- for ( /* void */ ; cl; cl = cl->next) {
- buf = cl->buf;
- p = ngx_cpymem(p, buf->pos, buf->last - buf->pos);
- }
-
- done:
-
- if (len == 0) {
- XSRETURN_UNDEF;
- }
-
- ngx_http_perl_set_targ(data, len);
-
- ST(0) = TARG;
-
-
-void
-request_body_file(r)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
-
- ngx_http_perl_set_request(r);
-
- if (r->request_body == NULL || r->request_body->temp_file == NULL) {
- XSRETURN_UNDEF;
- }
-
- ngx_http_perl_set_targ(r->request_body->temp_file->file.name.data,
- r->request_body->temp_file->file.name.len);
-
- ST(0) = TARG;
-
-
-void
-discard_request_body(r)
- CODE:
-
- ngx_http_request_t *r;
-
- ngx_http_perl_set_request(r);
-
- ngx_http_discard_request_body(r);
-
-
-void
-header_out(r, key, value)
- CODE:
-
- ngx_http_request_t *r;
- SV *key;
- SV *value;
- ngx_table_elt_t *header;
-
- ngx_http_perl_set_request(r);
-
- key = ST(1);
- value = ST(2);
-
- header = ngx_list_push(&r->headers_out.headers);
- if (header == NULL) {
- XSRETURN_EMPTY;
- }
-
- header->hash = 1;
-
- if (ngx_http_perl_sv2str(aTHX_ r, &header->key, key) != NGX_OK) {
- XSRETURN_EMPTY;
- }
-
- if (ngx_http_perl_sv2str(aTHX_ r, &header->value, value) != NGX_OK) {
- XSRETURN_EMPTY;
- }
-
- if (header->key.len == sizeof("Content-Length") - 1
- && ngx_strncasecmp(header->key.data, (u_char *) "Content-Length",
- sizeof("Content-Length") - 1) == 0)
- {
- r->headers_out.content_length_n = (off_t) SvIV(value);
- r->headers_out.content_length = header;
- }
-
- if (header->key.len == sizeof("Content-Encoding") - 1
- && ngx_strncasecmp(header->key.data, (u_char *) "Content-Encoding",
- sizeof("Content-Encoding") - 1) == 0)
- {
- r->headers_out.content_encoding = header;
- }
-
-
-void
-filename(r)
- CODE:
-
- dXSTARG;
- size_t root;
- ngx_http_request_t *r;
- ngx_http_perl_ctx_t *ctx;
-
- ngx_http_perl_set_request(r);
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
- if (ctx->filename.data) {
- goto done;
- }
-
- if (ngx_http_map_uri_to_path(r, &ctx->filename, &root, 0) == NULL) {
- XSRETURN_UNDEF;
- }
-
- ctx->filename.len--;
- sv_setpv(PL_statname, (char *) ctx->filename.data);
-
- done:
-
- ngx_http_perl_set_targ(ctx->filename.data, ctx->filename.len);
-
- ST(0) = TARG;
-
-
-void
-print(r, ...)
- CODE:
-
- ngx_http_request_t *r;
- SV *sv;
- int i;
- u_char *p;
- size_t size;
- STRLEN len;
- ngx_buf_t *b;
-
- ngx_http_perl_set_request(r);
-
- if (items == 2) {
-
- /*
- * do zero copy for prolate single read-only SV:
- * $r->print("some text\n");
- */
-
- sv = ST(1);
-
- if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PV) {
- sv = SvRV(sv);
- }
-
- if (SvREADONLY(sv) && SvPOK(sv)) {
-
- p = (u_char *) SvPV(sv, len);
-
- if (len == 0) {
- XSRETURN_EMPTY;
- }
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- XSRETURN_EMPTY;
- }
-
- b->memory = 1;
- b->pos = p;
- b->last = p + len;
- b->start = p;
- b->end = b->last;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "$r->print: read-only SV: %z", len);
-
- goto out;
- }
- }
-
- size = 0;
-
- for (i = 1; i < items; i++) {
-
- sv = ST(i);
-
- if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PV) {
- sv = SvRV(sv);
- }
-
- (void) SvPV(sv, len);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "$r->print: copy SV: %z", len);
-
- size += len;
- }
-
- if (size == 0) {
- XSRETURN_EMPTY;
- }
-
- b = ngx_create_temp_buf(r->pool, size);
- if (b == NULL) {
- XSRETURN_EMPTY;
- }
-
- for (i = 1; i < items; i++) {
- sv = ST(i);
-
- if (SvROK(sv) && SvTYPE(SvRV(sv)) == SVt_PV) {
- sv = SvRV(sv);
- }
-
- p = (u_char *) SvPV(sv, len);
- b->last = ngx_cpymem(b->last, p, len);
- }
-
- out:
-
- (void) ngx_http_perl_output(r, b);
-
-
-void
-sendfile(r, filename, offset = -1, bytes = 0)
- CODE:
-
- ngx_http_request_t *r;
- char *filename;
- off_t offset;
- size_t bytes;
- ngx_str_t path;
- ngx_buf_t *b;
- ngx_open_file_info_t of;
- ngx_http_core_loc_conf_t *clcf;
-
- ngx_http_perl_set_request(r);
-
- filename = SvPV_nolen(ST(1));
-
- if (filename == NULL) {
- croak("sendfile(): NULL filename");
- }
-
- offset = items < 3 ? -1 : SvIV(ST(2));
- bytes = items < 4 ? 0 : SvIV(ST(3));
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- XSRETURN_EMPTY;
- }
-
- b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t));
- if (b->file == NULL) {
- XSRETURN_EMPTY;
- }
-
- path.len = ngx_strlen(filename);
-
- path.data = ngx_pnalloc(r->pool, path.len + 1);
- if (path.data == NULL) {
- XSRETURN_EMPTY;
- }
-
- (void) ngx_cpystrn(path.data, (u_char *) filename, path.len + 1);
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.read_ahead = clcf->read_ahead;
- of.directio = clcf->directio;
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.errors = clcf->open_file_cache_errors;
- of.events = clcf->open_file_cache_events;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
- XSRETURN_EMPTY;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- != NGX_OK)
- {
- if (of.err == 0) {
- XSRETURN_EMPTY;
- }
-
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- "%s \"%s\" failed", of.failed, filename);
- XSRETURN_EMPTY;
- }
-
- if (offset == -1) {
- offset = 0;
- }
-
- if (bytes == 0) {
- bytes = of.size - offset;
- }
-
- b->in_file = 1;
-
- b->file_pos = offset;
- b->file_last = offset + bytes;
-
- b->file->fd = of.fd;
- b->file->log = r->connection->log;
- b->file->directio = of.is_directio;
-
- (void) ngx_http_perl_output(r, b);
-
-
-void
-flush(r)
- CODE:
-
- ngx_http_request_t *r;
- ngx_buf_t *b;
-
- ngx_http_perl_set_request(r);
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- XSRETURN_EMPTY;
- }
-
- b->flush = 1;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "$r->flush");
-
- (void) ngx_http_perl_output(r, b);
-
- XSRETURN_EMPTY;
-
-
-void
-internal_redirect(r, uri)
- CODE:
-
- ngx_http_request_t *r;
- SV *uri;
- ngx_uint_t i;
- ngx_http_perl_ctx_t *ctx;
-
- ngx_http_perl_set_request(r);
-
- uri = ST(1);
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
-
- if (ngx_http_perl_sv2str(aTHX_ r, &ctx->redirect_uri, uri) != NGX_OK) {
- XSRETURN_EMPTY;
- }
-
- for (i = 0; i < ctx->redirect_uri.len; i++) {
- if (ctx->redirect_uri.data[i] == '?') {
-
- ctx->redirect_args.len = ctx->redirect_uri.len - (i + 1);
- ctx->redirect_args.data = &ctx->redirect_uri.data[i + 1];
- ctx->redirect_uri.len = i;
-
- XSRETURN_EMPTY;
- }
- }
-
-
-void
-allow_ranges(r)
- CODE:
-
- ngx_http_request_t *r;
-
- ngx_http_perl_set_request(r);
-
- r->allow_ranges = 1;
-
-
-void
-unescape(r, text, type = 0)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
- SV *text;
- int type;
- u_char *p, *dst, *src;
- STRLEN len;
-
- ngx_http_perl_set_request(r);
-
- text = ST(1);
-
- src = (u_char *) SvPV(text, len);
-
- p = ngx_pnalloc(r->pool, len + 1);
- if (p == NULL) {
- XSRETURN_UNDEF;
- }
-
- dst = p;
-
- type = items < 3 ? 0 : SvIV(ST(2));
-
- ngx_unescape_uri(&dst, &src, len, (ngx_uint_t) type);
- *dst = '\0';
-
- ngx_http_perl_set_targ(p, dst - p);
-
- ST(0) = TARG;
-
-
-void
-variable(r, name, value = NULL)
- CODE:
-
- dXSTARG;
- ngx_http_request_t *r;
- SV *name, *value;
- u_char *p, *lowcase;
- STRLEN len;
- ngx_str_t var, val;
- ngx_uint_t i, hash;
- ngx_http_perl_var_t *v;
- ngx_http_perl_ctx_t *ctx;
- ngx_http_variable_value_t *vv;
-
- ngx_http_perl_set_request(r);
-
- name = ST(1);
-
- if (SvROK(name) && SvTYPE(SvRV(name)) == SVt_PV) {
- name = SvRV(name);
- }
-
- if (items == 2) {
- value = NULL;
-
- } else {
- value = ST(2);
-
- if (SvROK(value) && SvTYPE(SvRV(value)) == SVt_PV) {
- value = SvRV(value);
- }
-
- if (ngx_http_perl_sv2str(aTHX_ r, &val, value) != NGX_OK) {
- XSRETURN_UNDEF;
- }
- }
-
- p = (u_char *) SvPV(name, len);
-
- lowcase = ngx_pnalloc(r->pool, len);
- if (lowcase == NULL) {
- XSRETURN_UNDEF;
- }
-
- hash = ngx_hash_strlow(lowcase, p, len);
-
- var.len = len;
- var.data = lowcase;
-#if (NGX_DEBUG)
-
- if (value) {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl variable: \"%V\"=\"%V\"", &var, &val);
- } else {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl variable: \"%V\"", &var);
- }
-#endif
-
- vv = ngx_http_get_variable(r, &var, hash);
- if (vv == NULL) {
- XSRETURN_UNDEF;
- }
-
- if (vv->not_found) {
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
-
- if (ctx->variables) {
-
- v = ctx->variables->elts;
- for (i = 0; i < ctx->variables->nelts; i++) {
-
- if (hash != v[i].hash
- || len != v[i].name.len
- || ngx_strncmp(lowcase, v[i].name.data, len) != 0)
- {
- continue;
- }
-
- if (value) {
- v[i].value = val;
- XSRETURN_UNDEF;
- }
-
- ngx_http_perl_set_targ(v[i].value.data, v[i].value.len);
-
- goto done;
- }
- }
-
- if (value) {
- if (ctx->variables == NULL) {
- ctx->variables = ngx_array_create(r->pool, 1,
- sizeof(ngx_http_perl_var_t));
- if (ctx->variables == NULL) {
- XSRETURN_UNDEF;
- }
- }
-
- v = ngx_array_push(ctx->variables);
- if (v == NULL) {
- XSRETURN_UNDEF;
- }
-
- v->hash = hash;
- v->name.len = len;
- v->name.data = lowcase;
- v->value = val;
-
- XSRETURN_UNDEF;
- }
-
- XSRETURN_UNDEF;
- }
-
- if (value) {
- vv->len = val.len;
- vv->valid = 1;
- vv->no_cacheable = 0;
- vv->not_found = 0;
- vv->data = val.data;
-
- XSRETURN_UNDEF;
- }
-
- ngx_http_perl_set_targ(vv->data, vv->len);
-
- done:
-
- ST(0) = TARG;
-
-
-void
-sleep(r, sleep, next)
- CODE:
-
- ngx_http_request_t *r;
- ngx_msec_t sleep;
- ngx_http_perl_ctx_t *ctx;
-
- ngx_http_perl_set_request(r);
-
- sleep = (ngx_msec_t) SvIV(ST(1));
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl sleep: %M", sleep);
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
-
- ctx->next = SvRV(ST(2));
-
- ngx_add_timer(r->connection->write, sleep);
-
- r->write_event_handler = ngx_http_perl_sleep_handler;
- r->main->count++;
-
-
-void
-log_error(r, err, msg)
- CODE:
-
- ngx_http_request_t *r;
- SV *err, *msg;
- u_char *p;
- STRLEN len;
- ngx_err_t e;
-
- ngx_http_perl_set_request(r);
-
- err = ST(1);
-
- if (SvROK(err) && SvTYPE(SvRV(err)) == SVt_PV) {
- err = SvRV(err);
- }
-
- e = SvIV(err);
-
- msg = ST(2);
-
- if (SvROK(msg) && SvTYPE(SvRV(msg)) == SVt_PV) {
- msg = SvRV(msg);
- }
-
- p = (u_char *) SvPV(msg, len);
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, e, "perl: %s", p);
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.c
deleted file mode 100644
index 6a8894cc3b1..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.c
+++ /dev/null
@@ -1,1077 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <ngx_http_perl_module.h>
-
-
-typedef struct {
- PerlInterpreter *perl;
- HV *nginx;
- ngx_array_t *modules;
- ngx_array_t *requires;
-} ngx_http_perl_main_conf_t;
-
-
-typedef struct {
- SV *sub;
- ngx_str_t handler;
-} ngx_http_perl_loc_conf_t;
-
-
-typedef struct {
- SV *sub;
- ngx_str_t handler;
-} ngx_http_perl_variable_t;
-
-
-#if (NGX_HTTP_SSI)
-static ngx_int_t ngx_http_perl_ssi(ngx_http_request_t *r,
- ngx_http_ssi_ctx_t *ssi_ctx, ngx_str_t **params);
-#endif
-
-static char *ngx_http_perl_init_interpreter(ngx_conf_t *cf,
- ngx_http_perl_main_conf_t *pmcf);
-static PerlInterpreter *ngx_http_perl_create_interpreter(ngx_conf_t *cf,
- ngx_http_perl_main_conf_t *pmcf);
-static ngx_int_t ngx_http_perl_run_requires(pTHX_ ngx_array_t *requires,
- ngx_log_t *log);
-static ngx_int_t ngx_http_perl_call_handler(pTHX_ ngx_http_request_t *r,
- HV *nginx, SV *sub, SV **args, ngx_str_t *handler, ngx_str_t *rv);
-static void ngx_http_perl_eval_anon_sub(pTHX_ ngx_str_t *handler, SV **sv);
-
-static ngx_int_t ngx_http_perl_preconfiguration(ngx_conf_t *cf);
-static void *ngx_http_perl_create_main_conf(ngx_conf_t *cf);
-static char *ngx_http_perl_init_main_conf(ngx_conf_t *cf, void *conf);
-static void *ngx_http_perl_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_perl_merge_loc_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_http_perl(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static char *ngx_http_perl_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-
-#if (NGX_HAVE_PERL_MULTIPLICITY)
-static void ngx_http_perl_cleanup_perl(void *data);
-#endif
-
-static ngx_int_t ngx_http_perl_init_worker(ngx_cycle_t *cycle);
-static void ngx_http_perl_exit(ngx_cycle_t *cycle);
-
-
-static ngx_command_t ngx_http_perl_commands[] = {
-
- { ngx_string("perl_modules"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_perl_main_conf_t, modules),
- NULL },
-
- { ngx_string("perl_require"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_perl_main_conf_t, requires),
- NULL },
-
- { ngx_string("perl"),
- NGX_HTTP_LOC_CONF|NGX_HTTP_LMT_CONF|NGX_CONF_TAKE1,
- ngx_http_perl,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("perl_set"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE2,
- ngx_http_perl_set,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_perl_module_ctx = {
- ngx_http_perl_preconfiguration, /* preconfiguration */
- NULL, /* postconfiguration */
-
- ngx_http_perl_create_main_conf, /* create main configuration */
- ngx_http_perl_init_main_conf, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_perl_create_loc_conf, /* create location configuration */
- ngx_http_perl_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_perl_module = {
- NGX_MODULE_V1,
- &ngx_http_perl_module_ctx, /* module context */
- ngx_http_perl_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- ngx_http_perl_init_worker, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- ngx_http_perl_exit, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-#if (NGX_HTTP_SSI)
-
-#define NGX_HTTP_PERL_SSI_SUB 0
-#define NGX_HTTP_PERL_SSI_ARG 1
-
-
-static ngx_http_ssi_param_t ngx_http_perl_ssi_params[] = {
- { ngx_string("sub"), NGX_HTTP_PERL_SSI_SUB, 1, 0 },
- { ngx_string("arg"), NGX_HTTP_PERL_SSI_ARG, 0, 1 },
- { ngx_null_string, 0, 0, 0 }
-};
-
-static ngx_http_ssi_command_t ngx_http_perl_ssi_command = {
- ngx_string("perl"), ngx_http_perl_ssi, ngx_http_perl_ssi_params, 0, 0, 1
-};
-
-#endif
-
-
-static ngx_str_t ngx_null_name = ngx_null_string;
-static HV *nginx_stash;
-
-#if (NGX_HAVE_PERL_MULTIPLICITY)
-static ngx_uint_t ngx_perl_term;
-#else
-static PerlInterpreter *perl;
-#endif
-
-
-static void
-ngx_http_perl_xs_init(pTHX)
-{
- newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, __FILE__);
-
- nginx_stash = gv_stashpv("nginx", TRUE);
-}
-
-
-static ngx_int_t
-ngx_http_perl_handler(ngx_http_request_t *r)
-{
- r->main->count++;
-
- ngx_http_perl_handle_request(r);
-
- return NGX_DONE;
-}
-
-
-void
-ngx_http_perl_handle_request(ngx_http_request_t *r)
-{
- SV *sub;
- ngx_int_t rc;
- ngx_str_t uri, args, *handler;
- ngx_http_perl_ctx_t *ctx;
- ngx_http_perl_loc_conf_t *plcf;
- ngx_http_perl_main_conf_t *pmcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "perl handler");
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
-
- if (ctx == NULL) {
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_perl_ctx_t));
- if (ctx == NULL) {
- ngx_http_finalize_request(r, NGX_ERROR);
- return;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_perl_module);
- }
-
- pmcf = ngx_http_get_module_main_conf(r, ngx_http_perl_module);
-
- {
-
- dTHXa(pmcf->perl);
- PERL_SET_CONTEXT(pmcf->perl);
-
- if (ctx->next == NULL) {
- plcf = ngx_http_get_module_loc_conf(r, ngx_http_perl_module);
- sub = plcf->sub;
- handler = &plcf->handler;
-
- } else {
- sub = ctx->next;
- handler = &ngx_null_name;
- ctx->next = NULL;
- }
-
- rc = ngx_http_perl_call_handler(aTHX_ r, pmcf->nginx, sub, NULL, handler,
- NULL);
-
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl handler done: %i", rc);
-
- if (rc == NGX_DONE) {
- ngx_http_finalize_request(r, rc);
- return;
- }
-
- if (rc > 600) {
- rc = NGX_OK;
- }
-
- if (ctx->redirect_uri.len) {
- uri = ctx->redirect_uri;
- args = ctx->redirect_args;
-
- } else {
- uri.len = 0;
- }
-
- ctx->filename.data = NULL;
- ctx->redirect_uri.len = 0;
-
- if (ctx->done || ctx->next) {
- ngx_http_finalize_request(r, NGX_DONE);
- return;
- }
-
- if (uri.len) {
- ngx_http_internal_redirect(r, &uri, &args);
- ngx_http_finalize_request(r, NGX_DONE);
- return;
- }
-
- if (rc == NGX_OK || rc == NGX_HTTP_OK) {
- ngx_http_send_special(r, NGX_HTTP_LAST);
- ctx->done = 1;
- }
-
- ngx_http_finalize_request(r, rc);
-}
-
-
-void
-ngx_http_perl_sleep_handler(ngx_http_request_t *r)
-{
- ngx_event_t *wev;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl sleep handler");
-
- wev = r->connection->write;
-
- if (wev->timedout) {
- wev->timedout = 0;
- ngx_http_perl_handle_request(r);
- return;
- }
-
- if (ngx_handle_write_event(wev, 0) != NGX_OK) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- }
-}
-
-
-static ngx_int_t
-ngx_http_perl_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_http_perl_variable_t *pv = (ngx_http_perl_variable_t *) data;
-
- ngx_int_t rc;
- ngx_str_t value;
- ngx_http_perl_ctx_t *ctx;
- ngx_http_perl_main_conf_t *pmcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl variable handler");
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
-
- if (ctx == NULL) {
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_perl_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_perl_module);
- }
-
- pmcf = ngx_http_get_module_main_conf(r, ngx_http_perl_module);
-
- value.data = NULL;
-
- {
-
- dTHXa(pmcf->perl);
- PERL_SET_CONTEXT(pmcf->perl);
-
- rc = ngx_http_perl_call_handler(aTHX_ r, pmcf->nginx, pv->sub, NULL,
- &pv->handler, &value);
-
- }
-
- if (value.data) {
- v->len = value.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = value.data;
-
- } else {
- v->not_found = 1;
- }
-
- ctx->filename.data = NULL;
- ctx->redirect_uri.len = 0;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl variable done");
-
- return rc;
-}
-
-
-#if (NGX_HTTP_SSI)
-
-static ngx_int_t
-ngx_http_perl_ssi(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ssi_ctx,
- ngx_str_t **params)
-{
- SV *sv, **asv;
- ngx_int_t rc;
- ngx_str_t *handler, **args;
- ngx_uint_t i;
- ngx_http_perl_ctx_t *ctx;
- ngx_http_perl_main_conf_t *pmcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl ssi handler");
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_perl_module);
-
- if (ctx == NULL) {
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_http_perl_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_perl_module);
- }
-
- pmcf = ngx_http_get_module_main_conf(r, ngx_http_perl_module);
-
- ctx->ssi = ssi_ctx;
-
- handler = params[NGX_HTTP_PERL_SSI_SUB];
- handler->data[handler->len] = '\0';
-
- {
-
- dTHXa(pmcf->perl);
- PERL_SET_CONTEXT(pmcf->perl);
-
-#if 0
-
- /* the code is disabled to force the precompiled perl code using only */
-
- ngx_http_perl_eval_anon_sub(aTHX_ handler, &sv);
-
- if (sv == &PL_sv_undef) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "eval_pv(\"%V\") failed", handler);
- return NGX_ERROR;
- }
-
- if (sv == NULL) {
- sv = newSVpvn((char *) handler->data, handler->len);
- }
-
-#endif
-
- sv = newSVpvn((char *) handler->data, handler->len);
-
- args = &params[NGX_HTTP_PERL_SSI_ARG];
-
- if (args) {
-
- for (i = 0; args[i]; i++) { /* void */ }
-
- asv = ngx_pcalloc(r->pool, (i + 1) * sizeof(SV *));
-
- if (asv == NULL) {
- SvREFCNT_dec(sv);
- return NGX_ERROR;
- }
-
- asv[0] = (SV *) (uintptr_t) i;
-
- for (i = 0; args[i]; i++) {
- asv[i + 1] = newSVpvn((char *) args[i]->data, args[i]->len);
- }
-
- } else {
- asv = NULL;
- }
-
- rc = ngx_http_perl_call_handler(aTHX_ r, pmcf->nginx, sv, asv, handler,
- NULL);
-
- SvREFCNT_dec(sv);
-
- }
-
- ctx->filename.data = NULL;
- ctx->redirect_uri.len = 0;
- ctx->ssi = NULL;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "perl ssi done");
-
- return rc;
-}
-
-#endif
-
-
-static char *
-ngx_http_perl_init_interpreter(ngx_conf_t *cf, ngx_http_perl_main_conf_t *pmcf)
-{
- ngx_str_t *m;
- ngx_uint_t i;
-#if (NGX_HAVE_PERL_MULTIPLICITY)
- ngx_pool_cleanup_t *cln;
-
- cln = ngx_pool_cleanup_add(cf->pool, 0);
- if (cln == NULL) {
- return NGX_CONF_ERROR;
- }
-
-#endif
-
-#ifdef NGX_PERL_MODULES
- if (pmcf->modules == NGX_CONF_UNSET_PTR) {
-
- pmcf->modules = ngx_array_create(cf->pool, 1, sizeof(ngx_str_t));
- if (pmcf->modules == NULL) {
- return NGX_CONF_ERROR;
- }
-
- m = ngx_array_push(pmcf->modules);
- if (m == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_str_set(m, NGX_PERL_MODULES);
- }
-#endif
-
- if (pmcf->modules != NGX_CONF_UNSET_PTR) {
- m = pmcf->modules->elts;
- for (i = 0; i < pmcf->modules->nelts; i++) {
- if (ngx_conf_full_name(cf->cycle, &m[i], 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
- }
-
-#if !(NGX_HAVE_PERL_MULTIPLICITY)
-
- if (perl) {
-
- if (ngx_set_environment(cf->cycle, NULL) == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_http_perl_run_requires(aTHX_ pmcf->requires, cf->log)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- pmcf->perl = perl;
- pmcf->nginx = nginx_stash;
-
- return NGX_CONF_OK;
- }
-
-#endif
-
- if (nginx_stash == NULL) {
- PERL_SYS_INIT(&ngx_argc, &ngx_argv);
- }
-
- pmcf->perl = ngx_http_perl_create_interpreter(cf, pmcf);
-
- if (pmcf->perl == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pmcf->nginx = nginx_stash;
-
-#if (NGX_HAVE_PERL_MULTIPLICITY)
-
- cln->handler = ngx_http_perl_cleanup_perl;
- cln->data = pmcf->perl;
-
-#else
-
- perl = pmcf->perl;
-
-#endif
-
- return NGX_CONF_OK;
-}
-
-
-static PerlInterpreter *
-ngx_http_perl_create_interpreter(ngx_conf_t *cf,
- ngx_http_perl_main_conf_t *pmcf)
-{
- int n;
- STRLEN len;
- SV *sv;
- char *ver, **embedding;
- ngx_str_t *m;
- ngx_uint_t i;
- PerlInterpreter *perl;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cf->log, 0, "create perl interpreter");
-
- if (ngx_set_environment(cf->cycle, NULL) == NULL) {
- return NULL;
- }
-
- perl = perl_alloc();
- if (perl == NULL) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, 0, "perl_alloc() failed");
- return NULL;
- }
-
- {
-
- dTHXa(perl);
- PERL_SET_CONTEXT(perl);
-
- perl_construct(perl);
-
-#ifdef PERL_EXIT_DESTRUCT_END
- PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
-#endif
-
- n = (pmcf->modules != NGX_CONF_UNSET_PTR) ? pmcf->modules->nelts * 2 : 0;
-
- embedding = ngx_palloc(cf->pool, (5 + n) * sizeof(char *));
- if (embedding == NULL) {
- goto fail;
- }
-
- embedding[0] = "";
-
- if (n++) {
- m = pmcf->modules->elts;
- for (i = 0; i < pmcf->modules->nelts; i++) {
- embedding[2 * i + 1] = "-I";
- embedding[2 * i + 2] = (char *) m[i].data;
- }
- }
-
- embedding[n++] = "-Mnginx";
- embedding[n++] = "-e";
- embedding[n++] = "0";
- embedding[n] = NULL;
-
- n = perl_parse(perl, ngx_http_perl_xs_init, n, embedding, NULL);
-
- if (n != 0) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, 0, "perl_parse() failed: %d", n);
- goto fail;
- }
-
- sv = get_sv("nginx::VERSION", FALSE);
- ver = SvPV(sv, len);
-
- if (ngx_strcmp(ver, NGINX_VERSION) != 0) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, 0,
- "version " NGINX_VERSION " of nginx.pm is required, "
- "but %s was found", ver);
- goto fail;
- }
-
- if (ngx_http_perl_run_requires(aTHX_ pmcf->requires, cf->log) != NGX_OK) {
- goto fail;
- }
-
- }
-
- return perl;
-
-fail:
-
- (void) perl_destruct(perl);
-
- perl_free(perl);
-
- return NULL;
-}
-
-
-static ngx_int_t
-ngx_http_perl_run_requires(pTHX_ ngx_array_t *requires, ngx_log_t *log)
-{
- u_char *err;
- STRLEN len;
- ngx_str_t *script;
- ngx_uint_t i;
-
- if (requires == NGX_CONF_UNSET_PTR) {
- return NGX_OK;
- }
-
- script = requires->elts;
- for (i = 0; i < requires->nelts; i++) {
-
- require_pv((char *) script[i].data);
-
- if (SvTRUE(ERRSV)) {
-
- err = (u_char *) SvPV(ERRSV, len);
- while (--len && (err[len] == CR || err[len] == LF)) { /* void */ }
-
- ngx_log_error(NGX_LOG_EMERG, log, 0,
- "require_pv(\"%s\") failed: \"%*s\"",
- script[i].data, len + 1, err);
-
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_perl_call_handler(pTHX_ ngx_http_request_t *r, HV *nginx, SV *sub,
- SV **args, ngx_str_t *handler, ngx_str_t *rv)
-{
- SV *sv;
- int n, status;
- char *line;
- u_char *err;
- STRLEN len, n_a;
- ngx_uint_t i;
- ngx_connection_t *c;
-
- dSP;
-
- status = 0;
-
- ENTER;
- SAVETMPS;
-
- PUSHMARK(sp);
-
- sv = sv_2mortal(sv_bless(newRV_noinc(newSViv(PTR2IV(r))), nginx));
- XPUSHs(sv);
-
- if (args) {
- EXTEND(sp, (intptr_t) args[0]);
-
- for (i = 1; i <= (uintptr_t) args[0]; i++) {
- PUSHs(sv_2mortal(args[i]));
- }
- }
-
- PUTBACK;
-
- c = r->connection;
-
- n = call_sv(sub, G_EVAL);
-
- SPAGAIN;
-
- if (n) {
- if (rv == NULL) {
- status = POPi;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "call_sv: %d", status);
-
- } else {
- line = SvPVx(POPs, n_a);
- rv->len = n_a;
-
- rv->data = ngx_pnalloc(r->pool, n_a);
- if (rv->data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(rv->data, line, n_a);
- }
- }
-
- PUTBACK;
-
- FREETMPS;
- LEAVE;
-
- /* check $@ */
-
- if (SvTRUE(ERRSV)) {
-
- err = (u_char *) SvPV(ERRSV, len);
- while (--len && (err[len] == CR || err[len] == LF)) { /* void */ }
-
- ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "call_sv(\"%V\") failed: \"%*s\"", handler, len + 1, err);
-
- if (rv) {
- return NGX_ERROR;
- }
-
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (n != 1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "call_sv(\"%V\") returned %d results", handler, n);
- status = NGX_OK;
- }
-
- if (rv) {
- return NGX_OK;
- }
-
- return (ngx_int_t) status;
-}
-
-
-static void
-ngx_http_perl_eval_anon_sub(pTHX_ ngx_str_t *handler, SV **sv)
-{
- u_char *p;
-
- for (p = handler->data; *p; p++) {
- if (*p != ' ' && *p != '\t' && *p != CR && *p != LF) {
- break;
- }
- }
-
- if (ngx_strncmp(p, "sub ", 4) == 0
- || ngx_strncmp(p, "sub{", 4) == 0
- || ngx_strncmp(p, "use ", 4) == 0)
- {
- *sv = eval_pv((char *) p, FALSE);
-
- /* eval_pv() does not set ERRSV on failure */
-
- return;
- }
-
- *sv = NULL;
-}
-
-
-static void *
-ngx_http_perl_create_main_conf(ngx_conf_t *cf)
-{
- ngx_http_perl_main_conf_t *pmcf;
-
- pmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_perl_main_conf_t));
- if (pmcf == NULL) {
- return NULL;
- }
-
- pmcf->modules = NGX_CONF_UNSET_PTR;
- pmcf->requires = NGX_CONF_UNSET_PTR;
-
- return pmcf;
-}
-
-
-static char *
-ngx_http_perl_init_main_conf(ngx_conf_t *cf, void *conf)
-{
- ngx_http_perl_main_conf_t *pmcf = conf;
-
- if (pmcf->perl == NULL) {
- if (ngx_http_perl_init_interpreter(cf, pmcf) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- return NGX_CONF_OK;
-}
-
-
-#if (NGX_HAVE_PERL_MULTIPLICITY)
-
-static void
-ngx_http_perl_cleanup_perl(void *data)
-{
- PerlInterpreter *perl = data;
-
- PERL_SET_CONTEXT(perl);
-
- (void) perl_destruct(perl);
-
- perl_free(perl);
-
- if (ngx_perl_term) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0, "perl term");
-
- PERL_SYS_TERM();
- }
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_perl_preconfiguration(ngx_conf_t *cf)
-{
-#if (NGX_HTTP_SSI)
- ngx_int_t rc;
- ngx_http_ssi_main_conf_t *smcf;
-
- smcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_ssi_filter_module);
-
- rc = ngx_hash_add_key(&smcf->commands, &ngx_http_perl_ssi_command.name,
- &ngx_http_perl_ssi_command, NGX_HASH_READONLY_KEY);
-
- if (rc != NGX_OK) {
- if (rc == NGX_BUSY) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "conflicting SSI command \"%V\"",
- &ngx_http_perl_ssi_command.name);
- }
-
- return NGX_ERROR;
- }
-#endif
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_perl_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_perl_loc_conf_t *plcf;
-
- plcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_perl_loc_conf_t));
- if (plcf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * plcf->handler = { 0, NULL };
- */
-
- return plcf;
-}
-
-
-static char *
-ngx_http_perl_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_perl_loc_conf_t *prev = parent;
- ngx_http_perl_loc_conf_t *conf = child;
-
- if (conf->sub == NULL) {
- conf->sub = prev->sub;
- conf->handler = prev->handler;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_perl(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_perl_loc_conf_t *plcf = conf;
-
- ngx_str_t *value;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_perl_main_conf_t *pmcf;
-
- value = cf->args->elts;
-
- if (plcf->handler.data) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate perl handler \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- pmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_perl_module);
-
- if (pmcf->perl == NULL) {
- if (ngx_http_perl_init_interpreter(cf, pmcf) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- plcf->handler = value[1];
-
- {
-
- dTHXa(pmcf->perl);
- PERL_SET_CONTEXT(pmcf->perl);
-
- ngx_http_perl_eval_anon_sub(aTHX_ &value[1], &plcf->sub);
-
- if (plcf->sub == &PL_sv_undef) {
- ngx_conf_log_error(NGX_LOG_ERR, cf, 0,
- "eval_pv(\"%V\") failed", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- if (plcf->sub == NULL) {
- plcf->sub = newSVpvn((char *) value[1].data, value[1].len);
- }
-
- }
-
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
- clcf->handler = ngx_http_perl_handler;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_perl_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_int_t index;
- ngx_str_t *value;
- ngx_http_variable_t *v;
- ngx_http_perl_variable_t *pv;
- ngx_http_perl_main_conf_t *pmcf;
-
- value = cf->args->elts;
-
- if (value[1].data[0] != '$') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- value[1].len--;
- value[1].data++;
-
- v = ngx_http_add_variable(cf, &value[1], NGX_HTTP_VAR_CHANGEABLE);
- if (v == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pv = ngx_palloc(cf->pool, sizeof(ngx_http_perl_variable_t));
- if (pv == NULL) {
- return NGX_CONF_ERROR;
- }
-
- index = ngx_http_get_variable_index(cf, &value[1]);
- if (index == NGX_ERROR) {
- return NGX_CONF_ERROR;
- }
-
- pmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_perl_module);
-
- if (pmcf->perl == NULL) {
- if (ngx_http_perl_init_interpreter(cf, pmcf) != NGX_CONF_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- pv->handler = value[2];
-
- {
-
- dTHXa(pmcf->perl);
- PERL_SET_CONTEXT(pmcf->perl);
-
- ngx_http_perl_eval_anon_sub(aTHX_ &value[2], &pv->sub);
-
- if (pv->sub == &PL_sv_undef) {
- ngx_conf_log_error(NGX_LOG_ERR, cf, 0,
- "eval_pv(\"%V\") failed", &value[2]);
- return NGX_CONF_ERROR;
- }
-
- if (pv->sub == NULL) {
- pv->sub = newSVpvn((char *) value[2].data, value[2].len);
- }
-
- }
-
- v->get_handler = ngx_http_perl_variable;
- v->data = (uintptr_t) pv;
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_perl_init_worker(ngx_cycle_t *cycle)
-{
- ngx_http_perl_main_conf_t *pmcf;
-
- pmcf = ngx_http_cycle_get_module_main_conf(cycle, ngx_http_perl_module);
-
- if (pmcf) {
- dTHXa(pmcf->perl);
- PERL_SET_CONTEXT(pmcf->perl);
-
- /* set worker's $$ */
-
- sv_setiv(GvSV(gv_fetchpv("$", TRUE, SVt_PV)), (I32) ngx_pid);
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_perl_exit(ngx_cycle_t *cycle)
-{
-#if (NGX_HAVE_PERL_MULTIPLICITY)
-
- /*
- * the master exit hook is run before global pool cleanup,
- * therefore just set flag here
- */
-
- ngx_perl_term = 1;
-
-#else
-
- if (nginx_stash) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, cycle->log, 0, "perl term");
-
- (void) perl_destruct(perl);
-
- perl_free(perl);
-
- PERL_SYS_TERM();
- }
-
-#endif
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.h
deleted file mode 100644
index 5e60b031ec2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/ngx_http_perl_module.h
+++ /dev/null
@@ -1,67 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_PERL_MODULE_H_INCLUDED_
-#define _NGX_HTTP_PERL_MODULE_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <nginx.h>
-
-#include <EXTERN.h>
-#include <perl.h>
-
-
-typedef ngx_http_request_t *nginx;
-
-typedef struct {
- ngx_str_t filename;
- ngx_str_t redirect_uri;
- ngx_str_t redirect_args;
-
- SV *next;
-
- ngx_uint_t done; /* unsigned done:1; */
-
- ngx_array_t *variables; /* array of ngx_http_perl_var_t */
-
-#if (NGX_HTTP_SSI)
- ngx_http_ssi_ctx_t *ssi;
-#endif
-} ngx_http_perl_ctx_t;
-
-
-typedef struct {
- ngx_uint_t hash;
- ngx_str_t name;
- ngx_str_t value;
-} ngx_http_perl_var_t;
-
-
-extern ngx_module_t ngx_http_perl_module;
-
-
-/*
- * workaround for "unused variable `Perl___notused'" warning
- * when building with perl 5.6.1
- */
-#ifndef PERL_IMPLICIT_CONTEXT
-#undef dTHXa
-#define dTHXa(a)
-#endif
-
-
-extern void boot_DynaLoader(pTHX_ CV* cv);
-
-
-void ngx_http_perl_handle_request(ngx_http_request_t *r);
-void ngx_http_perl_sleep_handler(ngx_http_request_t *r);
-
-
-#endif /* _NGX_HTTP_PERL_MODULE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/typemap b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/typemap
deleted file mode 100644
index e2f1a4c6af6..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/modules/perl/typemap
+++ /dev/null
@@ -1,3 +0,0 @@
-TYPEMAP
-
-nginx T_PTROBJ
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.c
deleted file mode 100644
index 9c8d6cba48e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.c
+++ /dev/null
@@ -1,2122 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static char *ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static ngx_int_t ngx_http_init_phases(ngx_conf_t *cf,
- ngx_http_core_main_conf_t *cmcf);
-static ngx_int_t ngx_http_init_headers_in_hash(ngx_conf_t *cf,
- ngx_http_core_main_conf_t *cmcf);
-static ngx_int_t ngx_http_init_phase_handlers(ngx_conf_t *cf,
- ngx_http_core_main_conf_t *cmcf);
-
-static ngx_int_t ngx_http_add_addresses(ngx_conf_t *cf,
- ngx_http_core_srv_conf_t *cscf, ngx_http_conf_port_t *port,
- ngx_http_listen_opt_t *lsopt);
-static ngx_int_t ngx_http_add_address(ngx_conf_t *cf,
- ngx_http_core_srv_conf_t *cscf, ngx_http_conf_port_t *port,
- ngx_http_listen_opt_t *lsopt);
-static ngx_int_t ngx_http_add_server(ngx_conf_t *cf,
- ngx_http_core_srv_conf_t *cscf, ngx_http_conf_addr_t *addr);
-
-static char *ngx_http_merge_servers(ngx_conf_t *cf,
- ngx_http_core_main_conf_t *cmcf, ngx_http_module_t *module,
- ngx_uint_t ctx_index);
-static char *ngx_http_merge_locations(ngx_conf_t *cf,
- ngx_queue_t *locations, void **loc_conf, ngx_http_module_t *module,
- ngx_uint_t ctx_index);
-static ngx_int_t ngx_http_init_locations(ngx_conf_t *cf,
- ngx_http_core_srv_conf_t *cscf, ngx_http_core_loc_conf_t *pclcf);
-static ngx_int_t ngx_http_init_static_location_trees(ngx_conf_t *cf,
- ngx_http_core_loc_conf_t *pclcf);
-static ngx_int_t ngx_http_cmp_locations(const ngx_queue_t *one,
- const ngx_queue_t *two);
-static ngx_int_t ngx_http_join_exact_locations(ngx_conf_t *cf,
- ngx_queue_t *locations);
-static void ngx_http_create_locations_list(ngx_queue_t *locations,
- ngx_queue_t *q);
-static ngx_http_location_tree_node_t *
- ngx_http_create_locations_tree(ngx_conf_t *cf, ngx_queue_t *locations,
- size_t prefix);
-
-static ngx_int_t ngx_http_optimize_servers(ngx_conf_t *cf,
- ngx_http_core_main_conf_t *cmcf, ngx_array_t *ports);
-static ngx_int_t ngx_http_server_names(ngx_conf_t *cf,
- ngx_http_core_main_conf_t *cmcf, ngx_http_conf_addr_t *addr);
-static ngx_int_t ngx_http_cmp_conf_addrs(const void *one, const void *two);
-static int ngx_libc_cdecl ngx_http_cmp_dns_wildcards(const void *one,
- const void *two);
-
-static ngx_int_t ngx_http_init_listening(ngx_conf_t *cf,
- ngx_http_conf_port_t *port);
-static ngx_listening_t *ngx_http_add_listening(ngx_conf_t *cf,
- ngx_http_conf_addr_t *addr);
-static ngx_int_t ngx_http_add_addrs(ngx_conf_t *cf, ngx_http_port_t *hport,
- ngx_http_conf_addr_t *addr);
-#if (NGX_HAVE_INET6)
-static ngx_int_t ngx_http_add_addrs6(ngx_conf_t *cf, ngx_http_port_t *hport,
- ngx_http_conf_addr_t *addr);
-#endif
-
-ngx_uint_t ngx_http_max_module;
-
-
-ngx_int_t (*ngx_http_top_header_filter) (ngx_http_request_t *r);
-ngx_int_t (*ngx_http_top_body_filter) (ngx_http_request_t *r, ngx_chain_t *ch);
-
-
-ngx_str_t ngx_http_html_default_types[] = {
- ngx_string("text/html"),
- ngx_null_string
-};
-
-
-static ngx_command_t ngx_http_commands[] = {
-
- { ngx_string("http"),
- NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
- ngx_http_block,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_core_module_t ngx_http_module_ctx = {
- ngx_string("http"),
- NULL,
- NULL
-};
-
-
-ngx_module_t ngx_http_module = {
- NGX_MODULE_V1,
- &ngx_http_module_ctx, /* module context */
- ngx_http_commands, /* module directives */
- NGX_CORE_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static char *
-ngx_http_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *rv;
- ngx_uint_t mi, m, s;
- ngx_conf_t pcf;
- ngx_http_module_t *module;
- ngx_http_conf_ctx_t *ctx;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t **cscfp;
- ngx_http_core_main_conf_t *cmcf;
-
- /* the main http context */
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *(ngx_http_conf_ctx_t **) conf = ctx;
-
-
- /* count the number of the http modules and set up their indices */
-
- ngx_http_max_module = 0;
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- ngx_modules[m]->ctx_index = ngx_http_max_module++;
- }
-
-
- /* the http main_conf context, it is the same in the all http contexts */
-
- ctx->main_conf = ngx_pcalloc(cf->pool,
- sizeof(void *) * ngx_http_max_module);
- if (ctx->main_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
-
- /*
- * the http null srv_conf context, it is used to merge
- * the server{}s' srv_conf's
- */
-
- ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
- if (ctx->srv_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
-
- /*
- * the http null loc_conf context, it is used to merge
- * the server{}s' loc_conf's
- */
-
- ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
- if (ctx->loc_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
-
- /*
- * create the main_conf's, the null srv_conf's, and the null loc_conf's
- * of the all http modules
- */
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
- mi = ngx_modules[m]->ctx_index;
-
- if (module->create_main_conf) {
- ctx->main_conf[mi] = module->create_main_conf(cf);
- if (ctx->main_conf[mi] == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- if (module->create_srv_conf) {
- ctx->srv_conf[mi] = module->create_srv_conf(cf);
- if (ctx->srv_conf[mi] == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- if (module->create_loc_conf) {
- ctx->loc_conf[mi] = module->create_loc_conf(cf);
- if (ctx->loc_conf[mi] == NULL) {
- return NGX_CONF_ERROR;
- }
- }
- }
-
- pcf = *cf;
- cf->ctx = ctx;
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
-
- if (module->preconfiguration) {
- if (module->preconfiguration(cf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
- }
-
- /* parse inside the http{} block */
-
- cf->module_type = NGX_HTTP_MODULE;
- cf->cmd_type = NGX_HTTP_MAIN_CONF;
- rv = ngx_conf_parse(cf, NULL);
-
- if (rv != NGX_CONF_OK) {
- goto failed;
- }
-
- /*
- * init http{} main_conf's, merge the server{}s' srv_conf's
- * and its location{}s' loc_conf's
- */
-
- cmcf = ctx->main_conf[ngx_http_core_module.ctx_index];
- cscfp = cmcf->servers.elts;
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
- mi = ngx_modules[m]->ctx_index;
-
- /* init http{} main_conf's */
-
- if (module->init_main_conf) {
- rv = module->init_main_conf(cf, ctx->main_conf[mi]);
- if (rv != NGX_CONF_OK) {
- goto failed;
- }
- }
-
- rv = ngx_http_merge_servers(cf, cmcf, module, mi);
- if (rv != NGX_CONF_OK) {
- goto failed;
- }
- }
-
-
- /* create location trees */
-
- for (s = 0; s < cmcf->servers.nelts; s++) {
-
- clcf = cscfp[s]->ctx->loc_conf[ngx_http_core_module.ctx_index];
-
- if (ngx_http_init_locations(cf, cscfp[s], clcf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_http_init_static_location_trees(cf, clcf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
-
- if (ngx_http_init_phases(cf, cmcf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_http_init_headers_in_hash(cf, cmcf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
-
- if (module->postconfiguration) {
- if (module->postconfiguration(cf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
- }
-
- if (ngx_http_variables_init_vars(cf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- /*
- * http{}'s cf->ctx was needed while the configuration merging
- * and in postconfiguration process
- */
-
- *cf = pcf;
-
-
- if (ngx_http_init_phase_handlers(cf, cmcf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
-
- /* optimize the lists of ports, addresses and server names */
-
- if (ngx_http_optimize_servers(cf, cmcf, cmcf->ports) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-
-failed:
-
- *cf = pcf;
-
- return rv;
-}
-
-
-static ngx_int_t
-ngx_http_init_phases(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf)
-{
- if (ngx_array_init(&cmcf->phases[NGX_HTTP_POST_READ_PHASE].handlers,
- cf->pool, 1, sizeof(ngx_http_handler_pt))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&cmcf->phases[NGX_HTTP_SERVER_REWRITE_PHASE].handlers,
- cf->pool, 1, sizeof(ngx_http_handler_pt))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers,
- cf->pool, 1, sizeof(ngx_http_handler_pt))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&cmcf->phases[NGX_HTTP_PREACCESS_PHASE].handlers,
- cf->pool, 1, sizeof(ngx_http_handler_pt))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers,
- cf->pool, 2, sizeof(ngx_http_handler_pt))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&cmcf->phases[NGX_HTTP_CONTENT_PHASE].handlers,
- cf->pool, 4, sizeof(ngx_http_handler_pt))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&cmcf->phases[NGX_HTTP_LOG_PHASE].handlers,
- cf->pool, 1, sizeof(ngx_http_handler_pt))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_init_headers_in_hash(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf)
-{
- ngx_array_t headers_in;
- ngx_hash_key_t *hk;
- ngx_hash_init_t hash;
- ngx_http_header_t *header;
-
- if (ngx_array_init(&headers_in, cf->temp_pool, 32, sizeof(ngx_hash_key_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- for (header = ngx_http_headers_in; header->name.len; header++) {
- hk = ngx_array_push(&headers_in);
- if (hk == NULL) {
- return NGX_ERROR;
- }
-
- hk->key = header->name;
- hk->key_hash = ngx_hash_key_lc(header->name.data, header->name.len);
- hk->value = header;
- }
-
- hash.hash = &cmcf->headers_in_hash;
- hash.key = ngx_hash_key_lc;
- hash.max_size = 512;
- hash.bucket_size = ngx_align(64, ngx_cacheline_size);
- hash.name = "headers_in_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- if (ngx_hash_init(&hash, headers_in.elts, headers_in.nelts) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_init_phase_handlers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf)
-{
- ngx_int_t j;
- ngx_uint_t i, n;
- ngx_uint_t find_config_index, use_rewrite, use_access;
- ngx_http_handler_pt *h;
- ngx_http_phase_handler_t *ph;
- ngx_http_phase_handler_pt checker;
-
- cmcf->phase_engine.server_rewrite_index = (ngx_uint_t) -1;
- cmcf->phase_engine.location_rewrite_index = (ngx_uint_t) -1;
- find_config_index = 0;
- use_rewrite = cmcf->phases[NGX_HTTP_REWRITE_PHASE].handlers.nelts ? 1 : 0;
- use_access = cmcf->phases[NGX_HTTP_ACCESS_PHASE].handlers.nelts ? 1 : 0;
-
- n = use_rewrite + use_access + cmcf->try_files + 1 /* find config phase */;
-
- for (i = 0; i < NGX_HTTP_LOG_PHASE; i++) {
- n += cmcf->phases[i].handlers.nelts;
- }
-
- ph = ngx_pcalloc(cf->pool,
- n * sizeof(ngx_http_phase_handler_t) + sizeof(void *));
- if (ph == NULL) {
- return NGX_ERROR;
- }
-
- cmcf->phase_engine.handlers = ph;
- n = 0;
-
- for (i = 0; i < NGX_HTTP_LOG_PHASE; i++) {
- h = cmcf->phases[i].handlers.elts;
-
- switch (i) {
-
- case NGX_HTTP_SERVER_REWRITE_PHASE:
- if (cmcf->phase_engine.server_rewrite_index == (ngx_uint_t) -1) {
- cmcf->phase_engine.server_rewrite_index = n;
- }
- checker = ngx_http_core_rewrite_phase;
-
- break;
-
- case NGX_HTTP_FIND_CONFIG_PHASE:
- find_config_index = n;
-
- ph->checker = ngx_http_core_find_config_phase;
- n++;
- ph++;
-
- continue;
-
- case NGX_HTTP_REWRITE_PHASE:
- if (cmcf->phase_engine.location_rewrite_index == (ngx_uint_t) -1) {
- cmcf->phase_engine.location_rewrite_index = n;
- }
- checker = ngx_http_core_rewrite_phase;
-
- break;
-
- case NGX_HTTP_POST_REWRITE_PHASE:
- if (use_rewrite) {
- ph->checker = ngx_http_core_post_rewrite_phase;
- ph->next = find_config_index;
- n++;
- ph++;
- }
-
- continue;
-
- case NGX_HTTP_ACCESS_PHASE:
- checker = ngx_http_core_access_phase;
- n++;
- break;
-
- case NGX_HTTP_POST_ACCESS_PHASE:
- if (use_access) {
- ph->checker = ngx_http_core_post_access_phase;
- ph->next = n;
- ph++;
- }
-
- continue;
-
- case NGX_HTTP_TRY_FILES_PHASE:
- if (cmcf->try_files) {
- ph->checker = ngx_http_core_try_files_phase;
- n++;
- ph++;
- }
-
- continue;
-
- case NGX_HTTP_CONTENT_PHASE:
- checker = ngx_http_core_content_phase;
- break;
-
- default:
- checker = ngx_http_core_generic_phase;
- }
-
- n += cmcf->phases[i].handlers.nelts;
-
- for (j = cmcf->phases[i].handlers.nelts - 1; j >=0; j--) {
- ph->checker = checker;
- ph->handler = h[j];
- ph->next = n;
- ph++;
- }
- }
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_http_merge_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
- ngx_http_module_t *module, ngx_uint_t ctx_index)
-{
- char *rv;
- ngx_uint_t s;
- ngx_http_conf_ctx_t *ctx, saved;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t **cscfp;
-
- cscfp = cmcf->servers.elts;
- ctx = (ngx_http_conf_ctx_t *) cf->ctx;
- saved = *ctx;
- rv = NGX_CONF_OK;
-
- for (s = 0; s < cmcf->servers.nelts; s++) {
-
- /* merge the server{}s' srv_conf's */
-
- ctx->srv_conf = cscfp[s]->ctx->srv_conf;
-
- if (module->merge_srv_conf) {
- rv = module->merge_srv_conf(cf, saved.srv_conf[ctx_index],
- cscfp[s]->ctx->srv_conf[ctx_index]);
- if (rv != NGX_CONF_OK) {
- goto failed;
- }
- }
-
- if (module->merge_loc_conf) {
-
- /* merge the server{}'s loc_conf */
-
- ctx->loc_conf = cscfp[s]->ctx->loc_conf;
-
- rv = module->merge_loc_conf(cf, saved.loc_conf[ctx_index],
- cscfp[s]->ctx->loc_conf[ctx_index]);
- if (rv != NGX_CONF_OK) {
- goto failed;
- }
-
- /* merge the locations{}' loc_conf's */
-
- clcf = cscfp[s]->ctx->loc_conf[ngx_http_core_module.ctx_index];
-
- rv = ngx_http_merge_locations(cf, clcf->locations,
- cscfp[s]->ctx->loc_conf,
- module, ctx_index);
- if (rv != NGX_CONF_OK) {
- goto failed;
- }
- }
- }
-
-failed:
-
- *ctx = saved;
-
- return rv;
-}
-
-
-static char *
-ngx_http_merge_locations(ngx_conf_t *cf, ngx_queue_t *locations,
- void **loc_conf, ngx_http_module_t *module, ngx_uint_t ctx_index)
-{
- char *rv;
- ngx_queue_t *q;
- ngx_http_conf_ctx_t *ctx, saved;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_location_queue_t *lq;
-
- if (locations == NULL) {
- return NGX_CONF_OK;
- }
-
- ctx = (ngx_http_conf_ctx_t *) cf->ctx;
- saved = *ctx;
-
- for (q = ngx_queue_head(locations);
- q != ngx_queue_sentinel(locations);
- q = ngx_queue_next(q))
- {
- lq = (ngx_http_location_queue_t *) q;
-
- clcf = lq->exact ? lq->exact : lq->inclusive;
- ctx->loc_conf = clcf->loc_conf;
-
- rv = module->merge_loc_conf(cf, loc_conf[ctx_index],
- clcf->loc_conf[ctx_index]);
- if (rv != NGX_CONF_OK) {
- return rv;
- }
-
- rv = ngx_http_merge_locations(cf, clcf->locations, clcf->loc_conf,
- module, ctx_index);
- if (rv != NGX_CONF_OK) {
- return rv;
- }
- }
-
- *ctx = saved;
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_init_locations(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
- ngx_http_core_loc_conf_t *pclcf)
-{
- ngx_uint_t n;
- ngx_queue_t *q, *locations, *named, tail;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_location_queue_t *lq;
- ngx_http_core_loc_conf_t **clcfp;
-#if (NGX_PCRE)
- ngx_uint_t r;
- ngx_queue_t *regex;
-#endif
-
- locations = pclcf->locations;
-
- if (locations == NULL) {
- return NGX_OK;
- }
-
- ngx_queue_sort(locations, ngx_http_cmp_locations);
-
- named = NULL;
- n = 0;
-#if (NGX_PCRE)
- regex = NULL;
- r = 0;
-#endif
-
- for (q = ngx_queue_head(locations);
- q != ngx_queue_sentinel(locations);
- q = ngx_queue_next(q))
- {
- lq = (ngx_http_location_queue_t *) q;
-
- clcf = lq->exact ? lq->exact : lq->inclusive;
-
- if (ngx_http_init_locations(cf, NULL, clcf) != NGX_OK) {
- return NGX_ERROR;
- }
-
-#if (NGX_PCRE)
-
- if (clcf->regex) {
- r++;
-
- if (regex == NULL) {
- regex = q;
- }
-
- continue;
- }
-
-#endif
-
- if (clcf->named) {
- n++;
-
- if (named == NULL) {
- named = q;
- }
-
- continue;
- }
-
- if (clcf->noname) {
- break;
- }
- }
-
- if (q != ngx_queue_sentinel(locations)) {
- ngx_queue_split(locations, q, &tail);
- }
-
- if (named) {
- clcfp = ngx_palloc(cf->pool,
- (n + 1) * sizeof(ngx_http_core_loc_conf_t *));
- if (clcfp == NULL) {
- return NGX_ERROR;
- }
-
- cscf->named_locations = clcfp;
-
- for (q = named;
- q != ngx_queue_sentinel(locations);
- q = ngx_queue_next(q))
- {
- lq = (ngx_http_location_queue_t *) q;
-
- *(clcfp++) = lq->exact;
- }
-
- *clcfp = NULL;
-
- ngx_queue_split(locations, named, &tail);
- }
-
-#if (NGX_PCRE)
-
- if (regex) {
-
- clcfp = ngx_palloc(cf->pool,
- (r + 1) * sizeof(ngx_http_core_loc_conf_t *));
- if (clcfp == NULL) {
- return NGX_ERROR;
- }
-
- pclcf->regex_locations = clcfp;
-
- for (q = regex;
- q != ngx_queue_sentinel(locations);
- q = ngx_queue_next(q))
- {
- lq = (ngx_http_location_queue_t *) q;
-
- *(clcfp++) = lq->exact;
- }
-
- *clcfp = NULL;
-
- ngx_queue_split(locations, regex, &tail);
- }
-
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_init_static_location_trees(ngx_conf_t *cf,
- ngx_http_core_loc_conf_t *pclcf)
-{
- ngx_queue_t *q, *locations;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_location_queue_t *lq;
-
- locations = pclcf->locations;
-
- if (locations == NULL) {
- return NGX_OK;
- }
-
- if (ngx_queue_empty(locations)) {
- return NGX_OK;
- }
-
- for (q = ngx_queue_head(locations);
- q != ngx_queue_sentinel(locations);
- q = ngx_queue_next(q))
- {
- lq = (ngx_http_location_queue_t *) q;
-
- clcf = lq->exact ? lq->exact : lq->inclusive;
-
- if (ngx_http_init_static_location_trees(cf, clcf) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- if (ngx_http_join_exact_locations(cf, locations) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_http_create_locations_list(locations, ngx_queue_head(locations));
-
- pclcf->static_locations = ngx_http_create_locations_tree(cf, locations, 0);
- if (pclcf->static_locations == NULL) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_add_location(ngx_conf_t *cf, ngx_queue_t **locations,
- ngx_http_core_loc_conf_t *clcf)
-{
- ngx_http_location_queue_t *lq;
-
- if (*locations == NULL) {
- *locations = ngx_palloc(cf->temp_pool,
- sizeof(ngx_http_location_queue_t));
- if (*locations == NULL) {
- return NGX_ERROR;
- }
-
- ngx_queue_init(*locations);
- }
-
- lq = ngx_palloc(cf->temp_pool, sizeof(ngx_http_location_queue_t));
- if (lq == NULL) {
- return NGX_ERROR;
- }
-
- if (clcf->exact_match
-#if (NGX_PCRE)
- || clcf->regex
-#endif
- || clcf->named || clcf->noname)
- {
- lq->exact = clcf;
- lq->inclusive = NULL;
-
- } else {
- lq->exact = NULL;
- lq->inclusive = clcf;
- }
-
- lq->name = &clcf->name;
- lq->file_name = cf->conf_file->file.name.data;
- lq->line = cf->conf_file->line;
-
- ngx_queue_init(&lq->list);
-
- ngx_queue_insert_tail(*locations, &lq->queue);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_cmp_locations(const ngx_queue_t *one, const ngx_queue_t *two)
-{
- ngx_int_t rc;
- ngx_http_core_loc_conf_t *first, *second;
- ngx_http_location_queue_t *lq1, *lq2;
-
- lq1 = (ngx_http_location_queue_t *) one;
- lq2 = (ngx_http_location_queue_t *) two;
-
- first = lq1->exact ? lq1->exact : lq1->inclusive;
- second = lq2->exact ? lq2->exact : lq2->inclusive;
-
- if (first->noname && !second->noname) {
- /* shift no named locations to the end */
- return 1;
- }
-
- if (!first->noname && second->noname) {
- /* shift no named locations to the end */
- return -1;
- }
-
- if (first->noname || second->noname) {
- /* do not sort no named locations */
- return 0;
- }
-
- if (first->named && !second->named) {
- /* shift named locations to the end */
- return 1;
- }
-
- if (!first->named && second->named) {
- /* shift named locations to the end */
- return -1;
- }
-
- if (first->named && second->named) {
- return ngx_strcmp(first->name.data, second->name.data);
- }
-
-#if (NGX_PCRE)
-
- if (first->regex && !second->regex) {
- /* shift the regex matches to the end */
- return 1;
- }
-
- if (!first->regex && second->regex) {
- /* shift the regex matches to the end */
- return -1;
- }
-
- if (first->regex || second->regex) {
- /* do not sort the regex matches */
- return 0;
- }
-
-#endif
-
- rc = ngx_filename_cmp(first->name.data, second->name.data,
- ngx_min(first->name.len, second->name.len) + 1);
-
- if (rc == 0 && !first->exact_match && second->exact_match) {
- /* an exact match must be before the same inclusive one */
- return 1;
- }
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_join_exact_locations(ngx_conf_t *cf, ngx_queue_t *locations)
-{
- ngx_queue_t *q, *x;
- ngx_http_location_queue_t *lq, *lx;
-
- q = ngx_queue_head(locations);
-
- while (q != ngx_queue_last(locations)) {
-
- x = ngx_queue_next(q);
-
- lq = (ngx_http_location_queue_t *) q;
- lx = (ngx_http_location_queue_t *) x;
-
- if (lq->name->len == lx->name->len
- && ngx_filename_cmp(lq->name->data, lx->name->data, lx->name->len)
- == 0)
- {
- if ((lq->exact && lx->exact) || (lq->inclusive && lx->inclusive)) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "duplicate location \"%V\" in %s:%ui",
- lx->name, lx->file_name, lx->line);
-
- return NGX_ERROR;
- }
-
- lq->inclusive = lx->inclusive;
-
- ngx_queue_remove(x);
-
- continue;
- }
-
- q = ngx_queue_next(q);
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_create_locations_list(ngx_queue_t *locations, ngx_queue_t *q)
-{
- u_char *name;
- size_t len;
- ngx_queue_t *x, tail;
- ngx_http_location_queue_t *lq, *lx;
-
- if (q == ngx_queue_last(locations)) {
- return;
- }
-
- lq = (ngx_http_location_queue_t *) q;
-
- if (lq->inclusive == NULL) {
- ngx_http_create_locations_list(locations, ngx_queue_next(q));
- return;
- }
-
- len = lq->name->len;
- name = lq->name->data;
-
- for (x = ngx_queue_next(q);
- x != ngx_queue_sentinel(locations);
- x = ngx_queue_next(x))
- {
- lx = (ngx_http_location_queue_t *) x;
-
- if (len > lx->name->len
- || ngx_filename_cmp(name, lx->name->data, len) != 0)
- {
- break;
- }
- }
-
- q = ngx_queue_next(q);
-
- if (q == x) {
- ngx_http_create_locations_list(locations, x);
- return;
- }
-
- ngx_queue_split(locations, q, &tail);
- ngx_queue_add(&lq->list, &tail);
-
- if (x == ngx_queue_sentinel(locations)) {
- ngx_http_create_locations_list(&lq->list, ngx_queue_head(&lq->list));
- return;
- }
-
- ngx_queue_split(&lq->list, x, &tail);
- ngx_queue_add(locations, &tail);
-
- ngx_http_create_locations_list(&lq->list, ngx_queue_head(&lq->list));
-
- ngx_http_create_locations_list(locations, x);
-}
-
-
-/*
- * to keep cache locality for left leaf nodes, allocate nodes in following
- * order: node, left subtree, right subtree, inclusive subtree
- */
-
-static ngx_http_location_tree_node_t *
-ngx_http_create_locations_tree(ngx_conf_t *cf, ngx_queue_t *locations,
- size_t prefix)
-{
- size_t len;
- ngx_queue_t *q, tail;
- ngx_http_location_queue_t *lq;
- ngx_http_location_tree_node_t *node;
-
- q = ngx_queue_middle(locations);
-
- lq = (ngx_http_location_queue_t *) q;
- len = lq->name->len - prefix;
-
- node = ngx_palloc(cf->pool,
- offsetof(ngx_http_location_tree_node_t, name) + len);
- if (node == NULL) {
- return NULL;
- }
-
- node->left = NULL;
- node->right = NULL;
- node->tree = NULL;
- node->exact = lq->exact;
- node->inclusive = lq->inclusive;
-
- node->auto_redirect = (u_char) ((lq->exact && lq->exact->auto_redirect)
- || (lq->inclusive && lq->inclusive->auto_redirect));
-
- node->len = (u_char) len;
- ngx_memcpy(node->name, &lq->name->data[prefix], len);
-
- ngx_queue_split(locations, q, &tail);
-
- if (ngx_queue_empty(locations)) {
- /*
- * ngx_queue_split() insures that if left part is empty,
- * then right one is empty too
- */
- goto inclusive;
- }
-
- node->left = ngx_http_create_locations_tree(cf, locations, prefix);
- if (node->left == NULL) {
- return NULL;
- }
-
- ngx_queue_remove(q);
-
- if (ngx_queue_empty(&tail)) {
- goto inclusive;
- }
-
- node->right = ngx_http_create_locations_tree(cf, &tail, prefix);
- if (node->right == NULL) {
- return NULL;
- }
-
-inclusive:
-
- if (ngx_queue_empty(&lq->list)) {
- return node;
- }
-
- node->tree = ngx_http_create_locations_tree(cf, &lq->list, prefix + len);
- if (node->tree == NULL) {
- return NULL;
- }
-
- return node;
-}
-
-
-ngx_int_t
-ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
- ngx_http_listen_opt_t *lsopt)
-{
- in_port_t p;
- ngx_uint_t i;
- struct sockaddr *sa;
- struct sockaddr_in *sin;
- ngx_http_conf_port_t *port;
- ngx_http_core_main_conf_t *cmcf;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- if (cmcf->ports == NULL) {
- cmcf->ports = ngx_array_create(cf->temp_pool, 2,
- sizeof(ngx_http_conf_port_t));
- if (cmcf->ports == NULL) {
- return NGX_ERROR;
- }
- }
-
- sa = &lsopt->u.sockaddr;
-
- switch (sa->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = &lsopt->u.sockaddr_in6;
- p = sin6->sin6_port;
- break;
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- p = 0;
- break;
-#endif
-
- default: /* AF_INET */
- sin = &lsopt->u.sockaddr_in;
- p = sin->sin_port;
- break;
- }
-
- port = cmcf->ports->elts;
- for (i = 0; i < cmcf->ports->nelts; i++) {
-
- if (p != port[i].port || sa->sa_family != port[i].family) {
- continue;
- }
-
- /* a port is already in the port list */
-
- return ngx_http_add_addresses(cf, cscf, &port[i], lsopt);
- }
-
- /* add a port to the port list */
-
- port = ngx_array_push(cmcf->ports);
- if (port == NULL) {
- return NGX_ERROR;
- }
-
- port->family = sa->sa_family;
- port->port = p;
- port->addrs.elts = NULL;
-
- return ngx_http_add_address(cf, cscf, port, lsopt);
-}
-
-
-static ngx_int_t
-ngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
- ngx_http_conf_port_t *port, ngx_http_listen_opt_t *lsopt)
-{
- u_char *p;
- size_t len, off;
- ngx_uint_t i, default_server;
- struct sockaddr *sa;
- ngx_http_conf_addr_t *addr;
-#if (NGX_HAVE_UNIX_DOMAIN)
- struct sockaddr_un *saun;
-#endif
-#if (NGX_HTTP_SSL)
- ngx_uint_t ssl;
-#endif
-#if (NGX_HTTP_SPDY)
- ngx_uint_t spdy;
-#endif
-
- /*
- * we cannot compare whole sockaddr struct's as kernel
- * may fill some fields in inherited sockaddr struct's
- */
-
- sa = &lsopt->u.sockaddr;
-
- switch (sa->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- off = offsetof(struct sockaddr_in6, sin6_addr);
- len = 16;
- break;
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- off = offsetof(struct sockaddr_un, sun_path);
- len = sizeof(saun->sun_path);
- break;
-#endif
-
- default: /* AF_INET */
- off = offsetof(struct sockaddr_in, sin_addr);
- len = 4;
- break;
- }
-
- p = lsopt->u.sockaddr_data + off;
-
- addr = port->addrs.elts;
-
- for (i = 0; i < port->addrs.nelts; i++) {
-
- if (ngx_memcmp(p, addr[i].opt.u.sockaddr_data + off, len) != 0) {
- continue;
- }
-
- /* the address is already in the address list */
-
- if (ngx_http_add_server(cf, cscf, &addr[i]) != NGX_OK) {
- return NGX_ERROR;
- }
-
- /* preserve default_server bit during listen options overwriting */
- default_server = addr[i].opt.default_server;
-
-#if (NGX_HTTP_SSL)
- ssl = lsopt->ssl || addr[i].opt.ssl;
-#endif
-#if (NGX_HTTP_SPDY)
- spdy = lsopt->spdy || addr[i].opt.spdy;
-#endif
-
- if (lsopt->set) {
-
- if (addr[i].opt.set) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate listen options for %s", addr[i].opt.addr);
- return NGX_ERROR;
- }
-
- addr[i].opt = *lsopt;
- }
-
- /* check the duplicate "default" server for this address:port */
-
- if (lsopt->default_server) {
-
- if (default_server) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "a duplicate default server for %s", addr[i].opt.addr);
- return NGX_ERROR;
- }
-
- default_server = 1;
- addr[i].default_server = cscf;
- }
-
- addr[i].opt.default_server = default_server;
-#if (NGX_HTTP_SSL)
- addr[i].opt.ssl = ssl;
-#endif
-#if (NGX_HTTP_SPDY)
- addr[i].opt.spdy = spdy;
-#endif
-
- return NGX_OK;
- }
-
- /* add the address to the addresses list that bound to this port */
-
- return ngx_http_add_address(cf, cscf, port, lsopt);
-}
-
-
-/*
- * add the server address, the server names and the server core module
- * configurations to the port list
- */
-
-static ngx_int_t
-ngx_http_add_address(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
- ngx_http_conf_port_t *port, ngx_http_listen_opt_t *lsopt)
-{
- ngx_http_conf_addr_t *addr;
-
- if (port->addrs.elts == NULL) {
- if (ngx_array_init(&port->addrs, cf->temp_pool, 4,
- sizeof(ngx_http_conf_addr_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
-
-#if (NGX_HTTP_SPDY && NGX_HTTP_SSL \
- && !defined TLSEXT_TYPE_application_layer_protocol_negotiation \
- && !defined TLSEXT_TYPE_next_proto_neg)
- if (lsopt->spdy && lsopt->ssl) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "nginx was built without OpenSSL ALPN or NPN "
- "support, SPDY is not enabled for %s", lsopt->addr);
- }
-#endif
-
- addr = ngx_array_push(&port->addrs);
- if (addr == NULL) {
- return NGX_ERROR;
- }
-
- addr->opt = *lsopt;
- addr->hash.buckets = NULL;
- addr->hash.size = 0;
- addr->wc_head = NULL;
- addr->wc_tail = NULL;
-#if (NGX_PCRE)
- addr->nregex = 0;
- addr->regex = NULL;
-#endif
- addr->default_server = cscf;
- addr->servers.elts = NULL;
-
- return ngx_http_add_server(cf, cscf, addr);
-}
-
-
-/* add the server core module configuration to the address:port */
-
-static ngx_int_t
-ngx_http_add_server(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
- ngx_http_conf_addr_t *addr)
-{
- ngx_uint_t i;
- ngx_http_core_srv_conf_t **server;
-
- if (addr->servers.elts == NULL) {
- if (ngx_array_init(&addr->servers, cf->temp_pool, 4,
- sizeof(ngx_http_core_srv_conf_t *))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- } else {
- server = addr->servers.elts;
- for (i = 0; i < addr->servers.nelts; i++) {
- if (server[i] == cscf) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "a duplicate listen %s", addr->opt.addr);
- return NGX_ERROR;
- }
- }
- }
-
- server = ngx_array_push(&addr->servers);
- if (server == NULL) {
- return NGX_ERROR;
- }
-
- *server = cscf;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_optimize_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
- ngx_array_t *ports)
-{
- ngx_uint_t p, a;
- ngx_http_conf_port_t *port;
- ngx_http_conf_addr_t *addr;
-
- if (ports == NULL) {
- return NGX_OK;
- }
-
- port = ports->elts;
- for (p = 0; p < ports->nelts; p++) {
-
- ngx_sort(port[p].addrs.elts, (size_t) port[p].addrs.nelts,
- sizeof(ngx_http_conf_addr_t), ngx_http_cmp_conf_addrs);
-
- /*
- * check whether all name-based servers have the same
- * configuration as a default server for given address:port
- */
-
- addr = port[p].addrs.elts;
- for (a = 0; a < port[p].addrs.nelts; a++) {
-
- if (addr[a].servers.nelts > 1
-#if (NGX_PCRE)
- || addr[a].default_server->captures
-#endif
- )
- {
- if (ngx_http_server_names(cf, cmcf, &addr[a]) != NGX_OK) {
- return NGX_ERROR;
- }
- }
- }
-
- if (ngx_http_init_listening(cf, &port[p]) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_server_names(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
- ngx_http_conf_addr_t *addr)
-{
- ngx_int_t rc;
- ngx_uint_t n, s;
- ngx_hash_init_t hash;
- ngx_hash_keys_arrays_t ha;
- ngx_http_server_name_t *name;
- ngx_http_core_srv_conf_t **cscfp;
-#if (NGX_PCRE)
- ngx_uint_t regex, i;
-
- regex = 0;
-#endif
-
- ngx_memzero(&ha, sizeof(ngx_hash_keys_arrays_t));
-
- ha.temp_pool = ngx_create_pool(NGX_DEFAULT_POOL_SIZE, cf->log);
- if (ha.temp_pool == NULL) {
- return NGX_ERROR;
- }
-
- ha.pool = cf->pool;
-
- if (ngx_hash_keys_array_init(&ha, NGX_HASH_LARGE) != NGX_OK) {
- goto failed;
- }
-
- cscfp = addr->servers.elts;
-
- for (s = 0; s < addr->servers.nelts; s++) {
-
- name = cscfp[s]->server_names.elts;
-
- for (n = 0; n < cscfp[s]->server_names.nelts; n++) {
-
-#if (NGX_PCRE)
- if (name[n].regex) {
- regex++;
- continue;
- }
-#endif
-
- rc = ngx_hash_add_key(&ha, &name[n].name, name[n].server,
- NGX_HASH_WILDCARD_KEY);
-
- if (rc == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if (rc == NGX_DECLINED) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "invalid server name or wildcard \"%V\" on %s",
- &name[n].name, addr->opt.addr);
- return NGX_ERROR;
- }
-
- if (rc == NGX_BUSY) {
- ngx_log_error(NGX_LOG_WARN, cf->log, 0,
- "conflicting server name \"%V\" on %s, ignored",
- &name[n].name, addr->opt.addr);
- }
- }
- }
-
- hash.key = ngx_hash_key_lc;
- hash.max_size = cmcf->server_names_hash_max_size;
- hash.bucket_size = cmcf->server_names_hash_bucket_size;
- hash.name = "server_names_hash";
- hash.pool = cf->pool;
-
- if (ha.keys.nelts) {
- hash.hash = &addr->hash;
- hash.temp_pool = NULL;
-
- if (ngx_hash_init(&hash, ha.keys.elts, ha.keys.nelts) != NGX_OK) {
- goto failed;
- }
- }
-
- if (ha.dns_wc_head.nelts) {
-
- ngx_qsort(ha.dns_wc_head.elts, (size_t) ha.dns_wc_head.nelts,
- sizeof(ngx_hash_key_t), ngx_http_cmp_dns_wildcards);
-
- hash.hash = NULL;
- hash.temp_pool = ha.temp_pool;
-
- if (ngx_hash_wildcard_init(&hash, ha.dns_wc_head.elts,
- ha.dns_wc_head.nelts)
- != NGX_OK)
- {
- goto failed;
- }
-
- addr->wc_head = (ngx_hash_wildcard_t *) hash.hash;
- }
-
- if (ha.dns_wc_tail.nelts) {
-
- ngx_qsort(ha.dns_wc_tail.elts, (size_t) ha.dns_wc_tail.nelts,
- sizeof(ngx_hash_key_t), ngx_http_cmp_dns_wildcards);
-
- hash.hash = NULL;
- hash.temp_pool = ha.temp_pool;
-
- if (ngx_hash_wildcard_init(&hash, ha.dns_wc_tail.elts,
- ha.dns_wc_tail.nelts)
- != NGX_OK)
- {
- goto failed;
- }
-
- addr->wc_tail = (ngx_hash_wildcard_t *) hash.hash;
- }
-
- ngx_destroy_pool(ha.temp_pool);
-
-#if (NGX_PCRE)
-
- if (regex == 0) {
- return NGX_OK;
- }
-
- addr->nregex = regex;
- addr->regex = ngx_palloc(cf->pool, regex * sizeof(ngx_http_server_name_t));
- if (addr->regex == NULL) {
- return NGX_ERROR;
- }
-
- i = 0;
-
- for (s = 0; s < addr->servers.nelts; s++) {
-
- name = cscfp[s]->server_names.elts;
-
- for (n = 0; n < cscfp[s]->server_names.nelts; n++) {
- if (name[n].regex) {
- addr->regex[i++] = name[n];
- }
- }
- }
-
-#endif
-
- return NGX_OK;
-
-failed:
-
- ngx_destroy_pool(ha.temp_pool);
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_cmp_conf_addrs(const void *one, const void *two)
-{
- ngx_http_conf_addr_t *first, *second;
-
- first = (ngx_http_conf_addr_t *) one;
- second = (ngx_http_conf_addr_t *) two;
-
- if (first->opt.wildcard) {
- /* a wildcard address must be the last resort, shift it to the end */
- return 1;
- }
-
- if (second->opt.wildcard) {
- /* a wildcard address must be the last resort, shift it to the end */
- return -1;
- }
-
- if (first->opt.bind && !second->opt.bind) {
- /* shift explicit bind()ed addresses to the start */
- return -1;
- }
-
- if (!first->opt.bind && second->opt.bind) {
- /* shift explicit bind()ed addresses to the start */
- return 1;
- }
-
- /* do not sort by default */
-
- return 0;
-}
-
-
-static int ngx_libc_cdecl
-ngx_http_cmp_dns_wildcards(const void *one, const void *two)
-{
- ngx_hash_key_t *first, *second;
-
- first = (ngx_hash_key_t *) one;
- second = (ngx_hash_key_t *) two;
-
- return ngx_dns_strcmp(first->key.data, second->key.data);
-}
-
-
-static ngx_int_t
-ngx_http_init_listening(ngx_conf_t *cf, ngx_http_conf_port_t *port)
-{
- ngx_uint_t i, last, bind_wildcard;
- ngx_listening_t *ls;
- ngx_http_port_t *hport;
- ngx_http_conf_addr_t *addr;
-
- addr = port->addrs.elts;
- last = port->addrs.nelts;
-
- /*
- * If there is a binding to an "*:port" then we need to bind() to
- * the "*:port" only and ignore other implicit bindings. The bindings
- * have been already sorted: explicit bindings are on the start, then
- * implicit bindings go, and wildcard binding is in the end.
- */
-
- if (addr[last - 1].opt.wildcard) {
- addr[last - 1].opt.bind = 1;
- bind_wildcard = 1;
-
- } else {
- bind_wildcard = 0;
- }
-
- i = 0;
-
- while (i < last) {
-
- if (bind_wildcard && !addr[i].opt.bind) {
- i++;
- continue;
- }
-
- ls = ngx_http_add_listening(cf, &addr[i]);
- if (ls == NULL) {
- return NGX_ERROR;
- }
-
- hport = ngx_pcalloc(cf->pool, sizeof(ngx_http_port_t));
- if (hport == NULL) {
- return NGX_ERROR;
- }
-
- ls->servers = hport;
-
- if (i == last - 1) {
- hport->naddrs = last;
-
- } else {
- hport->naddrs = 1;
- i = 0;
- }
-
- switch (ls->sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- if (ngx_http_add_addrs6(cf, hport, addr) != NGX_OK) {
- return NGX_ERROR;
- }
- break;
-#endif
- default: /* AF_INET */
- if (ngx_http_add_addrs(cf, hport, addr) != NGX_OK) {
- return NGX_ERROR;
- }
- break;
- }
-
- addr++;
- last--;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_listening_t *
-ngx_http_add_listening(ngx_conf_t *cf, ngx_http_conf_addr_t *addr)
-{
- ngx_listening_t *ls;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t *cscf;
-
- ls = ngx_create_listening(cf, &addr->opt.u.sockaddr, addr->opt.socklen);
- if (ls == NULL) {
- return NULL;
- }
-
- ls->addr_ntop = 1;
-
- ls->handler = ngx_http_init_connection;
-
- cscf = addr->default_server;
- ls->pool_size = cscf->connection_pool_size;
- ls->post_accept_timeout = cscf->client_header_timeout;
-
- clcf = cscf->ctx->loc_conf[ngx_http_core_module.ctx_index];
-
- ls->logp = clcf->error_log;
- ls->log.data = &ls->addr_text;
- ls->log.handler = ngx_accept_log_error;
-
-#if (NGX_WIN32)
- {
- ngx_iocp_conf_t *iocpcf = NULL;
-
- if (ngx_get_conf(cf->cycle->conf_ctx, ngx_events_module)) {
- iocpcf = ngx_event_get_conf(cf->cycle->conf_ctx, ngx_iocp_module);
- }
- if (iocpcf && iocpcf->acceptex_read) {
- ls->post_accept_buffer_size = cscf->client_header_buffer_size;
- }
- }
-#endif
-
- ls->backlog = addr->opt.backlog;
- ls->rcvbuf = addr->opt.rcvbuf;
- ls->sndbuf = addr->opt.sndbuf;
-
- ls->keepalive = addr->opt.so_keepalive;
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- ls->keepidle = addr->opt.tcp_keepidle;
- ls->keepintvl = addr->opt.tcp_keepintvl;
- ls->keepcnt = addr->opt.tcp_keepcnt;
-#endif
-
-#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
- ls->accept_filter = addr->opt.accept_filter;
-#endif
-
-#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
- ls->deferred_accept = addr->opt.deferred_accept;
-#endif
-
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- ls->ipv6only = addr->opt.ipv6only;
-#endif
-
-#if (NGX_HAVE_SETFIB)
- ls->setfib = addr->opt.setfib;
-#endif
-
-#if (NGX_HAVE_TCP_FASTOPEN)
- ls->fastopen = addr->opt.fastopen;
-#endif
-
- return ls;
-}
-
-
-static ngx_int_t
-ngx_http_add_addrs(ngx_conf_t *cf, ngx_http_port_t *hport,
- ngx_http_conf_addr_t *addr)
-{
- ngx_uint_t i;
- ngx_http_in_addr_t *addrs;
- struct sockaddr_in *sin;
- ngx_http_virtual_names_t *vn;
-
- hport->addrs = ngx_pcalloc(cf->pool,
- hport->naddrs * sizeof(ngx_http_in_addr_t));
- if (hport->addrs == NULL) {
- return NGX_ERROR;
- }
-
- addrs = hport->addrs;
-
- for (i = 0; i < hport->naddrs; i++) {
-
- sin = &addr[i].opt.u.sockaddr_in;
- addrs[i].addr = sin->sin_addr.s_addr;
- addrs[i].conf.default_server = addr[i].default_server;
-#if (NGX_HTTP_SSL)
- addrs[i].conf.ssl = addr[i].opt.ssl;
-#endif
-#if (NGX_HTTP_SPDY)
- addrs[i].conf.spdy = addr[i].opt.spdy;
-#endif
- addrs[i].conf.proxy_protocol = addr[i].opt.proxy_protocol;
-
- if (addr[i].hash.buckets == NULL
- && (addr[i].wc_head == NULL
- || addr[i].wc_head->hash.buckets == NULL)
- && (addr[i].wc_tail == NULL
- || addr[i].wc_tail->hash.buckets == NULL)
-#if (NGX_PCRE)
- && addr[i].nregex == 0
-#endif
- )
- {
- continue;
- }
-
- vn = ngx_palloc(cf->pool, sizeof(ngx_http_virtual_names_t));
- if (vn == NULL) {
- return NGX_ERROR;
- }
-
- addrs[i].conf.virtual_names = vn;
-
- vn->names.hash = addr[i].hash;
- vn->names.wc_head = addr[i].wc_head;
- vn->names.wc_tail = addr[i].wc_tail;
-#if (NGX_PCRE)
- vn->nregex = addr[i].nregex;
- vn->regex = addr[i].regex;
-#endif
- }
-
- return NGX_OK;
-}
-
-
-#if (NGX_HAVE_INET6)
-
-static ngx_int_t
-ngx_http_add_addrs6(ngx_conf_t *cf, ngx_http_port_t *hport,
- ngx_http_conf_addr_t *addr)
-{
- ngx_uint_t i;
- ngx_http_in6_addr_t *addrs6;
- struct sockaddr_in6 *sin6;
- ngx_http_virtual_names_t *vn;
-
- hport->addrs = ngx_pcalloc(cf->pool,
- hport->naddrs * sizeof(ngx_http_in6_addr_t));
- if (hport->addrs == NULL) {
- return NGX_ERROR;
- }
-
- addrs6 = hport->addrs;
-
- for (i = 0; i < hport->naddrs; i++) {
-
- sin6 = &addr[i].opt.u.sockaddr_in6;
- addrs6[i].addr6 = sin6->sin6_addr;
- addrs6[i].conf.default_server = addr[i].default_server;
-#if (NGX_HTTP_SSL)
- addrs6[i].conf.ssl = addr[i].opt.ssl;
-#endif
-#if (NGX_HTTP_SPDY)
- addrs6[i].conf.spdy = addr[i].opt.spdy;
-#endif
-
- if (addr[i].hash.buckets == NULL
- && (addr[i].wc_head == NULL
- || addr[i].wc_head->hash.buckets == NULL)
- && (addr[i].wc_tail == NULL
- || addr[i].wc_tail->hash.buckets == NULL)
-#if (NGX_PCRE)
- && addr[i].nregex == 0
-#endif
- )
- {
- continue;
- }
-
- vn = ngx_palloc(cf->pool, sizeof(ngx_http_virtual_names_t));
- if (vn == NULL) {
- return NGX_ERROR;
- }
-
- addrs6[i].conf.virtual_names = vn;
-
- vn->names.hash = addr[i].hash;
- vn->names.wc_head = addr[i].wc_head;
- vn->names.wc_tail = addr[i].wc_tail;
-#if (NGX_PCRE)
- vn->nregex = addr[i].nregex;
- vn->regex = addr[i].regex;
-#endif
- }
-
- return NGX_OK;
-}
-
-#endif
-
-
-char *
-ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *p = conf;
-
- ngx_array_t **types;
- ngx_str_t *value, *default_type;
- ngx_uint_t i, n, hash;
- ngx_hash_key_t *type;
-
- types = (ngx_array_t **) (p + cmd->offset);
-
- if (*types == (void *) -1) {
- return NGX_CONF_OK;
- }
-
- default_type = cmd->post;
-
- if (*types == NULL) {
- *types = ngx_array_create(cf->temp_pool, 1, sizeof(ngx_hash_key_t));
- if (*types == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (default_type) {
- type = ngx_array_push(*types);
- if (type == NULL) {
- return NGX_CONF_ERROR;
- }
-
- type->key = *default_type;
- type->key_hash = ngx_hash_key(default_type->data,
- default_type->len);
- type->value = (void *) 4;
- }
- }
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (value[i].len == 1 && value[i].data[0] == '*') {
- *types = (void *) -1;
- return NGX_CONF_OK;
- }
-
- hash = ngx_hash_strlow(value[i].data, value[i].data, value[i].len);
- value[i].data[value[i].len] = '\0';
-
- type = (*types)->elts;
- for (n = 0; n < (*types)->nelts; n++) {
-
- if (ngx_strcmp(value[i].data, type[n].key.data) == 0) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "duplicate MIME type \"%V\"", &value[i]);
- goto next;
- }
- }
-
- type = ngx_array_push(*types);
- if (type == NULL) {
- return NGX_CONF_ERROR;
- }
-
- type->key = value[i];
- type->key_hash = hash;
- type->value = (void *) 4;
-
- next:
-
- continue;
- }
-
- return NGX_CONF_OK;
-}
-
-
-char *
-ngx_http_merge_types(ngx_conf_t *cf, ngx_array_t **keys, ngx_hash_t *types_hash,
- ngx_array_t **prev_keys, ngx_hash_t *prev_types_hash,
- ngx_str_t *default_types)
-{
- ngx_hash_init_t hash;
-
- if (*keys) {
-
- if (*keys == (void *) -1) {
- return NGX_CONF_OK;
- }
-
- hash.hash = types_hash;
- hash.key = NULL;
- hash.max_size = 2048;
- hash.bucket_size = 64;
- hash.name = "test_types_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- if (ngx_hash_init(&hash, (*keys)->elts, (*keys)->nelts) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
- }
-
- if (prev_types_hash->buckets == NULL) {
-
- if (*prev_keys == NULL) {
-
- if (ngx_http_set_default_types(cf, prev_keys, default_types)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- } else if (*prev_keys == (void *) -1) {
- *keys = *prev_keys;
- return NGX_CONF_OK;
- }
-
- hash.hash = prev_types_hash;
- hash.key = NULL;
- hash.max_size = 2048;
- hash.bucket_size = 64;
- hash.name = "test_types_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- if (ngx_hash_init(&hash, (*prev_keys)->elts, (*prev_keys)->nelts)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
-
- *types_hash = *prev_types_hash;
-
- return NGX_CONF_OK;
-
-}
-
-
-ngx_int_t
-ngx_http_set_default_types(ngx_conf_t *cf, ngx_array_t **types,
- ngx_str_t *default_type)
-{
- ngx_hash_key_t *type;
-
- *types = ngx_array_create(cf->temp_pool, 1, sizeof(ngx_hash_key_t));
- if (*types == NULL) {
- return NGX_ERROR;
- }
-
- while (default_type->len) {
-
- type = ngx_array_push(*types);
- if (type == NULL) {
- return NGX_ERROR;
- }
-
- type->key = *default_type;
- type->key_hash = ngx_hash_key(default_type->data,
- default_type->len);
- type->value = (void *) 4;
-
- default_type++;
- }
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.h
deleted file mode 100644
index 0acc234942c..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http.h
+++ /dev/null
@@ -1,186 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_H_INCLUDED_
-#define _NGX_HTTP_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-typedef struct ngx_http_request_s ngx_http_request_t;
-typedef struct ngx_http_upstream_s ngx_http_upstream_t;
-typedef struct ngx_http_cache_s ngx_http_cache_t;
-typedef struct ngx_http_file_cache_s ngx_http_file_cache_t;
-typedef struct ngx_http_log_ctx_s ngx_http_log_ctx_t;
-typedef struct ngx_http_chunked_s ngx_http_chunked_t;
-
-#if (NGX_HTTP_SPDY)
-typedef struct ngx_http_spdy_stream_s ngx_http_spdy_stream_t;
-#endif
-
-typedef ngx_int_t (*ngx_http_header_handler_pt)(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-typedef u_char *(*ngx_http_log_handler_pt)(ngx_http_request_t *r,
- ngx_http_request_t *sr, u_char *buf, size_t len);
-
-
-#include <ngx_http_variables.h>
-#include <ngx_http_config.h>
-#include <ngx_http_request.h>
-#include <ngx_http_script.h>
-#include <ngx_http_upstream.h>
-#include <ngx_http_upstream_round_robin.h>
-#include <ngx_http_busy_lock.h>
-#include <ngx_http_core_module.h>
-
-#if (NGX_HTTP_SPDY)
-#include <ngx_http_spdy.h>
-#endif
-#if (NGX_HTTP_CACHE)
-#include <ngx_http_cache.h>
-#endif
-#if (NGX_HTTP_SSI)
-#include <ngx_http_ssi_filter_module.h>
-#endif
-#if (NGX_HTTP_SSL)
-#include <ngx_http_ssl_module.h>
-#endif
-
-
-struct ngx_http_log_ctx_s {
- ngx_connection_t *connection;
- ngx_http_request_t *request;
- ngx_http_request_t *current_request;
-};
-
-
-struct ngx_http_chunked_s {
- ngx_uint_t state;
- off_t size;
- off_t length;
-};
-
-
-typedef struct {
- ngx_uint_t http_version;
- ngx_uint_t code;
- ngx_uint_t count;
- u_char *start;
- u_char *end;
-} ngx_http_status_t;
-
-
-#define ngx_http_get_module_ctx(r, module) (r)->ctx[module.ctx_index]
-#define ngx_http_set_ctx(r, c, module) r->ctx[module.ctx_index] = c;
-
-
-ngx_int_t ngx_http_add_location(ngx_conf_t *cf, ngx_queue_t **locations,
- ngx_http_core_loc_conf_t *clcf);
-ngx_int_t ngx_http_add_listen(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,
- ngx_http_listen_opt_t *lsopt);
-
-
-void ngx_http_init_connection(ngx_connection_t *c);
-void ngx_http_close_connection(ngx_connection_t *c);
-
-#if (NGX_HTTP_SSL && defined SSL_CTRL_SET_TLSEXT_HOSTNAME)
-int ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg);
-#endif
-
-ngx_int_t ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b);
-ngx_int_t ngx_http_parse_uri(ngx_http_request_t *r);
-ngx_int_t ngx_http_parse_complex_uri(ngx_http_request_t *r,
- ngx_uint_t merge_slashes);
-ngx_int_t ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
- ngx_http_status_t *status);
-ngx_int_t ngx_http_parse_unsafe_uri(ngx_http_request_t *r, ngx_str_t *uri,
- ngx_str_t *args, ngx_uint_t *flags);
-ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
- ngx_uint_t allow_underscores);
-ngx_int_t ngx_http_parse_multi_header_lines(ngx_array_t *headers,
- ngx_str_t *name, ngx_str_t *value);
-ngx_int_t ngx_http_parse_set_cookie_lines(ngx_array_t *headers,
- ngx_str_t *name, ngx_str_t *value);
-ngx_int_t ngx_http_arg(ngx_http_request_t *r, u_char *name, size_t len,
- ngx_str_t *value);
-void ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri,
- ngx_str_t *args);
-ngx_int_t ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
- ngx_http_chunked_t *ctx);
-
-
-ngx_http_request_t *ngx_http_create_request(ngx_connection_t *c);
-ngx_int_t ngx_http_process_request_uri(ngx_http_request_t *r);
-ngx_int_t ngx_http_process_request_header(ngx_http_request_t *r);
-void ngx_http_process_request(ngx_http_request_t *r);
-void ngx_http_update_location_config(ngx_http_request_t *r);
-void ngx_http_handler(ngx_http_request_t *r);
-void ngx_http_run_posted_requests(ngx_connection_t *c);
-ngx_int_t ngx_http_post_request(ngx_http_request_t *r,
- ngx_http_posted_request_t *pr);
-void ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc);
-void ngx_http_free_request(ngx_http_request_t *r, ngx_int_t rc);
-
-void ngx_http_empty_handler(ngx_event_t *wev);
-void ngx_http_request_empty_handler(ngx_http_request_t *r);
-
-
-#define ngx_http_ephemeral(r) (void *) (&r->uri_start)
-
-
-#define NGX_HTTP_LAST 1
-#define NGX_HTTP_FLUSH 2
-
-ngx_int_t ngx_http_send_special(ngx_http_request_t *r, ngx_uint_t flags);
-
-
-ngx_int_t ngx_http_read_client_request_body(ngx_http_request_t *r,
- ngx_http_client_body_handler_pt post_handler);
-
-ngx_int_t ngx_http_send_header(ngx_http_request_t *r);
-ngx_int_t ngx_http_special_response_handler(ngx_http_request_t *r,
- ngx_int_t error);
-ngx_int_t ngx_http_filter_finalize_request(ngx_http_request_t *r,
- ngx_module_t *m, ngx_int_t error);
-void ngx_http_clean_header(ngx_http_request_t *r);
-
-
-time_t ngx_http_parse_time(u_char *value, size_t len);
-size_t ngx_http_get_time(char *buf, time_t t);
-
-
-
-ngx_int_t ngx_http_discard_request_body(ngx_http_request_t *r);
-void ngx_http_discarded_request_body_handler(ngx_http_request_t *r);
-void ngx_http_block_reading(ngx_http_request_t *r);
-void ngx_http_test_reading(ngx_http_request_t *r);
-
-
-char *ngx_http_types_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-char *ngx_http_merge_types(ngx_conf_t *cf, ngx_array_t **keys,
- ngx_hash_t *types_hash, ngx_array_t **prev_keys,
- ngx_hash_t *prev_types_hash, ngx_str_t *default_types);
-ngx_int_t ngx_http_set_default_types(ngx_conf_t *cf, ngx_array_t **types,
- ngx_str_t *default_type);
-
-#if (NGX_HTTP_DEGRADATION)
-ngx_uint_t ngx_http_degraded(ngx_http_request_t *);
-#endif
-
-
-extern ngx_module_t ngx_http_module;
-
-extern ngx_str_t ngx_http_html_default_types[];
-
-
-extern ngx_http_output_header_filter_pt ngx_http_top_header_filter;
-extern ngx_http_output_body_filter_pt ngx_http_top_body_filter;
-
-
-#endif /* _NGX_HTTP_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.c
deleted file mode 100644
index 3b4b28c8b32..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.c
+++ /dev/null
@@ -1,307 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-
-static int ngx_http_busy_lock_look_cacheable(ngx_http_busy_lock_t *bl,
- ngx_http_busy_lock_ctx_t *bc,
- int lock);
-
-
-int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc)
-{
- if (bl->busy < bl->max_busy) {
- bl->busy++;
-
- if (bc->time) {
- bc->time = 0;
- bl->waiting--;
- }
-
- return NGX_OK;
- }
-
- if (bc->time) {
- if (bc->time < bl->timeout) {
- ngx_add_timer(bc->event, 1000);
- return NGX_AGAIN;
- }
-
- bl->waiting--;
- return NGX_DONE;
-
- }
-
- if (bl->timeout == 0) {
- return NGX_DONE;
- }
-
- if (bl->waiting < bl->max_waiting) {
- bl->waiting++;
-
-#if 0
- ngx_add_timer(bc->event, 1000);
- bc->event->event_handler = bc->event_handler;
-#endif
-
- /* TODO: ngx_handle_level_read_event() */
-
- return NGX_AGAIN;
- }
-
- return NGX_ERROR;
-}
-
-
-int ngx_http_busy_lock_cacheable(ngx_http_busy_lock_t *bl,
- ngx_http_busy_lock_ctx_t *bc, int lock)
-{
- int rc;
-
- rc = ngx_http_busy_lock_look_cacheable(bl, bc, lock);
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, bc->event->log, 0,
- "http busylock: %d w:%d mw::%d",
- rc, bl->waiting, bl->max_waiting);
-
- if (rc == NGX_OK) { /* no the same request, there's free slot */
- return NGX_OK;
- }
-
- if (rc == NGX_ERROR && !lock) { /* no the same request, no free slot */
- return NGX_OK;
- }
-
- /* rc == NGX_AGAIN: the same request */
-
- if (bc->time) {
- if (bc->time < bl->timeout) {
- ngx_add_timer(bc->event, 1000);
- return NGX_AGAIN;
- }
-
- bl->waiting--;
- return NGX_DONE;
-
- }
-
- if (bl->timeout == 0) {
- return NGX_DONE;
- }
-
- if (bl->waiting < bl->max_waiting) {
-#if 0
- bl->waiting++;
- ngx_add_timer(bc->event, 1000);
- bc->event->event_handler = bc->event_handler;
-#endif
-
- /* TODO: ngx_handle_level_read_event() */
-
- return NGX_AGAIN;
- }
-
- return NGX_ERROR;
-}
-
-
-void ngx_http_busy_unlock(ngx_http_busy_lock_t *bl,
- ngx_http_busy_lock_ctx_t *bc)
-{
- if (bl == NULL) {
- return;
- }
-
- if (bl->md5) {
- bl->md5_mask[bc->slot / 8] &= ~(1 << (bc->slot & 7));
- bl->cacheable--;
- }
-
- bl->busy--;
-}
-
-
-static int ngx_http_busy_lock_look_cacheable(ngx_http_busy_lock_t *bl,
- ngx_http_busy_lock_ctx_t *bc,
- int lock)
-{
- int i, b, cacheable, free;
- u_int mask;
-
- b = 0;
- cacheable = 0;
- free = -1;
-
-#if (NGX_SUPPRESS_WARN)
- mask = 0;
-#endif
-
- for (i = 0; i < bl->max_busy; i++) {
-
- if ((b & 7) == 0) {
- mask = bl->md5_mask[i / 8];
- }
-
- if (mask & 1) {
- if (ngx_memcmp(&bl->md5[i * 16], bc->md5, 16) == 0) {
- return NGX_AGAIN;
- }
- cacheable++;
-
- } else if (free == -1) {
- free = i;
- }
-
-#if 1
- if (cacheable == bl->cacheable) {
- if (free == -1 && cacheable < bl->max_busy) {
- free = i + 1;
- }
-
- break;
- }
-#endif
-
- mask >>= 1;
- b++;
- }
-
- if (free == -1) {
- return NGX_ERROR;
- }
-
- if (lock) {
- if (bl->busy == bl->max_busy) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(&bl->md5[free * 16], bc->md5, 16);
- bl->md5_mask[free / 8] |= 1 << (free & 7);
- bc->slot = free;
-
- bl->cacheable++;
- bl->busy++;
- }
-
- return NGX_OK;
-}
-
-
-char *ngx_http_set_busy_lock_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf)
-{
- char *p = conf;
-
- ngx_uint_t i, dup, invalid;
- ngx_str_t *value, line;
- ngx_http_busy_lock_t *bl, **blp;
-
- blp = (ngx_http_busy_lock_t **) (p + cmd->offset);
- if (*blp) {
- return "is duplicate";
- }
-
- /* ngx_calloc_shared() */
- bl = ngx_pcalloc(cf->pool, sizeof(ngx_http_busy_lock_t));
- if (bl == NULL) {
- return NGX_CONF_ERROR;
- }
- *blp = bl;
-
- /* ngx_calloc_shared() */
- bl->mutex = ngx_pcalloc(cf->pool, sizeof(ngx_event_mutex_t));
- if (bl->mutex == NULL) {
- return NGX_CONF_ERROR;
- }
-
- dup = 0;
- invalid = 0;
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (value[i].data[1] != '=') {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%s\"", value[i].data);
- return NGX_CONF_ERROR;
- }
-
- switch (value[i].data[0]) {
-
- case 'b':
- if (bl->max_busy) {
- dup = 1;
- break;
- }
-
- bl->max_busy = ngx_atoi(value[i].data + 2, value[i].len - 2);
- if (bl->max_busy == NGX_ERROR) {
- invalid = 1;
- break;
- }
-
- continue;
-
- case 'w':
- if (bl->max_waiting) {
- dup = 1;
- break;
- }
-
- bl->max_waiting = ngx_atoi(value[i].data + 2, value[i].len - 2);
- if (bl->max_waiting == NGX_ERROR) {
- invalid = 1;
- break;
- }
-
- continue;
-
- case 't':
- if (bl->timeout) {
- dup = 1;
- break;
- }
-
- line.len = value[i].len - 2;
- line.data = value[i].data + 2;
-
- bl->timeout = ngx_parse_time(&line, 1);
- if (bl->timeout == (time_t) NGX_ERROR) {
- invalid = 1;
- break;
- }
-
- continue;
-
- default:
- invalid = 1;
- }
-
- if (dup) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate value \"%s\"", value[i].data);
- return NGX_CONF_ERROR;
- }
-
- if (invalid) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%s\"", value[i].data);
- return NGX_CONF_ERROR;
- }
- }
-
- if (bl->timeout == 0 && bl->max_waiting) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "busy lock waiting is useless with zero timeout, ignoring");
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.h
deleted file mode 100644
index c676382f29d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_busy_lock.h
+++ /dev/null
@@ -1,54 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_BUSY_LOCK_H_INCLUDED_
-#define _NGX_HTTP_BUSY_LOCK_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- u_char *md5_mask;
- char *md5;
- int cacheable;
-
- int busy;
- int max_busy;
-
- int waiting;
- int max_waiting;
-
- time_t timeout;
-
- ngx_event_mutex_t *mutex;
-} ngx_http_busy_lock_t;
-
-
-typedef struct {
- time_t time;
- ngx_event_t *event;
- void (*event_handler)(ngx_event_t *ev);
- u_char *md5;
- int slot;
-} ngx_http_busy_lock_ctx_t;
-
-
-int ngx_http_busy_lock(ngx_http_busy_lock_t *bl, ngx_http_busy_lock_ctx_t *bc);
-int ngx_http_busy_lock_cacheable(ngx_http_busy_lock_t *bl,
- ngx_http_busy_lock_ctx_t *bc, int lock);
-void ngx_http_busy_unlock(ngx_http_busy_lock_t *bl,
- ngx_http_busy_lock_ctx_t *bc);
-
-char *ngx_http_set_busy_lock_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-#endif /* _NGX_HTTP_BUSY_LOCK_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_cache.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_cache.h
deleted file mode 100644
index 1cfd9fe845f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_cache.h
+++ /dev/null
@@ -1,169 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_CACHE_H_INCLUDED_
-#define _NGX_HTTP_CACHE_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_CACHE_MISS 1
-#define NGX_HTTP_CACHE_BYPASS 2
-#define NGX_HTTP_CACHE_EXPIRED 3
-#define NGX_HTTP_CACHE_STALE 4
-#define NGX_HTTP_CACHE_UPDATING 5
-#define NGX_HTTP_CACHE_REVALIDATED 6
-#define NGX_HTTP_CACHE_HIT 7
-#define NGX_HTTP_CACHE_SCARCE 8
-
-#define NGX_HTTP_CACHE_KEY_LEN 16
-#define NGX_HTTP_CACHE_ETAG_LEN 42
-
-#define NGX_HTTP_CACHE_VERSION 2
-
-
-typedef struct {
- ngx_uint_t status;
- time_t valid;
-} ngx_http_cache_valid_t;
-
-
-typedef struct {
- ngx_rbtree_node_t node;
- ngx_queue_t queue;
-
- u_char key[NGX_HTTP_CACHE_KEY_LEN
- - sizeof(ngx_rbtree_key_t)];
-
- unsigned count:20;
- unsigned uses:10;
- unsigned valid_msec:10;
- unsigned error:10;
- unsigned exists:1;
- unsigned updating:1;
- unsigned deleting:1;
- /* 11 unused bits */
-
- ngx_file_uniq_t uniq;
- time_t expire;
- time_t valid_sec;
- size_t body_start;
- off_t fs_size;
-} ngx_http_file_cache_node_t;
-
-
-struct ngx_http_cache_s {
- ngx_file_t file;
- ngx_array_t keys;
- uint32_t crc32;
- u_char key[NGX_HTTP_CACHE_KEY_LEN];
-
- ngx_file_uniq_t uniq;
- time_t valid_sec;
- time_t last_modified;
- time_t date;
-
- ngx_str_t etag;
-
- size_t header_start;
- size_t body_start;
- off_t length;
- off_t fs_size;
-
- ngx_uint_t min_uses;
- ngx_uint_t error;
- ngx_uint_t valid_msec;
-
- ngx_buf_t *buf;
-
- ngx_http_file_cache_t *file_cache;
- ngx_http_file_cache_node_t *node;
-
- ngx_msec_t lock_timeout;
- ngx_msec_t wait_time;
-
- ngx_event_t wait_event;
-
- unsigned lock:1;
- unsigned waiting:1;
-
- unsigned updated:1;
- unsigned updating:1;
- unsigned exists:1;
- unsigned temp_file:1;
-};
-
-
-typedef struct {
- ngx_uint_t version;
- time_t valid_sec;
- time_t last_modified;
- time_t date;
- uint32_t crc32;
- u_short valid_msec;
- u_short header_start;
- u_short body_start;
- u_char etag_len;
- u_char etag[NGX_HTTP_CACHE_ETAG_LEN];
-} ngx_http_file_cache_header_t;
-
-
-typedef struct {
- ngx_rbtree_t rbtree;
- ngx_rbtree_node_t sentinel;
- ngx_queue_t queue;
- ngx_atomic_t cold;
- ngx_atomic_t loading;
- off_t size;
-} ngx_http_file_cache_sh_t;
-
-
-struct ngx_http_file_cache_s {
- ngx_http_file_cache_sh_t *sh;
- ngx_slab_pool_t *shpool;
-
- ngx_path_t *path;
-
- off_t max_size;
- size_t bsize;
-
- time_t inactive;
-
- ngx_uint_t files;
- ngx_uint_t loader_files;
- ngx_msec_t last;
- ngx_msec_t loader_sleep;
- ngx_msec_t loader_threshold;
-
- ngx_shm_zone_t *shm_zone;
-};
-
-
-ngx_int_t ngx_http_file_cache_new(ngx_http_request_t *r);
-ngx_int_t ngx_http_file_cache_create(ngx_http_request_t *r);
-void ngx_http_file_cache_create_key(ngx_http_request_t *r);
-ngx_int_t ngx_http_file_cache_open(ngx_http_request_t *r);
-void ngx_http_file_cache_set_header(ngx_http_request_t *r, u_char *buf);
-void ngx_http_file_cache_update(ngx_http_request_t *r, ngx_temp_file_t *tf);
-void ngx_http_file_cache_update_header(ngx_http_request_t *r);
-ngx_int_t ngx_http_cache_send(ngx_http_request_t *);
-void ngx_http_file_cache_free(ngx_http_cache_t *c, ngx_temp_file_t *tf);
-time_t ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status);
-
-char *ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-char *ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-extern ngx_str_t ngx_http_cache_status[];
-
-
-#endif /* _NGX_HTTP_CACHE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_config.h
deleted file mode 100644
index 2208c601b96..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_config.h
+++ /dev/null
@@ -1,75 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_CONFIG_H_INCLUDED_
-#define _NGX_HTTP_CONFIG_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- void **main_conf;
- void **srv_conf;
- void **loc_conf;
-} ngx_http_conf_ctx_t;
-
-
-typedef struct {
- ngx_int_t (*preconfiguration)(ngx_conf_t *cf);
- ngx_int_t (*postconfiguration)(ngx_conf_t *cf);
-
- void *(*create_main_conf)(ngx_conf_t *cf);
- char *(*init_main_conf)(ngx_conf_t *cf, void *conf);
-
- void *(*create_srv_conf)(ngx_conf_t *cf);
- char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev, void *conf);
-
- void *(*create_loc_conf)(ngx_conf_t *cf);
- char *(*merge_loc_conf)(ngx_conf_t *cf, void *prev, void *conf);
-} ngx_http_module_t;
-
-
-#define NGX_HTTP_MODULE 0x50545448 /* "HTTP" */
-
-#define NGX_HTTP_MAIN_CONF 0x02000000
-#define NGX_HTTP_SRV_CONF 0x04000000
-#define NGX_HTTP_LOC_CONF 0x08000000
-#define NGX_HTTP_UPS_CONF 0x10000000
-#define NGX_HTTP_SIF_CONF 0x20000000
-#define NGX_HTTP_LIF_CONF 0x40000000
-#define NGX_HTTP_LMT_CONF 0x80000000
-
-
-#define NGX_HTTP_MAIN_CONF_OFFSET offsetof(ngx_http_conf_ctx_t, main_conf)
-#define NGX_HTTP_SRV_CONF_OFFSET offsetof(ngx_http_conf_ctx_t, srv_conf)
-#define NGX_HTTP_LOC_CONF_OFFSET offsetof(ngx_http_conf_ctx_t, loc_conf)
-
-
-#define ngx_http_get_module_main_conf(r, module) \
- (r)->main_conf[module.ctx_index]
-#define ngx_http_get_module_srv_conf(r, module) (r)->srv_conf[module.ctx_index]
-#define ngx_http_get_module_loc_conf(r, module) (r)->loc_conf[module.ctx_index]
-
-
-#define ngx_http_conf_get_module_main_conf(cf, module) \
- ((ngx_http_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index]
-#define ngx_http_conf_get_module_srv_conf(cf, module) \
- ((ngx_http_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index]
-#define ngx_http_conf_get_module_loc_conf(cf, module) \
- ((ngx_http_conf_ctx_t *) cf->ctx)->loc_conf[module.ctx_index]
-
-#define ngx_http_cycle_get_module_main_conf(cycle, module) \
- (cycle->conf_ctx[ngx_http_module.index] ? \
- ((ngx_http_conf_ctx_t *) cycle->conf_ctx[ngx_http_module.index]) \
- ->main_conf[module.ctx_index]: \
- NULL)
-
-
-#endif /* _NGX_HTTP_CONFIG_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_copy_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_copy_filter_module.c
deleted file mode 100644
index 3ad27b0425b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_copy_filter_module.c
+++ /dev/null
@@ -1,303 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- ngx_bufs_t bufs;
-} ngx_http_copy_filter_conf_t;
-
-
-#if (NGX_HAVE_FILE_AIO)
-static void ngx_http_copy_aio_handler(ngx_output_chain_ctx_t *ctx,
- ngx_file_t *file);
-static void ngx_http_copy_aio_event_handler(ngx_event_t *ev);
-#if (NGX_HAVE_AIO_SENDFILE)
-static void ngx_http_copy_aio_sendfile_event_handler(ngx_event_t *ev);
-#endif
-#endif
-
-static void *ngx_http_copy_filter_create_conf(ngx_conf_t *cf);
-static char *ngx_http_copy_filter_merge_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static ngx_int_t ngx_http_copy_filter_init(ngx_conf_t *cf);
-
-
-static ngx_command_t ngx_http_copy_filter_commands[] = {
-
- { ngx_string("output_buffers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE2,
- ngx_conf_set_bufs_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_copy_filter_conf_t, bufs),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_copy_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_copy_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- ngx_http_copy_filter_create_conf, /* create location configuration */
- ngx_http_copy_filter_merge_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_copy_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_copy_filter_module_ctx, /* module context */
- ngx_http_copy_filter_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- ngx_int_t rc;
- ngx_connection_t *c;
- ngx_output_chain_ctx_t *ctx;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_copy_filter_conf_t *conf;
-
- c = r->connection;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http copy filter: \"%V?%V\"", &r->uri, &r->args);
-
- ctx = ngx_http_get_module_ctx(r, ngx_http_copy_filter_module);
-
- if (ctx == NULL) {
- ctx = ngx_pcalloc(r->pool, sizeof(ngx_output_chain_ctx_t));
- if (ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_http_set_ctx(r, ctx, ngx_http_copy_filter_module);
-
- conf = ngx_http_get_module_loc_conf(r, ngx_http_copy_filter_module);
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ctx->sendfile = c->sendfile;
- ctx->need_in_memory = r->main_filter_need_in_memory
- || r->filter_need_in_memory;
- ctx->need_in_temp = r->filter_need_temporary;
-
- ctx->alignment = clcf->directio_alignment;
-
- ctx->pool = r->pool;
- ctx->bufs = conf->bufs;
- ctx->tag = (ngx_buf_tag_t) &ngx_http_copy_filter_module;
-
- ctx->output_filter = (ngx_output_chain_filter_pt)
- ngx_http_next_body_filter;
- ctx->filter_ctx = r;
-
-#if (NGX_HAVE_FILE_AIO)
- if (ngx_file_aio) {
- if (clcf->aio) {
- ctx->aio_handler = ngx_http_copy_aio_handler;
- }
-#if (NGX_HAVE_AIO_SENDFILE)
- c->aio_sendfile = (clcf->aio == NGX_HTTP_AIO_SENDFILE);
-#endif
- }
-#endif
-
- if (in && in->buf && ngx_buf_size(in->buf)) {
- r->request_output = 1;
- }
- }
-
-#if (NGX_HAVE_FILE_AIO)
- ctx->aio = r->aio;
-#endif
-
- for ( ;; ) {
- rc = ngx_output_chain(ctx, in);
-
- if (ctx->in == NULL) {
- r->buffered &= ~NGX_HTTP_COPY_BUFFERED;
-
- } else {
- r->buffered |= NGX_HTTP_COPY_BUFFERED;
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http copy filter: %i \"%V?%V\"", rc, &r->uri, &r->args);
-
-#if (NGX_HAVE_FILE_AIO && NGX_HAVE_AIO_SENDFILE)
-
- if (c->busy_sendfile) {
- ssize_t n;
- off_t offset;
- ngx_file_t *file;
- ngx_http_ephemeral_t *e;
-
- if (r->aio) {
- c->busy_sendfile = NULL;
- return rc;
- }
-
- file = c->busy_sendfile->file;
- offset = c->busy_sendfile->file_pos;
-
- if (file->aio) {
- c->busy_count = (offset == file->aio->last_offset) ?
- c->busy_count + 1 : 0;
- file->aio->last_offset = offset;
-
- if (c->busy_count > 2) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "sendfile(%V) returned busy again",
- &file->name);
- c->aio_sendfile = 0;
- }
- }
-
- c->busy_sendfile = NULL;
- e = (ngx_http_ephemeral_t *) &r->uri_start;
-
- n = ngx_file_aio_read(file, &e->aio_preload, 1, offset, r->pool);
-
- if (n > 0) {
- in = NULL;
- continue;
- }
-
- rc = n;
-
- if (rc == NGX_AGAIN) {
- file->aio->data = r;
- file->aio->handler = ngx_http_copy_aio_sendfile_event_handler;
-
- r->main->blocked++;
- r->aio = 1;
- }
- }
-#endif
-
- return rc;
- }
-}
-
-
-#if (NGX_HAVE_FILE_AIO)
-
-static void
-ngx_http_copy_aio_handler(ngx_output_chain_ctx_t *ctx, ngx_file_t *file)
-{
- ngx_http_request_t *r;
-
- r = ctx->filter_ctx;
-
- file->aio->data = r;
- file->aio->handler = ngx_http_copy_aio_event_handler;
-
- r->main->blocked++;
- r->aio = 1;
- ctx->aio = 1;
-}
-
-
-static void
-ngx_http_copy_aio_event_handler(ngx_event_t *ev)
-{
- ngx_event_aio_t *aio;
- ngx_http_request_t *r;
-
- aio = ev->data;
- r = aio->data;
-
- r->main->blocked--;
- r->aio = 0;
-
- r->connection->write->handler(r->connection->write);
-}
-
-
-#if (NGX_HAVE_AIO_SENDFILE)
-
-static void
-ngx_http_copy_aio_sendfile_event_handler(ngx_event_t *ev)
-{
- ngx_event_aio_t *aio;
- ngx_http_request_t *r;
-
- aio = ev->data;
- r = aio->data;
-
- r->main->blocked--;
- r->aio = 0;
- ev->complete = 0;
-
- r->connection->write->handler(r->connection->write);
-}
-
-#endif
-#endif
-
-
-static void *
-ngx_http_copy_filter_create_conf(ngx_conf_t *cf)
-{
- ngx_http_copy_filter_conf_t *conf;
-
- conf = ngx_palloc(cf->pool, sizeof(ngx_http_copy_filter_conf_t));
- if (conf == NULL) {
- return NULL;
- }
-
- conf->bufs.num = 0;
-
- return conf;
-}
-
-
-static char *
-ngx_http_copy_filter_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_copy_filter_conf_t *prev = parent;
- ngx_http_copy_filter_conf_t *conf = child;
-
- ngx_conf_merge_bufs_value(conf->bufs, prev->bufs, 1, 32768);
-
- return NULL;
-}
-
-
-static ngx_int_t
-ngx_http_copy_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_copy_filter;
-
- return NGX_OK;
-}
-
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.c
deleted file mode 100644
index 3b36f4a1920..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.c
+++ /dev/null
@@ -1,5284 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- u_char *name;
- uint32_t method;
-} ngx_http_method_name_t;
-
-
-#define NGX_HTTP_REQUEST_BODY_FILE_OFF 0
-#define NGX_HTTP_REQUEST_BODY_FILE_ON 1
-#define NGX_HTTP_REQUEST_BODY_FILE_CLEAN 2
-
-
-static ngx_int_t ngx_http_core_find_location(ngx_http_request_t *r);
-static ngx_int_t ngx_http_core_find_static_location(ngx_http_request_t *r,
- ngx_http_location_tree_node_t *node);
-
-static ngx_int_t ngx_http_core_preconfiguration(ngx_conf_t *cf);
-static void *ngx_http_core_create_main_conf(ngx_conf_t *cf);
-static char *ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf);
-static void *ngx_http_core_create_srv_conf(ngx_conf_t *cf);
-static char *ngx_http_core_merge_srv_conf(ngx_conf_t *cf,
- void *parent, void *child);
-static void *ngx_http_core_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_core_merge_loc_conf(ngx_conf_t *cf,
- void *parent, void *child);
-
-static char *ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd,
- void *dummy);
-static char *ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd,
- void *dummy);
-static ngx_int_t ngx_http_core_regex_location(ngx_conf_t *cf,
- ngx_http_core_loc_conf_t *clcf, ngx_str_t *regex, ngx_uint_t caseless);
-
-static char *ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy,
- void *conf);
-
-static char *ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static char *ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_try_files(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_keepalive(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_http_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-#if (NGX_HTTP_GZIP)
-static ngx_int_t ngx_http_gzip_accept_encoding(ngx_str_t *ae);
-static ngx_uint_t ngx_http_gzip_quantity(u_char *p, u_char *last);
-static char *ngx_http_gzip_disable(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-#endif
-static ngx_int_t ngx_http_get_forwarded_addr_internal(ngx_http_request_t *r,
- ngx_addr_t *addr, u_char *xff, size_t xfflen, ngx_array_t *proxies,
- int recursive);
-#if (NGX_HAVE_OPENAT)
-static char *ngx_http_disable_symlinks(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-#endif
-
-static char *ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data);
-static char *ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data);
-
-static ngx_conf_post_t ngx_http_core_lowat_post =
- { ngx_http_core_lowat_check };
-
-static ngx_conf_post_handler_pt ngx_http_core_pool_size_p =
- ngx_http_core_pool_size;
-
-static ngx_conf_deprecated_t ngx_conf_deprecated_optimize_server_names = {
- ngx_conf_deprecated, "optimize_server_names", "server_name_in_redirect"
-};
-
-static ngx_conf_deprecated_t ngx_conf_deprecated_open_file_cache_retest = {
- ngx_conf_deprecated, "open_file_cache_retest", "open_file_cache_valid"
-};
-
-static ngx_conf_deprecated_t ngx_conf_deprecated_satisfy_any = {
- ngx_conf_deprecated, "satisfy_any", "satisfy"
-};
-
-
-static ngx_conf_enum_t ngx_http_core_request_body_in_file[] = {
- { ngx_string("off"), NGX_HTTP_REQUEST_BODY_FILE_OFF },
- { ngx_string("on"), NGX_HTTP_REQUEST_BODY_FILE_ON },
- { ngx_string("clean"), NGX_HTTP_REQUEST_BODY_FILE_CLEAN },
- { ngx_null_string, 0 }
-};
-
-
-#if (NGX_HAVE_FILE_AIO)
-
-static ngx_conf_enum_t ngx_http_core_aio[] = {
- { ngx_string("off"), NGX_HTTP_AIO_OFF },
- { ngx_string("on"), NGX_HTTP_AIO_ON },
-#if (NGX_HAVE_AIO_SENDFILE)
- { ngx_string("sendfile"), NGX_HTTP_AIO_SENDFILE },
-#endif
- { ngx_null_string, 0 }
-};
-
-#endif
-
-
-static ngx_conf_enum_t ngx_http_core_satisfy[] = {
- { ngx_string("all"), NGX_HTTP_SATISFY_ALL },
- { ngx_string("any"), NGX_HTTP_SATISFY_ANY },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_conf_enum_t ngx_http_core_lingering_close[] = {
- { ngx_string("off"), NGX_HTTP_LINGERING_OFF },
- { ngx_string("on"), NGX_HTTP_LINGERING_ON },
- { ngx_string("always"), NGX_HTTP_LINGERING_ALWAYS },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_conf_enum_t ngx_http_core_if_modified_since[] = {
- { ngx_string("off"), NGX_HTTP_IMS_OFF },
- { ngx_string("exact"), NGX_HTTP_IMS_EXACT },
- { ngx_string("before"), NGX_HTTP_IMS_BEFORE },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_conf_bitmask_t ngx_http_core_keepalive_disable[] = {
- { ngx_string("none"), NGX_HTTP_KEEPALIVE_DISABLE_NONE },
- { ngx_string("msie6"), NGX_HTTP_KEEPALIVE_DISABLE_MSIE6 },
- { ngx_string("safari"), NGX_HTTP_KEEPALIVE_DISABLE_SAFARI },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_path_init_t ngx_http_client_temp_path = {
- ngx_string(NGX_HTTP_CLIENT_TEMP_PATH), { 0, 0, 0 }
-};
-
-
-#if (NGX_HTTP_GZIP)
-
-static ngx_conf_enum_t ngx_http_gzip_http_version[] = {
- { ngx_string("1.0"), NGX_HTTP_VERSION_10 },
- { ngx_string("1.1"), NGX_HTTP_VERSION_11 },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_conf_bitmask_t ngx_http_gzip_proxied_mask[] = {
- { ngx_string("off"), NGX_HTTP_GZIP_PROXIED_OFF },
- { ngx_string("expired"), NGX_HTTP_GZIP_PROXIED_EXPIRED },
- { ngx_string("no-cache"), NGX_HTTP_GZIP_PROXIED_NO_CACHE },
- { ngx_string("no-store"), NGX_HTTP_GZIP_PROXIED_NO_STORE },
- { ngx_string("private"), NGX_HTTP_GZIP_PROXIED_PRIVATE },
- { ngx_string("no_last_modified"), NGX_HTTP_GZIP_PROXIED_NO_LM },
- { ngx_string("no_etag"), NGX_HTTP_GZIP_PROXIED_NO_ETAG },
- { ngx_string("auth"), NGX_HTTP_GZIP_PROXIED_AUTH },
- { ngx_string("any"), NGX_HTTP_GZIP_PROXIED_ANY },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_str_t ngx_http_gzip_no_cache = ngx_string("no-cache");
-static ngx_str_t ngx_http_gzip_no_store = ngx_string("no-store");
-static ngx_str_t ngx_http_gzip_private = ngx_string("private");
-
-#endif
-
-
-static ngx_command_t ngx_http_core_commands[] = {
-
- { ngx_string("variables_hash_max_size"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_core_main_conf_t, variables_hash_max_size),
- NULL },
-
- { ngx_string("variables_hash_bucket_size"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_core_main_conf_t, variables_hash_bucket_size),
- NULL },
-
- { ngx_string("server_names_hash_max_size"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_core_main_conf_t, server_names_hash_max_size),
- NULL },
-
- { ngx_string("server_names_hash_bucket_size"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_core_main_conf_t, server_names_hash_bucket_size),
- NULL },
-
- { ngx_string("server"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
- ngx_http_core_server,
- 0,
- 0,
- NULL },
-
- { ngx_string("connection_pool_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, connection_pool_size),
- &ngx_http_core_pool_size_p },
-
- { ngx_string("request_pool_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, request_pool_size),
- &ngx_http_core_pool_size_p },
-
- { ngx_string("client_header_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, client_header_timeout),
- NULL },
-
- { ngx_string("client_header_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, client_header_buffer_size),
- NULL },
-
- { ngx_string("large_client_header_buffers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE2,
- ngx_conf_set_bufs_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, large_client_header_buffers),
- NULL },
-
- { ngx_string("optimize_server_names"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, server_name_in_redirect),
- &ngx_conf_deprecated_optimize_server_names },
-
- { ngx_string("ignore_invalid_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, ignore_invalid_headers),
- NULL },
-
- { ngx_string("merge_slashes"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, merge_slashes),
- NULL },
-
- { ngx_string("underscores_in_headers"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_core_srv_conf_t, underscores_in_headers),
- NULL },
-
- { ngx_string("location"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE12,
- ngx_http_core_location,
- NGX_HTTP_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("listen"),
- NGX_HTTP_SRV_CONF|NGX_CONF_1MORE,
- ngx_http_core_listen,
- NGX_HTTP_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("server_name"),
- NGX_HTTP_SRV_CONF|NGX_CONF_1MORE,
- ngx_http_core_server_name,
- NGX_HTTP_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("types_hash_max_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, types_hash_max_size),
- NULL },
-
- { ngx_string("types_hash_bucket_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, types_hash_bucket_size),
- NULL },
-
- { ngx_string("types"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF
- |NGX_CONF_BLOCK|NGX_CONF_NOARGS,
- ngx_http_core_types,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("default_type"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, default_type),
- NULL },
-
- { ngx_string("root"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE1,
- ngx_http_core_root,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("alias"),
- NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_core_root,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("limit_except"),
- NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_1MORE,
- ngx_http_core_limit_except,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("client_max_body_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_off_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, client_max_body_size),
- NULL },
-
- { ngx_string("client_body_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, client_body_buffer_size),
- NULL },
-
- { ngx_string("client_body_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, client_body_timeout),
- NULL },
-
- { ngx_string("client_body_temp_path"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1234,
- ngx_conf_set_path_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, client_body_temp_path),
- NULL },
-
- { ngx_string("client_body_in_file_only"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, client_body_in_file_only),
- &ngx_http_core_request_body_in_file },
-
- { ngx_string("client_body_in_single_buffer"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, client_body_in_single_buffer),
- NULL },
-
- { ngx_string("sendfile"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, sendfile),
- NULL },
-
- { ngx_string("sendfile_max_chunk"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, sendfile_max_chunk),
- NULL },
-
-#if (NGX_HAVE_FILE_AIO)
-
- { ngx_string("aio"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, aio),
- &ngx_http_core_aio },
-
-#endif
-
- { ngx_string("read_ahead"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, read_ahead),
- NULL },
-
- { ngx_string("directio"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_http_core_directio,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("directio_alignment"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_off_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, directio_alignment),
- NULL },
-
- { ngx_string("tcp_nopush"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, tcp_nopush),
- NULL },
-
- { ngx_string("tcp_nodelay"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, tcp_nodelay),
- NULL },
-
- { ngx_string("send_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, send_timeout),
- NULL },
-
- { ngx_string("send_lowat"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, send_lowat),
- &ngx_http_core_lowat_post },
-
- { ngx_string("postpone_output"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, postpone_output),
- NULL },
-
- { ngx_string("limit_rate"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, limit_rate),
- NULL },
-
- { ngx_string("limit_rate_after"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, limit_rate_after),
- NULL },
-
- { ngx_string("keepalive_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
- ngx_http_core_keepalive,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("keepalive_requests"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, keepalive_requests),
- NULL },
-
- { ngx_string("keepalive_disable"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, keepalive_disable),
- &ngx_http_core_keepalive_disable },
-
- { ngx_string("satisfy"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, satisfy),
- &ngx_http_core_satisfy },
-
- { ngx_string("satisfy_any"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, satisfy),
- &ngx_conf_deprecated_satisfy_any },
-
- { ngx_string("internal"),
- NGX_HTTP_LOC_CONF|NGX_CONF_NOARGS,
- ngx_http_core_internal,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("lingering_close"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, lingering_close),
- &ngx_http_core_lingering_close },
-
- { ngx_string("lingering_time"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, lingering_time),
- NULL },
-
- { ngx_string("lingering_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, lingering_timeout),
- NULL },
-
- { ngx_string("reset_timedout_connection"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, reset_timedout_connection),
- NULL },
-
- { ngx_string("server_name_in_redirect"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, server_name_in_redirect),
- NULL },
-
- { ngx_string("port_in_redirect"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, port_in_redirect),
- NULL },
-
- { ngx_string("msie_padding"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, msie_padding),
- NULL },
-
- { ngx_string("msie_refresh"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, msie_refresh),
- NULL },
-
- { ngx_string("log_not_found"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, log_not_found),
- NULL },
-
- { ngx_string("log_subrequest"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, log_subrequest),
- NULL },
-
- { ngx_string("recursive_error_pages"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, recursive_error_pages),
- NULL },
-
- { ngx_string("server_tokens"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, server_tokens),
- NULL },
-
- { ngx_string("if_modified_since"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, if_modified_since),
- &ngx_http_core_if_modified_since },
-
- { ngx_string("max_ranges"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, max_ranges),
- NULL },
-
- { ngx_string("chunked_transfer_encoding"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, chunked_transfer_encoding),
- NULL },
-
- { ngx_string("etag"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, etag),
- NULL },
-
- { ngx_string("error_page"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_2MORE,
- ngx_http_core_error_page,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("try_files"),
- NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_2MORE,
- ngx_http_core_try_files,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("post_action"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_HTTP_LIF_CONF
- |NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, post_action),
- NULL },
-
- { ngx_string("error_log"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_core_error_log,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("open_file_cache"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
- ngx_http_core_open_file_cache,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, open_file_cache),
- NULL },
-
- { ngx_string("open_file_cache_valid"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_sec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, open_file_cache_valid),
- NULL },
-
- { ngx_string("open_file_cache_retest"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_sec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, open_file_cache_valid),
- &ngx_conf_deprecated_open_file_cache_retest },
-
- { ngx_string("open_file_cache_min_uses"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, open_file_cache_min_uses),
- NULL },
-
- { ngx_string("open_file_cache_errors"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, open_file_cache_errors),
- NULL },
-
- { ngx_string("open_file_cache_events"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, open_file_cache_events),
- NULL },
-
- { ngx_string("resolver"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_core_resolver,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("resolver_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, resolver_timeout),
- NULL },
-
-#if (NGX_HTTP_GZIP)
-
- { ngx_string("gzip_vary"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, gzip_vary),
- NULL },
-
- { ngx_string("gzip_http_version"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_enum_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, gzip_http_version),
- &ngx_http_gzip_http_version },
-
- { ngx_string("gzip_proxied"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_core_loc_conf_t, gzip_proxied),
- &ngx_http_gzip_proxied_mask },
-
- { ngx_string("gzip_disable"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_1MORE,
- ngx_http_gzip_disable,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
-#endif
-
-#if (NGX_HAVE_OPENAT)
-
- { ngx_string("disable_symlinks"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
- ngx_http_disable_symlinks,
- NGX_HTTP_LOC_CONF_OFFSET,
- 0,
- NULL },
-
-#endif
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_core_module_ctx = {
- ngx_http_core_preconfiguration, /* preconfiguration */
- NULL, /* postconfiguration */
-
- ngx_http_core_create_main_conf, /* create main configuration */
- ngx_http_core_init_main_conf, /* init main configuration */
-
- ngx_http_core_create_srv_conf, /* create server configuration */
- ngx_http_core_merge_srv_conf, /* merge server configuration */
-
- ngx_http_core_create_loc_conf, /* create location configuration */
- ngx_http_core_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_core_module = {
- NGX_MODULE_V1,
- &ngx_http_core_module_ctx, /* module context */
- ngx_http_core_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-ngx_str_t ngx_http_core_get_method = { 3, (u_char *) "GET " };
-
-
-void
-ngx_http_handler(ngx_http_request_t *r)
-{
- ngx_http_core_main_conf_t *cmcf;
-
- r->connection->log->action = NULL;
-
- r->connection->unexpected_eof = 0;
-
- if (!r->internal) {
- switch (r->headers_in.connection_type) {
- case 0:
- r->keepalive = (r->http_version > NGX_HTTP_VERSION_10);
- break;
-
- case NGX_HTTP_CONNECTION_CLOSE:
- r->keepalive = 0;
- break;
-
- case NGX_HTTP_CONNECTION_KEEP_ALIVE:
- r->keepalive = 1;
- break;
- }
-
- r->lingering_close = (r->headers_in.content_length_n > 0
- || r->headers_in.chunked);
- r->phase_handler = 0;
-
- } else {
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
- r->phase_handler = cmcf->phase_engine.server_rewrite_index;
- }
-
- r->valid_location = 1;
-#if (NGX_HTTP_GZIP)
- r->gzip_tested = 0;
- r->gzip_ok = 0;
- r->gzip_vary = 0;
-#endif
-
- r->write_event_handler = ngx_http_core_run_phases;
- ngx_http_core_run_phases(r);
-}
-
-
-void
-ngx_http_core_run_phases(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_http_phase_handler_t *ph;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- ph = cmcf->phase_engine.handlers;
-
- while (ph[r->phase_handler].checker) {
-
- rc = ph[r->phase_handler].checker(r, &ph[r->phase_handler]);
-
- if (rc == NGX_OK) {
- return;
- }
- }
-}
-
-
-ngx_int_t
-ngx_http_core_generic_phase(ngx_http_request_t *r, ngx_http_phase_handler_t *ph)
-{
- ngx_int_t rc;
-
- /*
- * generic phase checker,
- * used by the post read and pre-access phases
- */
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "generic phase: %ui", r->phase_handler);
-
- rc = ph->handler(r);
-
- if (rc == NGX_OK) {
- r->phase_handler = ph->next;
- return NGX_AGAIN;
- }
-
- if (rc == NGX_DECLINED) {
- r->phase_handler++;
- return NGX_AGAIN;
- }
-
- if (rc == NGX_AGAIN || rc == NGX_DONE) {
- return NGX_OK;
- }
-
- /* rc == NGX_ERROR || rc == NGX_HTTP_... */
-
- ngx_http_finalize_request(r, rc);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_core_rewrite_phase(ngx_http_request_t *r, ngx_http_phase_handler_t *ph)
-{
- ngx_int_t rc;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "rewrite phase: %ui", r->phase_handler);
-
- rc = ph->handler(r);
-
- if (rc == NGX_DECLINED) {
- r->phase_handler++;
- return NGX_AGAIN;
- }
-
- if (rc == NGX_DONE) {
- return NGX_OK;
- }
-
- /* NGX_OK, NGX_AGAIN, NGX_ERROR, NGX_HTTP_... */
-
- ngx_http_finalize_request(r, rc);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_core_find_config_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph)
-{
- u_char *p;
- size_t len;
- ngx_int_t rc;
- ngx_http_core_loc_conf_t *clcf;
-
- r->content_handler = NULL;
- r->uri_changed = 0;
-
- rc = ngx_http_core_find_location(r);
-
- if (rc == NGX_ERROR) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_OK;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (!r->internal && clcf->internal) {
- ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
- return NGX_OK;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "using configuration \"%s%V\"",
- (clcf->noname ? "*" : (clcf->exact_match ? "=" : "")),
- &clcf->name);
-
- ngx_http_update_location_config(r);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http cl:%O max:%O",
- r->headers_in.content_length_n, clcf->client_max_body_size);
-
- if (r->headers_in.content_length_n != -1
- && !r->discard_body
- && clcf->client_max_body_size
- && clcf->client_max_body_size < r->headers_in.content_length_n)
- {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client intended to send too large body: %O bytes",
- r->headers_in.content_length_n);
-
- r->expect_tested = 1;
- (void) ngx_http_discard_request_body(r);
- ngx_http_finalize_request(r, NGX_HTTP_REQUEST_ENTITY_TOO_LARGE);
- return NGX_OK;
- }
-
- if (rc == NGX_DONE) {
- ngx_http_clear_location(r);
-
- r->headers_out.location = ngx_list_push(&r->headers_out.headers);
- if (r->headers_out.location == NULL) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_OK;
- }
-
- /*
- * we do not need to set the r->headers_out.location->hash and
- * r->headers_out.location->key fields
- */
-
- if (r->args.len == 0) {
- r->headers_out.location->value = clcf->name;
-
- } else {
- len = clcf->name.len + 1 + r->args.len;
- p = ngx_pnalloc(r->pool, len);
-
- if (p == NULL) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_OK;
- }
-
- r->headers_out.location->value.len = len;
- r->headers_out.location->value.data = p;
-
- p = ngx_cpymem(p, clcf->name.data, clcf->name.len);
- *p++ = '?';
- ngx_memcpy(p, r->args.data, r->args.len);
- }
-
- ngx_http_finalize_request(r, NGX_HTTP_MOVED_PERMANENTLY);
- return NGX_OK;
- }
-
- r->phase_handler++;
- return NGX_AGAIN;
-}
-
-
-ngx_int_t
-ngx_http_core_post_rewrite_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph)
-{
- ngx_http_core_srv_conf_t *cscf;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "post rewrite phase: %ui", r->phase_handler);
-
- if (!r->uri_changed) {
- r->phase_handler++;
- return NGX_AGAIN;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "uri changes: %d", r->uri_changes);
-
- /*
- * gcc before 3.3 compiles the broken code for
- * if (r->uri_changes-- == 0)
- * if the r->uri_changes is defined as
- * unsigned uri_changes:4
- */
-
- r->uri_changes--;
-
- if (r->uri_changes == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "rewrite or internal redirection cycle "
- "while processing \"%V\"", &r->uri);
-
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_OK;
- }
-
- r->phase_handler = ph->next;
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
- r->loc_conf = cscf->ctx->loc_conf;
-
- return NGX_AGAIN;
-}
-
-
-ngx_int_t
-ngx_http_core_access_phase(ngx_http_request_t *r, ngx_http_phase_handler_t *ph)
-{
- ngx_int_t rc;
- ngx_http_core_loc_conf_t *clcf;
-
- if (r != r->main) {
- r->phase_handler = ph->next;
- return NGX_AGAIN;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "access phase: %ui", r->phase_handler);
-
- rc = ph->handler(r);
-
- if (rc == NGX_DECLINED) {
- r->phase_handler++;
- return NGX_AGAIN;
- }
-
- if (rc == NGX_AGAIN || rc == NGX_DONE) {
- return NGX_OK;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->satisfy == NGX_HTTP_SATISFY_ALL) {
-
- if (rc == NGX_OK) {
- r->phase_handler++;
- return NGX_AGAIN;
- }
-
- } else {
- if (rc == NGX_OK) {
- r->access_code = 0;
-
- if (r->headers_out.www_authenticate) {
- r->headers_out.www_authenticate->hash = 0;
- }
-
- r->phase_handler = ph->next;
- return NGX_AGAIN;
- }
-
- if (rc == NGX_HTTP_FORBIDDEN || rc == NGX_HTTP_UNAUTHORIZED) {
- if (r->access_code != NGX_HTTP_UNAUTHORIZED) {
- r->access_code = rc;
- }
-
- r->phase_handler++;
- return NGX_AGAIN;
- }
- }
-
- /* rc == NGX_ERROR || rc == NGX_HTTP_... */
-
- ngx_http_finalize_request(r, rc);
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_core_post_access_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph)
-{
- ngx_int_t access_code;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "post access phase: %ui", r->phase_handler);
-
- access_code = r->access_code;
-
- if (access_code) {
- if (access_code == NGX_HTTP_FORBIDDEN) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "access forbidden by rule");
- }
-
- r->access_code = 0;
- ngx_http_finalize_request(r, access_code);
- return NGX_OK;
- }
-
- r->phase_handler++;
- return NGX_AGAIN;
-}
-
-
-ngx_int_t
-ngx_http_core_try_files_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph)
-{
- size_t len, root, alias, reserve, allocated;
- u_char *p, *name;
- ngx_str_t path, args;
- ngx_uint_t test_dir;
- ngx_http_try_file_t *tf;
- ngx_open_file_info_t of;
- ngx_http_script_code_pt code;
- ngx_http_script_engine_t e;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_script_len_code_pt lcode;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "try files phase: %ui", r->phase_handler);
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->try_files == NULL) {
- r->phase_handler++;
- return NGX_AGAIN;
- }
-
- allocated = 0;
- root = 0;
- name = NULL;
- /* suppress MSVC warning */
- path.data = NULL;
-
- tf = clcf->try_files;
-
- alias = clcf->alias;
-
- for ( ;; ) {
-
- if (tf->lengths) {
- ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
-
- e.ip = tf->lengths->elts;
- e.request = r;
-
- /* 1 is for terminating '\0' as in static names */
- len = 1;
-
- while (*(uintptr_t *) e.ip) {
- lcode = *(ngx_http_script_len_code_pt *) e.ip;
- len += lcode(&e);
- }
-
- } else {
- len = tf->name.len;
- }
-
- if (!alias) {
- reserve = len > r->uri.len ? len - r->uri.len : 0;
-
- } else if (alias == NGX_MAX_SIZE_T_VALUE) {
- reserve = len;
-
- } else {
- reserve = len > r->uri.len - alias ? len - (r->uri.len - alias) : 0;
- }
-
- if (reserve > allocated || !allocated) {
-
- /* 16 bytes are preallocation */
- allocated = reserve + 16;
-
- if (ngx_http_map_uri_to_path(r, &path, &root, allocated) == NULL) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_OK;
- }
-
- name = path.data + root;
- }
-
- if (tf->values == NULL) {
-
- /* tf->name.len includes the terminating '\0' */
-
- ngx_memcpy(name, tf->name.data, tf->name.len);
-
- path.len = (name + tf->name.len - 1) - path.data;
-
- } else {
- e.ip = tf->values->elts;
- e.pos = name;
- e.flushed = 1;
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
-
- path.len = e.pos - path.data;
-
- *e.pos = '\0';
-
- if (alias && ngx_strncmp(name, clcf->name.data, alias) == 0) {
- ngx_memmove(name, name + alias, len - alias);
- path.len -= alias;
- }
- }
-
- test_dir = tf->test_dir;
-
- tf++;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "trying to use %s: \"%s\" \"%s\"",
- test_dir ? "dir" : "file", name, path.data);
-
- if (tf->lengths == NULL && tf->name.len == 0) {
-
- if (tf->code) {
- ngx_http_finalize_request(r, tf->code);
- return NGX_OK;
- }
-
- path.len -= root;
- path.data += root;
-
- if (path.data[0] == '@') {
- (void) ngx_http_named_location(r, &path);
-
- } else {
- ngx_http_split_args(r, &path, &args);
-
- (void) ngx_http_internal_redirect(r, &path, &args);
- }
-
- ngx_http_finalize_request(r, NGX_DONE);
- return NGX_OK;
- }
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.read_ahead = clcf->read_ahead;
- of.directio = clcf->directio;
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.test_only = 1;
- of.errors = clcf->open_file_cache_errors;
- of.events = clcf->open_file_cache_events;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_OK;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- != NGX_OK)
- {
- if (of.err != NGX_ENOENT
- && of.err != NGX_ENOTDIR
- && of.err != NGX_ENAMETOOLONG)
- {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,
- "%s \"%s\" failed", of.failed, path.data);
- }
-
- continue;
- }
-
- if (of.is_dir && !test_dir) {
- continue;
- }
-
- path.len -= root;
- path.data += root;
-
- if (!alias) {
- r->uri = path;
-
- } else if (alias == NGX_MAX_SIZE_T_VALUE) {
- if (!test_dir) {
- r->uri = path;
- r->add_uri_to_alias = 1;
- }
-
- } else {
- r->uri.len = alias + path.len;
- r->uri.data = ngx_pnalloc(r->pool, r->uri.len);
- if (r->uri.data == NULL) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_OK;
- }
-
- p = ngx_copy(r->uri.data, clcf->name.data, alias);
- ngx_memcpy(p, name, path.len);
- }
-
- ngx_http_set_exten(r);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "try file uri: \"%V\"", &r->uri);
-
- r->phase_handler++;
- return NGX_AGAIN;
- }
-
- /* not reached */
-}
-
-
-ngx_int_t
-ngx_http_core_content_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph)
-{
- size_t root;
- ngx_int_t rc;
- ngx_str_t path;
-
- if (r->content_handler) {
- r->write_event_handler = ngx_http_request_empty_handler;
- ngx_http_finalize_request(r, r->content_handler(r));
- return NGX_OK;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "content phase: %ui", r->phase_handler);
-
- rc = ph->handler(r);
-
- if (rc != NGX_DECLINED) {
- ngx_http_finalize_request(r, rc);
- return NGX_OK;
- }
-
- /* rc == NGX_DECLINED */
-
- ph++;
-
- if (ph->checker) {
- r->phase_handler++;
- return NGX_AGAIN;
- }
-
- /* no content handler was found */
-
- if (r->uri.data[r->uri.len - 1] == '/') {
-
- if (ngx_http_map_uri_to_path(r, &path, &root, 0) != NULL) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "directory index of \"%s\" is forbidden", path.data);
- }
-
- ngx_http_finalize_request(r, NGX_HTTP_FORBIDDEN);
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no handler found");
-
- ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
- return NGX_OK;
-}
-
-
-void
-ngx_http_update_location_config(ngx_http_request_t *r)
-{
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (r->method & clcf->limit_except) {
- r->loc_conf = clcf->limit_except_loc_conf;
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- }
-
- if (r == r->main) {
- ngx_http_set_connection_log(r->connection, clcf->error_log);
- }
-
- if ((ngx_io.flags & NGX_IO_SENDFILE) && clcf->sendfile) {
- r->connection->sendfile = 1;
-
- } else {
- r->connection->sendfile = 0;
- }
-
- if (clcf->client_body_in_file_only) {
- r->request_body_in_file_only = 1;
- r->request_body_in_persistent_file = 1;
- r->request_body_in_clean_file =
- clcf->client_body_in_file_only == NGX_HTTP_REQUEST_BODY_FILE_CLEAN;
- r->request_body_file_log_level = NGX_LOG_NOTICE;
-
- } else {
- r->request_body_file_log_level = NGX_LOG_WARN;
- }
-
- r->request_body_in_single_buf = clcf->client_body_in_single_buffer;
-
- if (r->keepalive) {
- if (clcf->keepalive_timeout == 0) {
- r->keepalive = 0;
-
- } else if (r->connection->requests >= clcf->keepalive_requests) {
- r->keepalive = 0;
-
- } else if (r->headers_in.msie6
- && r->method == NGX_HTTP_POST
- && (clcf->keepalive_disable
- & NGX_HTTP_KEEPALIVE_DISABLE_MSIE6))
- {
- /*
- * MSIE may wait for some time if an response for
- * a POST request was sent over a keepalive connection
- */
- r->keepalive = 0;
-
- } else if (r->headers_in.safari
- && (clcf->keepalive_disable
- & NGX_HTTP_KEEPALIVE_DISABLE_SAFARI))
- {
- /*
- * Safari may send a POST request to a closed keepalive
- * connection and may stall for some time, see
- * https://bugs.webkit.org/show_bug.cgi?id=5760
- */
- r->keepalive = 0;
- }
- }
-
- if (!clcf->tcp_nopush) {
- /* disable TCP_NOPUSH/TCP_CORK use */
- r->connection->tcp_nopush = NGX_TCP_NOPUSH_DISABLED;
- }
-
- if (r->limit_rate == 0) {
- r->limit_rate = clcf->limit_rate;
- }
-
- if (clcf->handler) {
- r->content_handler = clcf->handler;
- }
-}
-
-
-/*
- * NGX_OK - exact or regex match
- * NGX_DONE - auto redirect
- * NGX_AGAIN - inclusive match
- * NGX_ERROR - regex error
- * NGX_DECLINED - no match
- */
-
-static ngx_int_t
-ngx_http_core_find_location(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_http_core_loc_conf_t *pclcf;
-#if (NGX_PCRE)
- ngx_int_t n;
- ngx_uint_t noregex;
- ngx_http_core_loc_conf_t *clcf, **clcfp;
-
- noregex = 0;
-#endif
-
- pclcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- rc = ngx_http_core_find_static_location(r, pclcf->static_locations);
-
- if (rc == NGX_AGAIN) {
-
-#if (NGX_PCRE)
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- noregex = clcf->noregex;
-#endif
-
- /* look up nested locations */
-
- rc = ngx_http_core_find_location(r);
- }
-
- if (rc == NGX_OK || rc == NGX_DONE) {
- return rc;
- }
-
- /* rc == NGX_DECLINED or rc == NGX_AGAIN in nested location */
-
-#if (NGX_PCRE)
-
- if (noregex == 0 && pclcf->regex_locations) {
-
- for (clcfp = pclcf->regex_locations; *clcfp; clcfp++) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "test location: ~ \"%V\"", &(*clcfp)->name);
-
- n = ngx_http_regex_exec(r, (*clcfp)->regex, &r->uri);
-
- if (n == NGX_OK) {
- r->loc_conf = (*clcfp)->loc_conf;
-
- /* look up nested locations */
-
- rc = ngx_http_core_find_location(r);
-
- return (rc == NGX_ERROR) ? rc : NGX_OK;
- }
-
- if (n == NGX_DECLINED) {
- continue;
- }
-
- return NGX_ERROR;
- }
- }
-#endif
-
- return rc;
-}
-
-
-/*
- * NGX_OK - exact match
- * NGX_DONE - auto redirect
- * NGX_AGAIN - inclusive match
- * NGX_DECLINED - no match
- */
-
-static ngx_int_t
-ngx_http_core_find_static_location(ngx_http_request_t *r,
- ngx_http_location_tree_node_t *node)
-{
- u_char *uri;
- size_t len, n;
- ngx_int_t rc, rv;
-
- len = r->uri.len;
- uri = r->uri.data;
-
- rv = NGX_DECLINED;
-
- for ( ;; ) {
-
- if (node == NULL) {
- return rv;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "test location: \"%*s\"", node->len, node->name);
-
- n = (len <= (size_t) node->len) ? len : node->len;
-
- rc = ngx_filename_cmp(uri, node->name, n);
-
- if (rc != 0) {
- node = (rc < 0) ? node->left : node->right;
-
- continue;
- }
-
- if (len > (size_t) node->len) {
-
- if (node->inclusive) {
-
- r->loc_conf = node->inclusive->loc_conf;
- rv = NGX_AGAIN;
-
- node = node->tree;
- uri += n;
- len -= n;
-
- continue;
- }
-
- /* exact only */
-
- node = node->right;
-
- continue;
- }
-
- if (len == (size_t) node->len) {
-
- if (node->exact) {
- r->loc_conf = node->exact->loc_conf;
- return NGX_OK;
-
- } else {
- r->loc_conf = node->inclusive->loc_conf;
- return NGX_AGAIN;
- }
- }
-
- /* len < node->len */
-
- if (len + 1 == (size_t) node->len && node->auto_redirect) {
-
- r->loc_conf = (node->exact) ? node->exact->loc_conf:
- node->inclusive->loc_conf;
- rv = NGX_DONE;
- }
-
- node = node->left;
- }
-}
-
-
-void *
-ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash)
-{
- u_char c, *lowcase;
- size_t len;
- ngx_uint_t i, hash;
-
- if (types_hash->size == 0) {
- return (void *) 4;
- }
-
- if (r->headers_out.content_type.len == 0) {
- return NULL;
- }
-
- len = r->headers_out.content_type_len;
-
- if (r->headers_out.content_type_lowcase == NULL) {
-
- lowcase = ngx_pnalloc(r->pool, len);
- if (lowcase == NULL) {
- return NULL;
- }
-
- r->headers_out.content_type_lowcase = lowcase;
-
- hash = 0;
-
- for (i = 0; i < len; i++) {
- c = ngx_tolower(r->headers_out.content_type.data[i]);
- hash = ngx_hash(hash, c);
- lowcase[i] = c;
- }
-
- r->headers_out.content_type_hash = hash;
- }
-
- return ngx_hash_find(types_hash, r->headers_out.content_type_hash,
- r->headers_out.content_type_lowcase, len);
-}
-
-
-ngx_int_t
-ngx_http_set_content_type(ngx_http_request_t *r)
-{
- u_char c, *exten;
- ngx_str_t *type;
- ngx_uint_t i, hash;
- ngx_http_core_loc_conf_t *clcf;
-
- if (r->headers_out.content_type.len) {
- return NGX_OK;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (r->exten.len) {
-
- hash = 0;
-
- for (i = 0; i < r->exten.len; i++) {
- c = r->exten.data[i];
-
- if (c >= 'A' && c <= 'Z') {
-
- exten = ngx_pnalloc(r->pool, r->exten.len);
- if (exten == NULL) {
- return NGX_ERROR;
- }
-
- hash = ngx_hash_strlow(exten, r->exten.data, r->exten.len);
-
- r->exten.data = exten;
-
- break;
- }
-
- hash = ngx_hash(hash, c);
- }
-
- type = ngx_hash_find(&clcf->types_hash, hash,
- r->exten.data, r->exten.len);
-
- if (type) {
- r->headers_out.content_type_len = type->len;
- r->headers_out.content_type = *type;
-
- return NGX_OK;
- }
- }
-
- r->headers_out.content_type_len = clcf->default_type.len;
- r->headers_out.content_type = clcf->default_type;
-
- return NGX_OK;
-}
-
-
-void
-ngx_http_set_exten(ngx_http_request_t *r)
-{
- ngx_int_t i;
-
- ngx_str_null(&r->exten);
-
- for (i = r->uri.len - 1; i > 1; i--) {
- if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {
-
- r->exten.len = r->uri.len - i - 1;
- r->exten.data = &r->uri.data[i + 1];
-
- return;
-
- } else if (r->uri.data[i] == '/') {
- return;
- }
- }
-
- return;
-}
-
-
-ngx_int_t
-ngx_http_set_etag(ngx_http_request_t *r)
-{
- ngx_table_elt_t *etag;
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (!clcf->etag) {
- return NGX_OK;
- }
-
- etag = ngx_list_push(&r->headers_out.headers);
- if (etag == NULL) {
- return NGX_ERROR;
- }
-
- etag->hash = 1;
- ngx_str_set(&etag->key, "ETag");
-
- etag->value.data = ngx_pnalloc(r->pool, NGX_OFF_T_LEN + NGX_TIME_T_LEN + 3);
- if (etag->value.data == NULL) {
- etag->hash = 0;
- return NGX_ERROR;
- }
-
- etag->value.len = ngx_sprintf(etag->value.data, "\"%xT-%xO\"",
- r->headers_out.last_modified_time,
- r->headers_out.content_length_n)
- - etag->value.data;
-
- r->headers_out.etag = etag;
-
- return NGX_OK;
-}
-
-
-void
-ngx_http_weak_etag(ngx_http_request_t *r)
-{
- size_t len;
- u_char *p;
- ngx_table_elt_t *etag;
-
- etag = r->headers_out.etag;
-
- if (etag == NULL) {
- return;
- }
-
- if (etag->value.len > 2
- && etag->value.data[0] == 'W'
- && etag->value.data[1] == '/')
- {
- return;
- }
-
- if (etag->value.len < 1 || etag->value.data[0] != '"') {
- r->headers_out.etag->hash = 0;
- r->headers_out.etag = NULL;
- return;
- }
-
- p = ngx_pnalloc(r->pool, etag->value.len + 2);
- if (p == NULL) {
- r->headers_out.etag->hash = 0;
- r->headers_out.etag = NULL;
- return;
- }
-
- len = ngx_sprintf(p, "W/%V", &etag->value) - p;
-
- etag->value.data = p;
- etag->value.len = len;
-}
-
-
-ngx_int_t
-ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status,
- ngx_str_t *ct, ngx_http_complex_value_t *cv)
-{
- ngx_int_t rc;
- ngx_str_t val;
- ngx_buf_t *b;
- ngx_chain_t out;
-
- if (ngx_http_discard_request_body(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- r->headers_out.status = status;
-
- if (ngx_http_complex_value(r, cv, &val) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (status == NGX_HTTP_MOVED_PERMANENTLY
- || status == NGX_HTTP_MOVED_TEMPORARILY
- || status == NGX_HTTP_SEE_OTHER
- || status == NGX_HTTP_TEMPORARY_REDIRECT)
- {
- ngx_http_clear_location(r);
-
- r->headers_out.location = ngx_list_push(&r->headers_out.headers);
- if (r->headers_out.location == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- r->headers_out.location->hash = 1;
- ngx_str_set(&r->headers_out.location->key, "Location");
- r->headers_out.location->value = val;
-
- return status;
- }
-
- r->headers_out.content_length_n = val.len;
-
- if (ct) {
- r->headers_out.content_type_len = ct->len;
- r->headers_out.content_type = *ct;
-
- } else {
- if (ngx_http_set_content_type(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
- }
-
- if (r->method == NGX_HTTP_HEAD || (r != r->main && val.len == 0)) {
- return ngx_http_send_header(r);
- }
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b->pos = val.data;
- b->last = val.data + val.len;
- b->memory = val.len ? 1 : 0;
- b->last_buf = (r == r->main) ? 1 : 0;
- b->last_in_chain = 1;
-
- out.buf = b;
- out.next = NULL;
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- return rc;
- }
-
- return ngx_http_output_filter(r, &out);
-}
-
-
-ngx_int_t
-ngx_http_send_header(ngx_http_request_t *r)
-{
- if (r->header_sent) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "header already sent");
- return NGX_ERROR;
- }
-
- if (r->err_status) {
- r->headers_out.status = r->err_status;
- r->headers_out.status_line.len = 0;
- }
-
- return ngx_http_top_header_filter(r);
-}
-
-
-ngx_int_t
-ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- ngx_int_t rc;
- ngx_connection_t *c;
-
- c = r->connection;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http output filter \"%V?%V\"", &r->uri, &r->args);
-
- rc = ngx_http_top_body_filter(r, in);
-
- if (rc == NGX_ERROR) {
- /* NGX_ERROR may be returned by any filter */
- c->error = 1;
- }
-
- return rc;
-}
-
-
-u_char *
-ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path,
- size_t *root_length, size_t reserved)
-{
- u_char *last;
- size_t alias;
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- alias = clcf->alias;
-
- if (alias && !r->valid_location) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "\"alias\" cannot be used in location \"%V\" "
- "where URI was rewritten", &clcf->name);
- return NULL;
- }
-
- if (clcf->root_lengths == NULL) {
-
- *root_length = clcf->root.len;
-
- path->len = clcf->root.len + reserved + r->uri.len - alias + 1;
-
- path->data = ngx_pnalloc(r->pool, path->len);
- if (path->data == NULL) {
- return NULL;
- }
-
- last = ngx_copy(path->data, clcf->root.data, clcf->root.len);
-
- } else {
-
- if (alias == NGX_MAX_SIZE_T_VALUE) {
- reserved += r->add_uri_to_alias ? r->uri.len + 1 : 1;
-
- } else {
- reserved += r->uri.len - alias + 1;
- }
-
- if (ngx_http_script_run(r, path, clcf->root_lengths->elts, reserved,
- clcf->root_values->elts)
- == NULL)
- {
- return NULL;
- }
-
- if (ngx_get_full_name(r->pool, (ngx_str_t *) &ngx_cycle->prefix, path)
- != NGX_OK)
- {
- return NULL;
- }
-
- *root_length = path->len - reserved;
- last = path->data + *root_length;
-
- if (alias == NGX_MAX_SIZE_T_VALUE) {
- if (!r->add_uri_to_alias) {
- *last = '\0';
- return last;
- }
-
- alias = 0;
- }
- }
-
- last = ngx_cpystrn(last, r->uri.data + alias, r->uri.len - alias + 1);
-
- return last;
-}
-
-
-ngx_int_t
-ngx_http_auth_basic_user(ngx_http_request_t *r)
-{
- ngx_str_t auth, encoded;
- ngx_uint_t len;
-
- if (r->headers_in.user.len == 0 && r->headers_in.user.data != NULL) {
- return NGX_DECLINED;
- }
-
- if (r->headers_in.authorization == NULL) {
- r->headers_in.user.data = (u_char *) "";
- return NGX_DECLINED;
- }
-
- encoded = r->headers_in.authorization->value;
-
- if (encoded.len < sizeof("Basic ") - 1
- || ngx_strncasecmp(encoded.data, (u_char *) "Basic ",
- sizeof("Basic ") - 1)
- != 0)
- {
- r->headers_in.user.data = (u_char *) "";
- return NGX_DECLINED;
- }
-
- encoded.len -= sizeof("Basic ") - 1;
- encoded.data += sizeof("Basic ") - 1;
-
- while (encoded.len && encoded.data[0] == ' ') {
- encoded.len--;
- encoded.data++;
- }
-
- if (encoded.len == 0) {
- r->headers_in.user.data = (u_char *) "";
- return NGX_DECLINED;
- }
-
- auth.len = ngx_base64_decoded_length(encoded.len);
- auth.data = ngx_pnalloc(r->pool, auth.len + 1);
- if (auth.data == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_decode_base64(&auth, &encoded) != NGX_OK) {
- r->headers_in.user.data = (u_char *) "";
- return NGX_DECLINED;
- }
-
- auth.data[auth.len] = '\0';
-
- for (len = 0; len < auth.len; len++) {
- if (auth.data[len] == ':') {
- break;
- }
- }
-
- if (len == 0 || len == auth.len) {
- r->headers_in.user.data = (u_char *) "";
- return NGX_DECLINED;
- }
-
- r->headers_in.user.len = len;
- r->headers_in.user.data = auth.data;
- r->headers_in.passwd.len = auth.len - len - 1;
- r->headers_in.passwd.data = &auth.data[len + 1];
-
- return NGX_OK;
-}
-
-
-#if (NGX_HTTP_GZIP)
-
-ngx_int_t
-ngx_http_gzip_ok(ngx_http_request_t *r)
-{
- time_t date, expires;
- ngx_uint_t p;
- ngx_array_t *cc;
- ngx_table_elt_t *e, *d, *ae;
- ngx_http_core_loc_conf_t *clcf;
-
- r->gzip_tested = 1;
-
- if (r != r->main) {
- return NGX_DECLINED;
- }
-
-#if (NGX_HTTP_SPDY)
- if (r->spdy_stream) {
- r->gzip_ok = 1;
- return NGX_OK;
- }
-#endif
-
- ae = r->headers_in.accept_encoding;
- if (ae == NULL) {
- return NGX_DECLINED;
- }
-
- if (ae->value.len < sizeof("gzip") - 1) {
- return NGX_DECLINED;
- }
-
- /*
- * test first for the most common case "gzip,...":
- * MSIE: "gzip, deflate"
- * Firefox: "gzip,deflate"
- * Chrome: "gzip,deflate,sdch"
- * Safari: "gzip, deflate"
- * Opera: "gzip, deflate"
- */
-
- if (ngx_memcmp(ae->value.data, "gzip,", 5) != 0
- && ngx_http_gzip_accept_encoding(&ae->value) != NGX_OK)
- {
- return NGX_DECLINED;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (r->headers_in.msie6 && clcf->gzip_disable_msie6) {
- return NGX_DECLINED;
- }
-
- if (r->http_version < clcf->gzip_http_version) {
- return NGX_DECLINED;
- }
-
- if (r->headers_in.via == NULL) {
- goto ok;
- }
-
- p = clcf->gzip_proxied;
-
- if (p & NGX_HTTP_GZIP_PROXIED_OFF) {
- return NGX_DECLINED;
- }
-
- if (p & NGX_HTTP_GZIP_PROXIED_ANY) {
- goto ok;
- }
-
- if (r->headers_in.authorization && (p & NGX_HTTP_GZIP_PROXIED_AUTH)) {
- goto ok;
- }
-
- e = r->headers_out.expires;
-
- if (e) {
-
- if (!(p & NGX_HTTP_GZIP_PROXIED_EXPIRED)) {
- return NGX_DECLINED;
- }
-
- expires = ngx_http_parse_time(e->value.data, e->value.len);
- if (expires == NGX_ERROR) {
- return NGX_DECLINED;
- }
-
- d = r->headers_out.date;
-
- if (d) {
- date = ngx_http_parse_time(d->value.data, d->value.len);
- if (date == NGX_ERROR) {
- return NGX_DECLINED;
- }
-
- } else {
- date = ngx_time();
- }
-
- if (expires < date) {
- goto ok;
- }
-
- return NGX_DECLINED;
- }
-
- cc = &r->headers_out.cache_control;
-
- if (cc->elts) {
-
- if ((p & NGX_HTTP_GZIP_PROXIED_NO_CACHE)
- && ngx_http_parse_multi_header_lines(cc, &ngx_http_gzip_no_cache,
- NULL)
- >= 0)
- {
- goto ok;
- }
-
- if ((p & NGX_HTTP_GZIP_PROXIED_NO_STORE)
- && ngx_http_parse_multi_header_lines(cc, &ngx_http_gzip_no_store,
- NULL)
- >= 0)
- {
- goto ok;
- }
-
- if ((p & NGX_HTTP_GZIP_PROXIED_PRIVATE)
- && ngx_http_parse_multi_header_lines(cc, &ngx_http_gzip_private,
- NULL)
- >= 0)
- {
- goto ok;
- }
-
- return NGX_DECLINED;
- }
-
- if ((p & NGX_HTTP_GZIP_PROXIED_NO_LM) && r->headers_out.last_modified) {
- return NGX_DECLINED;
- }
-
- if ((p & NGX_HTTP_GZIP_PROXIED_NO_ETAG) && r->headers_out.etag) {
- return NGX_DECLINED;
- }
-
-ok:
-
-#if (NGX_PCRE)
-
- if (clcf->gzip_disable && r->headers_in.user_agent) {
-
- if (ngx_regex_exec_array(clcf->gzip_disable,
- &r->headers_in.user_agent->value,
- r->connection->log)
- != NGX_DECLINED)
- {
- return NGX_DECLINED;
- }
- }
-
-#endif
-
- r->gzip_ok = 1;
-
- return NGX_OK;
-}
-
-
-/*
- * gzip is enabled for the following quantities:
- * "gzip; q=0.001" ... "gzip; q=1.000"
- * gzip is disabled for the following quantities:
- * "gzip; q=0" ... "gzip; q=0.000", and for any invalid cases
- */
-
-static ngx_int_t
-ngx_http_gzip_accept_encoding(ngx_str_t *ae)
-{
- u_char *p, *start, *last;
-
- start = ae->data;
- last = start + ae->len;
-
- for ( ;; ) {
- p = ngx_strcasestrn(start, "gzip", 4 - 1);
- if (p == NULL) {
- return NGX_DECLINED;
- }
-
- if (p == start || (*(p - 1) == ',' || *(p - 1) == ' ')) {
- break;
- }
-
- start = p + 4;
- }
-
- p += 4;
-
- while (p < last) {
- switch (*p++) {
- case ',':
- return NGX_OK;
- case ';':
- goto quantity;
- case ' ':
- continue;
- default:
- return NGX_DECLINED;
- }
- }
-
- return NGX_OK;
-
-quantity:
-
- while (p < last) {
- switch (*p++) {
- case 'q':
- case 'Q':
- goto equal;
- case ' ':
- continue;
- default:
- return NGX_DECLINED;
- }
- }
-
- return NGX_OK;
-
-equal:
-
- if (p + 2 > last || *p++ != '=') {
- return NGX_DECLINED;
- }
-
- if (ngx_http_gzip_quantity(p, last) == 0) {
- return NGX_DECLINED;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_uint_t
-ngx_http_gzip_quantity(u_char *p, u_char *last)
-{
- u_char c;
- ngx_uint_t n, q;
-
- c = *p++;
-
- if (c != '0' && c != '1') {
- return 0;
- }
-
- q = (c - '0') * 100;
-
- if (p == last) {
- return q;
- }
-
- c = *p++;
-
- if (c == ',' || c == ' ') {
- return q;
- }
-
- if (c != '.') {
- return 0;
- }
-
- n = 0;
-
- while (p < last) {
- c = *p++;
-
- if (c == ',' || c == ' ') {
- break;
- }
-
- if (c >= '0' && c <= '9') {
- q += c - '0';
- n++;
- continue;
- }
-
- return 0;
- }
-
- if (q > 100 || n > 3) {
- return 0;
- }
-
- return q;
-}
-
-#endif
-
-
-ngx_int_t
-ngx_http_subrequest(ngx_http_request_t *r,
- ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **psr,
- ngx_http_post_subrequest_t *ps, ngx_uint_t flags)
-{
- ngx_time_t *tp;
- ngx_connection_t *c;
- ngx_http_request_t *sr;
- ngx_http_core_srv_conf_t *cscf;
- ngx_http_postponed_request_t *pr, *p;
-
- r->main->subrequests--;
-
- if (r->main->subrequests == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "subrequests cycle while processing \"%V\"", uri);
- r->main->subrequests = 1;
- return NGX_ERROR;
- }
-
- sr = ngx_pcalloc(r->pool, sizeof(ngx_http_request_t));
- if (sr == NULL) {
- return NGX_ERROR;
- }
-
- sr->signature = NGX_HTTP_MODULE;
-
- c = r->connection;
- sr->connection = c;
-
- sr->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
- if (sr->ctx == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_list_init(&sr->headers_out.headers, r->pool, 20,
- sizeof(ngx_table_elt_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
- sr->main_conf = cscf->ctx->main_conf;
- sr->srv_conf = cscf->ctx->srv_conf;
- sr->loc_conf = cscf->ctx->loc_conf;
-
- sr->pool = r->pool;
-
- sr->headers_in = r->headers_in;
-
- ngx_http_clear_content_length(sr);
- ngx_http_clear_accept_ranges(sr);
- ngx_http_clear_last_modified(sr);
-
- sr->request_body = r->request_body;
-
-#if (NGX_HTTP_SPDY)
- sr->spdy_stream = r->spdy_stream;
-#endif
-
- sr->method = NGX_HTTP_GET;
- sr->http_version = r->http_version;
-
- sr->request_line = r->request_line;
- sr->uri = *uri;
-
- if (args) {
- sr->args = *args;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http subrequest \"%V?%V\"", uri, &sr->args);
-
- sr->subrequest_in_memory = (flags & NGX_HTTP_SUBREQUEST_IN_MEMORY) != 0;
- sr->waited = (flags & NGX_HTTP_SUBREQUEST_WAITED) != 0;
-
- sr->unparsed_uri = r->unparsed_uri;
- sr->method_name = ngx_http_core_get_method;
- sr->http_protocol = r->http_protocol;
-
- ngx_http_set_exten(sr);
-
- sr->main = r->main;
- sr->parent = r;
- sr->post_subrequest = ps;
- sr->read_event_handler = ngx_http_request_empty_handler;
- sr->write_event_handler = ngx_http_handler;
-
- if (c->data == r && r->postponed == NULL) {
- c->data = sr;
- }
-
- sr->variables = r->variables;
-
- sr->log_handler = r->log_handler;
-
- pr = ngx_palloc(r->pool, sizeof(ngx_http_postponed_request_t));
- if (pr == NULL) {
- return NGX_ERROR;
- }
-
- pr->request = sr;
- pr->out = NULL;
- pr->next = NULL;
-
- if (r->postponed) {
- for (p = r->postponed; p->next; p = p->next) { /* void */ }
- p->next = pr;
-
- } else {
- r->postponed = pr;
- }
-
- sr->internal = 1;
-
- sr->discard_body = r->discard_body;
- sr->expect_tested = 1;
- sr->main_filter_need_in_memory = r->main_filter_need_in_memory;
-
- sr->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1;
-
- tp = ngx_timeofday();
- sr->start_sec = tp->sec;
- sr->start_msec = tp->msec;
-
- r->main->count++;
-
- *psr = sr;
-
- return ngx_http_post_request(sr, NULL);
-}
-
-
-ngx_int_t
-ngx_http_internal_redirect(ngx_http_request_t *r,
- ngx_str_t *uri, ngx_str_t *args)
-{
- ngx_http_core_srv_conf_t *cscf;
-
- r->uri_changes--;
-
- if (r->uri_changes == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "rewrite or internal redirection cycle "
- "while internally redirecting to \"%V\"", uri);
-
- r->main->count++;
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_DONE;
- }
-
- r->uri = *uri;
-
- if (args) {
- r->args = *args;
-
- } else {
- ngx_str_null(&r->args);
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "internal redirect: \"%V?%V\"", uri, &r->args);
-
- ngx_http_set_exten(r);
-
- /* clear the modules contexts */
- ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
- r->loc_conf = cscf->ctx->loc_conf;
-
- ngx_http_update_location_config(r);
-
-#if (NGX_HTTP_CACHE)
- r->cache = NULL;
-#endif
-
- r->internal = 1;
- r->valid_unparsed_uri = 0;
- r->add_uri_to_alias = 0;
- r->main->count++;
-
- ngx_http_handler(r);
-
- return NGX_DONE;
-}
-
-
-ngx_int_t
-ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name)
-{
- ngx_http_core_srv_conf_t *cscf;
- ngx_http_core_loc_conf_t **clcfp;
- ngx_http_core_main_conf_t *cmcf;
-
- r->main->count++;
- r->uri_changes--;
-
- if (r->uri_changes == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "rewrite or internal redirection cycle "
- "while redirect to named location \"%V\"", name);
-
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_DONE;
- }
-
- if (r->uri.len == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "empty URI in redirect to named location \"%V\"", name);
-
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_DONE;
- }
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- if (cscf->named_locations) {
-
- for (clcfp = cscf->named_locations; *clcfp; clcfp++) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "test location: \"%V\"", &(*clcfp)->name);
-
- if (name->len != (*clcfp)->name.len
- || ngx_strncmp(name->data, (*clcfp)->name.data, name->len) != 0)
- {
- continue;
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "using location: %V \"%V?%V\"",
- name, &r->uri, &r->args);
-
- r->internal = 1;
- r->content_handler = NULL;
- r->uri_changed = 0;
- r->loc_conf = (*clcfp)->loc_conf;
-
- /* clear the modules contexts */
- ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
-
- ngx_http_update_location_config(r);
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- r->phase_handler = cmcf->phase_engine.location_rewrite_index;
-
- r->write_event_handler = ngx_http_core_run_phases;
- ngx_http_core_run_phases(r);
-
- return NGX_DONE;
- }
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "could not find named location \"%V\"", name);
-
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
-
- return NGX_DONE;
-}
-
-
-ngx_http_cleanup_t *
-ngx_http_cleanup_add(ngx_http_request_t *r, size_t size)
-{
- ngx_http_cleanup_t *cln;
-
- r = r->main;
-
- cln = ngx_palloc(r->pool, sizeof(ngx_http_cleanup_t));
- if (cln == NULL) {
- return NULL;
- }
-
- if (size) {
- cln->data = ngx_palloc(r->pool, size);
- if (cln->data == NULL) {
- return NULL;
- }
-
- } else {
- cln->data = NULL;
- }
-
- cln->handler = NULL;
- cln->next = r->cleanup;
-
- r->cleanup = cln;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http cleanup add: %p", cln);
-
- return cln;
-}
-
-
-ngx_int_t
-ngx_http_set_disable_symlinks(ngx_http_request_t *r,
- ngx_http_core_loc_conf_t *clcf, ngx_str_t *path, ngx_open_file_info_t *of)
-{
-#if (NGX_HAVE_OPENAT)
- u_char *p;
- ngx_str_t from;
-
- of->disable_symlinks = clcf->disable_symlinks;
-
- if (clcf->disable_symlinks_from == NULL) {
- return NGX_OK;
- }
-
- if (ngx_http_complex_value(r, clcf->disable_symlinks_from, &from)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- if (from.len == 0
- || from.len > path->len
- || ngx_memcmp(path->data, from.data, from.len) != 0)
- {
- return NGX_OK;
- }
-
- if (from.len == path->len) {
- of->disable_symlinks = NGX_DISABLE_SYMLINKS_OFF;
- return NGX_OK;
- }
-
- p = path->data + from.len;
-
- if (*p == '/') {
- of->disable_symlinks_from = from.len;
- return NGX_OK;
- }
-
- p--;
-
- if (*p == '/') {
- of->disable_symlinks_from = from.len - 1;
- }
-#endif
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_get_forwarded_addr(ngx_http_request_t *r, ngx_addr_t *addr,
- ngx_array_t *headers, ngx_str_t *value, ngx_array_t *proxies,
- int recursive)
-{
- ngx_int_t rc;
- ngx_uint_t i, found;
- ngx_table_elt_t **h;
-
- if (headers == NULL) {
- return ngx_http_get_forwarded_addr_internal(r, addr, value->data,
- value->len, proxies,
- recursive);
- }
-
- i = headers->nelts;
- h = headers->elts;
-
- rc = NGX_DECLINED;
-
- found = 0;
-
- while (i-- > 0) {
- rc = ngx_http_get_forwarded_addr_internal(r, addr, h[i]->value.data,
- h[i]->value.len, proxies,
- recursive);
-
- if (!recursive) {
- break;
- }
-
- if (rc == NGX_DECLINED && found) {
- rc = NGX_DONE;
- break;
- }
-
- if (rc != NGX_OK) {
- break;
- }
-
- found = 1;
- }
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_get_forwarded_addr_internal(ngx_http_request_t *r, ngx_addr_t *addr,
- u_char *xff, size_t xfflen, ngx_array_t *proxies, int recursive)
-{
- u_char *p;
- in_addr_t inaddr;
- ngx_int_t rc;
- ngx_addr_t paddr;
- ngx_cidr_t *cidr;
- ngx_uint_t family, i;
-#if (NGX_HAVE_INET6)
- ngx_uint_t n;
- struct in6_addr *inaddr6;
-#endif
-
-#if (NGX_SUPPRESS_WARN)
- inaddr = 0;
-#if (NGX_HAVE_INET6)
- inaddr6 = NULL;
-#endif
-#endif
-
- family = addr->sockaddr->sa_family;
-
- if (family == AF_INET) {
- inaddr = ((struct sockaddr_in *) addr->sockaddr)->sin_addr.s_addr;
- }
-
-#if (NGX_HAVE_INET6)
- else if (family == AF_INET6) {
- inaddr6 = &((struct sockaddr_in6 *) addr->sockaddr)->sin6_addr;
-
- if (IN6_IS_ADDR_V4MAPPED(inaddr6)) {
- family = AF_INET;
-
- p = inaddr6->s6_addr;
-
- inaddr = p[12] << 24;
- inaddr += p[13] << 16;
- inaddr += p[14] << 8;
- inaddr += p[15];
-
- inaddr = htonl(inaddr);
- }
- }
-#endif
-
- for (cidr = proxies->elts, i = 0; i < proxies->nelts; i++) {
- if (cidr[i].family != family) {
- goto next;
- }
-
- switch (family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- for (n = 0; n < 16; n++) {
- if ((inaddr6->s6_addr[n] & cidr[i].u.in6.mask.s6_addr[n])
- != cidr[i].u.in6.addr.s6_addr[n])
- {
- goto next;
- }
- }
- break;
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- break;
-#endif
-
- default: /* AF_INET */
- if ((inaddr & cidr[i].u.in.mask) != cidr[i].u.in.addr) {
- goto next;
- }
- break;
- }
-
- for (p = xff + xfflen - 1; p > xff; p--, xfflen--) {
- if (*p != ' ' && *p != ',') {
- break;
- }
- }
-
- for ( /* void */ ; p > xff; p--) {
- if (*p == ' ' || *p == ',') {
- p++;
- break;
- }
- }
-
- if (ngx_parse_addr(r->pool, &paddr, p, xfflen - (p - xff)) != NGX_OK) {
- return NGX_DECLINED;
- }
-
- *addr = paddr;
-
- if (recursive && p > xff) {
- rc = ngx_http_get_forwarded_addr_internal(r, addr, xff, p - 1 - xff,
- proxies, 1);
-
- if (rc == NGX_DECLINED) {
- return NGX_DONE;
- }
-
- /* rc == NGX_OK || rc == NGX_DONE */
- return rc;
- }
-
- return NGX_OK;
-
- next:
- continue;
- }
-
- return NGX_DECLINED;
-}
-
-
-static char *
-ngx_http_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
-{
- char *rv;
- void *mconf;
- ngx_uint_t i;
- ngx_conf_t pcf;
- ngx_http_module_t *module;
- struct sockaddr_in *sin;
- ngx_http_conf_ctx_t *ctx, *http_ctx;
- ngx_http_listen_opt_t lsopt;
- ngx_http_core_srv_conf_t *cscf, **cscfp;
- ngx_http_core_main_conf_t *cmcf;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- http_ctx = cf->ctx;
- ctx->main_conf = http_ctx->main_conf;
-
- /* the server{}'s srv_conf */
-
- ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
- if (ctx->srv_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- /* the server{}'s loc_conf */
-
- ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
- if (ctx->loc_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- module = ngx_modules[i]->ctx;
-
- if (module->create_srv_conf) {
- mconf = module->create_srv_conf(cf);
- if (mconf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->srv_conf[ngx_modules[i]->ctx_index] = mconf;
- }
-
- if (module->create_loc_conf) {
- mconf = module->create_loc_conf(cf);
- if (mconf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf;
- }
- }
-
-
- /* the server configuration context */
-
- cscf = ctx->srv_conf[ngx_http_core_module.ctx_index];
- cscf->ctx = ctx;
-
-
- cmcf = ctx->main_conf[ngx_http_core_module.ctx_index];
-
- cscfp = ngx_array_push(&cmcf->servers);
- if (cscfp == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *cscfp = cscf;
-
-
- /* parse inside server{} */
-
- pcf = *cf;
- cf->ctx = ctx;
- cf->cmd_type = NGX_HTTP_SRV_CONF;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = pcf;
-
- if (rv == NGX_CONF_OK && !cscf->listen) {
- ngx_memzero(&lsopt, sizeof(ngx_http_listen_opt_t));
-
- sin = &lsopt.u.sockaddr_in;
-
- sin->sin_family = AF_INET;
-#if (NGX_WIN32)
- sin->sin_port = htons(80);
-#else
- sin->sin_port = htons((getuid() == 0) ? 80 : 8000);
-#endif
- sin->sin_addr.s_addr = INADDR_ANY;
-
- lsopt.socklen = sizeof(struct sockaddr_in);
-
- lsopt.backlog = NGX_LISTEN_BACKLOG;
- lsopt.rcvbuf = -1;
- lsopt.sndbuf = -1;
-#if (NGX_HAVE_SETFIB)
- lsopt.setfib = -1;
-#endif
-#if (NGX_HAVE_TCP_FASTOPEN)
- lsopt.fastopen = -1;
-#endif
- lsopt.wildcard = 1;
-
- (void) ngx_sock_ntop(&lsopt.u.sockaddr, lsopt.socklen, lsopt.addr,
- NGX_SOCKADDR_STRLEN, 1);
-
- if (ngx_http_add_listen(cf, cscf, &lsopt) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- return rv;
-}
-
-
-static char *
-ngx_http_core_location(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
-{
- char *rv;
- u_char *mod;
- size_t len;
- ngx_str_t *value, *name;
- ngx_uint_t i;
- ngx_conf_t save;
- ngx_http_module_t *module;
- ngx_http_conf_ctx_t *ctx, *pctx;
- ngx_http_core_loc_conf_t *clcf, *pclcf;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pctx = cf->ctx;
- ctx->main_conf = pctx->main_conf;
- ctx->srv_conf = pctx->srv_conf;
-
- ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
- if (ctx->loc_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- module = ngx_modules[i]->ctx;
-
- if (module->create_loc_conf) {
- ctx->loc_conf[ngx_modules[i]->ctx_index] =
- module->create_loc_conf(cf);
- if (ctx->loc_conf[ngx_modules[i]->ctx_index] == NULL) {
- return NGX_CONF_ERROR;
- }
- }
- }
-
- clcf = ctx->loc_conf[ngx_http_core_module.ctx_index];
- clcf->loc_conf = ctx->loc_conf;
-
- value = cf->args->elts;
-
- if (cf->args->nelts == 3) {
-
- len = value[1].len;
- mod = value[1].data;
- name = &value[2];
-
- if (len == 1 && mod[0] == '=') {
-
- clcf->name = *name;
- clcf->exact_match = 1;
-
- } else if (len == 2 && mod[0] == '^' && mod[1] == '~') {
-
- clcf->name = *name;
- clcf->noregex = 1;
-
- } else if (len == 1 && mod[0] == '~') {
-
- if (ngx_http_core_regex_location(cf, clcf, name, 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- } else if (len == 2 && mod[0] == '~' && mod[1] == '*') {
-
- if (ngx_http_core_regex_location(cf, clcf, name, 1) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid location modifier \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
- }
-
- } else {
-
- name = &value[1];
-
- if (name->data[0] == '=') {
-
- clcf->name.len = name->len - 1;
- clcf->name.data = name->data + 1;
- clcf->exact_match = 1;
-
- } else if (name->data[0] == '^' && name->data[1] == '~') {
-
- clcf->name.len = name->len - 2;
- clcf->name.data = name->data + 2;
- clcf->noregex = 1;
-
- } else if (name->data[0] == '~') {
-
- name->len--;
- name->data++;
-
- if (name->data[0] == '*') {
-
- name->len--;
- name->data++;
-
- if (ngx_http_core_regex_location(cf, clcf, name, 1) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- } else {
- if (ngx_http_core_regex_location(cf, clcf, name, 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- } else {
-
- clcf->name = *name;
-
- if (name->data[0] == '@') {
- clcf->named = 1;
- }
- }
- }
-
- pclcf = pctx->loc_conf[ngx_http_core_module.ctx_index];
-
- if (pclcf->name.len) {
-
- /* nested location */
-
-#if 0
- clcf->prev_location = pclcf;
-#endif
-
- if (pclcf->exact_match) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "location \"%V\" cannot be inside "
- "the exact location \"%V\"",
- &clcf->name, &pclcf->name);
- return NGX_CONF_ERROR;
- }
-
- if (pclcf->named) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "location \"%V\" cannot be inside "
- "the named location \"%V\"",
- &clcf->name, &pclcf->name);
- return NGX_CONF_ERROR;
- }
-
- if (clcf->named) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "named location \"%V\" can be "
- "on the server level only",
- &clcf->name);
- return NGX_CONF_ERROR;
- }
-
- len = pclcf->name.len;
-
-#if (NGX_PCRE)
- if (clcf->regex == NULL
- && ngx_filename_cmp(clcf->name.data, pclcf->name.data, len) != 0)
-#else
- if (ngx_filename_cmp(clcf->name.data, pclcf->name.data, len) != 0)
-#endif
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "location \"%V\" is outside location \"%V\"",
- &clcf->name, &pclcf->name);
- return NGX_CONF_ERROR;
- }
- }
-
- if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- save = *cf;
- cf->ctx = ctx;
- cf->cmd_type = NGX_HTTP_LOC_CONF;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = save;
-
- return rv;
-}
-
-
-static ngx_int_t
-ngx_http_core_regex_location(ngx_conf_t *cf, ngx_http_core_loc_conf_t *clcf,
- ngx_str_t *regex, ngx_uint_t caseless)
-{
-#if (NGX_PCRE)
- ngx_regex_compile_t rc;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
-
- ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
-
- rc.pattern = *regex;
- rc.err.len = NGX_MAX_CONF_ERRSTR;
- rc.err.data = errstr;
-
-#if (NGX_HAVE_CASELESS_FILESYSTEM)
- rc.options = NGX_REGEX_CASELESS;
-#else
- rc.options = caseless ? NGX_REGEX_CASELESS : 0;
-#endif
-
- clcf->regex = ngx_http_regex_compile(cf, &rc);
- if (clcf->regex == NULL) {
- return NGX_ERROR;
- }
-
- clcf->name = *regex;
-
- return NGX_OK;
-
-#else
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "using regex \"%V\" requires PCRE library",
- regex);
- return NGX_ERROR;
-
-#endif
-}
-
-
-static char *
-ngx_http_core_types(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- char *rv;
- ngx_conf_t save;
-
- if (clcf->types == NULL) {
- clcf->types = ngx_array_create(cf->pool, 64, sizeof(ngx_hash_key_t));
- if (clcf->types == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- save = *cf;
- cf->handler = ngx_http_core_type;
- cf->handler_conf = conf;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = save;
-
- return rv;
-}
-
-
-static char *
-ngx_http_core_type(ngx_conf_t *cf, ngx_command_t *dummy, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- ngx_str_t *value, *content_type, *old;
- ngx_uint_t i, n, hash;
- ngx_hash_key_t *type;
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[0].data, "include") == 0) {
- if (cf->args->nelts != 2) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid number of arguments"
- " in \"include\" directive");
- return NGX_CONF_ERROR;
- }
-
- return ngx_conf_include(cf, dummy, conf);
- }
-
- content_type = ngx_palloc(cf->pool, sizeof(ngx_str_t));
- if (content_type == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *content_type = value[0];
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- hash = ngx_hash_strlow(value[i].data, value[i].data, value[i].len);
-
- type = clcf->types->elts;
- for (n = 0; n < clcf->types->nelts; n++) {
- if (ngx_strcmp(value[i].data, type[n].key.data) == 0) {
- old = type[n].value;
- type[n].value = content_type;
-
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "duplicate extension \"%V\", "
- "content type: \"%V\", "
- "previous content type: \"%V\"",
- &value[i], content_type, old);
- goto next;
- }
- }
-
-
- type = ngx_array_push(clcf->types);
- if (type == NULL) {
- return NGX_CONF_ERROR;
- }
-
- type->key = value[i];
- type->key_hash = hash;
- type->value = content_type;
-
- next:
- continue;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_http_core_preconfiguration(ngx_conf_t *cf)
-{
- return ngx_http_variables_add_core_vars(cf);
-}
-
-
-static void *
-ngx_http_core_create_main_conf(ngx_conf_t *cf)
-{
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_main_conf_t));
- if (cmcf == NULL) {
- return NULL;
- }
-
- if (ngx_array_init(&cmcf->servers, cf->pool, 4,
- sizeof(ngx_http_core_srv_conf_t *))
- != NGX_OK)
- {
- return NULL;
- }
-
- cmcf->server_names_hash_max_size = NGX_CONF_UNSET_UINT;
- cmcf->server_names_hash_bucket_size = NGX_CONF_UNSET_UINT;
-
- cmcf->variables_hash_max_size = NGX_CONF_UNSET_UINT;
- cmcf->variables_hash_bucket_size = NGX_CONF_UNSET_UINT;
-
- return cmcf;
-}
-
-
-static char *
-ngx_http_core_init_main_conf(ngx_conf_t *cf, void *conf)
-{
- ngx_http_core_main_conf_t *cmcf = conf;
-
- ngx_conf_init_uint_value(cmcf->server_names_hash_max_size, 512);
- ngx_conf_init_uint_value(cmcf->server_names_hash_bucket_size,
- ngx_cacheline_size);
-
- cmcf->server_names_hash_bucket_size =
- ngx_align(cmcf->server_names_hash_bucket_size, ngx_cacheline_size);
-
-
- ngx_conf_init_uint_value(cmcf->variables_hash_max_size, 1024);
- ngx_conf_init_uint_value(cmcf->variables_hash_bucket_size, 64);
-
- cmcf->variables_hash_bucket_size =
- ngx_align(cmcf->variables_hash_bucket_size, ngx_cacheline_size);
-
- if (cmcf->ncaptures) {
- cmcf->ncaptures = (cmcf->ncaptures + 1) * 3;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_http_core_create_srv_conf(ngx_conf_t *cf)
-{
- ngx_http_core_srv_conf_t *cscf;
-
- cscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_srv_conf_t));
- if (cscf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * conf->client_large_buffers.num = 0;
- */
-
- if (ngx_array_init(&cscf->server_names, cf->temp_pool, 4,
- sizeof(ngx_http_server_name_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- cscf->connection_pool_size = NGX_CONF_UNSET_SIZE;
- cscf->request_pool_size = NGX_CONF_UNSET_SIZE;
- cscf->client_header_timeout = NGX_CONF_UNSET_MSEC;
- cscf->client_header_buffer_size = NGX_CONF_UNSET_SIZE;
- cscf->ignore_invalid_headers = NGX_CONF_UNSET;
- cscf->merge_slashes = NGX_CONF_UNSET;
- cscf->underscores_in_headers = NGX_CONF_UNSET;
-
- return cscf;
-}
-
-
-static char *
-ngx_http_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_core_srv_conf_t *prev = parent;
- ngx_http_core_srv_conf_t *conf = child;
-
- ngx_str_t name;
- ngx_http_server_name_t *sn;
-
- /* TODO: it does not merge, it inits only */
-
- ngx_conf_merge_size_value(conf->connection_pool_size,
- prev->connection_pool_size, 256);
- ngx_conf_merge_size_value(conf->request_pool_size,
- prev->request_pool_size, 4096);
- ngx_conf_merge_msec_value(conf->client_header_timeout,
- prev->client_header_timeout, 60000);
- ngx_conf_merge_size_value(conf->client_header_buffer_size,
- prev->client_header_buffer_size, 1024);
- ngx_conf_merge_bufs_value(conf->large_client_header_buffers,
- prev->large_client_header_buffers,
- 4, 8192);
-
- if (conf->large_client_header_buffers.size < conf->connection_pool_size) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the \"large_client_header_buffers\" size must be "
- "equal to or greater than \"connection_pool_size\"");
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_value(conf->ignore_invalid_headers,
- prev->ignore_invalid_headers, 1);
-
- ngx_conf_merge_value(conf->merge_slashes, prev->merge_slashes, 1);
-
- ngx_conf_merge_value(conf->underscores_in_headers,
- prev->underscores_in_headers, 0);
-
- if (conf->server_names.nelts == 0) {
- /* the array has 4 empty preallocated elements, so push cannot fail */
- sn = ngx_array_push(&conf->server_names);
-#if (NGX_PCRE)
- sn->regex = NULL;
-#endif
- sn->server = conf;
- ngx_str_set(&sn->name, "");
- }
-
- sn = conf->server_names.elts;
- name = sn[0].name;
-
-#if (NGX_PCRE)
- if (sn->regex) {
- name.len++;
- name.data--;
- } else
-#endif
-
- if (name.data[0] == '.') {
- name.len--;
- name.data++;
- }
-
- conf->server_name.len = name.len;
- conf->server_name.data = ngx_pstrdup(cf->pool, &name);
- if (conf->server_name.data == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_http_core_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_core_loc_conf_t));
- if (clcf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * clcf->root = { 0, NULL };
- * clcf->limit_except = 0;
- * clcf->post_action = { 0, NULL };
- * clcf->types = NULL;
- * clcf->default_type = { 0, NULL };
- * clcf->error_log = NULL;
- * clcf->error_pages = NULL;
- * clcf->try_files = NULL;
- * clcf->client_body_path = NULL;
- * clcf->regex = NULL;
- * clcf->exact_match = 0;
- * clcf->auto_redirect = 0;
- * clcf->alias = 0;
- * clcf->gzip_proxied = 0;
- * clcf->keepalive_disable = 0;
- */
-
- clcf->client_max_body_size = NGX_CONF_UNSET;
- clcf->client_body_buffer_size = NGX_CONF_UNSET_SIZE;
- clcf->client_body_timeout = NGX_CONF_UNSET_MSEC;
- clcf->satisfy = NGX_CONF_UNSET_UINT;
- clcf->if_modified_since = NGX_CONF_UNSET_UINT;
- clcf->max_ranges = NGX_CONF_UNSET_UINT;
- clcf->client_body_in_file_only = NGX_CONF_UNSET_UINT;
- clcf->client_body_in_single_buffer = NGX_CONF_UNSET;
- clcf->internal = NGX_CONF_UNSET;
- clcf->sendfile = NGX_CONF_UNSET;
- clcf->sendfile_max_chunk = NGX_CONF_UNSET_SIZE;
-#if (NGX_HAVE_FILE_AIO)
- clcf->aio = NGX_CONF_UNSET;
-#endif
- clcf->read_ahead = NGX_CONF_UNSET_SIZE;
- clcf->directio = NGX_CONF_UNSET;
- clcf->directio_alignment = NGX_CONF_UNSET;
- clcf->tcp_nopush = NGX_CONF_UNSET;
- clcf->tcp_nodelay = NGX_CONF_UNSET;
- clcf->send_timeout = NGX_CONF_UNSET_MSEC;
- clcf->send_lowat = NGX_CONF_UNSET_SIZE;
- clcf->postpone_output = NGX_CONF_UNSET_SIZE;
- clcf->limit_rate = NGX_CONF_UNSET_SIZE;
- clcf->limit_rate_after = NGX_CONF_UNSET_SIZE;
- clcf->keepalive_timeout = NGX_CONF_UNSET_MSEC;
- clcf->keepalive_header = NGX_CONF_UNSET;
- clcf->keepalive_requests = NGX_CONF_UNSET_UINT;
- clcf->lingering_close = NGX_CONF_UNSET_UINT;
- clcf->lingering_time = NGX_CONF_UNSET_MSEC;
- clcf->lingering_timeout = NGX_CONF_UNSET_MSEC;
- clcf->resolver_timeout = NGX_CONF_UNSET_MSEC;
- clcf->reset_timedout_connection = NGX_CONF_UNSET;
- clcf->server_name_in_redirect = NGX_CONF_UNSET;
- clcf->port_in_redirect = NGX_CONF_UNSET;
- clcf->msie_padding = NGX_CONF_UNSET;
- clcf->msie_refresh = NGX_CONF_UNSET;
- clcf->log_not_found = NGX_CONF_UNSET;
- clcf->log_subrequest = NGX_CONF_UNSET;
- clcf->recursive_error_pages = NGX_CONF_UNSET;
- clcf->server_tokens = NGX_CONF_UNSET;
- clcf->chunked_transfer_encoding = NGX_CONF_UNSET;
- clcf->etag = NGX_CONF_UNSET;
- clcf->types_hash_max_size = NGX_CONF_UNSET_UINT;
- clcf->types_hash_bucket_size = NGX_CONF_UNSET_UINT;
-
- clcf->open_file_cache = NGX_CONF_UNSET_PTR;
- clcf->open_file_cache_valid = NGX_CONF_UNSET;
- clcf->open_file_cache_min_uses = NGX_CONF_UNSET_UINT;
- clcf->open_file_cache_errors = NGX_CONF_UNSET;
- clcf->open_file_cache_events = NGX_CONF_UNSET;
-
-#if (NGX_HTTP_GZIP)
- clcf->gzip_vary = NGX_CONF_UNSET;
- clcf->gzip_http_version = NGX_CONF_UNSET_UINT;
-#if (NGX_PCRE)
- clcf->gzip_disable = NGX_CONF_UNSET_PTR;
-#endif
- clcf->gzip_disable_msie6 = 3;
-#if (NGX_HTTP_DEGRADATION)
- clcf->gzip_disable_degradation = 3;
-#endif
-#endif
-
-#if (NGX_HAVE_OPENAT)
- clcf->disable_symlinks = NGX_CONF_UNSET_UINT;
- clcf->disable_symlinks_from = NGX_CONF_UNSET_PTR;
-#endif
-
- return clcf;
-}
-
-
-static ngx_str_t ngx_http_core_text_html_type = ngx_string("text/html");
-static ngx_str_t ngx_http_core_image_gif_type = ngx_string("image/gif");
-static ngx_str_t ngx_http_core_image_jpeg_type = ngx_string("image/jpeg");
-
-static ngx_hash_key_t ngx_http_core_default_types[] = {
- { ngx_string("html"), 0, &ngx_http_core_text_html_type },
- { ngx_string("gif"), 0, &ngx_http_core_image_gif_type },
- { ngx_string("jpg"), 0, &ngx_http_core_image_jpeg_type },
- { ngx_null_string, 0, NULL }
-};
-
-
-static char *
-ngx_http_core_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_core_loc_conf_t *prev = parent;
- ngx_http_core_loc_conf_t *conf = child;
-
- ngx_uint_t i;
- ngx_hash_key_t *type;
- ngx_hash_init_t types_hash;
-
- if (conf->root.data == NULL) {
-
- conf->alias = prev->alias;
- conf->root = prev->root;
- conf->root_lengths = prev->root_lengths;
- conf->root_values = prev->root_values;
-
- if (prev->root.data == NULL) {
- ngx_str_set(&conf->root, "html");
-
- if (ngx_conf_full_name(cf->cycle, &conf->root, 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
- }
-
- if (conf->post_action.data == NULL) {
- conf->post_action = prev->post_action;
- }
-
- ngx_conf_merge_uint_value(conf->types_hash_max_size,
- prev->types_hash_max_size, 1024);
-
- ngx_conf_merge_uint_value(conf->types_hash_bucket_size,
- prev->types_hash_bucket_size, 64);
-
- conf->types_hash_bucket_size = ngx_align(conf->types_hash_bucket_size,
- ngx_cacheline_size);
-
- /*
- * the special handling of the "types" directive in the "http" section
- * to inherit the http's conf->types_hash to all servers
- */
-
- if (prev->types && prev->types_hash.buckets == NULL) {
-
- types_hash.hash = &prev->types_hash;
- types_hash.key = ngx_hash_key_lc;
- types_hash.max_size = conf->types_hash_max_size;
- types_hash.bucket_size = conf->types_hash_bucket_size;
- types_hash.name = "types_hash";
- types_hash.pool = cf->pool;
- types_hash.temp_pool = NULL;
-
- if (ngx_hash_init(&types_hash, prev->types->elts, prev->types->nelts)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
-
- if (conf->types == NULL) {
- conf->types = prev->types;
- conf->types_hash = prev->types_hash;
- }
-
- if (conf->types == NULL) {
- conf->types = ngx_array_create(cf->pool, 3, sizeof(ngx_hash_key_t));
- if (conf->types == NULL) {
- return NGX_CONF_ERROR;
- }
-
- for (i = 0; ngx_http_core_default_types[i].key.len; i++) {
- type = ngx_array_push(conf->types);
- if (type == NULL) {
- return NGX_CONF_ERROR;
- }
-
- type->key = ngx_http_core_default_types[i].key;
- type->key_hash =
- ngx_hash_key_lc(ngx_http_core_default_types[i].key.data,
- ngx_http_core_default_types[i].key.len);
- type->value = ngx_http_core_default_types[i].value;
- }
- }
-
- if (conf->types_hash.buckets == NULL) {
-
- types_hash.hash = &conf->types_hash;
- types_hash.key = ngx_hash_key_lc;
- types_hash.max_size = conf->types_hash_max_size;
- types_hash.bucket_size = conf->types_hash_bucket_size;
- types_hash.name = "types_hash";
- types_hash.pool = cf->pool;
- types_hash.temp_pool = NULL;
-
- if (ngx_hash_init(&types_hash, conf->types->elts, conf->types->nelts)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
- }
-
- if (conf->error_log == NULL) {
- if (prev->error_log) {
- conf->error_log = prev->error_log;
- } else {
- conf->error_log = &cf->cycle->new_log;
- }
- }
-
- if (conf->error_pages == NULL && prev->error_pages) {
- conf->error_pages = prev->error_pages;
- }
-
- ngx_conf_merge_str_value(conf->default_type,
- prev->default_type, "text/plain");
-
- ngx_conf_merge_off_value(conf->client_max_body_size,
- prev->client_max_body_size, 1 * 1024 * 1024);
- ngx_conf_merge_size_value(conf->client_body_buffer_size,
- prev->client_body_buffer_size,
- (size_t) 2 * ngx_pagesize);
- ngx_conf_merge_msec_value(conf->client_body_timeout,
- prev->client_body_timeout, 60000);
-
- ngx_conf_merge_bitmask_value(conf->keepalive_disable,
- prev->keepalive_disable,
- (NGX_CONF_BITMASK_SET
- |NGX_HTTP_KEEPALIVE_DISABLE_MSIE6));
- ngx_conf_merge_uint_value(conf->satisfy, prev->satisfy,
- NGX_HTTP_SATISFY_ALL);
- ngx_conf_merge_uint_value(conf->if_modified_since, prev->if_modified_since,
- NGX_HTTP_IMS_EXACT);
- ngx_conf_merge_uint_value(conf->max_ranges, prev->max_ranges,
- NGX_MAX_INT32_VALUE);
- ngx_conf_merge_uint_value(conf->client_body_in_file_only,
- prev->client_body_in_file_only,
- NGX_HTTP_REQUEST_BODY_FILE_OFF);
- ngx_conf_merge_value(conf->client_body_in_single_buffer,
- prev->client_body_in_single_buffer, 0);
- ngx_conf_merge_value(conf->internal, prev->internal, 0);
- ngx_conf_merge_value(conf->sendfile, prev->sendfile, 0);
- ngx_conf_merge_size_value(conf->sendfile_max_chunk,
- prev->sendfile_max_chunk, 0);
-#if (NGX_HAVE_FILE_AIO)
- ngx_conf_merge_value(conf->aio, prev->aio, NGX_HTTP_AIO_OFF);
-#endif
- ngx_conf_merge_size_value(conf->read_ahead, prev->read_ahead, 0);
- ngx_conf_merge_off_value(conf->directio, prev->directio,
- NGX_OPEN_FILE_DIRECTIO_OFF);
- ngx_conf_merge_off_value(conf->directio_alignment, prev->directio_alignment,
- 512);
- ngx_conf_merge_value(conf->tcp_nopush, prev->tcp_nopush, 0);
- ngx_conf_merge_value(conf->tcp_nodelay, prev->tcp_nodelay, 1);
-
- ngx_conf_merge_msec_value(conf->send_timeout, prev->send_timeout, 60000);
- ngx_conf_merge_size_value(conf->send_lowat, prev->send_lowat, 0);
- ngx_conf_merge_size_value(conf->postpone_output, prev->postpone_output,
- 1460);
- ngx_conf_merge_size_value(conf->limit_rate, prev->limit_rate, 0);
- ngx_conf_merge_size_value(conf->limit_rate_after, prev->limit_rate_after,
- 0);
- ngx_conf_merge_msec_value(conf->keepalive_timeout,
- prev->keepalive_timeout, 75000);
- ngx_conf_merge_sec_value(conf->keepalive_header,
- prev->keepalive_header, 0);
- ngx_conf_merge_uint_value(conf->keepalive_requests,
- prev->keepalive_requests, 100);
- ngx_conf_merge_uint_value(conf->lingering_close,
- prev->lingering_close, NGX_HTTP_LINGERING_ON);
- ngx_conf_merge_msec_value(conf->lingering_time,
- prev->lingering_time, 30000);
- ngx_conf_merge_msec_value(conf->lingering_timeout,
- prev->lingering_timeout, 5000);
- ngx_conf_merge_msec_value(conf->resolver_timeout,
- prev->resolver_timeout, 30000);
-
- if (conf->resolver == NULL) {
-
- if (prev->resolver == NULL) {
-
- /*
- * create dummy resolver in http {} context
- * to inherit it in all servers
- */
-
- prev->resolver = ngx_resolver_create(cf, NULL, 0);
- if (prev->resolver == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- conf->resolver = prev->resolver;
- }
-
- if (ngx_conf_merge_path_value(cf, &conf->client_body_temp_path,
- prev->client_body_temp_path,
- &ngx_http_client_temp_path)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_value(conf->reset_timedout_connection,
- prev->reset_timedout_connection, 0);
- ngx_conf_merge_value(conf->server_name_in_redirect,
- prev->server_name_in_redirect, 0);
- ngx_conf_merge_value(conf->port_in_redirect, prev->port_in_redirect, 1);
- ngx_conf_merge_value(conf->msie_padding, prev->msie_padding, 1);
- ngx_conf_merge_value(conf->msie_refresh, prev->msie_refresh, 0);
- ngx_conf_merge_value(conf->log_not_found, prev->log_not_found, 1);
- ngx_conf_merge_value(conf->log_subrequest, prev->log_subrequest, 0);
- ngx_conf_merge_value(conf->recursive_error_pages,
- prev->recursive_error_pages, 0);
- ngx_conf_merge_value(conf->server_tokens, prev->server_tokens, 1);
- ngx_conf_merge_value(conf->chunked_transfer_encoding,
- prev->chunked_transfer_encoding, 1);
- ngx_conf_merge_value(conf->etag, prev->etag, 1);
-
- ngx_conf_merge_ptr_value(conf->open_file_cache,
- prev->open_file_cache, NULL);
-
- ngx_conf_merge_sec_value(conf->open_file_cache_valid,
- prev->open_file_cache_valid, 60);
-
- ngx_conf_merge_uint_value(conf->open_file_cache_min_uses,
- prev->open_file_cache_min_uses, 1);
-
- ngx_conf_merge_sec_value(conf->open_file_cache_errors,
- prev->open_file_cache_errors, 0);
-
- ngx_conf_merge_sec_value(conf->open_file_cache_events,
- prev->open_file_cache_events, 0);
-#if (NGX_HTTP_GZIP)
-
- ngx_conf_merge_value(conf->gzip_vary, prev->gzip_vary, 0);
- ngx_conf_merge_uint_value(conf->gzip_http_version, prev->gzip_http_version,
- NGX_HTTP_VERSION_11);
- ngx_conf_merge_bitmask_value(conf->gzip_proxied, prev->gzip_proxied,
- (NGX_CONF_BITMASK_SET|NGX_HTTP_GZIP_PROXIED_OFF));
-
-#if (NGX_PCRE)
- ngx_conf_merge_ptr_value(conf->gzip_disable, prev->gzip_disable, NULL);
-#endif
-
- if (conf->gzip_disable_msie6 == 3) {
- conf->gzip_disable_msie6 =
- (prev->gzip_disable_msie6 == 3) ? 0 : prev->gzip_disable_msie6;
- }
-
-#if (NGX_HTTP_DEGRADATION)
-
- if (conf->gzip_disable_degradation == 3) {
- conf->gzip_disable_degradation =
- (prev->gzip_disable_degradation == 3) ?
- 0 : prev->gzip_disable_degradation;
- }
-
-#endif
-#endif
-
-#if (NGX_HAVE_OPENAT)
- ngx_conf_merge_uint_value(conf->disable_symlinks, prev->disable_symlinks,
- NGX_DISABLE_SYMLINKS_OFF);
- ngx_conf_merge_ptr_value(conf->disable_symlinks_from,
- prev->disable_symlinks_from, NULL);
-#endif
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_srv_conf_t *cscf = conf;
-
- ngx_str_t *value, size;
- ngx_url_t u;
- ngx_uint_t n;
- ngx_http_listen_opt_t lsopt;
-
- cscf->listen = 1;
-
- value = cf->args->elts;
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url = value[1];
- u.listen = 1;
- u.default_port = 80;
-
- if (ngx_parse_url(cf->pool, &u) != NGX_OK) {
- if (u.err) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%s in \"%V\" of the \"listen\" directive",
- u.err, &u.url);
- }
-
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(&lsopt, sizeof(ngx_http_listen_opt_t));
-
- ngx_memcpy(&lsopt.u.sockaddr, u.sockaddr, u.socklen);
-
- lsopt.socklen = u.socklen;
- lsopt.backlog = NGX_LISTEN_BACKLOG;
- lsopt.rcvbuf = -1;
- lsopt.sndbuf = -1;
-#if (NGX_HAVE_SETFIB)
- lsopt.setfib = -1;
-#endif
-#if (NGX_HAVE_TCP_FASTOPEN)
- lsopt.fastopen = -1;
-#endif
- lsopt.wildcard = u.wildcard;
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- lsopt.ipv6only = 1;
-#endif
-
- (void) ngx_sock_ntop(&lsopt.u.sockaddr, lsopt.socklen, lsopt.addr,
- NGX_SOCKADDR_STRLEN, 1);
-
- for (n = 2; n < cf->args->nelts; n++) {
-
- if (ngx_strcmp(value[n].data, "default_server") == 0
- || ngx_strcmp(value[n].data, "default") == 0)
- {
- lsopt.default_server = 1;
- continue;
- }
-
- if (ngx_strcmp(value[n].data, "bind") == 0) {
- lsopt.set = 1;
- lsopt.bind = 1;
- continue;
- }
-
-#if (NGX_HAVE_SETFIB)
- if (ngx_strncmp(value[n].data, "setfib=", 7) == 0) {
- lsopt.setfib = ngx_atoi(value[n].data + 7, value[n].len - 7);
- lsopt.set = 1;
- lsopt.bind = 1;
-
- if (lsopt.setfib == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid setfib \"%V\"", &value[n]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-#endif
-
-#if (NGX_HAVE_TCP_FASTOPEN)
- if (ngx_strncmp(value[n].data, "fastopen=", 9) == 0) {
- lsopt.fastopen = ngx_atoi(value[n].data + 9, value[n].len - 9);
- lsopt.set = 1;
- lsopt.bind = 1;
-
- if (lsopt.fastopen == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid fastopen \"%V\"", &value[n]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-#endif
-
- if (ngx_strncmp(value[n].data, "backlog=", 8) == 0) {
- lsopt.backlog = ngx_atoi(value[n].data + 8, value[n].len - 8);
- lsopt.set = 1;
- lsopt.bind = 1;
-
- if (lsopt.backlog == NGX_ERROR || lsopt.backlog == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid backlog \"%V\"", &value[n]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[n].data, "rcvbuf=", 7) == 0) {
- size.len = value[n].len - 7;
- size.data = value[n].data + 7;
-
- lsopt.rcvbuf = ngx_parse_size(&size);
- lsopt.set = 1;
- lsopt.bind = 1;
-
- if (lsopt.rcvbuf == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid rcvbuf \"%V\"", &value[n]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[n].data, "sndbuf=", 7) == 0) {
- size.len = value[n].len - 7;
- size.data = value[n].data + 7;
-
- lsopt.sndbuf = ngx_parse_size(&size);
- lsopt.set = 1;
- lsopt.bind = 1;
-
- if (lsopt.sndbuf == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid sndbuf \"%V\"", &value[n]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[n].data, "accept_filter=", 14) == 0) {
-#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
- lsopt.accept_filter = (char *) &value[n].data[14];
- lsopt.set = 1;
- lsopt.bind = 1;
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "accept filters \"%V\" are not supported "
- "on this platform, ignored",
- &value[n]);
-#endif
- continue;
- }
-
- if (ngx_strcmp(value[n].data, "deferred") == 0) {
-#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
- lsopt.deferred_accept = 1;
- lsopt.set = 1;
- lsopt.bind = 1;
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the deferred accept is not supported "
- "on this platform, ignored");
-#endif
- continue;
- }
-
- if (ngx_strncmp(value[n].data, "ipv6only=o", 10) == 0) {
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- struct sockaddr *sa;
-
- sa = &lsopt.u.sockaddr;
-
- if (sa->sa_family == AF_INET6) {
-
- if (ngx_strcmp(&value[n].data[10], "n") == 0) {
- lsopt.ipv6only = 1;
-
- } else if (ngx_strcmp(&value[n].data[10], "ff") == 0) {
- lsopt.ipv6only = 0;
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid ipv6only flags \"%s\"",
- &value[n].data[9]);
- return NGX_CONF_ERROR;
- }
-
- lsopt.set = 1;
- lsopt.bind = 1;
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "ipv6only is not supported "
- "on addr \"%s\", ignored", lsopt.addr);
- }
-
- continue;
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "ipv6only is not supported "
- "on this platform");
- return NGX_CONF_ERROR;
-#endif
- }
-
- if (ngx_strcmp(value[n].data, "ssl") == 0) {
-#if (NGX_HTTP_SSL)
- lsopt.ssl = 1;
- continue;
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the \"ssl\" parameter requires "
- "ngx_http_ssl_module");
- return NGX_CONF_ERROR;
-#endif
- }
-
- if (ngx_strcmp(value[n].data, "spdy") == 0) {
-#if (NGX_HTTP_SPDY)
- lsopt.spdy = 1;
- continue;
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the \"spdy\" parameter requires "
- "ngx_http_spdy_module");
- return NGX_CONF_ERROR;
-#endif
- }
-
- if (ngx_strncmp(value[n].data, "so_keepalive=", 13) == 0) {
-
- if (ngx_strcmp(&value[n].data[13], "on") == 0) {
- lsopt.so_keepalive = 1;
-
- } else if (ngx_strcmp(&value[n].data[13], "off") == 0) {
- lsopt.so_keepalive = 2;
-
- } else {
-
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- u_char *p, *end;
- ngx_str_t s;
-
- end = value[n].data + value[n].len;
- s.data = value[n].data + 13;
-
- p = ngx_strlchr(s.data, end, ':');
- if (p == NULL) {
- p = end;
- }
-
- if (p > s.data) {
- s.len = p - s.data;
-
- lsopt.tcp_keepidle = ngx_parse_time(&s, 1);
- if (lsopt.tcp_keepidle == (time_t) NGX_ERROR) {
- goto invalid_so_keepalive;
- }
- }
-
- s.data = (p < end) ? (p + 1) : end;
-
- p = ngx_strlchr(s.data, end, ':');
- if (p == NULL) {
- p = end;
- }
-
- if (p > s.data) {
- s.len = p - s.data;
-
- lsopt.tcp_keepintvl = ngx_parse_time(&s, 1);
- if (lsopt.tcp_keepintvl == (time_t) NGX_ERROR) {
- goto invalid_so_keepalive;
- }
- }
-
- s.data = (p < end) ? (p + 1) : end;
-
- if (s.data < end) {
- s.len = end - s.data;
-
- lsopt.tcp_keepcnt = ngx_atoi(s.data, s.len);
- if (lsopt.tcp_keepcnt == NGX_ERROR) {
- goto invalid_so_keepalive;
- }
- }
-
- if (lsopt.tcp_keepidle == 0 && lsopt.tcp_keepintvl == 0
- && lsopt.tcp_keepcnt == 0)
- {
- goto invalid_so_keepalive;
- }
-
- lsopt.so_keepalive = 1;
-
-#else
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the \"so_keepalive\" parameter accepts "
- "only \"on\" or \"off\" on this platform");
- return NGX_CONF_ERROR;
-
-#endif
- }
-
- lsopt.set = 1;
- lsopt.bind = 1;
-
- continue;
-
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- invalid_so_keepalive:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid so_keepalive value: \"%s\"",
- &value[n].data[13]);
- return NGX_CONF_ERROR;
-#endif
- }
-
- if (ngx_strcmp(value[n].data, "proxy_protocol") == 0) {
- lsopt.proxy_protocol = 1;
- continue;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[n]);
- return NGX_CONF_ERROR;
- }
-
- if (ngx_http_add_listen(cf, cscf, &lsopt) == NGX_OK) {
- return NGX_CONF_OK;
- }
-
- return NGX_CONF_ERROR;
-}
-
-
-static char *
-ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_srv_conf_t *cscf = conf;
-
- u_char ch;
- ngx_str_t *value;
- ngx_uint_t i;
- ngx_http_server_name_t *sn;
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- ch = value[i].data[0];
-
- if ((ch == '*' && (value[i].len < 3 || value[i].data[1] != '.'))
- || (ch == '.' && value[i].len < 2))
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "server name \"%V\" is invalid", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (ngx_strchr(value[i].data, '/')) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "server name \"%V\" has suspicious symbols",
- &value[i]);
- }
-
- sn = ngx_array_push(&cscf->server_names);
- if (sn == NULL) {
- return NGX_CONF_ERROR;
- }
-
-#if (NGX_PCRE)
- sn->regex = NULL;
-#endif
- sn->server = cscf;
-
- if (ngx_strcasecmp(value[i].data, (u_char *) "$hostname") == 0) {
- sn->name = cf->cycle->hostname;
-
- } else {
- sn->name = value[i];
- }
-
- if (value[i].data[0] != '~') {
- ngx_strlow(sn->name.data, sn->name.data, sn->name.len);
- continue;
- }
-
-#if (NGX_PCRE)
- {
- u_char *p;
- ngx_regex_compile_t rc;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
-
- if (value[i].len == 1) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "empty regex in server name \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- value[i].len--;
- value[i].data++;
-
- ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
-
- rc.pattern = value[i];
- rc.err.len = NGX_MAX_CONF_ERRSTR;
- rc.err.data = errstr;
-
- for (p = value[i].data; p < value[i].data + value[i].len; p++) {
- if (*p >= 'A' && *p <= 'Z') {
- rc.options = NGX_REGEX_CASELESS;
- break;
- }
- }
-
- sn->regex = ngx_http_regex_compile(cf, &rc);
- if (sn->regex == NULL) {
- return NGX_CONF_ERROR;
- }
-
- sn->name = value[i];
- cscf->captures = (rc.captures > 0);
- }
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "using regex \"%V\" "
- "requires PCRE library", &value[i]);
-
- return NGX_CONF_ERROR;
-#endif
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- ngx_str_t *value;
- ngx_int_t alias;
- ngx_uint_t n;
- ngx_http_script_compile_t sc;
-
- alias = (cmd->name.len == sizeof("alias") - 1) ? 1 : 0;
-
- if (clcf->root.data) {
-
- if ((clcf->alias != 0) == alias) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"%V\" directive is duplicate",
- &cmd->name);
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"%V\" directive is duplicate, "
- "\"%s\" directive was specified earlier",
- &cmd->name, clcf->alias ? "alias" : "root");
- }
-
- return NGX_CONF_ERROR;
- }
-
- if (clcf->named && alias) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the \"alias\" directive cannot be used "
- "inside the named location");
-
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- if (ngx_strstr(value[1].data, "$document_root")
- || ngx_strstr(value[1].data, "${document_root}"))
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the $document_root variable cannot be used "
- "in the \"%V\" directive",
- &cmd->name);
-
- return NGX_CONF_ERROR;
- }
-
- if (ngx_strstr(value[1].data, "$realpath_root")
- || ngx_strstr(value[1].data, "${realpath_root}"))
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the $realpath_root variable cannot be used "
- "in the \"%V\" directive",
- &cmd->name);
-
- return NGX_CONF_ERROR;
- }
-
- clcf->alias = alias ? clcf->name.len : 0;
- clcf->root = value[1];
-
- if (!alias && clcf->root.data[clcf->root.len - 1] == '/') {
- clcf->root.len--;
- }
-
- if (clcf->root.data[0] != '$') {
- if (ngx_conf_full_name(cf->cycle, &clcf->root, 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- n = ngx_http_script_variables_count(&clcf->root);
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
- sc.variables = n;
-
-#if (NGX_PCRE)
- if (alias && clcf->regex) {
- clcf->alias = NGX_MAX_SIZE_T_VALUE;
- n = 1;
- }
-#endif
-
- if (n) {
- sc.cf = cf;
- sc.source = &clcf->root;
- sc.lengths = &clcf->root_lengths;
- sc.values = &clcf->root_values;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_http_method_name_t ngx_methods_names[] = {
- { (u_char *) "GET", (uint32_t) ~NGX_HTTP_GET },
- { (u_char *) "HEAD", (uint32_t) ~NGX_HTTP_HEAD },
- { (u_char *) "POST", (uint32_t) ~NGX_HTTP_POST },
- { (u_char *) "PUT", (uint32_t) ~NGX_HTTP_PUT },
- { (u_char *) "DELETE", (uint32_t) ~NGX_HTTP_DELETE },
- { (u_char *) "MKCOL", (uint32_t) ~NGX_HTTP_MKCOL },
- { (u_char *) "COPY", (uint32_t) ~NGX_HTTP_COPY },
- { (u_char *) "MOVE", (uint32_t) ~NGX_HTTP_MOVE },
- { (u_char *) "OPTIONS", (uint32_t) ~NGX_HTTP_OPTIONS },
- { (u_char *) "PROPFIND", (uint32_t) ~NGX_HTTP_PROPFIND },
- { (u_char *) "PROPPATCH", (uint32_t) ~NGX_HTTP_PROPPATCH },
- { (u_char *) "LOCK", (uint32_t) ~NGX_HTTP_LOCK },
- { (u_char *) "UNLOCK", (uint32_t) ~NGX_HTTP_UNLOCK },
- { (u_char *) "PATCH", (uint32_t) ~NGX_HTTP_PATCH },
- { NULL, 0 }
-};
-
-
-static char *
-ngx_http_core_limit_except(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *pclcf = conf;
-
- char *rv;
- void *mconf;
- ngx_str_t *value;
- ngx_uint_t i;
- ngx_conf_t save;
- ngx_http_module_t *module;
- ngx_http_conf_ctx_t *ctx, *pctx;
- ngx_http_method_name_t *name;
- ngx_http_core_loc_conf_t *clcf;
-
- if (pclcf->limit_except) {
- return "duplicate";
- }
-
- pclcf->limit_except = 0xffffffff;
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
- for (name = ngx_methods_names; name->name; name++) {
-
- if (ngx_strcasecmp(value[i].data, name->name) == 0) {
- pclcf->limit_except &= name->method;
- goto next;
- }
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid method \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
-
- next:
- continue;
- }
-
- if (!(pclcf->limit_except & NGX_HTTP_GET)) {
- pclcf->limit_except &= (uint32_t) ~NGX_HTTP_HEAD;
- }
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- pctx = cf->ctx;
- ctx->main_conf = pctx->main_conf;
- ctx->srv_conf = pctx->srv_conf;
-
- ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
- if (ctx->loc_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- module = ngx_modules[i]->ctx;
-
- if (module->create_loc_conf) {
-
- mconf = module->create_loc_conf(cf);
- if (mconf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->loc_conf[ngx_modules[i]->ctx_index] = mconf;
- }
- }
-
-
- clcf = ctx->loc_conf[ngx_http_core_module.ctx_index];
- pclcf->limit_except_loc_conf = ctx->loc_conf;
- clcf->loc_conf = ctx->loc_conf;
- clcf->name = pclcf->name;
- clcf->noname = 1;
- clcf->lmt_excpt = 1;
-
- if (ngx_http_add_location(cf, &pclcf->locations, clcf) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- save = *cf;
- cf->ctx = ctx;
- cf->cmd_type = NGX_HTTP_LMT_CONF;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = save;
-
- return rv;
-}
-
-
-static char *
-ngx_http_core_directio(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- ngx_str_t *value;
-
- if (clcf->directio != NGX_CONF_UNSET) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- clcf->directio = NGX_OPEN_FILE_DIRECTIO_OFF;
- return NGX_CONF_OK;
- }
-
- clcf->directio = ngx_parse_offset(&value[1]);
- if (clcf->directio == (off_t) NGX_ERROR) {
- return "invalid value";
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_core_error_page(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- u_char *p;
- ngx_int_t overwrite;
- ngx_str_t *value, uri, args;
- ngx_uint_t i, n;
- ngx_http_err_page_t *err;
- ngx_http_complex_value_t cv;
- ngx_http_compile_complex_value_t ccv;
-
- if (clcf->error_pages == NULL) {
- clcf->error_pages = ngx_array_create(cf->pool, 4,
- sizeof(ngx_http_err_page_t));
- if (clcf->error_pages == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- value = cf->args->elts;
-
- i = cf->args->nelts - 2;
-
- if (value[i].data[0] == '=') {
- if (i == 1) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (value[i].len > 1) {
- overwrite = ngx_atoi(&value[i].data[1], value[i].len - 1);
-
- if (overwrite == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- } else {
- overwrite = 0;
- }
-
- n = 2;
-
- } else {
- overwrite = -1;
- n = 1;
- }
-
- uri = value[cf->args->nelts - 1];
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &uri;
- ccv.complex_value = &cv;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- ngx_str_null(&args);
-
- if (cv.lengths == NULL && uri.len && uri.data[0] == '/') {
- p = (u_char *) ngx_strchr(uri.data, '?');
-
- if (p) {
- cv.value.len = p - uri.data;
- cv.value.data = uri.data;
- p++;
- args.len = (uri.data + uri.len) - p;
- args.data = p;
- }
- }
-
- for (i = 1; i < cf->args->nelts - n; i++) {
- err = ngx_array_push(clcf->error_pages);
- if (err == NULL) {
- return NGX_CONF_ERROR;
- }
-
- err->status = ngx_atoi(value[i].data, value[i].len);
-
- if (err->status == NGX_ERROR || err->status == 499) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid value \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (err->status < 300 || err->status > 599) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "value \"%V\" must be between 300 and 599",
- &value[i]);
- return NGX_CONF_ERROR;
- }
-
- err->overwrite = overwrite;
-
- if (overwrite == -1) {
- switch (err->status) {
- case NGX_HTTP_TO_HTTPS:
- case NGX_HTTPS_CERT_ERROR:
- case NGX_HTTPS_NO_CERT:
- err->overwrite = NGX_HTTP_BAD_REQUEST;
- default:
- break;
- }
- }
-
- err->value = cv;
- err->args = args;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_core_try_files(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- ngx_str_t *value;
- ngx_int_t code;
- ngx_uint_t i, n;
- ngx_http_try_file_t *tf;
- ngx_http_script_compile_t sc;
- ngx_http_core_main_conf_t *cmcf;
-
- if (clcf->try_files) {
- return "is duplicate";
- }
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- cmcf->try_files = 1;
-
- tf = ngx_pcalloc(cf->pool, cf->args->nelts * sizeof(ngx_http_try_file_t));
- if (tf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- clcf->try_files = tf;
-
- value = cf->args->elts;
-
- for (i = 0; i < cf->args->nelts - 1; i++) {
-
- tf[i].name = value[i + 1];
-
- if (tf[i].name.len > 0
- && tf[i].name.data[tf[i].name.len - 1] == '/'
- && i + 2 < cf->args->nelts)
- {
- tf[i].test_dir = 1;
- tf[i].name.len--;
- tf[i].name.data[tf[i].name.len] = '\0';
- }
-
- n = ngx_http_script_variables_count(&tf[i].name);
-
- if (n) {
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = cf;
- sc.source = &tf[i].name;
- sc.lengths = &tf[i].lengths;
- sc.values = &tf[i].values;
- sc.variables = n;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- } else {
- /* add trailing '\0' to length */
- tf[i].name.len++;
- }
- }
-
- if (tf[i - 1].name.data[0] == '=') {
-
- code = ngx_atoi(tf[i - 1].name.data + 1, tf[i - 1].name.len - 2);
-
- if (code == NGX_ERROR || code > 999) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid code \"%*s\"",
- tf[i - 1].name.len - 1, tf[i - 1].name.data);
- return NGX_CONF_ERROR;
- }
-
- tf[i].code = code;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_core_open_file_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- time_t inactive;
- ngx_str_t *value, s;
- ngx_int_t max;
- ngx_uint_t i;
-
- if (clcf->open_file_cache != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- max = 0;
- inactive = 60;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (ngx_strncmp(value[i].data, "max=", 4) == 0) {
-
- max = ngx_atoi(value[i].data + 4, value[i].len - 4);
- if (max <= 0) {
- goto failed;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "inactive=", 9) == 0) {
-
- s.len = value[i].len - 9;
- s.data = value[i].data + 9;
-
- inactive = ngx_parse_time(&s, 1);
- if (inactive == (time_t) NGX_ERROR) {
- goto failed;
- }
-
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "off") == 0) {
-
- clcf->open_file_cache = NULL;
-
- continue;
- }
-
- failed:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid \"open_file_cache\" parameter \"%V\"",
- &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (clcf->open_file_cache == NULL) {
- return NGX_CONF_OK;
- }
-
- if (max == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"open_file_cache\" must have the \"max\" parameter");
- return NGX_CONF_ERROR;
- }
-
- clcf->open_file_cache = ngx_open_file_cache_init(cf->pool, max, inactive);
- if (clcf->open_file_cache) {
- return NGX_CONF_OK;
- }
-
- return NGX_CONF_ERROR;
-}
-
-
-static char *
-ngx_http_core_error_log(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- return ngx_log_set_log(cf, &clcf->error_log);
-}
-
-
-static char *
-ngx_http_core_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- ngx_str_t *value;
-
- if (clcf->keepalive_timeout != NGX_CONF_UNSET_MSEC) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- clcf->keepalive_timeout = ngx_parse_time(&value[1], 0);
-
- if (clcf->keepalive_timeout == (ngx_msec_t) NGX_ERROR) {
- return "invalid value";
- }
-
- if (cf->args->nelts == 2) {
- return NGX_CONF_OK;
- }
-
- clcf->keepalive_header = ngx_parse_time(&value[2], 1);
-
- if (clcf->keepalive_header == (time_t) NGX_ERROR) {
- return "invalid value";
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_core_internal(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- if (clcf->internal != NGX_CONF_UNSET) {
- return "is duplicate";
- }
-
- clcf->internal = 1;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- ngx_str_t *value;
-
- if (clcf->resolver) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- clcf->resolver = ngx_resolver_create(cf, &value[1], cf->args->nelts - 1);
- if (clcf->resolver == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-#if (NGX_HTTP_GZIP)
-
-static char *
-ngx_http_gzip_disable(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
-#if (NGX_PCRE)
-
- ngx_str_t *value;
- ngx_uint_t i;
- ngx_regex_elt_t *re;
- ngx_regex_compile_t rc;
- u_char errstr[NGX_MAX_CONF_ERRSTR];
-
- if (clcf->gzip_disable == NGX_CONF_UNSET_PTR) {
- clcf->gzip_disable = ngx_array_create(cf->pool, 2,
- sizeof(ngx_regex_elt_t));
- if (clcf->gzip_disable == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- value = cf->args->elts;
-
- ngx_memzero(&rc, sizeof(ngx_regex_compile_t));
-
- rc.pool = cf->pool;
- rc.err.len = NGX_MAX_CONF_ERRSTR;
- rc.err.data = errstr;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (ngx_strcmp(value[i].data, "msie6") == 0) {
- clcf->gzip_disable_msie6 = 1;
- continue;
- }
-
-#if (NGX_HTTP_DEGRADATION)
-
- if (ngx_strcmp(value[i].data, "degradation") == 0) {
- clcf->gzip_disable_degradation = 1;
- continue;
- }
-
-#endif
-
- re = ngx_array_push(clcf->gzip_disable);
- if (re == NULL) {
- return NGX_CONF_ERROR;
- }
-
- rc.pattern = value[i];
- rc.options = NGX_REGEX_CASELESS;
-
- if (ngx_regex_compile(&rc) != NGX_OK) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V", &rc.err);
- return NGX_CONF_ERROR;
- }
-
- re->regex = rc.regex;
- re->name = value[i].data;
- }
-
- return NGX_CONF_OK;
-
-#else
- ngx_str_t *value;
- ngx_uint_t i;
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
- if (ngx_strcmp(value[i].data, "msie6") == 0) {
- clcf->gzip_disable_msie6 = 1;
- continue;
- }
-
-#if (NGX_HTTP_DEGRADATION)
-
- if (ngx_strcmp(value[i].data, "degradation") == 0) {
- clcf->gzip_disable_degradation = 1;
- continue;
- }
-
-#endif
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "without PCRE library \"gzip_disable\" supports "
- "builtin \"msie6\" and \"degradation\" mask only");
-
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-
-#endif
-}
-
-#endif
-
-
-#if (NGX_HAVE_OPENAT)
-
-static char *
-ngx_http_disable_symlinks(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_core_loc_conf_t *clcf = conf;
-
- ngx_str_t *value;
- ngx_uint_t i;
- ngx_http_compile_complex_value_t ccv;
-
- if (clcf->disable_symlinks != NGX_CONF_UNSET_UINT) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (ngx_strcmp(value[i].data, "off") == 0) {
- clcf->disable_symlinks = NGX_DISABLE_SYMLINKS_OFF;
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "if_not_owner") == 0) {
- clcf->disable_symlinks = NGX_DISABLE_SYMLINKS_NOTOWNER;
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "on") == 0) {
- clcf->disable_symlinks = NGX_DISABLE_SYMLINKS_ON;
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "from=", 5) == 0) {
- value[i].len -= 5;
- value[i].data += 5;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[i];
- ccv.complex_value = ngx_palloc(cf->pool,
- sizeof(ngx_http_complex_value_t));
- if (ccv.complex_value == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- clcf->disable_symlinks_from = ccv.complex_value;
-
- continue;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (clcf->disable_symlinks == NGX_CONF_UNSET_UINT) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"%V\" must have \"off\", \"on\" "
- "or \"if_not_owner\" parameter",
- &cmd->name);
- return NGX_CONF_ERROR;
- }
-
- if (cf->args->nelts == 2) {
- clcf->disable_symlinks_from = NULL;
- return NGX_CONF_OK;
- }
-
- if (clcf->disable_symlinks_from == NGX_CONF_UNSET_PTR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate parameters \"%V %V\"",
- &value[1], &value[2]);
- return NGX_CONF_ERROR;
- }
-
- if (clcf->disable_symlinks == NGX_DISABLE_SYMLINKS_OFF) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"from=\" cannot be used with \"off\" parameter");
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-#endif
-
-
-static char *
-ngx_http_core_lowat_check(ngx_conf_t *cf, void *post, void *data)
-{
-#if (NGX_FREEBSD)
- ssize_t *np = data;
-
- if ((u_long) *np >= ngx_freebsd_net_inet_tcp_sendspace) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"send_lowat\" must be less than %d "
- "(sysctl net.inet.tcp.sendspace)",
- ngx_freebsd_net_inet_tcp_sendspace);
-
- return NGX_CONF_ERROR;
- }
-
-#elif !(NGX_HAVE_SO_SNDLOWAT)
- ssize_t *np = data;
-
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "\"send_lowat\" is not supported, ignored");
-
- *np = 0;
-
-#endif
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_core_pool_size(ngx_conf_t *cf, void *post, void *data)
-{
- size_t *sp = data;
-
- if (*sp < NGX_MIN_POOL_SIZE) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the pool size must be no less than %uz",
- NGX_MIN_POOL_SIZE);
- return NGX_CONF_ERROR;
- }
-
- if (*sp % NGX_POOL_ALIGNMENT) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the pool size must be a multiple of %uz",
- NGX_POOL_ALIGNMENT);
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.h
deleted file mode 100644
index fc2c3d49bf3..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_core_module.h
+++ /dev/null
@@ -1,589 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_CORE_H_INCLUDED_
-#define _NGX_HTTP_CORE_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_GZIP_PROXIED_OFF 0x0002
-#define NGX_HTTP_GZIP_PROXIED_EXPIRED 0x0004
-#define NGX_HTTP_GZIP_PROXIED_NO_CACHE 0x0008
-#define NGX_HTTP_GZIP_PROXIED_NO_STORE 0x0010
-#define NGX_HTTP_GZIP_PROXIED_PRIVATE 0x0020
-#define NGX_HTTP_GZIP_PROXIED_NO_LM 0x0040
-#define NGX_HTTP_GZIP_PROXIED_NO_ETAG 0x0080
-#define NGX_HTTP_GZIP_PROXIED_AUTH 0x0100
-#define NGX_HTTP_GZIP_PROXIED_ANY 0x0200
-
-
-#define NGX_HTTP_AIO_OFF 0
-#define NGX_HTTP_AIO_ON 1
-#define NGX_HTTP_AIO_SENDFILE 2
-
-
-#define NGX_HTTP_SATISFY_ALL 0
-#define NGX_HTTP_SATISFY_ANY 1
-
-
-#define NGX_HTTP_LINGERING_OFF 0
-#define NGX_HTTP_LINGERING_ON 1
-#define NGX_HTTP_LINGERING_ALWAYS 2
-
-
-#define NGX_HTTP_IMS_OFF 0
-#define NGX_HTTP_IMS_EXACT 1
-#define NGX_HTTP_IMS_BEFORE 2
-
-
-#define NGX_HTTP_KEEPALIVE_DISABLE_NONE 0x0002
-#define NGX_HTTP_KEEPALIVE_DISABLE_MSIE6 0x0004
-#define NGX_HTTP_KEEPALIVE_DISABLE_SAFARI 0x0008
-
-
-typedef struct ngx_http_location_tree_node_s ngx_http_location_tree_node_t;
-typedef struct ngx_http_core_loc_conf_s ngx_http_core_loc_conf_t;
-
-
-typedef struct {
- union {
- struct sockaddr sockaddr;
- struct sockaddr_in sockaddr_in;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 sockaddr_in6;
-#endif
-#if (NGX_HAVE_UNIX_DOMAIN)
- struct sockaddr_un sockaddr_un;
-#endif
- u_char sockaddr_data[NGX_SOCKADDRLEN];
- } u;
-
- socklen_t socklen;
-
- unsigned set:1;
- unsigned default_server:1;
- unsigned bind:1;
- unsigned wildcard:1;
-#if (NGX_HTTP_SSL)
- unsigned ssl:1;
-#endif
-#if (NGX_HTTP_SPDY)
- unsigned spdy:1;
-#endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- unsigned ipv6only:1;
-#endif
- unsigned so_keepalive:2;
- unsigned proxy_protocol:1;
-
- int backlog;
- int rcvbuf;
- int sndbuf;
-#if (NGX_HAVE_SETFIB)
- int setfib;
-#endif
-#if (NGX_HAVE_TCP_FASTOPEN)
- int fastopen;
-#endif
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- int tcp_keepidle;
- int tcp_keepintvl;
- int tcp_keepcnt;
-#endif
-
-#if (NGX_HAVE_DEFERRED_ACCEPT && defined SO_ACCEPTFILTER)
- char *accept_filter;
-#endif
-#if (NGX_HAVE_DEFERRED_ACCEPT && defined TCP_DEFER_ACCEPT)
- ngx_uint_t deferred_accept;
-#endif
-
- u_char addr[NGX_SOCKADDR_STRLEN + 1];
-} ngx_http_listen_opt_t;
-
-
-typedef enum {
- NGX_HTTP_POST_READ_PHASE = 0,
-
- NGX_HTTP_SERVER_REWRITE_PHASE,
-
- NGX_HTTP_FIND_CONFIG_PHASE,
- NGX_HTTP_REWRITE_PHASE,
- NGX_HTTP_POST_REWRITE_PHASE,
-
- NGX_HTTP_PREACCESS_PHASE,
-
- NGX_HTTP_ACCESS_PHASE,
- NGX_HTTP_POST_ACCESS_PHASE,
-
- NGX_HTTP_TRY_FILES_PHASE,
- NGX_HTTP_CONTENT_PHASE,
-
- NGX_HTTP_LOG_PHASE
-} ngx_http_phases;
-
-typedef struct ngx_http_phase_handler_s ngx_http_phase_handler_t;
-
-typedef ngx_int_t (*ngx_http_phase_handler_pt)(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph);
-
-struct ngx_http_phase_handler_s {
- ngx_http_phase_handler_pt checker;
- ngx_http_handler_pt handler;
- ngx_uint_t next;
-};
-
-
-typedef struct {
- ngx_http_phase_handler_t *handlers;
- ngx_uint_t server_rewrite_index;
- ngx_uint_t location_rewrite_index;
-} ngx_http_phase_engine_t;
-
-
-typedef struct {
- ngx_array_t handlers;
-} ngx_http_phase_t;
-
-
-typedef struct {
- ngx_array_t servers; /* ngx_http_core_srv_conf_t */
-
- ngx_http_phase_engine_t phase_engine;
-
- ngx_hash_t headers_in_hash;
-
- ngx_hash_t variables_hash;
-
- ngx_array_t variables; /* ngx_http_variable_t */
- ngx_uint_t ncaptures;
-
- ngx_uint_t server_names_hash_max_size;
- ngx_uint_t server_names_hash_bucket_size;
-
- ngx_uint_t variables_hash_max_size;
- ngx_uint_t variables_hash_bucket_size;
-
- ngx_hash_keys_arrays_t *variables_keys;
-
- ngx_array_t *ports;
-
- ngx_uint_t try_files; /* unsigned try_files:1 */
-
- ngx_http_phase_t phases[NGX_HTTP_LOG_PHASE + 1];
-} ngx_http_core_main_conf_t;
-
-
-typedef struct {
- /* array of the ngx_http_server_name_t, "server_name" directive */
- ngx_array_t server_names;
-
- /* server ctx */
- ngx_http_conf_ctx_t *ctx;
-
- ngx_str_t server_name;
-
- size_t connection_pool_size;
- size_t request_pool_size;
- size_t client_header_buffer_size;
-
- ngx_bufs_t large_client_header_buffers;
-
- ngx_msec_t client_header_timeout;
-
- ngx_flag_t ignore_invalid_headers;
- ngx_flag_t merge_slashes;
- ngx_flag_t underscores_in_headers;
-
- unsigned listen:1;
-#if (NGX_PCRE)
- unsigned captures:1;
-#endif
-
- ngx_http_core_loc_conf_t **named_locations;
-} ngx_http_core_srv_conf_t;
-
-
-/* list of structures to find core_srv_conf quickly at run time */
-
-
-typedef struct {
-#if (NGX_PCRE)
- ngx_http_regex_t *regex;
-#endif
- ngx_http_core_srv_conf_t *server; /* virtual name server conf */
- ngx_str_t name;
-} ngx_http_server_name_t;
-
-
-typedef struct {
- ngx_hash_combined_t names;
-
- ngx_uint_t nregex;
- ngx_http_server_name_t *regex;
-} ngx_http_virtual_names_t;
-
-
-struct ngx_http_addr_conf_s {
- /* the default server configuration for this address:port */
- ngx_http_core_srv_conf_t *default_server;
-
- ngx_http_virtual_names_t *virtual_names;
-
-#if (NGX_HTTP_SSL)
- unsigned ssl:1;
-#endif
-#if (NGX_HTTP_SPDY)
- unsigned spdy:1;
-#endif
- unsigned proxy_protocol:1;
-};
-
-
-typedef struct {
- in_addr_t addr;
- ngx_http_addr_conf_t conf;
-} ngx_http_in_addr_t;
-
-
-#if (NGX_HAVE_INET6)
-
-typedef struct {
- struct in6_addr addr6;
- ngx_http_addr_conf_t conf;
-} ngx_http_in6_addr_t;
-
-#endif
-
-
-typedef struct {
- /* ngx_http_in_addr_t or ngx_http_in6_addr_t */
- void *addrs;
- ngx_uint_t naddrs;
-} ngx_http_port_t;
-
-
-typedef struct {
- ngx_int_t family;
- in_port_t port;
- ngx_array_t addrs; /* array of ngx_http_conf_addr_t */
-} ngx_http_conf_port_t;
-
-
-typedef struct {
- ngx_http_listen_opt_t opt;
-
- ngx_hash_t hash;
- ngx_hash_wildcard_t *wc_head;
- ngx_hash_wildcard_t *wc_tail;
-
-#if (NGX_PCRE)
- ngx_uint_t nregex;
- ngx_http_server_name_t *regex;
-#endif
-
- /* the default server configuration for this address:port */
- ngx_http_core_srv_conf_t *default_server;
- ngx_array_t servers; /* array of ngx_http_core_srv_conf_t */
-} ngx_http_conf_addr_t;
-
-
-typedef struct {
- ngx_int_t status;
- ngx_int_t overwrite;
- ngx_http_complex_value_t value;
- ngx_str_t args;
-} ngx_http_err_page_t;
-
-
-typedef struct {
- ngx_array_t *lengths;
- ngx_array_t *values;
- ngx_str_t name;
-
- unsigned code:10;
- unsigned test_dir:1;
-} ngx_http_try_file_t;
-
-
-struct ngx_http_core_loc_conf_s {
- ngx_str_t name; /* location name */
-
-#if (NGX_PCRE)
- ngx_http_regex_t *regex;
-#endif
-
- unsigned noname:1; /* "if () {}" block or limit_except */
- unsigned lmt_excpt:1;
- unsigned named:1;
-
- unsigned exact_match:1;
- unsigned noregex:1;
-
- unsigned auto_redirect:1;
-#if (NGX_HTTP_GZIP)
- unsigned gzip_disable_msie6:2;
-#if (NGX_HTTP_DEGRADATION)
- unsigned gzip_disable_degradation:2;
-#endif
-#endif
-
- ngx_http_location_tree_node_t *static_locations;
-#if (NGX_PCRE)
- ngx_http_core_loc_conf_t **regex_locations;
-#endif
-
- /* pointer to the modules' loc_conf */
- void **loc_conf;
-
- uint32_t limit_except;
- void **limit_except_loc_conf;
-
- ngx_http_handler_pt handler;
-
- /* location name length for inclusive location with inherited alias */
- size_t alias;
- ngx_str_t root; /* root, alias */
- ngx_str_t post_action;
-
- ngx_array_t *root_lengths;
- ngx_array_t *root_values;
-
- ngx_array_t *types;
- ngx_hash_t types_hash;
- ngx_str_t default_type;
-
- off_t client_max_body_size; /* client_max_body_size */
- off_t directio; /* directio */
- off_t directio_alignment; /* directio_alignment */
-
- size_t client_body_buffer_size; /* client_body_buffer_size */
- size_t send_lowat; /* send_lowat */
- size_t postpone_output; /* postpone_output */
- size_t limit_rate; /* limit_rate */
- size_t limit_rate_after; /* limit_rate_after */
- size_t sendfile_max_chunk; /* sendfile_max_chunk */
- size_t read_ahead; /* read_ahead */
-
- ngx_msec_t client_body_timeout; /* client_body_timeout */
- ngx_msec_t send_timeout; /* send_timeout */
- ngx_msec_t keepalive_timeout; /* keepalive_timeout */
- ngx_msec_t lingering_time; /* lingering_time */
- ngx_msec_t lingering_timeout; /* lingering_timeout */
- ngx_msec_t resolver_timeout; /* resolver_timeout */
-
- ngx_resolver_t *resolver; /* resolver */
-
- time_t keepalive_header; /* keepalive_timeout */
-
- ngx_uint_t keepalive_requests; /* keepalive_requests */
- ngx_uint_t keepalive_disable; /* keepalive_disable */
- ngx_uint_t satisfy; /* satisfy */
- ngx_uint_t lingering_close; /* lingering_close */
- ngx_uint_t if_modified_since; /* if_modified_since */
- ngx_uint_t max_ranges; /* max_ranges */
- ngx_uint_t client_body_in_file_only; /* client_body_in_file_only */
-
- ngx_flag_t client_body_in_single_buffer;
- /* client_body_in_singe_buffer */
- ngx_flag_t internal; /* internal */
- ngx_flag_t sendfile; /* sendfile */
-#if (NGX_HAVE_FILE_AIO)
- ngx_flag_t aio; /* aio */
-#endif
- ngx_flag_t tcp_nopush; /* tcp_nopush */
- ngx_flag_t tcp_nodelay; /* tcp_nodelay */
- ngx_flag_t reset_timedout_connection; /* reset_timedout_connection */
- ngx_flag_t server_name_in_redirect; /* server_name_in_redirect */
- ngx_flag_t port_in_redirect; /* port_in_redirect */
- ngx_flag_t msie_padding; /* msie_padding */
- ngx_flag_t msie_refresh; /* msie_refresh */
- ngx_flag_t log_not_found; /* log_not_found */
- ngx_flag_t log_subrequest; /* log_subrequest */
- ngx_flag_t recursive_error_pages; /* recursive_error_pages */
- ngx_flag_t server_tokens; /* server_tokens */
- ngx_flag_t chunked_transfer_encoding; /* chunked_transfer_encoding */
- ngx_flag_t etag; /* etag */
-
-#if (NGX_HTTP_GZIP)
- ngx_flag_t gzip_vary; /* gzip_vary */
-
- ngx_uint_t gzip_http_version; /* gzip_http_version */
- ngx_uint_t gzip_proxied; /* gzip_proxied */
-
-#if (NGX_PCRE)
- ngx_array_t *gzip_disable; /* gzip_disable */
-#endif
-#endif
-
-#if (NGX_HAVE_OPENAT)
- ngx_uint_t disable_symlinks; /* disable_symlinks */
- ngx_http_complex_value_t *disable_symlinks_from;
-#endif
-
- ngx_array_t *error_pages; /* error_page */
- ngx_http_try_file_t *try_files; /* try_files */
-
- ngx_path_t *client_body_temp_path; /* client_body_temp_path */
-
- ngx_open_file_cache_t *open_file_cache;
- time_t open_file_cache_valid;
- ngx_uint_t open_file_cache_min_uses;
- ngx_flag_t open_file_cache_errors;
- ngx_flag_t open_file_cache_events;
-
- ngx_log_t *error_log;
-
- ngx_uint_t types_hash_max_size;
- ngx_uint_t types_hash_bucket_size;
-
- ngx_queue_t *locations;
-
-#if 0
- ngx_http_core_loc_conf_t *prev_location;
-#endif
-};
-
-
-typedef struct {
- ngx_queue_t queue;
- ngx_http_core_loc_conf_t *exact;
- ngx_http_core_loc_conf_t *inclusive;
- ngx_str_t *name;
- u_char *file_name;
- ngx_uint_t line;
- ngx_queue_t list;
-} ngx_http_location_queue_t;
-
-
-struct ngx_http_location_tree_node_s {
- ngx_http_location_tree_node_t *left;
- ngx_http_location_tree_node_t *right;
- ngx_http_location_tree_node_t *tree;
-
- ngx_http_core_loc_conf_t *exact;
- ngx_http_core_loc_conf_t *inclusive;
-
- u_char auto_redirect;
- u_char len;
- u_char name[1];
-};
-
-
-void ngx_http_core_run_phases(ngx_http_request_t *r);
-ngx_int_t ngx_http_core_generic_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph);
-ngx_int_t ngx_http_core_rewrite_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph);
-ngx_int_t ngx_http_core_find_config_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph);
-ngx_int_t ngx_http_core_post_rewrite_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph);
-ngx_int_t ngx_http_core_access_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph);
-ngx_int_t ngx_http_core_post_access_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph);
-ngx_int_t ngx_http_core_try_files_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph);
-ngx_int_t ngx_http_core_content_phase(ngx_http_request_t *r,
- ngx_http_phase_handler_t *ph);
-
-
-void *ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash);
-ngx_int_t ngx_http_set_content_type(ngx_http_request_t *r);
-void ngx_http_set_exten(ngx_http_request_t *r);
-ngx_int_t ngx_http_set_etag(ngx_http_request_t *r);
-void ngx_http_weak_etag(ngx_http_request_t *r);
-ngx_int_t ngx_http_send_response(ngx_http_request_t *r, ngx_uint_t status,
- ngx_str_t *ct, ngx_http_complex_value_t *cv);
-u_char *ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *name,
- size_t *root_length, size_t reserved);
-ngx_int_t ngx_http_auth_basic_user(ngx_http_request_t *r);
-#if (NGX_HTTP_GZIP)
-ngx_int_t ngx_http_gzip_ok(ngx_http_request_t *r);
-#endif
-
-
-ngx_int_t ngx_http_subrequest(ngx_http_request_t *r,
- ngx_str_t *uri, ngx_str_t *args, ngx_http_request_t **sr,
- ngx_http_post_subrequest_t *psr, ngx_uint_t flags);
-ngx_int_t ngx_http_internal_redirect(ngx_http_request_t *r,
- ngx_str_t *uri, ngx_str_t *args);
-ngx_int_t ngx_http_named_location(ngx_http_request_t *r, ngx_str_t *name);
-
-
-ngx_http_cleanup_t *ngx_http_cleanup_add(ngx_http_request_t *r, size_t size);
-
-
-typedef ngx_int_t (*ngx_http_output_header_filter_pt)(ngx_http_request_t *r);
-typedef ngx_int_t (*ngx_http_output_body_filter_pt)
- (ngx_http_request_t *r, ngx_chain_t *chain);
-
-
-ngx_int_t ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *chain);
-ngx_int_t ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *chain);
-
-
-ngx_int_t ngx_http_set_disable_symlinks(ngx_http_request_t *r,
- ngx_http_core_loc_conf_t *clcf, ngx_str_t *path, ngx_open_file_info_t *of);
-
-ngx_int_t ngx_http_get_forwarded_addr(ngx_http_request_t *r, ngx_addr_t *addr,
- ngx_array_t *headers, ngx_str_t *value, ngx_array_t *proxies,
- int recursive);
-
-
-extern ngx_module_t ngx_http_core_module;
-
-extern ngx_uint_t ngx_http_max_module;
-
-extern ngx_str_t ngx_http_core_get_method;
-
-
-#define ngx_http_clear_content_length(r) \
- \
- r->headers_out.content_length_n = -1; \
- if (r->headers_out.content_length) { \
- r->headers_out.content_length->hash = 0; \
- r->headers_out.content_length = NULL; \
- }
-
-#define ngx_http_clear_accept_ranges(r) \
- \
- r->allow_ranges = 0; \
- if (r->headers_out.accept_ranges) { \
- r->headers_out.accept_ranges->hash = 0; \
- r->headers_out.accept_ranges = NULL; \
- }
-
-#define ngx_http_clear_last_modified(r) \
- \
- r->headers_out.last_modified_time = -1; \
- if (r->headers_out.last_modified) { \
- r->headers_out.last_modified->hash = 0; \
- r->headers_out.last_modified = NULL; \
- }
-
-#define ngx_http_clear_location(r) \
- \
- if (r->headers_out.location) { \
- r->headers_out.location->hash = 0; \
- r->headers_out.location = NULL; \
- }
-
-#define ngx_http_clear_etag(r) \
- \
- if (r->headers_out.etag) { \
- r->headers_out.etag->hash = 0; \
- r->headers_out.etag = NULL; \
- }
-
-
-#endif /* _NGX_HTTP_CORE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_file_cache.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_file_cache.c
deleted file mode 100644
index 2eebc3068ef..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_file_cache.c
+++ /dev/null
@@ -1,2019 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <ngx_md5.h>
-
-
-static ngx_int_t ngx_http_file_cache_lock(ngx_http_request_t *r,
- ngx_http_cache_t *c);
-static void ngx_http_file_cache_lock_wait_handler(ngx_event_t *ev);
-static ngx_int_t ngx_http_file_cache_read(ngx_http_request_t *r,
- ngx_http_cache_t *c);
-static ssize_t ngx_http_file_cache_aio_read(ngx_http_request_t *r,
- ngx_http_cache_t *c);
-#if (NGX_HAVE_FILE_AIO)
-static void ngx_http_cache_aio_event_handler(ngx_event_t *ev);
-#endif
-static ngx_int_t ngx_http_file_cache_exists(ngx_http_file_cache_t *cache,
- ngx_http_cache_t *c);
-static ngx_int_t ngx_http_file_cache_name(ngx_http_request_t *r,
- ngx_path_t *path);
-static ngx_http_file_cache_node_t *
- ngx_http_file_cache_lookup(ngx_http_file_cache_t *cache, u_char *key);
-static void ngx_http_file_cache_rbtree_insert_value(ngx_rbtree_node_t *temp,
- ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel);
-static void ngx_http_file_cache_cleanup(void *data);
-static time_t ngx_http_file_cache_forced_expire(ngx_http_file_cache_t *cache);
-static time_t ngx_http_file_cache_expire(ngx_http_file_cache_t *cache);
-static void ngx_http_file_cache_delete(ngx_http_file_cache_t *cache,
- ngx_queue_t *q, u_char *name);
-static void ngx_http_file_cache_loader_sleep(ngx_http_file_cache_t *cache);
-static ngx_int_t ngx_http_file_cache_noop(ngx_tree_ctx_t *ctx,
- ngx_str_t *path);
-static ngx_int_t ngx_http_file_cache_manage_file(ngx_tree_ctx_t *ctx,
- ngx_str_t *path);
-static ngx_int_t ngx_http_file_cache_add_file(ngx_tree_ctx_t *ctx,
- ngx_str_t *path);
-static ngx_int_t ngx_http_file_cache_add(ngx_http_file_cache_t *cache,
- ngx_http_cache_t *c);
-static ngx_int_t ngx_http_file_cache_delete_file(ngx_tree_ctx_t *ctx,
- ngx_str_t *path);
-
-
-ngx_str_t ngx_http_cache_status[] = {
- ngx_string("MISS"),
- ngx_string("BYPASS"),
- ngx_string("EXPIRED"),
- ngx_string("STALE"),
- ngx_string("UPDATING"),
- ngx_string("REVALIDATED"),
- ngx_string("HIT")
-};
-
-
-static u_char ngx_http_file_cache_key[] = { LF, 'K', 'E', 'Y', ':', ' ' };
-
-
-static ngx_int_t
-ngx_http_file_cache_init(ngx_shm_zone_t *shm_zone, void *data)
-{
- ngx_http_file_cache_t *ocache = data;
-
- size_t len;
- ngx_uint_t n;
- ngx_http_file_cache_t *cache;
-
- cache = shm_zone->data;
-
- if (ocache) {
- if (ngx_strcmp(cache->path->name.data, ocache->path->name.data) != 0) {
- ngx_log_error(NGX_LOG_EMERG, shm_zone->shm.log, 0,
- "cache \"%V\" uses the \"%V\" cache path "
- "while previously it used the \"%V\" cache path",
- &shm_zone->shm.name, &cache->path->name,
- &ocache->path->name);
-
- return NGX_ERROR;
- }
-
- for (n = 0; n < 3; n++) {
- if (cache->path->level[n] != ocache->path->level[n]) {
- ngx_log_error(NGX_LOG_EMERG, shm_zone->shm.log, 0,
- "cache \"%V\" had previously different levels",
- &shm_zone->shm.name);
- return NGX_ERROR;
- }
- }
-
- cache->sh = ocache->sh;
-
- cache->shpool = ocache->shpool;
- cache->bsize = ocache->bsize;
-
- cache->max_size /= cache->bsize;
-
- if (!cache->sh->cold || cache->sh->loading) {
- cache->path->loader = NULL;
- }
-
- return NGX_OK;
- }
-
- cache->shpool = (ngx_slab_pool_t *) shm_zone->shm.addr;
-
- if (shm_zone->shm.exists) {
- cache->sh = cache->shpool->data;
- cache->bsize = ngx_fs_bsize(cache->path->name.data);
-
- return NGX_OK;
- }
-
- cache->sh = ngx_slab_alloc(cache->shpool, sizeof(ngx_http_file_cache_sh_t));
- if (cache->sh == NULL) {
- return NGX_ERROR;
- }
-
- cache->shpool->data = cache->sh;
-
- ngx_rbtree_init(&cache->sh->rbtree, &cache->sh->sentinel,
- ngx_http_file_cache_rbtree_insert_value);
-
- ngx_queue_init(&cache->sh->queue);
-
- cache->sh->cold = 1;
- cache->sh->loading = 0;
- cache->sh->size = 0;
-
- cache->bsize = ngx_fs_bsize(cache->path->name.data);
-
- cache->max_size /= cache->bsize;
-
- len = sizeof(" in cache keys zone \"\"") + shm_zone->shm.name.len;
-
- cache->shpool->log_ctx = ngx_slab_alloc(cache->shpool, len);
- if (cache->shpool->log_ctx == NULL) {
- return NGX_ERROR;
- }
-
- ngx_sprintf(cache->shpool->log_ctx, " in cache keys zone \"%V\"%Z",
- &shm_zone->shm.name);
-
- cache->shpool->log_nomem = 0;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_file_cache_new(ngx_http_request_t *r)
-{
- ngx_http_cache_t *c;
-
- c = ngx_pcalloc(r->pool, sizeof(ngx_http_cache_t));
- if (c == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_array_init(&c->keys, r->pool, 4, sizeof(ngx_str_t)) != NGX_OK) {
- return NGX_ERROR;
- }
-
- r->cache = c;
- c->file.log = r->connection->log;
- c->file.fd = NGX_INVALID_FILE;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_file_cache_create(ngx_http_request_t *r)
-{
- ngx_http_cache_t *c;
- ngx_pool_cleanup_t *cln;
- ngx_http_file_cache_t *cache;
-
- c = r->cache;
- cache = c->file_cache;
-
- cln = ngx_pool_cleanup_add(r->pool, 0);
- if (cln == NULL) {
- return NGX_ERROR;
- }
-
- cln->handler = ngx_http_file_cache_cleanup;
- cln->data = c;
-
- if (ngx_http_file_cache_exists(cache, c) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if (ngx_http_file_cache_name(r, cache->path) != NGX_OK) {
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-void
-ngx_http_file_cache_create_key(ngx_http_request_t *r)
-{
- size_t len;
- ngx_str_t *key;
- ngx_uint_t i;
- ngx_md5_t md5;
- ngx_http_cache_t *c;
-
- c = r->cache;
-
- len = 0;
-
- ngx_crc32_init(c->crc32);
- ngx_md5_init(&md5);
-
- key = c->keys.elts;
- for (i = 0; i < c->keys.nelts; i++) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http cache key: \"%V\"", &key[i]);
-
- len += key[i].len;
-
- ngx_crc32_update(&c->crc32, key[i].data, key[i].len);
- ngx_md5_update(&md5, key[i].data, key[i].len);
- }
-
- c->header_start = sizeof(ngx_http_file_cache_header_t)
- + sizeof(ngx_http_file_cache_key) + len + 1;
-
- ngx_crc32_final(c->crc32);
- ngx_md5_final(c->key, &md5);
-}
-
-
-ngx_int_t
-ngx_http_file_cache_open(ngx_http_request_t *r)
-{
- ngx_int_t rc, rv;
- ngx_uint_t cold, test;
- ngx_http_cache_t *c;
- ngx_pool_cleanup_t *cln;
- ngx_open_file_info_t of;
- ngx_http_file_cache_t *cache;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->cache;
-
- if (c->waiting) {
- return NGX_AGAIN;
- }
-
- if (c->buf) {
- return ngx_http_file_cache_read(r, c);
- }
-
- cache = c->file_cache;
-
- if (c->node == NULL) {
- cln = ngx_pool_cleanup_add(r->pool, 0);
- if (cln == NULL) {
- return NGX_ERROR;
- }
-
- cln->handler = ngx_http_file_cache_cleanup;
- cln->data = c;
- }
-
- rc = ngx_http_file_cache_exists(cache, c);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache exists: %i e:%d", rc, c->exists);
-
- if (rc == NGX_ERROR) {
- return rc;
- }
-
- if (rc == NGX_AGAIN) {
- return NGX_HTTP_CACHE_SCARCE;
- }
-
- cold = cache->sh->cold;
-
- if (rc == NGX_OK) {
-
- if (c->error) {
- return c->error;
- }
-
- c->temp_file = 1;
- test = c->exists ? 1 : 0;
- rv = NGX_DECLINED;
-
- } else { /* rc == NGX_DECLINED */
-
- if (c->min_uses > 1) {
-
- if (!cold) {
- return NGX_HTTP_CACHE_SCARCE;
- }
-
- test = 1;
- rv = NGX_HTTP_CACHE_SCARCE;
-
- } else {
- c->temp_file = 1;
- test = cold ? 1 : 0;
- rv = NGX_DECLINED;
- }
- }
-
- if (ngx_http_file_cache_name(r, cache->path) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (!test) {
- goto done;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.uniq = c->uniq;
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.events = clcf->open_file_cache_events;
- of.directio = NGX_OPEN_FILE_DIRECTIO_OFF;
- of.read_ahead = clcf->read_ahead;
-
- if (ngx_open_cached_file(clcf->open_file_cache, &c->file.name, &of, r->pool)
- != NGX_OK)
- {
- switch (of.err) {
-
- case 0:
- return NGX_ERROR;
-
- case NGX_ENOENT:
- case NGX_ENOTDIR:
- goto done;
-
- default:
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,
- ngx_open_file_n " \"%s\" failed", c->file.name.data);
- return NGX_ERROR;
- }
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache fd: %d", of.fd);
-
- c->file.fd = of.fd;
- c->file.log = r->connection->log;
- c->uniq = of.uniq;
- c->length = of.size;
- c->fs_size = (of.fs_size + cache->bsize - 1) / cache->bsize;
-
- c->buf = ngx_create_temp_buf(r->pool, c->body_start);
- if (c->buf == NULL) {
- return NGX_ERROR;
- }
-
- return ngx_http_file_cache_read(r, c);
-
-done:
-
- if (rv == NGX_DECLINED) {
- return ngx_http_file_cache_lock(r, c);
- }
-
- return rv;
-}
-
-
-static ngx_int_t
-ngx_http_file_cache_lock(ngx_http_request_t *r, ngx_http_cache_t *c)
-{
- ngx_msec_t now, timer;
- ngx_http_file_cache_t *cache;
-
- if (!c->lock) {
- return NGX_DECLINED;
- }
-
- cache = c->file_cache;
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- if (!c->node->updating) {
- c->node->updating = 1;
- c->updating = 1;
- }
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache lock u:%d wt:%M",
- c->updating, c->wait_time);
-
- if (c->updating) {
- return NGX_DECLINED;
- }
-
- c->waiting = 1;
-
- now = ngx_current_msec;
-
- if (c->wait_time == 0) {
- c->wait_time = now + c->lock_timeout;
-
- c->wait_event.handler = ngx_http_file_cache_lock_wait_handler;
- c->wait_event.data = r;
- c->wait_event.log = r->connection->log;
- }
-
- timer = c->wait_time - now;
-
- ngx_add_timer(&c->wait_event, (timer > 500) ? 500 : timer);
-
- r->main->blocked++;
-
- return NGX_AGAIN;
-}
-
-
-static void
-ngx_http_file_cache_lock_wait_handler(ngx_event_t *ev)
-{
- ngx_uint_t wait;
- ngx_msec_t timer;
- ngx_http_cache_t *c;
- ngx_http_request_t *r;
- ngx_http_file_cache_t *cache;
-
- r = ev->data;
- c = r->cache;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ev->log, 0,
- "http file cache wait handler wt:%M cur:%M",
- c->wait_time, ngx_current_msec);
-
- timer = c->wait_time - ngx_current_msec;
-
- if ((ngx_msec_int_t) timer <= 0) {
- ngx_log_error(NGX_LOG_INFO, ev->log, 0, "cache lock timeout");
- c->lock = 0;
- goto wakeup;
- }
-
- cache = c->file_cache;
- wait = 0;
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- if (c->node->updating) {
- wait = 1;
- }
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- if (wait) {
- ngx_add_timer(ev, (timer > 500) ? 500 : timer);
- return;
- }
-
-wakeup:
-
- c->waiting = 0;
- r->main->blocked--;
- r->connection->write->handler(r->connection->write);
-}
-
-
-static ngx_int_t
-ngx_http_file_cache_read(ngx_http_request_t *r, ngx_http_cache_t *c)
-{
- time_t now;
- ssize_t n;
- ngx_int_t rc;
- ngx_http_file_cache_t *cache;
- ngx_http_file_cache_header_t *h;
-
- n = ngx_http_file_cache_aio_read(r, c);
-
- if (n < 0) {
- return n;
- }
-
- if ((size_t) n < c->header_start) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
- "cache file \"%s\" is too small", c->file.name.data);
- return NGX_DECLINED;
- }
-
- h = (ngx_http_file_cache_header_t *) c->buf->pos;
-
- if (h->version != NGX_HTTP_CACHE_VERSION) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "cache file \"%s\" version mismatch", c->file.name.data);
- return NGX_DECLINED;
- }
-
- if (h->crc32 != c->crc32) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
- "cache file \"%s\" has md5 collision", c->file.name.data);
- return NGX_DECLINED;
- }
-
- if ((size_t) h->body_start > c->body_start) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
- "cache file \"%s\" has too long header",
- c->file.name.data);
- return NGX_DECLINED;
- }
-
- c->buf->last += n;
-
- c->valid_sec = h->valid_sec;
- c->last_modified = h->last_modified;
- c->date = h->date;
- c->valid_msec = h->valid_msec;
- c->header_start = h->header_start;
- c->body_start = h->body_start;
- c->etag.len = h->etag_len;
- c->etag.data = h->etag;
-
- r->cached = 1;
-
- cache = c->file_cache;
-
- if (cache->sh->cold) {
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- if (!c->node->exists) {
- c->node->uses = 1;
- c->node->body_start = c->body_start;
- c->node->exists = 1;
- c->node->uniq = c->uniq;
- c->node->fs_size = c->fs_size;
-
- cache->sh->size += c->fs_size;
- }
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
- }
-
- now = ngx_time();
-
- if (c->valid_sec < now) {
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- if (c->node->updating) {
- rc = NGX_HTTP_CACHE_UPDATING;
-
- } else {
- c->node->updating = 1;
- c->updating = 1;
- rc = NGX_HTTP_CACHE_STALE;
- }
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache expired: %i %T %T",
- rc, c->valid_sec, now);
-
- return rc;
- }
-
- return NGX_OK;
-}
-
-
-static ssize_t
-ngx_http_file_cache_aio_read(ngx_http_request_t *r, ngx_http_cache_t *c)
-{
-#if (NGX_HAVE_FILE_AIO)
- ssize_t n;
- ngx_http_core_loc_conf_t *clcf;
-
- if (!ngx_file_aio) {
- goto noaio;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (!clcf->aio) {
- goto noaio;
- }
-
- n = ngx_file_aio_read(&c->file, c->buf->pos, c->body_start, 0, r->pool);
-
- if (n != NGX_AGAIN) {
- return n;
- }
-
- c->file.aio->data = r;
- c->file.aio->handler = ngx_http_cache_aio_event_handler;
-
- r->main->blocked++;
- r->aio = 1;
-
- return NGX_AGAIN;
-
-noaio:
-
-#endif
-
- return ngx_read_file(&c->file, c->buf->pos, c->body_start, 0);
-}
-
-
-#if (NGX_HAVE_FILE_AIO)
-
-static void
-ngx_http_cache_aio_event_handler(ngx_event_t *ev)
-{
- ngx_event_aio_t *aio;
- ngx_http_request_t *r;
-
- aio = ev->data;
- r = aio->data;
-
- r->main->blocked--;
- r->aio = 0;
-
- r->connection->write->handler(r->connection->write);
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_file_cache_exists(ngx_http_file_cache_t *cache, ngx_http_cache_t *c)
-{
- ngx_int_t rc;
- ngx_http_file_cache_node_t *fcn;
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- fcn = c->node;
-
- if (fcn == NULL) {
- fcn = ngx_http_file_cache_lookup(cache, c->key);
- }
-
- if (fcn) {
- ngx_queue_remove(&fcn->queue);
-
- if (c->node == NULL) {
- fcn->uses++;
- fcn->count++;
- }
-
- if (fcn->error) {
-
- if (fcn->valid_sec < ngx_time()) {
- goto renew;
- }
-
- rc = NGX_OK;
-
- goto done;
- }
-
- if (fcn->exists || fcn->uses >= c->min_uses) {
-
- c->exists = fcn->exists;
- if (fcn->body_start) {
- c->body_start = fcn->body_start;
- }
-
- rc = NGX_OK;
-
- goto done;
- }
-
- rc = NGX_AGAIN;
-
- goto done;
- }
-
- fcn = ngx_slab_calloc_locked(cache->shpool,
- sizeof(ngx_http_file_cache_node_t));
- if (fcn == NULL) {
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- (void) ngx_http_file_cache_forced_expire(cache);
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- fcn = ngx_slab_calloc_locked(cache->shpool,
- sizeof(ngx_http_file_cache_node_t));
- if (fcn == NULL) {
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
- "could not allocate node%s", cache->shpool->log_ctx);
- rc = NGX_ERROR;
- goto failed;
- }
- }
-
- ngx_memcpy((u_char *) &fcn->node.key, c->key, sizeof(ngx_rbtree_key_t));
-
- ngx_memcpy(fcn->key, &c->key[sizeof(ngx_rbtree_key_t)],
- NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t));
-
- ngx_rbtree_insert(&cache->sh->rbtree, &fcn->node);
-
- fcn->uses = 1;
- fcn->count = 1;
-
-renew:
-
- rc = NGX_DECLINED;
-
- fcn->valid_msec = 0;
- fcn->error = 0;
- fcn->exists = 0;
- fcn->valid_sec = 0;
- fcn->uniq = 0;
- fcn->body_start = 0;
- fcn->fs_size = 0;
-
-done:
-
- fcn->expire = ngx_time() + cache->inactive;
-
- ngx_queue_insert_head(&cache->sh->queue, &fcn->queue);
-
- c->uniq = fcn->uniq;
- c->error = fcn->error;
- c->node = fcn;
-
-failed:
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_file_cache_name(ngx_http_request_t *r, ngx_path_t *path)
-{
- u_char *p;
- ngx_http_cache_t *c;
-
- c = r->cache;
-
- if (c->file.name.len) {
- return NGX_OK;
- }
-
- c->file.name.len = path->name.len + 1 + path->len
- + 2 * NGX_HTTP_CACHE_KEY_LEN;
-
- c->file.name.data = ngx_pnalloc(r->pool, c->file.name.len + 1);
- if (c->file.name.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(c->file.name.data, path->name.data, path->name.len);
-
- p = c->file.name.data + path->name.len + 1 + path->len;
- p = ngx_hex_dump(p, c->key, NGX_HTTP_CACHE_KEY_LEN);
- *p = '\0';
-
- ngx_create_hashed_filename(path, c->file.name.data, c->file.name.len);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "cache file: \"%s\"", c->file.name.data);
-
- return NGX_OK;
-}
-
-
-static ngx_http_file_cache_node_t *
-ngx_http_file_cache_lookup(ngx_http_file_cache_t *cache, u_char *key)
-{
- ngx_int_t rc;
- ngx_rbtree_key_t node_key;
- ngx_rbtree_node_t *node, *sentinel;
- ngx_http_file_cache_node_t *fcn;
-
- ngx_memcpy((u_char *) &node_key, key, sizeof(ngx_rbtree_key_t));
-
- node = cache->sh->rbtree.root;
- sentinel = cache->sh->rbtree.sentinel;
-
- while (node != sentinel) {
-
- if (node_key < node->key) {
- node = node->left;
- continue;
- }
-
- if (node_key > node->key) {
- node = node->right;
- continue;
- }
-
- /* node_key == node->key */
-
- fcn = (ngx_http_file_cache_node_t *) node;
-
- rc = ngx_memcmp(&key[sizeof(ngx_rbtree_key_t)], fcn->key,
- NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t));
-
- if (rc == 0) {
- return fcn;
- }
-
- node = (rc < 0) ? node->left : node->right;
- }
-
- /* not found */
-
- return NULL;
-}
-
-
-static void
-ngx_http_file_cache_rbtree_insert_value(ngx_rbtree_node_t *temp,
- ngx_rbtree_node_t *node, ngx_rbtree_node_t *sentinel)
-{
- ngx_rbtree_node_t **p;
- ngx_http_file_cache_node_t *cn, *cnt;
-
- for ( ;; ) {
-
- if (node->key < temp->key) {
-
- p = &temp->left;
-
- } else if (node->key > temp->key) {
-
- p = &temp->right;
-
- } else { /* node->key == temp->key */
-
- cn = (ngx_http_file_cache_node_t *) node;
- cnt = (ngx_http_file_cache_node_t *) temp;
-
- p = (ngx_memcmp(cn->key, cnt->key,
- NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t))
- < 0)
- ? &temp->left : &temp->right;
- }
-
- if (*p == sentinel) {
- break;
- }
-
- temp = *p;
- }
-
- *p = node;
- node->parent = temp;
- node->left = sentinel;
- node->right = sentinel;
- ngx_rbt_red(node);
-}
-
-
-void
-ngx_http_file_cache_set_header(ngx_http_request_t *r, u_char *buf)
-{
- ngx_http_file_cache_header_t *h = (ngx_http_file_cache_header_t *) buf;
-
- u_char *p;
- ngx_str_t *key;
- ngx_uint_t i;
- ngx_http_cache_t *c;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache set header");
-
- c = r->cache;
-
- ngx_memzero(h, sizeof(ngx_http_file_cache_header_t));
-
- h->version = NGX_HTTP_CACHE_VERSION;
- h->valid_sec = c->valid_sec;
- h->last_modified = c->last_modified;
- h->date = c->date;
- h->crc32 = c->crc32;
- h->valid_msec = (u_short) c->valid_msec;
- h->header_start = (u_short) c->header_start;
- h->body_start = (u_short) c->body_start;
-
- if (c->etag.len <= NGX_HTTP_CACHE_ETAG_LEN) {
- h->etag_len = (u_char) c->etag.len;
- ngx_memcpy(h->etag, c->etag.data, c->etag.len);
- }
-
- p = buf + sizeof(ngx_http_file_cache_header_t);
-
- p = ngx_cpymem(p, ngx_http_file_cache_key, sizeof(ngx_http_file_cache_key));
-
- key = c->keys.elts;
- for (i = 0; i < c->keys.nelts; i++) {
- p = ngx_copy(p, key[i].data, key[i].len);
- }
-
- *p = LF;
-}
-
-
-void
-ngx_http_file_cache_update(ngx_http_request_t *r, ngx_temp_file_t *tf)
-{
- off_t fs_size;
- ngx_int_t rc;
- ngx_file_uniq_t uniq;
- ngx_file_info_t fi;
- ngx_http_cache_t *c;
- ngx_ext_rename_file_t ext;
- ngx_http_file_cache_t *cache;
-
- c = r->cache;
-
- if (c->updated) {
- return;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache update");
-
- c->updated = 1;
- c->updating = 0;
-
- cache = c->file_cache;
-
- uniq = 0;
- fs_size = 0;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache rename: \"%s\" to \"%s\"",
- tf->file.name.data, c->file.name.data);
-
- ext.access = NGX_FILE_OWNER_ACCESS;
- ext.path_access = NGX_FILE_OWNER_ACCESS;
- ext.time = -1;
- ext.create_path = 1;
- ext.delete_file = 1;
- ext.log = r->connection->log;
-
- rc = ngx_ext_rename_file(&tf->file.name, &c->file.name, &ext);
-
- if (rc == NGX_OK) {
-
- if (ngx_fd_info(tf->file.fd, &fi) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- ngx_fd_info_n " \"%s\" failed", tf->file.name.data);
-
- rc = NGX_ERROR;
-
- } else {
- uniq = ngx_file_uniq(&fi);
- fs_size = (ngx_file_fs_size(&fi) + cache->bsize - 1) / cache->bsize;
- }
- }
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- c->node->count--;
- c->node->uniq = uniq;
- c->node->body_start = c->body_start;
-
- cache->sh->size += fs_size - c->node->fs_size;
- c->node->fs_size = fs_size;
-
- if (rc == NGX_OK) {
- c->node->exists = 1;
- }
-
- c->node->updating = 0;
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-}
-
-
-void
-ngx_http_file_cache_update_header(ngx_http_request_t *r)
-{
- ssize_t n;
- ngx_err_t err;
- ngx_file_t file;
- ngx_file_info_t fi;
- ngx_http_cache_t *c;
- ngx_http_file_cache_header_t h;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache update header");
-
- c = r->cache;
-
- ngx_memzero(&file, sizeof(ngx_file_t));
-
- file.name = c->file.name;
- file.log = r->connection->log;
- file.fd = ngx_open_file(file.name.data, NGX_FILE_RDWR, NGX_FILE_OPEN, 0);
-
- if (file.fd == NGX_INVALID_FILE) {
- err = ngx_errno;
-
- /* cache file may have been deleted */
-
- if (err == NGX_ENOENT) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache \"%s\" not found",
- file.name.data);
- return;
- }
-
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, err,
- ngx_open_file_n " \"%s\" failed", file.name.data);
- return;
- }
-
- /*
- * make sure cache file wasn't replaced;
- * if it was, do nothing
- */
-
- if (ngx_fd_info(file.fd, &fi) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- ngx_fd_info_n " \"%s\" failed", file.name.data);
- goto done;
- }
-
- if (c->uniq != ngx_file_uniq(&fi)
- || c->length != ngx_file_size(&fi))
- {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache \"%s\" changed",
- file.name.data);
- goto done;
- }
-
- n = ngx_read_file(&file, (u_char *) &h,
- sizeof(ngx_http_file_cache_header_t), 0);
-
- if (n == NGX_ERROR) {
- goto done;
- }
-
- if ((size_t) n != sizeof(ngx_http_file_cache_header_t)) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, 0,
- ngx_read_file_n " read only %z of %z from \"%s\"",
- n, sizeof(ngx_http_file_cache_header_t), file.name.data);
- goto done;
- }
-
- if (h.version != NGX_HTTP_CACHE_VERSION
- || h.last_modified != c->last_modified
- || h.crc32 != c->crc32
- || h.header_start != c->header_start
- || h.body_start != c->body_start)
- {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache \"%s\" content changed",
- file.name.data);
- goto done;
- }
-
- /*
- * update cache file header with new data,
- * notably h.valid_sec and h.date
- */
-
- ngx_memzero(&h, sizeof(ngx_http_file_cache_header_t));
-
- h.version = NGX_HTTP_CACHE_VERSION;
- h.valid_sec = c->valid_sec;
- h.last_modified = c->last_modified;
- h.date = c->date;
- h.crc32 = c->crc32;
- h.valid_msec = (u_short) c->valid_msec;
- h.header_start = (u_short) c->header_start;
- h.body_start = (u_short) c->body_start;
-
- if (c->etag.len <= NGX_HTTP_CACHE_ETAG_LEN) {
- h.etag_len = (u_char) c->etag.len;
- ngx_memcpy(h.etag, c->etag.data, c->etag.len);
- }
-
- (void) ngx_write_file(&file, (u_char *) &h,
- sizeof(ngx_http_file_cache_header_t), 0);
-
-done:
-
- if (ngx_close_file(file.fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", file.name.data);
- }
-}
-
-
-ngx_int_t
-ngx_http_cache_send(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t out;
- ngx_http_cache_t *c;
-
- c = r->cache;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http file cache send: %s", c->file.name.data);
-
- if (r != r->main && c->length - c->body_start == 0) {
- return ngx_http_send_header(r);
- }
-
- /* we need to allocate all before the header would be sent */
-
- b = ngx_pcalloc(r->pool, sizeof(ngx_buf_t));
- if (b == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t));
- if (b->file == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) {
- return rc;
- }
-
- b->file_pos = c->body_start;
- b->file_last = c->length;
-
- b->in_file = (c->length - c->body_start) ? 1: 0;
- b->last_buf = (r == r->main) ? 1: 0;
- b->last_in_chain = 1;
-
- b->file->fd = c->file.fd;
- b->file->name = c->file.name;
- b->file->log = r->connection->log;
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_output_filter(r, &out);
-}
-
-
-void
-ngx_http_file_cache_free(ngx_http_cache_t *c, ngx_temp_file_t *tf)
-{
- ngx_http_file_cache_t *cache;
- ngx_http_file_cache_node_t *fcn;
-
- if (c->updated || c->node == NULL) {
- return;
- }
-
- cache = c->file_cache;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->file.log, 0,
- "http file cache free, fd: %d", c->file.fd);
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- fcn = c->node;
- fcn->count--;
-
- if (c->updating) {
- fcn->updating = 0;
- }
-
- if (c->error) {
- fcn->error = c->error;
-
- if (c->valid_sec) {
- fcn->valid_sec = c->valid_sec;
- fcn->valid_msec = c->valid_msec;
- }
-
- } else if (!fcn->exists && fcn->count == 0 && c->min_uses == 1) {
- ngx_queue_remove(&fcn->queue);
- ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node);
- ngx_slab_free_locked(cache->shpool, fcn);
- c->node = NULL;
- }
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- c->updated = 1;
- c->updating = 0;
-
- if (c->temp_file) {
- if (tf && tf->file.fd != NGX_INVALID_FILE) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->file.log, 0,
- "http file cache incomplete: \"%s\"",
- tf->file.name.data);
-
- if (ngx_delete_file(tf->file.name.data) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, c->file.log, ngx_errno,
- ngx_delete_file_n " \"%s\" failed",
- tf->file.name.data);
- }
- }
- }
-
- if (c->wait_event.timer_set) {
- ngx_del_timer(&c->wait_event);
- }
-}
-
-
-static void
-ngx_http_file_cache_cleanup(void *data)
-{
- ngx_http_cache_t *c = data;
-
- if (c->updated) {
- return;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->file.log, 0,
- "http file cache cleanup");
-
- if (c->updating) {
- ngx_log_error(NGX_LOG_ALERT, c->file.log, 0,
- "stalled cache updating, error:%ui", c->error);
- }
-
- ngx_http_file_cache_free(c, NULL);
-}
-
-
-static time_t
-ngx_http_file_cache_forced_expire(ngx_http_file_cache_t *cache)
-{
- u_char *name;
- size_t len;
- time_t wait;
- ngx_uint_t tries;
- ngx_path_t *path;
- ngx_queue_t *q;
- ngx_http_file_cache_node_t *fcn;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
- "http file cache forced expire");
-
- path = cache->path;
- len = path->name.len + 1 + path->len + 2 * NGX_HTTP_CACHE_KEY_LEN;
-
- name = ngx_alloc(len + 1, ngx_cycle->log);
- if (name == NULL) {
- return 10;
- }
-
- ngx_memcpy(name, path->name.data, path->name.len);
-
- wait = 10;
- tries = 20;
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- for (q = ngx_queue_last(&cache->sh->queue);
- q != ngx_queue_sentinel(&cache->sh->queue);
- q = ngx_queue_prev(q))
- {
- fcn = ngx_queue_data(q, ngx_http_file_cache_node_t, queue);
-
- ngx_log_debug6(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
- "http file cache forced expire: #%d %d %02xd%02xd%02xd%02xd",
- fcn->count, fcn->exists,
- fcn->key[0], fcn->key[1], fcn->key[2], fcn->key[3]);
-
- if (fcn->count == 0) {
- ngx_http_file_cache_delete(cache, q, name);
- wait = 0;
-
- } else {
- if (--tries) {
- continue;
- }
-
- wait = 1;
- }
-
- break;
- }
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- ngx_free(name);
-
- return wait;
-}
-
-
-static time_t
-ngx_http_file_cache_expire(ngx_http_file_cache_t *cache)
-{
- u_char *name, *p;
- size_t len;
- time_t now, wait;
- ngx_path_t *path;
- ngx_queue_t *q;
- ngx_http_file_cache_node_t *fcn;
- u_char key[2 * NGX_HTTP_CACHE_KEY_LEN];
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
- "http file cache expire");
-
- path = cache->path;
- len = path->name.len + 1 + path->len + 2 * NGX_HTTP_CACHE_KEY_LEN;
-
- name = ngx_alloc(len + 1, ngx_cycle->log);
- if (name == NULL) {
- return 10;
- }
-
- ngx_memcpy(name, path->name.data, path->name.len);
-
- now = ngx_time();
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- for ( ;; ) {
-
- if (ngx_quit || ngx_terminate) {
- wait = 1;
- break;
- }
-
- if (ngx_queue_empty(&cache->sh->queue)) {
- wait = 10;
- break;
- }
-
- q = ngx_queue_last(&cache->sh->queue);
-
- fcn = ngx_queue_data(q, ngx_http_file_cache_node_t, queue);
-
- wait = fcn->expire - now;
-
- if (wait > 0) {
- wait = wait > 10 ? 10 : wait;
- break;
- }
-
- ngx_log_debug6(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
- "http file cache expire: #%d %d %02xd%02xd%02xd%02xd",
- fcn->count, fcn->exists,
- fcn->key[0], fcn->key[1], fcn->key[2], fcn->key[3]);
-
- if (fcn->count == 0) {
- ngx_http_file_cache_delete(cache, q, name);
- continue;
- }
-
- if (fcn->deleting) {
- wait = 1;
- break;
- }
-
- p = ngx_hex_dump(key, (u_char *) &fcn->node.key,
- sizeof(ngx_rbtree_key_t));
- len = NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t);
- (void) ngx_hex_dump(p, fcn->key, len);
-
- /*
- * abnormally exited workers may leave locked cache entries,
- * and although it may be safe to remove them completely,
- * we prefer to just move them to the top of the inactive queue
- */
-
- ngx_queue_remove(q);
- fcn->expire = ngx_time() + cache->inactive;
- ngx_queue_insert_head(&cache->sh->queue, &fcn->queue);
-
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
- "ignore long locked inactive cache entry %*s, count:%d",
- 2 * NGX_HTTP_CACHE_KEY_LEN, key, fcn->count);
- }
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- ngx_free(name);
-
- return wait;
-}
-
-
-static void
-ngx_http_file_cache_delete(ngx_http_file_cache_t *cache, ngx_queue_t *q,
- u_char *name)
-{
- u_char *p;
- size_t len;
- ngx_path_t *path;
- ngx_http_file_cache_node_t *fcn;
-
- fcn = ngx_queue_data(q, ngx_http_file_cache_node_t, queue);
-
- if (fcn->exists) {
- cache->sh->size -= fcn->fs_size;
-
- path = cache->path;
- p = name + path->name.len + 1 + path->len;
- p = ngx_hex_dump(p, (u_char *) &fcn->node.key,
- sizeof(ngx_rbtree_key_t));
- len = NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t);
- p = ngx_hex_dump(p, fcn->key, len);
- *p = '\0';
-
- fcn->count++;
- fcn->deleting = 1;
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- len = path->name.len + 1 + path->len + 2 * NGX_HTTP_CACHE_KEY_LEN;
- ngx_create_hashed_filename(path, name, len);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
- "http file cache expire: \"%s\"", name);
-
- if (ngx_delete_file(name) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, ngx_cycle->log, ngx_errno,
- ngx_delete_file_n " \"%s\" failed", name);
- }
-
- ngx_shmtx_lock(&cache->shpool->mutex);
- fcn->count--;
- fcn->deleting = 0;
- }
-
- if (fcn->count == 0) {
- ngx_queue_remove(q);
- ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node);
- ngx_slab_free_locked(cache->shpool, fcn);
- }
-}
-
-
-static time_t
-ngx_http_file_cache_manager(void *data)
-{
- ngx_http_file_cache_t *cache = data;
-
- off_t size;
- time_t next, wait;
-
- next = ngx_http_file_cache_expire(cache);
-
- cache->last = ngx_current_msec;
- cache->files = 0;
-
- for ( ;; ) {
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- size = cache->sh->size;
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
- "http file cache size: %O", size);
-
- if (size < cache->max_size) {
- return next;
- }
-
- wait = ngx_http_file_cache_forced_expire(cache);
-
- if (wait > 0) {
- return wait;
- }
-
- if (ngx_quit || ngx_terminate) {
- return next;
- }
- }
-}
-
-
-static void
-ngx_http_file_cache_loader(void *data)
-{
- ngx_http_file_cache_t *cache = data;
-
- ngx_tree_ctx_t tree;
-
- if (!cache->sh->cold || cache->sh->loading) {
- return;
- }
-
- if (!ngx_atomic_cmp_set(&cache->sh->loading, 0, ngx_pid)) {
- return;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
- "http file cache loader");
-
- tree.init_handler = NULL;
- tree.file_handler = ngx_http_file_cache_manage_file;
- tree.pre_tree_handler = ngx_http_file_cache_noop;
- tree.post_tree_handler = ngx_http_file_cache_noop;
- tree.spec_handler = ngx_http_file_cache_delete_file;
- tree.data = cache;
- tree.alloc = 0;
- tree.log = ngx_cycle->log;
-
- cache->last = ngx_current_msec;
- cache->files = 0;
-
- if (ngx_walk_tree(&tree, &cache->path->name) == NGX_ABORT) {
- cache->sh->loading = 0;
- return;
- }
-
- cache->sh->cold = 0;
- cache->sh->loading = 0;
-
- ngx_log_error(NGX_LOG_NOTICE, ngx_cycle->log, 0,
- "http file cache: %V %.3fM, bsize: %uz",
- &cache->path->name,
- ((double) cache->sh->size * cache->bsize) / (1024 * 1024),
- cache->bsize);
-}
-
-
-static ngx_int_t
-ngx_http_file_cache_noop(ngx_tree_ctx_t *ctx, ngx_str_t *path)
-{
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_file_cache_manage_file(ngx_tree_ctx_t *ctx, ngx_str_t *path)
-{
- ngx_msec_t elapsed;
- ngx_http_file_cache_t *cache;
-
- cache = ctx->data;
-
- if (ngx_http_file_cache_add_file(ctx, path) != NGX_OK) {
- (void) ngx_http_file_cache_delete_file(ctx, path);
- }
-
- if (++cache->files >= cache->loader_files) {
- ngx_http_file_cache_loader_sleep(cache);
-
- } else {
- ngx_time_update();
-
- elapsed = ngx_abs((ngx_msec_int_t) (ngx_current_msec - cache->last));
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
- "http file cache loader time elapsed: %M", elapsed);
-
- if (elapsed >= cache->loader_threshold) {
- ngx_http_file_cache_loader_sleep(cache);
- }
- }
-
- return (ngx_quit || ngx_terminate) ? NGX_ABORT : NGX_OK;
-}
-
-
-static void
-ngx_http_file_cache_loader_sleep(ngx_http_file_cache_t *cache)
-{
- ngx_msleep(cache->loader_sleep);
-
- ngx_time_update();
-
- cache->last = ngx_current_msec;
- cache->files = 0;
-}
-
-
-static ngx_int_t
-ngx_http_file_cache_add_file(ngx_tree_ctx_t *ctx, ngx_str_t *name)
-{
- u_char *p;
- ngx_int_t n;
- ngx_uint_t i;
- ngx_http_cache_t c;
- ngx_http_file_cache_t *cache;
-
- if (name->len < 2 * NGX_HTTP_CACHE_KEY_LEN) {
- return NGX_ERROR;
- }
-
- if (ctx->size < (off_t) sizeof(ngx_http_file_cache_header_t)) {
- ngx_log_error(NGX_LOG_CRIT, ctx->log, 0,
- "cache file \"%s\" is too small", name->data);
- return NGX_ERROR;
- }
-
- ngx_memzero(&c, sizeof(ngx_http_cache_t));
- cache = ctx->data;
-
- c.length = ctx->size;
- c.fs_size = (ctx->fs_size + cache->bsize - 1) / cache->bsize;
-
- p = &name->data[name->len - 2 * NGX_HTTP_CACHE_KEY_LEN];
-
- for (i = 0; i < NGX_HTTP_CACHE_KEY_LEN; i++) {
- n = ngx_hextoi(p, 2);
-
- if (n == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- p += 2;
-
- c.key[i] = (u_char) n;
- }
-
- return ngx_http_file_cache_add(cache, &c);
-}
-
-
-static ngx_int_t
-ngx_http_file_cache_add(ngx_http_file_cache_t *cache, ngx_http_cache_t *c)
-{
- ngx_http_file_cache_node_t *fcn;
-
- ngx_shmtx_lock(&cache->shpool->mutex);
-
- fcn = ngx_http_file_cache_lookup(cache, c->key);
-
- if (fcn == NULL) {
-
- fcn = ngx_slab_calloc_locked(cache->shpool,
- sizeof(ngx_http_file_cache_node_t));
- if (fcn == NULL) {
- ngx_shmtx_unlock(&cache->shpool->mutex);
- return NGX_ERROR;
- }
-
- ngx_memcpy((u_char *) &fcn->node.key, c->key, sizeof(ngx_rbtree_key_t));
-
- ngx_memcpy(fcn->key, &c->key[sizeof(ngx_rbtree_key_t)],
- NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t));
-
- ngx_rbtree_insert(&cache->sh->rbtree, &fcn->node);
-
- fcn->uses = 1;
- fcn->exists = 1;
- fcn->fs_size = c->fs_size;
-
- cache->sh->size += c->fs_size;
-
- } else {
- ngx_queue_remove(&fcn->queue);
- }
-
- fcn->expire = ngx_time() + cache->inactive;
-
- ngx_queue_insert_head(&cache->sh->queue, &fcn->queue);
-
- ngx_shmtx_unlock(&cache->shpool->mutex);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_file_cache_delete_file(ngx_tree_ctx_t *ctx, ngx_str_t *path)
-{
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ctx->log, 0,
- "http file cache delete: \"%s\"", path->data);
-
- if (ngx_delete_file(path->data) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, ctx->log, ngx_errno,
- ngx_delete_file_n " \"%s\" failed", path->data);
- }
-
- return NGX_OK;
-}
-
-
-time_t
-ngx_http_file_cache_valid(ngx_array_t *cache_valid, ngx_uint_t status)
-{
- ngx_uint_t i;
- ngx_http_cache_valid_t *valid;
-
- if (cache_valid == NULL) {
- return 0;
- }
-
- valid = cache_valid->elts;
- for (i = 0; i < cache_valid->nelts; i++) {
-
- if (valid[i].status == 0) {
- return valid[i].valid;
- }
-
- if (valid[i].status == status) {
- return valid[i].valid;
- }
- }
-
- return 0;
-}
-
-
-char *
-ngx_http_file_cache_set_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- off_t max_size;
- u_char *last, *p;
- time_t inactive;
- ssize_t size;
- ngx_str_t s, name, *value;
- ngx_int_t loader_files;
- ngx_msec_t loader_sleep, loader_threshold;
- ngx_uint_t i, n;
- ngx_http_file_cache_t *cache;
-
- cache = ngx_pcalloc(cf->pool, sizeof(ngx_http_file_cache_t));
- if (cache == NULL) {
- return NGX_CONF_ERROR;
- }
-
- cache->path = ngx_pcalloc(cf->pool, sizeof(ngx_path_t));
- if (cache->path == NULL) {
- return NGX_CONF_ERROR;
- }
-
- inactive = 600;
- loader_files = 100;
- loader_sleep = 50;
- loader_threshold = 200;
-
- name.len = 0;
- size = 0;
- max_size = NGX_MAX_OFF_T_VALUE;
-
- value = cf->args->elts;
-
- cache->path->name = value[1];
-
- if (cache->path->name.data[cache->path->name.len - 1] == '/') {
- cache->path->name.len--;
- }
-
- if (ngx_conf_full_name(cf->cycle, &cache->path->name, 0) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- for (i = 2; i < cf->args->nelts; i++) {
-
- if (ngx_strncmp(value[i].data, "levels=", 7) == 0) {
-
- p = value[i].data + 7;
- last = value[i].data + value[i].len;
-
- for (n = 0; n < 3 && p < last; n++) {
-
- if (*p > '0' && *p < '3') {
-
- cache->path->level[n] = *p++ - '0';
- cache->path->len += cache->path->level[n] + 1;
-
- if (p == last) {
- break;
- }
-
- if (*p++ == ':' && n < 2 && p != last) {
- continue;
- }
-
- goto invalid_levels;
- }
-
- goto invalid_levels;
- }
-
- if (cache->path->len < 10 + 3) {
- continue;
- }
-
- invalid_levels:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid \"levels\" \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (ngx_strncmp(value[i].data, "keys_zone=", 10) == 0) {
-
- name.data = value[i].data + 10;
-
- p = (u_char *) ngx_strchr(name.data, ':');
-
- if (p) {
- name.len = p - name.data;
-
- p++;
-
- s.len = value[i].data + value[i].len - p;
- s.data = p;
-
- size = ngx_parse_size(&s);
- if (size > 8191) {
- continue;
- }
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid keys zone size \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (ngx_strncmp(value[i].data, "inactive=", 9) == 0) {
-
- s.len = value[i].len - 9;
- s.data = value[i].data + 9;
-
- inactive = ngx_parse_time(&s, 1);
- if (inactive == (time_t) NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid inactive value \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "max_size=", 9) == 0) {
-
- s.len = value[i].len - 9;
- s.data = value[i].data + 9;
-
- max_size = ngx_parse_offset(&s);
- if (max_size < 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid max_size value \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "loader_files=", 13) == 0) {
-
- loader_files = ngx_atoi(value[i].data + 13, value[i].len - 13);
- if (loader_files == NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid loader_files value \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "loader_sleep=", 13) == 0) {
-
- s.len = value[i].len - 13;
- s.data = value[i].data + 13;
-
- loader_sleep = ngx_parse_time(&s, 0);
- if (loader_sleep == (ngx_msec_t) NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid loader_sleep value \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "loader_threshold=", 17) == 0) {
-
- s.len = value[i].len - 17;
- s.data = value[i].data + 17;
-
- loader_threshold = ngx_parse_time(&s, 0);
- if (loader_threshold == (ngx_msec_t) NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid loader_threshold value \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- continue;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- if (name.len == 0 || size == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"%V\" must have \"keys_zone\" parameter",
- &cmd->name);
- return NGX_CONF_ERROR;
- }
-
- cache->path->manager = ngx_http_file_cache_manager;
- cache->path->loader = ngx_http_file_cache_loader;
- cache->path->data = cache;
- cache->path->conf_file = cf->conf_file->file.name.data;
- cache->path->line = cf->conf_file->line;
- cache->loader_files = loader_files;
- cache->loader_sleep = loader_sleep;
- cache->loader_threshold = loader_threshold;
-
- if (ngx_add_path(cf, &cache->path) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- cache->shm_zone = ngx_shared_memory_add(cf, &name, size, cmd->post);
- if (cache->shm_zone == NULL) {
- return NGX_CONF_ERROR;
- }
-
- if (cache->shm_zone->data) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate zone \"%V\"", &name);
- return NGX_CONF_ERROR;
- }
-
-
- cache->shm_zone->init = ngx_http_file_cache_init;
- cache->shm_zone->data = cache;
-
- cache->inactive = inactive;
- cache->max_size = max_size;
-
- return NGX_CONF_OK;
-}
-
-
-char *
-ngx_http_file_cache_valid_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf)
-{
- char *p = conf;
-
- time_t valid;
- ngx_str_t *value;
- ngx_uint_t i, n, status;
- ngx_array_t **a;
- ngx_http_cache_valid_t *v;
- static ngx_uint_t statuses[] = { 200, 301, 302 };
-
- a = (ngx_array_t **) (p + cmd->offset);
-
- if (*a == NGX_CONF_UNSET_PTR) {
- *a = ngx_array_create(cf->pool, 1, sizeof(ngx_http_cache_valid_t));
- if (*a == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- value = cf->args->elts;
- n = cf->args->nelts - 1;
-
- valid = ngx_parse_time(&value[n], 1);
- if (valid == (time_t) NGX_ERROR) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid time value \"%V\"", &value[n]);
- return NGX_CONF_ERROR;
- }
-
- if (n == 1) {
-
- for (i = 0; i < 3; i++) {
- v = ngx_array_push(*a);
- if (v == NULL) {
- return NGX_CONF_ERROR;
- }
-
- v->status = statuses[i];
- v->valid = valid;
- }
-
- return NGX_CONF_OK;
- }
-
- for (i = 1; i < n; i++) {
-
- if (ngx_strcmp(value[i].data, "any") == 0) {
-
- status = 0;
-
- } else {
-
- status = ngx_atoi(value[i].data, value[i].len);
- if (status < 100) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid status \"%V\"", &value[i]);
- return NGX_CONF_ERROR;
- }
- }
-
- v = ngx_array_push(*a);
- if (v == NULL) {
- return NGX_CONF_ERROR;
- }
-
- v->status = status;
- v->valid = valid;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_header_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_header_filter_module.c
deleted file mode 100644
index 507dc939c78..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_header_filter_module.c
+++ /dev/null
@@ -1,633 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <nginx.h>
-
-
-static ngx_int_t ngx_http_header_filter_init(ngx_conf_t *cf);
-static ngx_int_t ngx_http_header_filter(ngx_http_request_t *r);
-
-
-static ngx_http_module_t ngx_http_header_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_header_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL, /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_header_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_header_filter_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static char ngx_http_server_string[] = "Server: nginx" CRLF;
-static char ngx_http_server_full_string[] = "Server: " NGINX_VER CRLF;
-
-
-static ngx_str_t ngx_http_status_lines[] = {
-
- ngx_string("200 OK"),
- ngx_string("201 Created"),
- ngx_string("202 Accepted"),
- ngx_null_string, /* "203 Non-Authoritative Information" */
- ngx_string("204 No Content"),
- ngx_null_string, /* "205 Reset Content" */
- ngx_string("206 Partial Content"),
-
- /* ngx_null_string, */ /* "207 Multi-Status" */
-
-#define NGX_HTTP_LAST_2XX 207
-#define NGX_HTTP_OFF_3XX (NGX_HTTP_LAST_2XX - 200)
-
- /* ngx_null_string, */ /* "300 Multiple Choices" */
-
- ngx_string("301 Moved Permanently"),
- ngx_string("302 Moved Temporarily"),
- ngx_string("303 See Other"),
- ngx_string("304 Not Modified"),
- ngx_null_string, /* "305 Use Proxy" */
- ngx_null_string, /* "306 unused" */
- ngx_string("307 Temporary Redirect"),
-
-#define NGX_HTTP_LAST_3XX 308
-#define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX)
-
- ngx_string("400 Bad Request"),
- ngx_string("401 Unauthorized"),
- ngx_string("402 Payment Required"),
- ngx_string("403 Forbidden"),
- ngx_string("404 Not Found"),
- ngx_string("405 Not Allowed"),
- ngx_string("406 Not Acceptable"),
- ngx_null_string, /* "407 Proxy Authentication Required" */
- ngx_string("408 Request Time-out"),
- ngx_string("409 Conflict"),
- ngx_string("410 Gone"),
- ngx_string("411 Length Required"),
- ngx_string("412 Precondition Failed"),
- ngx_string("413 Request Entity Too Large"),
- ngx_string("414 Request-URI Too Large"),
- ngx_string("415 Unsupported Media Type"),
- ngx_string("416 Requested Range Not Satisfiable"),
-
- /* ngx_null_string, */ /* "417 Expectation Failed" */
- /* ngx_null_string, */ /* "418 unused" */
- /* ngx_null_string, */ /* "419 unused" */
- /* ngx_null_string, */ /* "420 unused" */
- /* ngx_null_string, */ /* "421 unused" */
- /* ngx_null_string, */ /* "422 Unprocessable Entity" */
- /* ngx_null_string, */ /* "423 Locked" */
- /* ngx_null_string, */ /* "424 Failed Dependency" */
-
-#define NGX_HTTP_LAST_4XX 417
-#define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX)
-
- ngx_string("500 Internal Server Error"),
- ngx_string("501 Not Implemented"),
- ngx_string("502 Bad Gateway"),
- ngx_string("503 Service Temporarily Unavailable"),
- ngx_string("504 Gateway Time-out"),
-
- ngx_null_string, /* "505 HTTP Version Not Supported" */
- ngx_null_string, /* "506 Variant Also Negotiates" */
- ngx_string("507 Insufficient Storage"),
- /* ngx_null_string, */ /* "508 unused" */
- /* ngx_null_string, */ /* "509 unused" */
- /* ngx_null_string, */ /* "510 Not Extended" */
-
-#define NGX_HTTP_LAST_5XX 508
-
-};
-
-
-ngx_http_header_out_t ngx_http_headers_out[] = {
- { ngx_string("Server"), offsetof(ngx_http_headers_out_t, server) },
- { ngx_string("Date"), offsetof(ngx_http_headers_out_t, date) },
- { ngx_string("Content-Length"),
- offsetof(ngx_http_headers_out_t, content_length) },
- { ngx_string("Content-Encoding"),
- offsetof(ngx_http_headers_out_t, content_encoding) },
- { ngx_string("Location"), offsetof(ngx_http_headers_out_t, location) },
- { ngx_string("Last-Modified"),
- offsetof(ngx_http_headers_out_t, last_modified) },
- { ngx_string("Accept-Ranges"),
- offsetof(ngx_http_headers_out_t, accept_ranges) },
- { ngx_string("Expires"), offsetof(ngx_http_headers_out_t, expires) },
- { ngx_string("Cache-Control"),
- offsetof(ngx_http_headers_out_t, cache_control) },
- { ngx_string("ETag"), offsetof(ngx_http_headers_out_t, etag) },
-
- { ngx_null_string, 0 }
-};
-
-
-static ngx_int_t
-ngx_http_header_filter(ngx_http_request_t *r)
-{
- u_char *p;
- size_t len;
- ngx_str_t host, *status_line;
- ngx_buf_t *b;
- ngx_uint_t status, i, port;
- ngx_chain_t out;
- ngx_list_part_t *part;
- ngx_table_elt_t *header;
- ngx_connection_t *c;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t *cscf;
- struct sockaddr_in *sin;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
- u_char addr[NGX_SOCKADDR_STRLEN];
-
- if (r->header_sent) {
- return NGX_OK;
- }
-
- r->header_sent = 1;
-
- if (r != r->main) {
- return NGX_OK;
- }
-
- if (r->http_version < NGX_HTTP_VERSION_10) {
- return NGX_OK;
- }
-
- if (r->method == NGX_HTTP_HEAD) {
- r->header_only = 1;
- }
-
- if (r->headers_out.last_modified_time != -1) {
- if (r->headers_out.status != NGX_HTTP_OK
- && r->headers_out.status != NGX_HTTP_PARTIAL_CONTENT
- && r->headers_out.status != NGX_HTTP_NOT_MODIFIED)
- {
- r->headers_out.last_modified_time = -1;
- r->headers_out.last_modified = NULL;
- }
- }
-
- len = sizeof("HTTP/1.x ") - 1 + sizeof(CRLF) - 1
- /* the end of the header */
- + sizeof(CRLF) - 1;
-
- /* status line */
-
- if (r->headers_out.status_line.len) {
- len += r->headers_out.status_line.len;
- status_line = &r->headers_out.status_line;
-#if (NGX_SUPPRESS_WARN)
- status = 0;
-#endif
-
- } else {
-
- status = r->headers_out.status;
-
- if (status >= NGX_HTTP_OK
- && status < NGX_HTTP_LAST_2XX)
- {
- /* 2XX */
-
- if (status == NGX_HTTP_NO_CONTENT) {
- r->header_only = 1;
- ngx_str_null(&r->headers_out.content_type);
- r->headers_out.last_modified_time = -1;
- r->headers_out.last_modified = NULL;
- r->headers_out.content_length = NULL;
- r->headers_out.content_length_n = -1;
- }
-
- status -= NGX_HTTP_OK;
- status_line = &ngx_http_status_lines[status];
- len += ngx_http_status_lines[status].len;
-
- } else if (status >= NGX_HTTP_MOVED_PERMANENTLY
- && status < NGX_HTTP_LAST_3XX)
- {
- /* 3XX */
-
- if (status == NGX_HTTP_NOT_MODIFIED) {
- r->header_only = 1;
- }
-
- status = status - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_OFF_3XX;
- status_line = &ngx_http_status_lines[status];
- len += ngx_http_status_lines[status].len;
-
- } else if (status >= NGX_HTTP_BAD_REQUEST
- && status < NGX_HTTP_LAST_4XX)
- {
- /* 4XX */
- status = status - NGX_HTTP_BAD_REQUEST
- + NGX_HTTP_OFF_4XX;
-
- status_line = &ngx_http_status_lines[status];
- len += ngx_http_status_lines[status].len;
-
- } else if (status >= NGX_HTTP_INTERNAL_SERVER_ERROR
- && status < NGX_HTTP_LAST_5XX)
- {
- /* 5XX */
- status = status - NGX_HTTP_INTERNAL_SERVER_ERROR
- + NGX_HTTP_OFF_5XX;
-
- status_line = &ngx_http_status_lines[status];
- len += ngx_http_status_lines[status].len;
-
- } else {
- len += NGX_INT_T_LEN + 1 /* SP */;
- status_line = NULL;
- }
-
- if (status_line && status_line->len == 0) {
- status = r->headers_out.status;
- len += NGX_INT_T_LEN + 1 /* SP */;
- status_line = NULL;
- }
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (r->headers_out.server == NULL) {
- len += clcf->server_tokens ? sizeof(ngx_http_server_full_string) - 1:
- sizeof(ngx_http_server_string) - 1;
- }
-
- if (r->headers_out.date == NULL) {
- len += sizeof("Date: Mon, 28 Sep 1970 06:00:00 GMT" CRLF) - 1;
- }
-
- if (r->headers_out.content_type.len) {
- len += sizeof("Content-Type: ") - 1
- + r->headers_out.content_type.len + 2;
-
- if (r->headers_out.content_type_len == r->headers_out.content_type.len
- && r->headers_out.charset.len)
- {
- len += sizeof("; charset=") - 1 + r->headers_out.charset.len;
- }
- }
-
- if (r->headers_out.content_length == NULL
- && r->headers_out.content_length_n >= 0)
- {
- len += sizeof("Content-Length: ") - 1 + NGX_OFF_T_LEN + 2;
- }
-
- if (r->headers_out.last_modified == NULL
- && r->headers_out.last_modified_time != -1)
- {
- len += sizeof("Last-Modified: Mon, 28 Sep 1970 06:00:00 GMT" CRLF) - 1;
- }
-
- c = r->connection;
-
- if (r->headers_out.location
- && r->headers_out.location->value.len
- && r->headers_out.location->value.data[0] == '/')
- {
- r->headers_out.location->hash = 0;
-
- if (clcf->server_name_in_redirect) {
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
- host = cscf->server_name;
-
- } else if (r->headers_in.server.len) {
- host = r->headers_in.server;
-
- } else {
- host.len = NGX_SOCKADDR_STRLEN;
- host.data = addr;
-
- if (ngx_connection_local_sockaddr(c, &host, 0) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- switch (c->local_sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) c->local_sockaddr;
- port = ntohs(sin6->sin6_port);
- break;
-#endif
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- port = 0;
- break;
-#endif
- default: /* AF_INET */
- sin = (struct sockaddr_in *) c->local_sockaddr;
- port = ntohs(sin->sin_port);
- break;
- }
-
- len += sizeof("Location: https://") - 1
- + host.len
- + r->headers_out.location->value.len + 2;
-
- if (clcf->port_in_redirect) {
-
-#if (NGX_HTTP_SSL)
- if (c->ssl)
- port = (port == 443) ? 0 : port;
- else
-#endif
- port = (port == 80) ? 0 : port;
-
- } else {
- port = 0;
- }
-
- if (port) {
- len += sizeof(":65535") - 1;
- }
-
- } else {
- ngx_str_null(&host);
- port = 0;
- }
-
- if (r->chunked) {
- len += sizeof("Transfer-Encoding: chunked" CRLF) - 1;
- }
-
- if (r->headers_out.status == NGX_HTTP_SWITCHING_PROTOCOLS) {
- len += sizeof("Connection: upgrade" CRLF) - 1;
-
- } else if (r->keepalive) {
- len += sizeof("Connection: keep-alive" CRLF) - 1;
-
- /*
- * MSIE and Opera ignore the "Keep-Alive: timeout=<N>" header.
- * MSIE keeps the connection alive for about 60-65 seconds.
- * Opera keeps the connection alive very long.
- * Mozilla keeps the connection alive for N plus about 1-10 seconds.
- * Konqueror keeps the connection alive for about N seconds.
- */
-
- if (clcf->keepalive_header) {
- len += sizeof("Keep-Alive: timeout=") - 1 + NGX_TIME_T_LEN + 2;
- }
-
- } else {
- len += sizeof("Connection: close" CRLF) - 1;
- }
-
-#if (NGX_HTTP_GZIP)
- if (r->gzip_vary) {
- if (clcf->gzip_vary) {
- len += sizeof("Vary: Accept-Encoding" CRLF) - 1;
-
- } else {
- r->gzip_vary = 0;
- }
- }
-#endif
-
- part = &r->headers_out.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (header[i].hash == 0) {
- continue;
- }
-
- len += header[i].key.len + sizeof(": ") - 1 + header[i].value.len
- + sizeof(CRLF) - 1;
- }
-
- b = ngx_create_temp_buf(r->pool, len);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- /* "HTTP/1.x " */
- b->last = ngx_cpymem(b->last, "HTTP/1.1 ", sizeof("HTTP/1.x ") - 1);
-
- /* status line */
- if (status_line) {
- b->last = ngx_copy(b->last, status_line->data, status_line->len);
-
- } else {
- b->last = ngx_sprintf(b->last, "%03ui ", status);
- }
- *b->last++ = CR; *b->last++ = LF;
-
- if (r->headers_out.server == NULL) {
- if (clcf->server_tokens) {
- p = (u_char *) ngx_http_server_full_string;
- len = sizeof(ngx_http_server_full_string) - 1;
-
- } else {
- p = (u_char *) ngx_http_server_string;
- len = sizeof(ngx_http_server_string) - 1;
- }
-
- b->last = ngx_cpymem(b->last, p, len);
- }
-
- if (r->headers_out.date == NULL) {
- b->last = ngx_cpymem(b->last, "Date: ", sizeof("Date: ") - 1);
- b->last = ngx_cpymem(b->last, ngx_cached_http_time.data,
- ngx_cached_http_time.len);
-
- *b->last++ = CR; *b->last++ = LF;
- }
-
- if (r->headers_out.content_type.len) {
- b->last = ngx_cpymem(b->last, "Content-Type: ",
- sizeof("Content-Type: ") - 1);
- p = b->last;
- b->last = ngx_copy(b->last, r->headers_out.content_type.data,
- r->headers_out.content_type.len);
-
- if (r->headers_out.content_type_len == r->headers_out.content_type.len
- && r->headers_out.charset.len)
- {
- b->last = ngx_cpymem(b->last, "; charset=",
- sizeof("; charset=") - 1);
- b->last = ngx_copy(b->last, r->headers_out.charset.data,
- r->headers_out.charset.len);
-
- /* update r->headers_out.content_type for possible logging */
-
- r->headers_out.content_type.len = b->last - p;
- r->headers_out.content_type.data = p;
- }
-
- *b->last++ = CR; *b->last++ = LF;
- }
-
- if (r->headers_out.content_length == NULL
- && r->headers_out.content_length_n >= 0)
- {
- b->last = ngx_sprintf(b->last, "Content-Length: %O" CRLF,
- r->headers_out.content_length_n);
- }
-
- if (r->headers_out.last_modified == NULL
- && r->headers_out.last_modified_time != -1)
- {
- b->last = ngx_cpymem(b->last, "Last-Modified: ",
- sizeof("Last-Modified: ") - 1);
- b->last = ngx_http_time(b->last, r->headers_out.last_modified_time);
-
- *b->last++ = CR; *b->last++ = LF;
- }
-
- if (host.data) {
-
- p = b->last + sizeof("Location: ") - 1;
-
- b->last = ngx_cpymem(b->last, "Location: http",
- sizeof("Location: http") - 1);
-
-#if (NGX_HTTP_SSL)
- if (c->ssl) {
- *b->last++ ='s';
- }
-#endif
-
- *b->last++ = ':'; *b->last++ = '/'; *b->last++ = '/';
- b->last = ngx_copy(b->last, host.data, host.len);
-
- if (port) {
- b->last = ngx_sprintf(b->last, ":%ui", port);
- }
-
- b->last = ngx_copy(b->last, r->headers_out.location->value.data,
- r->headers_out.location->value.len);
-
- /* update r->headers_out.location->value for possible logging */
-
- r->headers_out.location->value.len = b->last - p;
- r->headers_out.location->value.data = p;
- ngx_str_set(&r->headers_out.location->key, "Location");
-
- *b->last++ = CR; *b->last++ = LF;
- }
-
- if (r->chunked) {
- b->last = ngx_cpymem(b->last, "Transfer-Encoding: chunked" CRLF,
- sizeof("Transfer-Encoding: chunked" CRLF) - 1);
- }
-
- if (r->headers_out.status == NGX_HTTP_SWITCHING_PROTOCOLS) {
- b->last = ngx_cpymem(b->last, "Connection: upgrade" CRLF,
- sizeof("Connection: upgrade" CRLF) - 1);
-
- } else if (r->keepalive) {
- b->last = ngx_cpymem(b->last, "Connection: keep-alive" CRLF,
- sizeof("Connection: keep-alive" CRLF) - 1);
-
- if (clcf->keepalive_header) {
- b->last = ngx_sprintf(b->last, "Keep-Alive: timeout=%T" CRLF,
- clcf->keepalive_header);
- }
-
- } else {
- b->last = ngx_cpymem(b->last, "Connection: close" CRLF,
- sizeof("Connection: close" CRLF) - 1);
- }
-
-#if (NGX_HTTP_GZIP)
- if (r->gzip_vary) {
- b->last = ngx_cpymem(b->last, "Vary: Accept-Encoding" CRLF,
- sizeof("Vary: Accept-Encoding" CRLF) - 1);
- }
-#endif
-
- part = &r->headers_out.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (header[i].hash == 0) {
- continue;
- }
-
- b->last = ngx_copy(b->last, header[i].key.data, header[i].key.len);
- *b->last++ = ':'; *b->last++ = ' ';
-
- b->last = ngx_copy(b->last, header[i].value.data, header[i].value.len);
- *b->last++ = CR; *b->last++ = LF;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "%*s", (size_t) (b->last - b->pos), b->pos);
-
- /* the end of HTTP header */
- *b->last++ = CR; *b->last++ = LF;
-
- r->header_size = b->last - b->pos;
-
- if (r->header_only) {
- b->last_buf = 1;
- }
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_write_filter(r, &out);
-}
-
-
-static ngx_int_t
-ngx_http_header_filter_init(ngx_conf_t *cf)
-{
- ngx_http_top_header_filter = ngx_http_header_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse.c
deleted file mode 100644
index b60f41bb6a3..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse.c
+++ /dev/null
@@ -1,2359 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static uint32_t usual[] = {
- 0xffffdbfe, /* 1111 1111 1111 1111 1101 1011 1111 1110 */
-
- /* ?>=< ;:98 7654 3210 /.-, +*)( '&%$ #"! */
- 0x7fff37d6, /* 0111 1111 1111 1111 0011 0111 1101 0110 */
-
- /* _^]\ [ZYX WVUT SRQP ONML KJIH GFED CBA@ */
-#if (NGX_WIN32)
- 0xefffffff, /* 1110 1111 1111 1111 1111 1111 1111 1111 */
-#else
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
-#endif
-
- /* ~}| {zyx wvut srqp onml kjih gfed cba` */
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
-
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
- 0xffffffff, /* 1111 1111 1111 1111 1111 1111 1111 1111 */
- 0xffffffff /* 1111 1111 1111 1111 1111 1111 1111 1111 */
-};
-
-
-#if (NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED)
-
-#define ngx_str3_cmp(m, c0, c1, c2, c3) \
- *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)
-
-#define ngx_str3Ocmp(m, c0, c1, c2, c3) \
- *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)
-
-#define ngx_str4cmp(m, c0, c1, c2, c3) \
- *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)
-
-#define ngx_str5cmp(m, c0, c1, c2, c3, c4) \
- *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \
- && m[4] == c4
-
-#define ngx_str6cmp(m, c0, c1, c2, c3, c4, c5) \
- *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \
- && (((uint32_t *) m)[1] & 0xffff) == ((c5 << 8) | c4)
-
-#define ngx_str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \
- *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \
- && ((uint32_t *) m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4)
-
-#define ngx_str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \
- *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \
- && ((uint32_t *) m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4)
-
-#define ngx_str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8) \
- *(uint32_t *) m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \
- && ((uint32_t *) m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) \
- && m[8] == c8
-
-#else /* !(NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED) */
-
-#define ngx_str3_cmp(m, c0, c1, c2, c3) \
- m[0] == c0 && m[1] == c1 && m[2] == c2
-
-#define ngx_str3Ocmp(m, c0, c1, c2, c3) \
- m[0] == c0 && m[2] == c2 && m[3] == c3
-
-#define ngx_str4cmp(m, c0, c1, c2, c3) \
- m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3
-
-#define ngx_str5cmp(m, c0, c1, c2, c3, c4) \
- m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 && m[4] == c4
-
-#define ngx_str6cmp(m, c0, c1, c2, c3, c4, c5) \
- m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \
- && m[4] == c4 && m[5] == c5
-
-#define ngx_str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \
- m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \
- && m[4] == c4 && m[5] == c5 && m[6] == c6
-
-#define ngx_str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \
- m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \
- && m[4] == c4 && m[5] == c5 && m[6] == c6 && m[7] == c7
-
-#define ngx_str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8) \
- m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 \
- && m[4] == c4 && m[5] == c5 && m[6] == c6 && m[7] == c7 && m[8] == c8
-
-#endif
-
-
-/* gcc, icc, msvc and others compile these switches as an jump table */
-
-ngx_int_t
-ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
-{
- u_char c, ch, *p, *m;
- enum {
- sw_start = 0,
- sw_method,
- sw_spaces_before_uri,
- sw_schema,
- sw_schema_slash,
- sw_schema_slash_slash,
- sw_host_start,
- sw_host,
- sw_host_end,
- sw_host_ip_literal,
- sw_port,
- sw_host_http_09,
- sw_after_slash_in_uri,
- sw_check_uri,
- sw_check_uri_http_09,
- sw_uri,
- sw_http_09,
- sw_http_H,
- sw_http_HT,
- sw_http_HTT,
- sw_http_HTTP,
- sw_first_major_digit,
- sw_major_digit,
- sw_first_minor_digit,
- sw_minor_digit,
- sw_spaces_after_digit,
- sw_almost_done
- } state;
-
- state = r->state;
-
- for (p = b->pos; p < b->last; p++) {
- ch = *p;
-
- switch (state) {
-
- /* HTTP methods: GET, HEAD, POST */
- case sw_start:
- r->request_start = p;
-
- if (ch == CR || ch == LF) {
- break;
- }
-
- if ((ch < 'A' || ch > 'Z') && ch != '_') {
- return NGX_HTTP_PARSE_INVALID_METHOD;
- }
-
- state = sw_method;
- break;
-
- case sw_method:
- if (ch == ' ') {
- r->method_end = p - 1;
- m = r->request_start;
-
- switch (p - m) {
-
- case 3:
- if (ngx_str3_cmp(m, 'G', 'E', 'T', ' ')) {
- r->method = NGX_HTTP_GET;
- break;
- }
-
- if (ngx_str3_cmp(m, 'P', 'U', 'T', ' ')) {
- r->method = NGX_HTTP_PUT;
- break;
- }
-
- break;
-
- case 4:
- if (m[1] == 'O') {
-
- if (ngx_str3Ocmp(m, 'P', 'O', 'S', 'T')) {
- r->method = NGX_HTTP_POST;
- break;
- }
-
- if (ngx_str3Ocmp(m, 'C', 'O', 'P', 'Y')) {
- r->method = NGX_HTTP_COPY;
- break;
- }
-
- if (ngx_str3Ocmp(m, 'M', 'O', 'V', 'E')) {
- r->method = NGX_HTTP_MOVE;
- break;
- }
-
- if (ngx_str3Ocmp(m, 'L', 'O', 'C', 'K')) {
- r->method = NGX_HTTP_LOCK;
- break;
- }
-
- } else {
-
- if (ngx_str4cmp(m, 'H', 'E', 'A', 'D')) {
- r->method = NGX_HTTP_HEAD;
- break;
- }
- }
-
- break;
-
- case 5:
- if (ngx_str5cmp(m, 'M', 'K', 'C', 'O', 'L')) {
- r->method = NGX_HTTP_MKCOL;
- break;
- }
-
- if (ngx_str5cmp(m, 'P', 'A', 'T', 'C', 'H')) {
- r->method = NGX_HTTP_PATCH;
- break;
- }
-
- if (ngx_str5cmp(m, 'T', 'R', 'A', 'C', 'E')) {
- r->method = NGX_HTTP_TRACE;
- break;
- }
-
- break;
-
- case 6:
- if (ngx_str6cmp(m, 'D', 'E', 'L', 'E', 'T', 'E')) {
- r->method = NGX_HTTP_DELETE;
- break;
- }
-
- if (ngx_str6cmp(m, 'U', 'N', 'L', 'O', 'C', 'K')) {
- r->method = NGX_HTTP_UNLOCK;
- break;
- }
-
- break;
-
- case 7:
- if (ngx_str7_cmp(m, 'O', 'P', 'T', 'I', 'O', 'N', 'S', ' '))
- {
- r->method = NGX_HTTP_OPTIONS;
- }
-
- break;
-
- case 8:
- if (ngx_str8cmp(m, 'P', 'R', 'O', 'P', 'F', 'I', 'N', 'D'))
- {
- r->method = NGX_HTTP_PROPFIND;
- }
-
- break;
-
- case 9:
- if (ngx_str9cmp(m,
- 'P', 'R', 'O', 'P', 'P', 'A', 'T', 'C', 'H'))
- {
- r->method = NGX_HTTP_PROPPATCH;
- }
-
- break;
- }
-
- state = sw_spaces_before_uri;
- break;
- }
-
- if ((ch < 'A' || ch > 'Z') && ch != '_') {
- return NGX_HTTP_PARSE_INVALID_METHOD;
- }
-
- break;
-
- /* space* before URI */
- case sw_spaces_before_uri:
-
- if (ch == '/') {
- r->uri_start = p;
- state = sw_after_slash_in_uri;
- break;
- }
-
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'z') {
- r->schema_start = p;
- state = sw_schema;
- break;
- }
-
- switch (ch) {
- case ' ':
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- case sw_schema:
-
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'z') {
- break;
- }
-
- switch (ch) {
- case ':':
- r->schema_end = p;
- state = sw_schema_slash;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- case sw_schema_slash:
- switch (ch) {
- case '/':
- state = sw_schema_slash_slash;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- case sw_schema_slash_slash:
- switch (ch) {
- case '/':
- state = sw_host_start;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- case sw_host_start:
-
- r->host_start = p;
-
- if (ch == '[') {
- state = sw_host_ip_literal;
- break;
- }
-
- state = sw_host;
-
- /* fall through */
-
- case sw_host:
-
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'z') {
- break;
- }
-
- if ((ch >= '0' && ch <= '9') || ch == '.' || ch == '-') {
- break;
- }
-
- /* fall through */
-
- case sw_host_end:
-
- r->host_end = p;
-
- switch (ch) {
- case ':':
- state = sw_port;
- break;
- case '/':
- r->uri_start = p;
- state = sw_after_slash_in_uri;
- break;
- case ' ':
- /*
- * use single "/" from request line to preserve pointers,
- * if request line will be copied to large client buffer
- */
- r->uri_start = r->schema_end + 1;
- r->uri_end = r->schema_end + 2;
- state = sw_host_http_09;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- case sw_host_ip_literal:
-
- if (ch >= '0' && ch <= '9') {
- break;
- }
-
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'z') {
- break;
- }
-
- switch (ch) {
- case ':':
- break;
- case ']':
- state = sw_host_end;
- break;
- case '-':
- case '.':
- case '_':
- case '~':
- /* unreserved */
- break;
- case '!':
- case '$':
- case '&':
- case '\'':
- case '(':
- case ')':
- case '*':
- case '+':
- case ',':
- case ';':
- case '=':
- /* sub-delims */
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- case sw_port:
- if (ch >= '0' && ch <= '9') {
- break;
- }
-
- switch (ch) {
- case '/':
- r->port_end = p;
- r->uri_start = p;
- state = sw_after_slash_in_uri;
- break;
- case ' ':
- r->port_end = p;
- /*
- * use single "/" from request line to preserve pointers,
- * if request line will be copied to large client buffer
- */
- r->uri_start = r->schema_end + 1;
- r->uri_end = r->schema_end + 2;
- state = sw_host_http_09;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- /* space+ after "http://host[:port] " */
- case sw_host_http_09:
- switch (ch) {
- case ' ':
- break;
- case CR:
- r->http_minor = 9;
- state = sw_almost_done;
- break;
- case LF:
- r->http_minor = 9;
- goto done;
- case 'H':
- r->http_protocol.data = p;
- state = sw_http_H;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
-
- /* check "/.", "//", "%", and "\" (Win32) in URI */
- case sw_after_slash_in_uri:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- state = sw_check_uri;
- break;
- }
-
- switch (ch) {
- case ' ':
- r->uri_end = p;
- state = sw_check_uri_http_09;
- break;
- case CR:
- r->uri_end = p;
- r->http_minor = 9;
- state = sw_almost_done;
- break;
- case LF:
- r->uri_end = p;
- r->http_minor = 9;
- goto done;
- case '.':
- r->complex_uri = 1;
- state = sw_uri;
- break;
- case '%':
- r->quoted_uri = 1;
- state = sw_uri;
- break;
- case '/':
- r->complex_uri = 1;
- state = sw_uri;
- break;
-#if (NGX_WIN32)
- case '\\':
- r->complex_uri = 1;
- state = sw_uri;
- break;
-#endif
- case '?':
- r->args_start = p + 1;
- state = sw_uri;
- break;
- case '#':
- r->complex_uri = 1;
- state = sw_uri;
- break;
- case '+':
- r->plus_in_uri = 1;
- break;
- case '\0':
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- default:
- state = sw_check_uri;
- break;
- }
- break;
-
- /* check "/", "%" and "\" (Win32) in URI */
- case sw_check_uri:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- break;
- }
-
- switch (ch) {
- case '/':
-#if (NGX_WIN32)
- if (r->uri_ext == p) {
- r->complex_uri = 1;
- state = sw_uri;
- break;
- }
-#endif
- r->uri_ext = NULL;
- state = sw_after_slash_in_uri;
- break;
- case '.':
- r->uri_ext = p + 1;
- break;
- case ' ':
- r->uri_end = p;
- state = sw_check_uri_http_09;
- break;
- case CR:
- r->uri_end = p;
- r->http_minor = 9;
- state = sw_almost_done;
- break;
- case LF:
- r->uri_end = p;
- r->http_minor = 9;
- goto done;
-#if (NGX_WIN32)
- case '\\':
- r->complex_uri = 1;
- state = sw_after_slash_in_uri;
- break;
-#endif
- case '%':
- r->quoted_uri = 1;
- state = sw_uri;
- break;
- case '?':
- r->args_start = p + 1;
- state = sw_uri;
- break;
- case '#':
- r->complex_uri = 1;
- state = sw_uri;
- break;
- case '+':
- r->plus_in_uri = 1;
- break;
- case '\0':
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- /* space+ after URI */
- case sw_check_uri_http_09:
- switch (ch) {
- case ' ':
- break;
- case CR:
- r->http_minor = 9;
- state = sw_almost_done;
- break;
- case LF:
- r->http_minor = 9;
- goto done;
- case 'H':
- r->http_protocol.data = p;
- state = sw_http_H;
- break;
- default:
- r->space_in_uri = 1;
- state = sw_check_uri;
- p--;
- break;
- }
- break;
-
-
- /* URI */
- case sw_uri:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- break;
- }
-
- switch (ch) {
- case ' ':
- r->uri_end = p;
- state = sw_http_09;
- break;
- case CR:
- r->uri_end = p;
- r->http_minor = 9;
- state = sw_almost_done;
- break;
- case LF:
- r->uri_end = p;
- r->http_minor = 9;
- goto done;
- case '#':
- r->complex_uri = 1;
- break;
- case '\0':
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- /* space+ after URI */
- case sw_http_09:
- switch (ch) {
- case ' ':
- break;
- case CR:
- r->http_minor = 9;
- state = sw_almost_done;
- break;
- case LF:
- r->http_minor = 9;
- goto done;
- case 'H':
- r->http_protocol.data = p;
- state = sw_http_H;
- break;
- default:
- r->space_in_uri = 1;
- state = sw_uri;
- p--;
- break;
- }
- break;
-
- case sw_http_H:
- switch (ch) {
- case 'T':
- state = sw_http_HT;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- case sw_http_HT:
- switch (ch) {
- case 'T':
- state = sw_http_HTT;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- case sw_http_HTT:
- switch (ch) {
- case 'P':
- state = sw_http_HTTP;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- case sw_http_HTTP:
- switch (ch) {
- case '/':
- state = sw_first_major_digit;
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- /* first digit of major HTTP version */
- case sw_first_major_digit:
- if (ch < '1' || ch > '9') {
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
-
- r->http_major = ch - '0';
- state = sw_major_digit;
- break;
-
- /* major HTTP version or dot */
- case sw_major_digit:
- if (ch == '.') {
- state = sw_first_minor_digit;
- break;
- }
-
- if (ch < '0' || ch > '9') {
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
-
- r->http_major = r->http_major * 10 + ch - '0';
- break;
-
- /* first digit of minor HTTP version */
- case sw_first_minor_digit:
- if (ch < '0' || ch > '9') {
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
-
- r->http_minor = ch - '0';
- state = sw_minor_digit;
- break;
-
- /* minor HTTP version or end of request line */
- case sw_minor_digit:
- if (ch == CR) {
- state = sw_almost_done;
- break;
- }
-
- if (ch == LF) {
- goto done;
- }
-
- if (ch == ' ') {
- state = sw_spaces_after_digit;
- break;
- }
-
- if (ch < '0' || ch > '9') {
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
-
- r->http_minor = r->http_minor * 10 + ch - '0';
- break;
-
- case sw_spaces_after_digit:
- switch (ch) {
- case ' ':
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- break;
-
- /* end of request line */
- case sw_almost_done:
- r->request_end = p - 1;
- switch (ch) {
- case LF:
- goto done;
- default:
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- }
- }
-
- b->pos = p;
- r->state = state;
-
- return NGX_AGAIN;
-
-done:
-
- b->pos = p + 1;
-
- if (r->request_end == NULL) {
- r->request_end = p;
- }
-
- r->http_version = r->http_major * 1000 + r->http_minor;
- r->state = sw_start;
-
- if (r->http_version == 9 && r->method != NGX_HTTP_GET) {
- return NGX_HTTP_PARSE_INVALID_09_METHOD;
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
- ngx_uint_t allow_underscores)
-{
- u_char c, ch, *p;
- ngx_uint_t hash, i;
- enum {
- sw_start = 0,
- sw_name,
- sw_space_before_value,
- sw_value,
- sw_space_after_value,
- sw_ignore_line,
- sw_almost_done,
- sw_header_almost_done
- } state;
-
- /* the last '\0' is not needed because string is zero terminated */
-
- static u_char lowcase[] =
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0-\0\0" "0123456789\0\0\0\0\0\0"
- "\0abcdefghijklmnopqrstuvwxyz\0\0\0\0\0"
- "\0abcdefghijklmnopqrstuvwxyz\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
-
- state = r->state;
- hash = r->header_hash;
- i = r->lowcase_index;
-
- for (p = b->pos; p < b->last; p++) {
- ch = *p;
-
- switch (state) {
-
- /* first char */
- case sw_start:
- r->header_name_start = p;
- r->invalid_header = 0;
-
- switch (ch) {
- case CR:
- r->header_end = p;
- state = sw_header_almost_done;
- break;
- case LF:
- r->header_end = p;
- goto header_done;
- default:
- state = sw_name;
-
- c = lowcase[ch];
-
- if (c) {
- hash = ngx_hash(0, c);
- r->lowcase_header[0] = c;
- i = 1;
- break;
- }
-
- if (ch == '_') {
- if (allow_underscores) {
- hash = ngx_hash(0, ch);
- r->lowcase_header[0] = ch;
- i = 1;
-
- } else {
- r->invalid_header = 1;
- }
-
- break;
- }
-
- if (ch == '\0') {
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- r->invalid_header = 1;
-
- break;
-
- }
- break;
-
- /* header name */
- case sw_name:
- c = lowcase[ch];
-
- if (c) {
- hash = ngx_hash(hash, c);
- r->lowcase_header[i++] = c;
- i &= (NGX_HTTP_LC_HEADER_LEN - 1);
- break;
- }
-
- if (ch == '_') {
- if (allow_underscores) {
- hash = ngx_hash(hash, ch);
- r->lowcase_header[i++] = ch;
- i &= (NGX_HTTP_LC_HEADER_LEN - 1);
-
- } else {
- r->invalid_header = 1;
- }
-
- break;
- }
-
- if (ch == ':') {
- r->header_name_end = p;
- state = sw_space_before_value;
- break;
- }
-
- if (ch == CR) {
- r->header_name_end = p;
- r->header_start = p;
- r->header_end = p;
- state = sw_almost_done;
- break;
- }
-
- if (ch == LF) {
- r->header_name_end = p;
- r->header_start = p;
- r->header_end = p;
- goto done;
- }
-
- /* IIS may send the duplicate "HTTP/1.1 ..." lines */
- if (ch == '/'
- && r->upstream
- && p - r->header_name_start == 4
- && ngx_strncmp(r->header_name_start, "HTTP", 4) == 0)
- {
- state = sw_ignore_line;
- break;
- }
-
- if (ch == '\0') {
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- r->invalid_header = 1;
-
- break;
-
- /* space* before header value */
- case sw_space_before_value:
- switch (ch) {
- case ' ':
- break;
- case CR:
- r->header_start = p;
- r->header_end = p;
- state = sw_almost_done;
- break;
- case LF:
- r->header_start = p;
- r->header_end = p;
- goto done;
- case '\0':
- return NGX_HTTP_PARSE_INVALID_HEADER;
- default:
- r->header_start = p;
- state = sw_value;
- break;
- }
- break;
-
- /* header value */
- case sw_value:
- switch (ch) {
- case ' ':
- r->header_end = p;
- state = sw_space_after_value;
- break;
- case CR:
- r->header_end = p;
- state = sw_almost_done;
- break;
- case LF:
- r->header_end = p;
- goto done;
- case '\0':
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
- break;
-
- /* space* before end of header line */
- case sw_space_after_value:
- switch (ch) {
- case ' ':
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- case '\0':
- return NGX_HTTP_PARSE_INVALID_HEADER;
- default:
- state = sw_value;
- break;
- }
- break;
-
- /* ignore header line */
- case sw_ignore_line:
- switch (ch) {
- case LF:
- state = sw_start;
- break;
- default:
- break;
- }
- break;
-
- /* end of header line */
- case sw_almost_done:
- switch (ch) {
- case LF:
- goto done;
- case CR:
- break;
- default:
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
- break;
-
- /* end of header */
- case sw_header_almost_done:
- switch (ch) {
- case LF:
- goto header_done;
- default:
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
- }
- }
-
- b->pos = p;
- r->state = state;
- r->header_hash = hash;
- r->lowcase_index = i;
-
- return NGX_AGAIN;
-
-done:
-
- b->pos = p + 1;
- r->state = sw_start;
- r->header_hash = hash;
- r->lowcase_index = i;
-
- return NGX_OK;
-
-header_done:
-
- b->pos = p + 1;
- r->state = sw_start;
-
- return NGX_HTTP_PARSE_HEADER_DONE;
-}
-
-
-ngx_int_t
-ngx_http_parse_uri(ngx_http_request_t *r)
-{
- u_char *p, ch;
- enum {
- sw_start = 0,
- sw_after_slash_in_uri,
- sw_check_uri,
- sw_uri
- } state;
-
- state = sw_start;
-
- for (p = r->uri_start; p != r->uri_end; p++) {
-
- ch = *p;
-
- switch (state) {
-
- case sw_start:
-
- if (ch != '/') {
- return NGX_ERROR;
- }
-
- state = sw_after_slash_in_uri;
- break;
-
- /* check "/.", "//", "%", and "\" (Win32) in URI */
- case sw_after_slash_in_uri:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- state = sw_check_uri;
- break;
- }
-
- switch (ch) {
- case ' ':
- r->space_in_uri = 1;
- state = sw_check_uri;
- break;
- case '.':
- r->complex_uri = 1;
- state = sw_uri;
- break;
- case '%':
- r->quoted_uri = 1;
- state = sw_uri;
- break;
- case '/':
- r->complex_uri = 1;
- state = sw_uri;
- break;
-#if (NGX_WIN32)
- case '\\':
- r->complex_uri = 1;
- state = sw_uri;
- break;
-#endif
- case '?':
- r->args_start = p + 1;
- state = sw_uri;
- break;
- case '#':
- r->complex_uri = 1;
- state = sw_uri;
- break;
- case '+':
- r->plus_in_uri = 1;
- break;
- default:
- state = sw_check_uri;
- break;
- }
- break;
-
- /* check "/", "%" and "\" (Win32) in URI */
- case sw_check_uri:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- break;
- }
-
- switch (ch) {
- case '/':
-#if (NGX_WIN32)
- if (r->uri_ext == p) {
- r->complex_uri = 1;
- state = sw_uri;
- break;
- }
-#endif
- r->uri_ext = NULL;
- state = sw_after_slash_in_uri;
- break;
- case '.':
- r->uri_ext = p + 1;
- break;
- case ' ':
- r->space_in_uri = 1;
- break;
-#if (NGX_WIN32)
- case '\\':
- r->complex_uri = 1;
- state = sw_after_slash_in_uri;
- break;
-#endif
- case '%':
- r->quoted_uri = 1;
- state = sw_uri;
- break;
- case '?':
- r->args_start = p + 1;
- state = sw_uri;
- break;
- case '#':
- r->complex_uri = 1;
- state = sw_uri;
- break;
- case '+':
- r->plus_in_uri = 1;
- break;
- }
- break;
-
- /* URI */
- case sw_uri:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- break;
- }
-
- switch (ch) {
- case ' ':
- r->space_in_uri = 1;
- break;
- case '#':
- r->complex_uri = 1;
- break;
- }
- break;
- }
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_parse_complex_uri(ngx_http_request_t *r, ngx_uint_t merge_slashes)
-{
- u_char c, ch, decoded, *p, *u;
- enum {
- sw_usual = 0,
- sw_slash,
- sw_dot,
- sw_dot_dot,
- sw_quoted,
- sw_quoted_second
- } state, quoted_state;
-
-#if (NGX_SUPPRESS_WARN)
- decoded = '\0';
- quoted_state = sw_usual;
-#endif
-
- state = sw_usual;
- p = r->uri_start;
- u = r->uri.data;
- r->uri_ext = NULL;
- r->args_start = NULL;
-
- ch = *p++;
-
- while (p <= r->uri_end) {
-
- /*
- * we use "ch = *p++" inside the cycle, but this operation is safe,
- * because after the URI there is always at least one character:
- * the line feed
- */
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "s:%d in:'%Xd:%c'", state, ch, ch);
-
- switch (state) {
-
- case sw_usual:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- *u++ = ch;
- ch = *p++;
- break;
- }
-
- switch (ch) {
-#if (NGX_WIN32)
- case '\\':
- if (u - 2 >= r->uri.data
- && *(u - 1) == '.' && *(u - 2) != '.')
- {
- u--;
- }
-
- r->uri_ext = NULL;
-
- if (p == r->uri_start + r->uri.len) {
-
- /*
- * we omit the last "\" to cause redirect because
- * the browsers do not treat "\" as "/" in relative URL path
- */
-
- break;
- }
-
- state = sw_slash;
- *u++ = '/';
- break;
-#endif
- case '/':
-#if (NGX_WIN32)
- if (u - 2 >= r->uri.data
- && *(u - 1) == '.' && *(u - 2) != '.')
- {
- u--;
- }
-#endif
- r->uri_ext = NULL;
- state = sw_slash;
- *u++ = ch;
- break;
- case '%':
- quoted_state = state;
- state = sw_quoted;
- break;
- case '?':
- r->args_start = p;
- goto args;
- case '#':
- goto done;
- case '.':
- r->uri_ext = u + 1;
- *u++ = ch;
- break;
- case '+':
- r->plus_in_uri = 1;
- /* fall through */
- default:
- *u++ = ch;
- break;
- }
-
- ch = *p++;
- break;
-
- case sw_slash:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- state = sw_usual;
- *u++ = ch;
- ch = *p++;
- break;
- }
-
- switch (ch) {
-#if (NGX_WIN32)
- case '\\':
- break;
-#endif
- case '/':
- if (!merge_slashes) {
- *u++ = ch;
- }
- break;
- case '.':
- state = sw_dot;
- *u++ = ch;
- break;
- case '%':
- quoted_state = state;
- state = sw_quoted;
- break;
- case '?':
- r->args_start = p;
- goto args;
- case '#':
- goto done;
- case '+':
- r->plus_in_uri = 1;
- default:
- state = sw_usual;
- *u++ = ch;
- break;
- }
-
- ch = *p++;
- break;
-
- case sw_dot:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- state = sw_usual;
- *u++ = ch;
- ch = *p++;
- break;
- }
-
- switch (ch) {
-#if (NGX_WIN32)
- case '\\':
-#endif
- case '/':
- state = sw_slash;
- u--;
- break;
- case '.':
- state = sw_dot_dot;
- *u++ = ch;
- break;
- case '%':
- quoted_state = state;
- state = sw_quoted;
- break;
- case '?':
- r->args_start = p;
- goto args;
- case '#':
- goto done;
- case '+':
- r->plus_in_uri = 1;
- default:
- state = sw_usual;
- *u++ = ch;
- break;
- }
-
- ch = *p++;
- break;
-
- case sw_dot_dot:
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- state = sw_usual;
- *u++ = ch;
- ch = *p++;
- break;
- }
-
- switch (ch) {
-#if (NGX_WIN32)
- case '\\':
-#endif
- case '/':
- state = sw_slash;
- u -= 5;
- for ( ;; ) {
- if (u < r->uri.data) {
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- if (*u == '/') {
- u++;
- break;
- }
- u--;
- }
- break;
- case '%':
- quoted_state = state;
- state = sw_quoted;
- break;
- case '?':
- r->args_start = p;
- goto args;
- case '#':
- goto done;
- case '+':
- r->plus_in_uri = 1;
- default:
- state = sw_usual;
- *u++ = ch;
- break;
- }
-
- ch = *p++;
- break;
-
- case sw_quoted:
- r->quoted_uri = 1;
-
- if (ch >= '0' && ch <= '9') {
- decoded = (u_char) (ch - '0');
- state = sw_quoted_second;
- ch = *p++;
- break;
- }
-
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'f') {
- decoded = (u_char) (c - 'a' + 10);
- state = sw_quoted_second;
- ch = *p++;
- break;
- }
-
- return NGX_HTTP_PARSE_INVALID_REQUEST;
-
- case sw_quoted_second:
- if (ch >= '0' && ch <= '9') {
- ch = (u_char) ((decoded << 4) + ch - '0');
-
- if (ch == '%' || ch == '#') {
- state = sw_usual;
- *u++ = ch;
- ch = *p++;
- break;
-
- } else if (ch == '\0') {
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
-
- state = quoted_state;
- break;
- }
-
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'f') {
- ch = (u_char) ((decoded << 4) + c - 'a' + 10);
-
- if (ch == '?') {
- state = sw_usual;
- *u++ = ch;
- ch = *p++;
- break;
-
- } else if (ch == '+') {
- r->plus_in_uri = 1;
- }
-
- state = quoted_state;
- break;
- }
-
- return NGX_HTTP_PARSE_INVALID_REQUEST;
- }
- }
-
-done:
-
- r->uri.len = u - r->uri.data;
-
- if (r->uri_ext) {
- r->exten.len = u - r->uri_ext;
- r->exten.data = r->uri_ext;
- }
-
- r->uri_ext = NULL;
-
- return NGX_OK;
-
-args:
-
- while (p < r->uri_end) {
- if (*p++ != '#') {
- continue;
- }
-
- r->args.len = p - 1 - r->args_start;
- r->args.data = r->args_start;
- r->args_start = NULL;
-
- break;
- }
-
- r->uri.len = u - r->uri.data;
-
- if (r->uri_ext) {
- r->exten.len = u - r->uri_ext;
- r->exten.data = r->uri_ext;
- }
-
- r->uri_ext = NULL;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_parse_status_line(ngx_http_request_t *r, ngx_buf_t *b,
- ngx_http_status_t *status)
-{
- u_char ch;
- u_char *p;
- enum {
- sw_start = 0,
- sw_H,
- sw_HT,
- sw_HTT,
- sw_HTTP,
- sw_first_major_digit,
- sw_major_digit,
- sw_first_minor_digit,
- sw_minor_digit,
- sw_status,
- sw_space_after_status,
- sw_status_text,
- sw_almost_done
- } state;
-
- state = r->state;
-
- for (p = b->pos; p < b->last; p++) {
- ch = *p;
-
- switch (state) {
-
- /* "HTTP/" */
- case sw_start:
- switch (ch) {
- case 'H':
- state = sw_H;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- case sw_H:
- switch (ch) {
- case 'T':
- state = sw_HT;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- case sw_HT:
- switch (ch) {
- case 'T':
- state = sw_HTT;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- case sw_HTT:
- switch (ch) {
- case 'P':
- state = sw_HTTP;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- case sw_HTTP:
- switch (ch) {
- case '/':
- state = sw_first_major_digit;
- break;
- default:
- return NGX_ERROR;
- }
- break;
-
- /* the first digit of major HTTP version */
- case sw_first_major_digit:
- if (ch < '1' || ch > '9') {
- return NGX_ERROR;
- }
-
- r->http_major = ch - '0';
- state = sw_major_digit;
- break;
-
- /* the major HTTP version or dot */
- case sw_major_digit:
- if (ch == '.') {
- state = sw_first_minor_digit;
- break;
- }
-
- if (ch < '0' || ch > '9') {
- return NGX_ERROR;
- }
-
- r->http_major = r->http_major * 10 + ch - '0';
- break;
-
- /* the first digit of minor HTTP version */
- case sw_first_minor_digit:
- if (ch < '0' || ch > '9') {
- return NGX_ERROR;
- }
-
- r->http_minor = ch - '0';
- state = sw_minor_digit;
- break;
-
- /* the minor HTTP version or the end of the request line */
- case sw_minor_digit:
- if (ch == ' ') {
- state = sw_status;
- break;
- }
-
- if (ch < '0' || ch > '9') {
- return NGX_ERROR;
- }
-
- r->http_minor = r->http_minor * 10 + ch - '0';
- break;
-
- /* HTTP status code */
- case sw_status:
- if (ch == ' ') {
- break;
- }
-
- if (ch < '0' || ch > '9') {
- return NGX_ERROR;
- }
-
- status->code = status->code * 10 + ch - '0';
-
- if (++status->count == 3) {
- state = sw_space_after_status;
- status->start = p - 2;
- }
-
- break;
-
- /* space or end of line */
- case sw_space_after_status:
- switch (ch) {
- case ' ':
- state = sw_status_text;
- break;
- case '.': /* IIS may send 403.1, 403.2, etc */
- state = sw_status_text;
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- default:
- return NGX_ERROR;
- }
- break;
-
- /* any text until end of line */
- case sw_status_text:
- switch (ch) {
- case CR:
- state = sw_almost_done;
-
- break;
- case LF:
- goto done;
- }
- break;
-
- /* end of status line */
- case sw_almost_done:
- status->end = p - 1;
- switch (ch) {
- case LF:
- goto done;
- default:
- return NGX_ERROR;
- }
- }
- }
-
- b->pos = p;
- r->state = state;
-
- return NGX_AGAIN;
-
-done:
-
- b->pos = p + 1;
-
- if (status->end == NULL) {
- status->end = p;
- }
-
- status->http_version = r->http_major * 1000 + r->http_minor;
- r->state = sw_start;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_parse_unsafe_uri(ngx_http_request_t *r, ngx_str_t *uri,
- ngx_str_t *args, ngx_uint_t *flags)
-{
- u_char ch, *p, *src, *dst;
- size_t len;
- ngx_uint_t quoted;
-
- len = uri->len;
- p = uri->data;
- quoted = 0;
-
- if (len == 0 || p[0] == '?') {
- goto unsafe;
- }
-
- if (p[0] == '.' && len > 1 && p[1] == '.'
- && (len == 2 || ngx_path_separator(p[2])))
- {
- goto unsafe;
- }
-
- for ( /* void */ ; len; len--) {
-
- ch = *p++;
-
- if (ch == '%') {
- quoted = 1;
- continue;
- }
-
- if (usual[ch >> 5] & (1 << (ch & 0x1f))) {
- continue;
- }
-
- if (ch == '?') {
- args->len = len - 1;
- args->data = p;
- uri->len -= len;
-
- break;
- }
-
- if (ch == '\0') {
- goto unsafe;
- }
-
- if (ngx_path_separator(ch) && len > 2) {
-
- /* detect "/../" and "/.." */
-
- if (p[0] == '.' && p[1] == '.'
- && (len == 3 || ngx_path_separator(p[2])))
- {
- goto unsafe;
- }
- }
- }
-
- if (quoted) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "escaped URI: \"%V\"", uri);
-
- src = uri->data;
-
- dst = ngx_pnalloc(r->pool, uri->len);
- if (dst == NULL) {
- return NGX_ERROR;
- }
-
- uri->data = dst;
-
- ngx_unescape_uri(&dst, &src, uri->len, 0);
-
- uri->len = dst - uri->data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "unescaped URI: \"%V\"", uri);
-
- len = uri->len;
- p = uri->data;
-
- if (p[0] == '.' && len > 1 && p[1] == '.'
- && (len == 2 || ngx_path_separator(p[2])))
- {
- goto unsafe;
- }
-
- for ( /* void */ ; len; len--) {
-
- ch = *p++;
-
- if (ch == '\0') {
- goto unsafe;
- }
-
- if (ngx_path_separator(ch) && len > 2) {
-
- /* detect "/../" and "/.." */
-
- if (p[0] == '.' && p[1] == '.'
- && (len == 3 || ngx_path_separator(p[2])))
- {
- goto unsafe;
- }
- }
- }
- }
-
- return NGX_OK;
-
-unsafe:
-
- if (*flags & NGX_HTTP_LOG_UNSAFE) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "unsafe URI \"%V\" was detected", uri);
- }
-
- return NGX_ERROR;
-}
-
-
-ngx_int_t
-ngx_http_parse_multi_header_lines(ngx_array_t *headers, ngx_str_t *name,
- ngx_str_t *value)
-{
- ngx_uint_t i;
- u_char *start, *last, *end, ch;
- ngx_table_elt_t **h;
-
- h = headers->elts;
-
- for (i = 0; i < headers->nelts; i++) {
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, headers->pool->log, 0,
- "parse header: \"%V: %V\"", &h[i]->key, &h[i]->value);
-
- if (name->len > h[i]->value.len) {
- continue;
- }
-
- start = h[i]->value.data;
- end = h[i]->value.data + h[i]->value.len;
-
- while (start < end) {
-
- if (ngx_strncasecmp(start, name->data, name->len) != 0) {
- goto skip;
- }
-
- for (start += name->len; start < end && *start == ' '; start++) {
- /* void */
- }
-
- if (value == NULL) {
- if (start == end || *start == ',') {
- return i;
- }
-
- goto skip;
- }
-
- if (start == end || *start++ != '=') {
- /* the invalid header value */
- goto skip;
- }
-
- while (start < end && *start == ' ') { start++; }
-
- for (last = start; last < end && *last != ';'; last++) {
- /* void */
- }
-
- value->len = last - start;
- value->data = start;
-
- return i;
-
- skip:
-
- while (start < end) {
- ch = *start++;
- if (ch == ';' || ch == ',') {
- break;
- }
- }
-
- while (start < end && *start == ' ') { start++; }
- }
- }
-
- return NGX_DECLINED;
-}
-
-
-ngx_int_t
-ngx_http_parse_set_cookie_lines(ngx_array_t *headers, ngx_str_t *name,
- ngx_str_t *value)
-{
- ngx_uint_t i;
- u_char *start, *last, *end;
- ngx_table_elt_t **h;
-
- h = headers->elts;
-
- for (i = 0; i < headers->nelts; i++) {
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, headers->pool->log, 0,
- "parse header: \"%V: %V\"", &h[i]->key, &h[i]->value);
-
- if (name->len >= h[i]->value.len) {
- continue;
- }
-
- start = h[i]->value.data;
- end = h[i]->value.data + h[i]->value.len;
-
- if (ngx_strncasecmp(start, name->data, name->len) != 0) {
- continue;
- }
-
- for (start += name->len; start < end && *start == ' '; start++) {
- /* void */
- }
-
- if (start == end || *start++ != '=') {
- /* the invalid header value */
- continue;
- }
-
- while (start < end && *start == ' ') { start++; }
-
- for (last = start; last < end && *last != ';'; last++) {
- /* void */
- }
-
- value->len = last - start;
- value->data = start;
-
- return i;
- }
-
- return NGX_DECLINED;
-}
-
-
-ngx_int_t
-ngx_http_arg(ngx_http_request_t *r, u_char *name, size_t len, ngx_str_t *value)
-{
- u_char *p, *last;
-
- if (r->args.len == 0) {
- return NGX_DECLINED;
- }
-
- p = r->args.data;
- last = p + r->args.len;
-
- for ( /* void */ ; p < last; p++) {
-
- /* we need '=' after name, so drop one char from last */
-
- p = ngx_strlcasestrn(p, last - 1, name, len - 1);
-
- if (p == NULL) {
- return NGX_DECLINED;
- }
-
- if ((p == r->args.data || *(p - 1) == '&') && *(p + len) == '=') {
-
- value->data = p + len + 1;
-
- p = ngx_strlchr(p, last, '&');
-
- if (p == NULL) {
- p = r->args.data + r->args.len;
- }
-
- value->len = p - value->data;
-
- return NGX_OK;
- }
- }
-
- return NGX_DECLINED;
-}
-
-
-void
-ngx_http_split_args(ngx_http_request_t *r, ngx_str_t *uri, ngx_str_t *args)
-{
- u_char *p, *last;
-
- last = uri->data + uri->len;
-
- p = ngx_strlchr(uri->data, last, '?');
-
- if (p) {
- uri->len = p - uri->data;
- p++;
- args->len = last - p;
- args->data = p;
-
- } else {
- args->len = 0;
- }
-}
-
-
-ngx_int_t
-ngx_http_parse_chunked(ngx_http_request_t *r, ngx_buf_t *b,
- ngx_http_chunked_t *ctx)
-{
- u_char *pos, ch, c;
- ngx_int_t rc;
- enum {
- sw_chunk_start = 0,
- sw_chunk_size,
- sw_chunk_extension,
- sw_chunk_extension_almost_done,
- sw_chunk_data,
- sw_after_data,
- sw_after_data_almost_done,
- sw_last_chunk_extension,
- sw_last_chunk_extension_almost_done,
- sw_trailer,
- sw_trailer_almost_done,
- sw_trailer_header,
- sw_trailer_header_almost_done
- } state;
-
- state = ctx->state;
-
- if (state == sw_chunk_data && ctx->size == 0) {
- state = sw_after_data;
- }
-
- rc = NGX_AGAIN;
-
- for (pos = b->pos; pos < b->last; pos++) {
-
- ch = *pos;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http chunked byte: %02Xd s:%d", ch, state);
-
- switch (state) {
-
- case sw_chunk_start:
- if (ch >= '0' && ch <= '9') {
- state = sw_chunk_size;
- ctx->size = ch - '0';
- break;
- }
-
- c = (u_char) (ch | 0x20);
-
- if (c >= 'a' && c <= 'f') {
- state = sw_chunk_size;
- ctx->size = c - 'a' + 10;
- break;
- }
-
- goto invalid;
-
- case sw_chunk_size:
- if (ch >= '0' && ch <= '9') {
- ctx->size = ctx->size * 16 + (ch - '0');
- break;
- }
-
- c = (u_char) (ch | 0x20);
-
- if (c >= 'a' && c <= 'f') {
- ctx->size = ctx->size * 16 + (c - 'a' + 10);
- break;
- }
-
- if (ctx->size == 0) {
-
- switch (ch) {
- case CR:
- state = sw_last_chunk_extension_almost_done;
- break;
- case LF:
- state = sw_trailer;
- break;
- case ';':
- case ' ':
- case '\t':
- state = sw_last_chunk_extension;
- break;
- default:
- goto invalid;
- }
-
- break;
- }
-
- switch (ch) {
- case CR:
- state = sw_chunk_extension_almost_done;
- break;
- case LF:
- state = sw_chunk_data;
- break;
- case ';':
- case ' ':
- case '\t':
- state = sw_chunk_extension;
- break;
- default:
- goto invalid;
- }
-
- break;
-
- case sw_chunk_extension:
- switch (ch) {
- case CR:
- state = sw_chunk_extension_almost_done;
- break;
- case LF:
- state = sw_chunk_data;
- }
- break;
-
- case sw_chunk_extension_almost_done:
- if (ch == LF) {
- state = sw_chunk_data;
- break;
- }
- goto invalid;
-
- case sw_chunk_data:
- rc = NGX_OK;
- goto data;
-
- case sw_after_data:
- switch (ch) {
- case CR:
- state = sw_after_data_almost_done;
- break;
- case LF:
- state = sw_chunk_start;
- }
- break;
-
- case sw_after_data_almost_done:
- if (ch == LF) {
- state = sw_chunk_start;
- break;
- }
- goto invalid;
-
- case sw_last_chunk_extension:
- switch (ch) {
- case CR:
- state = sw_last_chunk_extension_almost_done;
- break;
- case LF:
- state = sw_trailer;
- }
- break;
-
- case sw_last_chunk_extension_almost_done:
- if (ch == LF) {
- state = sw_trailer;
- break;
- }
- goto invalid;
-
- case sw_trailer:
- switch (ch) {
- case CR:
- state = sw_trailer_almost_done;
- break;
- case LF:
- goto done;
- default:
- state = sw_trailer_header;
- }
- break;
-
- case sw_trailer_almost_done:
- if (ch == LF) {
- goto done;
- }
- goto invalid;
-
- case sw_trailer_header:
- switch (ch) {
- case CR:
- state = sw_trailer_header_almost_done;
- break;
- case LF:
- state = sw_trailer;
- }
- break;
-
- case sw_trailer_header_almost_done:
- if (ch == LF) {
- state = sw_trailer;
- break;
- }
- goto invalid;
-
- }
- }
-
-data:
-
- ctx->state = state;
- b->pos = pos;
-
- switch (state) {
-
- case sw_chunk_start:
- ctx->length = 3 /* "0" LF LF */;
- break;
- case sw_chunk_size:
- ctx->length = 1 /* LF */
- + (ctx->size ? ctx->size + 4 /* LF "0" LF LF */
- : 1 /* LF */);
- break;
- case sw_chunk_extension:
- case sw_chunk_extension_almost_done:
- ctx->length = 1 /* LF */ + ctx->size + 4 /* LF "0" LF LF */;
- break;
- case sw_chunk_data:
- ctx->length = ctx->size + 4 /* LF "0" LF LF */;
- break;
- case sw_after_data:
- case sw_after_data_almost_done:
- ctx->length = 4 /* LF "0" LF LF */;
- break;
- case sw_last_chunk_extension:
- case sw_last_chunk_extension_almost_done:
- ctx->length = 2 /* LF LF */;
- break;
- case sw_trailer:
- case sw_trailer_almost_done:
- ctx->length = 1 /* LF */;
- break;
- case sw_trailer_header:
- case sw_trailer_header_almost_done:
- ctx->length = 2 /* LF LF */;
- break;
-
- }
-
- if (ctx->size < 0 || ctx->length < 0) {
- goto invalid;
- }
-
- return rc;
-
-done:
-
- ctx->state = 0;
- b->pos = pos + 1;
-
- return NGX_DONE;
-
-invalid:
-
- return NGX_ERROR;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse_time.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse_time.c
deleted file mode 100644
index 985af31725b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_parse_time.c
+++ /dev/null
@@ -1,277 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static ngx_uint_t mday[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
-
-time_t
-ngx_http_parse_time(u_char *value, size_t len)
-{
- u_char *p, *end;
- ngx_int_t month;
- ngx_uint_t day, year, hour, min, sec;
- uint64_t time;
- enum {
- no = 0,
- rfc822, /* Tue, 10 Nov 2002 23:50:13 */
- rfc850, /* Tuesday, 10-Dec-02 23:50:13 */
- isoc /* Tue Dec 10 23:50:13 2002 */
- } fmt;
-
- fmt = 0;
- end = value + len;
-
-#if (NGX_SUPPRESS_WARN)
- day = 32;
- year = 2038;
-#endif
-
- for (p = value; p < end; p++) {
- if (*p == ',') {
- break;
- }
-
- if (*p == ' ') {
- fmt = isoc;
- break;
- }
- }
-
- for (p++; p < end; p++)
- if (*p != ' ') {
- break;
- }
-
- if (end - p < 18) {
- return NGX_ERROR;
- }
-
- if (fmt != isoc) {
- if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') {
- return NGX_ERROR;
- }
-
- day = (*p - '0') * 10 + *(p + 1) - '0';
- p += 2;
-
- if (*p == ' ') {
- if (end - p < 18) {
- return NGX_ERROR;
- }
- fmt = rfc822;
-
- } else if (*p == '-') {
- fmt = rfc850;
-
- } else {
- return NGX_ERROR;
- }
-
- p++;
- }
-
- switch (*p) {
-
- case 'J':
- month = *(p + 1) == 'a' ? 0 : *(p + 2) == 'n' ? 5 : 6;
- break;
-
- case 'F':
- month = 1;
- break;
-
- case 'M':
- month = *(p + 2) == 'r' ? 2 : 4;
- break;
-
- case 'A':
- month = *(p + 1) == 'p' ? 3 : 7;
- break;
-
- case 'S':
- month = 8;
- break;
-
- case 'O':
- month = 9;
- break;
-
- case 'N':
- month = 10;
- break;
-
- case 'D':
- month = 11;
- break;
-
- default:
- return NGX_ERROR;
- }
-
- p += 3;
-
- if ((fmt == rfc822 && *p != ' ') || (fmt == rfc850 && *p != '-')) {
- return NGX_ERROR;
- }
-
- p++;
-
- if (fmt == rfc822) {
- if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9'
- || *(p + 2) < '0' || *(p + 2) > '9'
- || *(p + 3) < '0' || *(p + 3) > '9')
- {
- return NGX_ERROR;
- }
-
- year = (*p - '0') * 1000 + (*(p + 1) - '0') * 100
- + (*(p + 2) - '0') * 10 + *(p + 3) - '0';
- p += 4;
-
- } else if (fmt == rfc850) {
- if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') {
- return NGX_ERROR;
- }
-
- year = (*p - '0') * 10 + *(p + 1) - '0';
- year += (year < 70) ? 2000 : 1900;
- p += 2;
- }
-
- if (fmt == isoc) {
- if (*p == ' ') {
- p++;
- }
-
- if (*p < '0' || *p > '9') {
- return NGX_ERROR;
- }
-
- day = *p++ - '0';
-
- if (*p != ' ') {
- if (*p < '0' || *p > '9') {
- return NGX_ERROR;
- }
-
- day = day * 10 + *p++ - '0';
- }
-
- if (end - p < 14) {
- return NGX_ERROR;
- }
- }
-
- if (*p++ != ' ') {
- return NGX_ERROR;
- }
-
- if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') {
- return NGX_ERROR;
- }
-
- hour = (*p - '0') * 10 + *(p + 1) - '0';
- p += 2;
-
- if (*p++ != ':') {
- return NGX_ERROR;
- }
-
- if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') {
- return NGX_ERROR;
- }
-
- min = (*p - '0') * 10 + *(p + 1) - '0';
- p += 2;
-
- if (*p++ != ':') {
- return NGX_ERROR;
- }
-
- if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9') {
- return NGX_ERROR;
- }
-
- sec = (*p - '0') * 10 + *(p + 1) - '0';
-
- if (fmt == isoc) {
- p += 2;
-
- if (*p++ != ' ') {
- return NGX_ERROR;
- }
-
- if (*p < '0' || *p > '9' || *(p + 1) < '0' || *(p + 1) > '9'
- || *(p + 2) < '0' || *(p + 2) > '9'
- || *(p + 3) < '0' || *(p + 3) > '9')
- {
- return NGX_ERROR;
- }
-
- year = (*p - '0') * 1000 + (*(p + 1) - '0') * 100
- + (*(p + 2) - '0') * 10 + *(p + 3) - '0';
- }
-
- if (hour > 23 || min > 59 || sec > 59) {
- return NGX_ERROR;
- }
-
- if (day == 29 && month == 1) {
- if ((year & 3) || ((year % 100 == 0) && (year % 400) != 0)) {
- return NGX_ERROR;
- }
-
- } else if (day > mday[month]) {
- return NGX_ERROR;
- }
-
- /*
- * shift new year to March 1 and start months from 1 (not 0),
- * it is needed for Gauss' formula
- */
-
- if (--month <= 0) {
- month += 12;
- year -= 1;
- }
-
- /* Gauss' formula for Gregorian days since March 1, 1 BC */
-
- time = (uint64_t) (
- /* days in years including leap years since March 1, 1 BC */
-
- 365 * year + year / 4 - year / 100 + year / 400
-
- /* days before the month */
-
- + 367 * month / 12 - 30
-
- /* days before the day */
-
- + day - 1
-
- /*
- * 719527 days were between March 1, 1 BC and March 1, 1970,
- * 31 and 28 days were in January and February 1970
- */
-
- - 719527 + 31 + 28) * 86400 + hour * 3600 + min * 60 + sec;
-
-#if (NGX_TIME_T_SIZE <= 4)
-
- if (time > 0x7fffffff) {
- return NGX_ERROR;
- }
-
-#endif
-
- return (time_t) time;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_postpone_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_postpone_filter_module.c
deleted file mode 100644
index e893b836488..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_postpone_filter_module.c
+++ /dev/null
@@ -1,176 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static ngx_int_t ngx_http_postpone_filter_add(ngx_http_request_t *r,
- ngx_chain_t *in);
-static ngx_int_t ngx_http_postpone_filter_init(ngx_conf_t *cf);
-
-
-static ngx_http_module_t ngx_http_postpone_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_postpone_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_postpone_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_postpone_filter_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_body_filter_pt ngx_http_next_body_filter;
-
-
-static ngx_int_t
-ngx_http_postpone_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- ngx_connection_t *c;
- ngx_http_postponed_request_t *pr;
-
- c = r->connection;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http postpone filter \"%V?%V\" %p", &r->uri, &r->args, in);
-
- if (r != c->data) {
-
- if (in) {
- ngx_http_postpone_filter_add(r, in);
- return NGX_OK;
- }
-
-#if 0
- /* TODO: SSI may pass NULL */
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "http postpone filter NULL inactive request");
-#endif
-
- return NGX_OK;
- }
-
- if (r->postponed == NULL) {
-
- if (in || c->buffered) {
- return ngx_http_next_body_filter(r->main, in);
- }
-
- return NGX_OK;
- }
-
- if (in) {
- ngx_http_postpone_filter_add(r, in);
- }
-
- do {
- pr = r->postponed;
-
- if (pr->request) {
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http postpone filter wake \"%V?%V\"",
- &pr->request->uri, &pr->request->args);
-
- r->postponed = pr->next;
-
- c->data = pr->request;
-
- return ngx_http_post_request(pr->request, NULL);
- }
-
- if (pr->out == NULL) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "http postpone filter NULL output");
-
- } else {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http postpone filter output \"%V?%V\"",
- &r->uri, &r->args);
-
- if (ngx_http_next_body_filter(r->main, pr->out) == NGX_ERROR) {
- return NGX_ERROR;
- }
- }
-
- r->postponed = pr->next;
-
- } while (r->postponed);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_postpone_filter_add(ngx_http_request_t *r, ngx_chain_t *in)
-{
- ngx_http_postponed_request_t *pr, **ppr;
-
- if (r->postponed) {
- for (pr = r->postponed; pr->next; pr = pr->next) { /* void */ }
-
- if (pr->request == NULL) {
- goto found;
- }
-
- ppr = &pr->next;
-
- } else {
- ppr = &r->postponed;
- }
-
- pr = ngx_palloc(r->pool, sizeof(ngx_http_postponed_request_t));
- if (pr == NULL) {
- return NGX_ERROR;
- }
-
- *ppr = pr;
-
- pr->request = NULL;
- pr->out = NULL;
- pr->next = NULL;
-
-found:
-
- if (ngx_chain_add_copy(r->pool, &pr->out, in) == NGX_OK) {
- return NGX_OK;
- }
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_postpone_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_body_filter = ngx_http_top_body_filter;
- ngx_http_top_body_filter = ngx_http_postpone_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.c
deleted file mode 100644
index 2b932dee436..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.c
+++ /dev/null
@@ -1,3656 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static void ngx_http_wait_request_handler(ngx_event_t *ev);
-static void ngx_http_process_request_line(ngx_event_t *rev);
-static void ngx_http_process_request_headers(ngx_event_t *rev);
-static ssize_t ngx_http_read_request_header(ngx_http_request_t *r);
-static ngx_int_t ngx_http_alloc_large_header_buffer(ngx_http_request_t *r,
- ngx_uint_t request_line);
-
-static ngx_int_t ngx_http_process_header_line(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_process_unique_header_line(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_process_multi_header_lines(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_process_host(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_process_connection(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_process_user_agent(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-
-static ngx_int_t ngx_http_validate_host(ngx_str_t *host, ngx_pool_t *pool,
- ngx_uint_t alloc);
-static ngx_int_t ngx_http_set_virtual_server(ngx_http_request_t *r,
- ngx_str_t *host);
-static ngx_int_t ngx_http_find_virtual_server(ngx_connection_t *c,
- ngx_http_virtual_names_t *virtual_names, ngx_str_t *host,
- ngx_http_request_t *r, ngx_http_core_srv_conf_t **cscfp);
-
-static void ngx_http_request_handler(ngx_event_t *ev);
-static void ngx_http_terminate_request(ngx_http_request_t *r, ngx_int_t rc);
-static void ngx_http_terminate_handler(ngx_http_request_t *r);
-static void ngx_http_finalize_connection(ngx_http_request_t *r);
-static ngx_int_t ngx_http_set_write_handler(ngx_http_request_t *r);
-static void ngx_http_writer(ngx_http_request_t *r);
-static void ngx_http_request_finalizer(ngx_http_request_t *r);
-
-static void ngx_http_set_keepalive(ngx_http_request_t *r);
-static void ngx_http_keepalive_handler(ngx_event_t *ev);
-static void ngx_http_set_lingering_close(ngx_http_request_t *r);
-static void ngx_http_lingering_close_handler(ngx_event_t *ev);
-static ngx_int_t ngx_http_post_action(ngx_http_request_t *r);
-static void ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error);
-static void ngx_http_log_request(ngx_http_request_t *r);
-
-static u_char *ngx_http_log_error(ngx_log_t *log, u_char *buf, size_t len);
-static u_char *ngx_http_log_error_handler(ngx_http_request_t *r,
- ngx_http_request_t *sr, u_char *buf, size_t len);
-
-#if (NGX_HTTP_SSL)
-static void ngx_http_ssl_handshake(ngx_event_t *rev);
-static void ngx_http_ssl_handshake_handler(ngx_connection_t *c);
-#endif
-
-
-static char *ngx_http_client_errors[] = {
-
- /* NGX_HTTP_PARSE_INVALID_METHOD */
- "client sent invalid method",
-
- /* NGX_HTTP_PARSE_INVALID_REQUEST */
- "client sent invalid request",
-
- /* NGX_HTTP_PARSE_INVALID_09_METHOD */
- "client sent invalid method in HTTP/0.9 request"
-};
-
-
-ngx_http_header_t ngx_http_headers_in[] = {
- { ngx_string("Host"), offsetof(ngx_http_headers_in_t, host),
- ngx_http_process_host },
-
- { ngx_string("Connection"), offsetof(ngx_http_headers_in_t, connection),
- ngx_http_process_connection },
-
- { ngx_string("If-Modified-Since"),
- offsetof(ngx_http_headers_in_t, if_modified_since),
- ngx_http_process_unique_header_line },
-
- { ngx_string("If-Unmodified-Since"),
- offsetof(ngx_http_headers_in_t, if_unmodified_since),
- ngx_http_process_unique_header_line },
-
- { ngx_string("If-Match"),
- offsetof(ngx_http_headers_in_t, if_match),
- ngx_http_process_unique_header_line },
-
- { ngx_string("If-None-Match"),
- offsetof(ngx_http_headers_in_t, if_none_match),
- ngx_http_process_unique_header_line },
-
- { ngx_string("User-Agent"), offsetof(ngx_http_headers_in_t, user_agent),
- ngx_http_process_user_agent },
-
- { ngx_string("Referer"), offsetof(ngx_http_headers_in_t, referer),
- ngx_http_process_header_line },
-
- { ngx_string("Content-Length"),
- offsetof(ngx_http_headers_in_t, content_length),
- ngx_http_process_unique_header_line },
-
- { ngx_string("Content-Type"),
- offsetof(ngx_http_headers_in_t, content_type),
- ngx_http_process_header_line },
-
- { ngx_string("Range"), offsetof(ngx_http_headers_in_t, range),
- ngx_http_process_header_line },
-
- { ngx_string("If-Range"),
- offsetof(ngx_http_headers_in_t, if_range),
- ngx_http_process_unique_header_line },
-
- { ngx_string("Transfer-Encoding"),
- offsetof(ngx_http_headers_in_t, transfer_encoding),
- ngx_http_process_header_line },
-
- { ngx_string("Expect"),
- offsetof(ngx_http_headers_in_t, expect),
- ngx_http_process_unique_header_line },
-
- { ngx_string("Upgrade"),
- offsetof(ngx_http_headers_in_t, upgrade),
- ngx_http_process_header_line },
-
-#if (NGX_HTTP_GZIP)
- { ngx_string("Accept-Encoding"),
- offsetof(ngx_http_headers_in_t, accept_encoding),
- ngx_http_process_header_line },
-
- { ngx_string("Via"), offsetof(ngx_http_headers_in_t, via),
- ngx_http_process_header_line },
-#endif
-
- { ngx_string("Authorization"),
- offsetof(ngx_http_headers_in_t, authorization),
- ngx_http_process_unique_header_line },
-
- { ngx_string("Keep-Alive"), offsetof(ngx_http_headers_in_t, keep_alive),
- ngx_http_process_header_line },
-
-#if (NGX_HTTP_X_FORWARDED_FOR)
- { ngx_string("X-Forwarded-For"),
- offsetof(ngx_http_headers_in_t, x_forwarded_for),
- ngx_http_process_multi_header_lines },
-#endif
-
-#if (NGX_HTTP_REALIP)
- { ngx_string("X-Real-IP"),
- offsetof(ngx_http_headers_in_t, x_real_ip),
- ngx_http_process_header_line },
-#endif
-
-#if (NGX_HTTP_HEADERS)
- { ngx_string("Accept"), offsetof(ngx_http_headers_in_t, accept),
- ngx_http_process_header_line },
-
- { ngx_string("Accept-Language"),
- offsetof(ngx_http_headers_in_t, accept_language),
- ngx_http_process_header_line },
-#endif
-
-#if (NGX_HTTP_DAV)
- { ngx_string("Depth"), offsetof(ngx_http_headers_in_t, depth),
- ngx_http_process_header_line },
-
- { ngx_string("Destination"), offsetof(ngx_http_headers_in_t, destination),
- ngx_http_process_header_line },
-
- { ngx_string("Overwrite"), offsetof(ngx_http_headers_in_t, overwrite),
- ngx_http_process_header_line },
-
- { ngx_string("Date"), offsetof(ngx_http_headers_in_t, date),
- ngx_http_process_header_line },
-#endif
-
- { ngx_string("Cookie"), offsetof(ngx_http_headers_in_t, cookies),
- ngx_http_process_multi_header_lines },
-
- { ngx_null_string, 0, NULL }
-};
-
-
-void
-ngx_http_init_connection(ngx_connection_t *c)
-{
- ngx_uint_t i;
- ngx_event_t *rev;
- struct sockaddr_in *sin;
- ngx_http_port_t *port;
- ngx_http_in_addr_t *addr;
- ngx_http_log_ctx_t *ctx;
- ngx_http_connection_t *hc;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
- ngx_http_in6_addr_t *addr6;
-#endif
-
- hc = ngx_pcalloc(c->pool, sizeof(ngx_http_connection_t));
- if (hc == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- c->data = hc;
-
- /* find the server configuration for the address:port */
-
- port = c->listening->servers;
-
- if (port->naddrs > 1) {
-
- /*
- * there are several addresses on this port and one of them
- * is an "*:port" wildcard so getsockname() in ngx_http_server_addr()
- * is required to determine a server address
- */
-
- if (ngx_connection_local_sockaddr(c, NULL, 0) != NGX_OK) {
- ngx_http_close_connection(c);
- return;
- }
-
- switch (c->local_sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) c->local_sockaddr;
-
- addr6 = port->addrs;
-
- /* the last address is "*" */
-
- for (i = 0; i < port->naddrs - 1; i++) {
- if (ngx_memcmp(&addr6[i].addr6, &sin6->sin6_addr, 16) == 0) {
- break;
- }
- }
-
- hc->addr_conf = &addr6[i].conf;
-
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) c->local_sockaddr;
-
- addr = port->addrs;
-
- /* the last address is "*" */
-
- for (i = 0; i < port->naddrs - 1; i++) {
- if (addr[i].addr == sin->sin_addr.s_addr) {
- break;
- }
- }
-
- hc->addr_conf = &addr[i].conf;
-
- break;
- }
-
- } else {
-
- switch (c->local_sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- addr6 = port->addrs;
- hc->addr_conf = &addr6[0].conf;
- break;
-#endif
-
- default: /* AF_INET */
- addr = port->addrs;
- hc->addr_conf = &addr[0].conf;
- break;
- }
- }
-
- /* the default server configuration for the address:port */
- hc->conf_ctx = hc->addr_conf->default_server->ctx;
-
- ctx = ngx_palloc(c->pool, sizeof(ngx_http_log_ctx_t));
- if (ctx == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- ctx->connection = c;
- ctx->request = NULL;
- ctx->current_request = NULL;
-
- c->log->connection = c->number;
- c->log->handler = ngx_http_log_error;
- c->log->data = ctx;
- c->log->action = "waiting for request";
-
- c->log_error = NGX_ERROR_INFO;
-
- rev = c->read;
- rev->handler = ngx_http_wait_request_handler;
- c->write->handler = ngx_http_empty_handler;
-
-#if (NGX_HTTP_SPDY)
- if (hc->addr_conf->spdy) {
- rev->handler = ngx_http_spdy_init;
- }
-#endif
-
-#if (NGX_HTTP_SSL)
- {
- ngx_http_ssl_srv_conf_t *sscf;
-
- sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_ssl_module);
-
- if (sscf->enable || hc->addr_conf->ssl) {
-
- c->log->action = "SSL handshaking";
-
- if (hc->addr_conf->ssl && sscf->ssl.ctx == NULL) {
- ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "no \"ssl_certificate\" is defined "
- "in server listening on SSL port");
- ngx_http_close_connection(c);
- return;
- }
-
- hc->ssl = 1;
-
- rev->handler = ngx_http_ssl_handshake;
- }
- }
-#endif
-
- if (hc->addr_conf->proxy_protocol) {
- hc->proxy_protocol = 1;
- c->log->action = "reading PROXY protocol";
- }
-
- if (rev->ready) {
- /* the deferred accept(), rtsig, aio, iocp */
-
- if (ngx_use_accept_mutex) {
- ngx_post_event(rev, &ngx_posted_events);
- return;
- }
-
- rev->handler(rev);
- return;
- }
-
- ngx_add_timer(rev, c->listening->post_accept_timeout);
- ngx_reusable_connection(c, 1);
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_close_connection(c);
- return;
- }
-}
-
-
-static void
-ngx_http_wait_request_handler(ngx_event_t *rev)
-{
- u_char *p;
- size_t size;
- ssize_t n;
- ngx_buf_t *b;
- ngx_connection_t *c;
- ngx_http_connection_t *hc;
- ngx_http_core_srv_conf_t *cscf;
-
- c = rev->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http wait request handler");
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- ngx_http_close_connection(c);
- return;
- }
-
- if (c->close) {
- ngx_http_close_connection(c);
- return;
- }
-
- hc = c->data;
- cscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_core_module);
-
- size = cscf->client_header_buffer_size;
-
- b = c->buffer;
-
- if (b == NULL) {
- b = ngx_create_temp_buf(c->pool, size);
- if (b == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- c->buffer = b;
-
- } else if (b->start == NULL) {
-
- b->start = ngx_palloc(c->pool, size);
- if (b->start == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- b->pos = b->start;
- b->last = b->start;
- b->end = b->last + size;
- }
-
- n = c->recv(c, b->last, size);
-
- if (n == NGX_AGAIN) {
-
- if (!rev->timer_set) {
- ngx_add_timer(rev, c->listening->post_accept_timeout);
- ngx_reusable_connection(c, 1);
- }
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_close_connection(c);
- return;
- }
-
- /*
- * We are trying to not hold c->buffer's memory for an idle connection.
- */
-
- if (ngx_pfree(c->pool, b->start) == NGX_OK) {
- b->start = NULL;
- }
-
- return;
- }
-
- if (n == NGX_ERROR) {
- ngx_http_close_connection(c);
- return;
- }
-
- if (n == 0) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client closed connection");
- ngx_http_close_connection(c);
- return;
- }
-
- b->last += n;
-
- if (hc->proxy_protocol) {
- hc->proxy_protocol = 0;
-
- p = ngx_proxy_protocol_parse(c, b->pos, b->last);
-
- if (p == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- b->pos = p;
-
- if (b->pos == b->last) {
- c->log->action = "waiting for request";
- b->pos = b->start;
- b->last = b->start;
- ngx_post_event(rev, &ngx_posted_events);
- return;
- }
- }
-
- c->log->action = "reading client request line";
-
- ngx_reusable_connection(c, 0);
-
- c->data = ngx_http_create_request(c);
- if (c->data == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- rev->handler = ngx_http_process_request_line;
- ngx_http_process_request_line(rev);
-}
-
-
-ngx_http_request_t *
-ngx_http_create_request(ngx_connection_t *c)
-{
- ngx_pool_t *pool;
- ngx_time_t *tp;
- ngx_http_request_t *r;
- ngx_http_log_ctx_t *ctx;
- ngx_http_connection_t *hc;
- ngx_http_core_srv_conf_t *cscf;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_main_conf_t *cmcf;
-
- c->requests++;
-
- hc = c->data;
-
- cscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_core_module);
-
- pool = ngx_create_pool(cscf->request_pool_size, c->log);
- if (pool == NULL) {
- return NULL;
- }
-
- r = ngx_pcalloc(pool, sizeof(ngx_http_request_t));
- if (r == NULL) {
- ngx_destroy_pool(pool);
- return NULL;
- }
-
- r->pool = pool;
-
- r->http_connection = hc;
- r->signature = NGX_HTTP_MODULE;
- r->connection = c;
-
- r->main_conf = hc->conf_ctx->main_conf;
- r->srv_conf = hc->conf_ctx->srv_conf;
- r->loc_conf = hc->conf_ctx->loc_conf;
-
- r->read_event_handler = ngx_http_block_reading;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ngx_http_set_connection_log(r->connection, clcf->error_log);
-
- r->header_in = hc->nbusy ? hc->busy[0] : c->buffer;
-
- if (ngx_list_init(&r->headers_out.headers, r->pool, 20,
- sizeof(ngx_table_elt_t))
- != NGX_OK)
- {
- ngx_destroy_pool(r->pool);
- return NULL;
- }
-
- r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
- if (r->ctx == NULL) {
- ngx_destroy_pool(r->pool);
- return NULL;
- }
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- r->variables = ngx_pcalloc(r->pool, cmcf->variables.nelts
- * sizeof(ngx_http_variable_value_t));
- if (r->variables == NULL) {
- ngx_destroy_pool(r->pool);
- return NULL;
- }
-
-#if (NGX_HTTP_SSL)
- if (c->ssl) {
- r->main_filter_need_in_memory = 1;
- }
-#endif
-
- r->main = r;
- r->count = 1;
-
- tp = ngx_timeofday();
- r->start_sec = tp->sec;
- r->start_msec = tp->msec;
-
- r->method = NGX_HTTP_UNKNOWN;
- r->http_version = NGX_HTTP_VERSION_10;
-
- r->headers_in.content_length_n = -1;
- r->headers_in.keep_alive_n = -1;
- r->headers_out.content_length_n = -1;
- r->headers_out.last_modified_time = -1;
-
- r->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1;
- r->subrequests = NGX_HTTP_MAX_SUBREQUESTS + 1;
-
- r->http_state = NGX_HTTP_READING_REQUEST_STATE;
-
- ctx = c->log->data;
- ctx->request = r;
- ctx->current_request = r;
- r->log_handler = ngx_http_log_error_handler;
-
-#if (NGX_STAT_STUB)
- (void) ngx_atomic_fetch_add(ngx_stat_reading, 1);
- r->stat_reading = 1;
- (void) ngx_atomic_fetch_add(ngx_stat_requests, 1);
-#endif
-
- return r;
-}
-
-
-#if (NGX_HTTP_SSL)
-
-static void
-ngx_http_ssl_handshake(ngx_event_t *rev)
-{
- u_char *p, buf[NGX_PROXY_PROTOCOL_MAX_HEADER + 1];
- size_t size;
- ssize_t n;
- ngx_err_t err;
- ngx_int_t rc;
- ngx_connection_t *c;
- ngx_http_connection_t *hc;
- ngx_http_ssl_srv_conf_t *sscf;
-
- c = rev->data;
- hc = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0,
- "http check ssl handshake");
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- ngx_http_close_connection(c);
- return;
- }
-
- if (c->close) {
- ngx_http_close_connection(c);
- return;
- }
-
- size = hc->proxy_protocol ? sizeof(buf) : 1;
-
- n = recv(c->fd, (char *) buf, size, MSG_PEEK);
-
- err = ngx_socket_errno;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, rev->log, 0, "http recv(): %d", n);
-
- if (n == -1) {
- if (err == NGX_EAGAIN) {
-
- if (!rev->timer_set) {
- ngx_add_timer(rev, c->listening->post_accept_timeout);
- ngx_reusable_connection(c, 1);
- }
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_close_connection(c);
- }
-
- return;
- }
-
- ngx_connection_error(c, err, "recv() failed");
- ngx_http_close_connection(c);
-
- return;
- }
-
- if (hc->proxy_protocol) {
- hc->proxy_protocol = 0;
-
- p = ngx_proxy_protocol_parse(c, buf, buf + n);
-
- if (p == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- size = p - buf;
-
- if (c->recv(c, buf, size) != (ssize_t) size) {
- ngx_http_close_connection(c);
- return;
- }
-
- c->log->action = "SSL handshaking";
-
- if (n == (ssize_t) size) {
- ngx_post_event(rev, &ngx_posted_events);
- return;
- }
-
- n = 1;
- buf[0] = *p;
- }
-
- if (n == 1) {
- if (buf[0] & 0x80 /* SSLv2 */ || buf[0] == 0x16 /* SSLv3/TLSv1 */) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, rev->log, 0,
- "https ssl handshake: 0x%02Xd", buf[0]);
-
- sscf = ngx_http_get_module_srv_conf(hc->conf_ctx,
- ngx_http_ssl_module);
-
- if (ngx_ssl_create_connection(&sscf->ssl, c, NGX_SSL_BUFFER)
- != NGX_OK)
- {
- ngx_http_close_connection(c);
- return;
- }
-
- rc = ngx_ssl_handshake(c);
-
- if (rc == NGX_AGAIN) {
-
- if (!rev->timer_set) {
- ngx_add_timer(rev, c->listening->post_accept_timeout);
- }
-
- ngx_reusable_connection(c, 0);
-
- c->ssl->handler = ngx_http_ssl_handshake_handler;
- return;
- }
-
- ngx_http_ssl_handshake_handler(c);
-
- return;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0, "plain http");
-
- c->log->action = "waiting for request";
-
- rev->handler = ngx_http_wait_request_handler;
- ngx_http_wait_request_handler(rev);
-
- return;
- }
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0, "client closed connection");
- ngx_http_close_connection(c);
-}
-
-
-static void
-ngx_http_ssl_handshake_handler(ngx_connection_t *c)
-{
- if (c->ssl->handshaked) {
-
- /*
- * The majority of browsers do not send the "close notify" alert.
- * Among them are MSIE, old Mozilla, Netscape 4, Konqueror,
- * and Links. And what is more, MSIE ignores the server's alert.
- *
- * Opera and recent Mozilla send the alert.
- */
-
- c->ssl->no_wait_shutdown = 1;
-
-#if (NGX_HTTP_SPDY \
- && (defined TLSEXT_TYPE_application_layer_protocol_negotiation \
- || defined TLSEXT_TYPE_next_proto_neg))
- {
- unsigned int len;
- const unsigned char *data;
- static const ngx_str_t spdy = ngx_string(NGX_SPDY_NPN_NEGOTIATED);
-
-#ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
- SSL_get0_alpn_selected(c->ssl->connection, &data, &len);
-
-#ifdef TLSEXT_TYPE_next_proto_neg
- if (len == 0) {
- SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
- }
-#endif
-
-#else /* TLSEXT_TYPE_next_proto_neg */
- SSL_get0_next_proto_negotiated(c->ssl->connection, &data, &len);
-#endif
-
- if (len == spdy.len && ngx_strncmp(data, spdy.data, spdy.len) == 0) {
- ngx_http_spdy_init(c->read);
- return;
- }
- }
-#endif
-
- c->log->action = "waiting for request";
-
- c->read->handler = ngx_http_wait_request_handler;
- /* STUB: epoll edge */ c->write->handler = ngx_http_empty_handler;
-
- ngx_reusable_connection(c, 1);
-
- ngx_http_wait_request_handler(c->read);
-
- return;
- }
-
- if (c->read->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- }
-
- ngx_http_close_connection(c);
-}
-
-#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
-
-int
-ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg)
-{
- ngx_str_t host;
- const char *servername;
- ngx_connection_t *c;
- ngx_http_connection_t *hc;
- ngx_http_ssl_srv_conf_t *sscf;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t *cscf;
-
- servername = SSL_get_servername(ssl_conn, TLSEXT_NAMETYPE_host_name);
-
- if (servername == NULL) {
- return SSL_TLSEXT_ERR_NOACK;
- }
-
- c = ngx_ssl_get_connection(ssl_conn);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "SSL server name: \"%s\"", servername);
-
- host.len = ngx_strlen(servername);
-
- if (host.len == 0) {
- return SSL_TLSEXT_ERR_NOACK;
- }
-
- host.data = (u_char *) servername;
-
- if (ngx_http_validate_host(&host, c->pool, 1) != NGX_OK) {
- return SSL_TLSEXT_ERR_NOACK;
- }
-
- hc = c->data;
-
- if (ngx_http_find_virtual_server(c, hc->addr_conf->virtual_names, &host,
- NULL, &cscf)
- != NGX_OK)
- {
- return SSL_TLSEXT_ERR_NOACK;
- }
-
- hc->ssl_servername = ngx_palloc(c->pool, sizeof(ngx_str_t));
- if (hc->ssl_servername == NULL) {
- return SSL_TLSEXT_ERR_NOACK;
- }
-
- *hc->ssl_servername = host;
-
- hc->conf_ctx = cscf->ctx;
-
- clcf = ngx_http_get_module_loc_conf(hc->conf_ctx, ngx_http_core_module);
-
- ngx_http_set_connection_log(c, clcf->error_log);
-
- sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_ssl_module);
-
- if (sscf->ssl.ctx) {
- SSL_set_SSL_CTX(ssl_conn, sscf->ssl.ctx);
-
- /*
- * SSL_set_SSL_CTX() only changes certs as of 1.0.0d
- * adjust other things we care about
- */
-
- SSL_set_verify(ssl_conn, SSL_CTX_get_verify_mode(sscf->ssl.ctx),
- SSL_CTX_get_verify_callback(sscf->ssl.ctx));
-
- SSL_set_verify_depth(ssl_conn, SSL_CTX_get_verify_depth(sscf->ssl.ctx));
-
-#ifdef SSL_CTRL_CLEAR_OPTIONS
- /* only in 0.9.8m+ */
- SSL_clear_options(ssl_conn, SSL_get_options(ssl_conn) &
- ~SSL_CTX_get_options(sscf->ssl.ctx));
-#endif
-
- SSL_set_options(ssl_conn, SSL_CTX_get_options(sscf->ssl.ctx));
- }
-
- return SSL_TLSEXT_ERR_OK;
-}
-
-#endif
-
-#endif
-
-
-static void
-ngx_http_process_request_line(ngx_event_t *rev)
-{
- ssize_t n;
- ngx_int_t rc, rv;
- ngx_str_t host;
- ngx_connection_t *c;
- ngx_http_request_t *r;
-
- c = rev->data;
- r = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0,
- "http process request line");
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- c->timedout = 1;
- ngx_http_close_request(r, NGX_HTTP_REQUEST_TIME_OUT);
- return;
- }
-
- rc = NGX_AGAIN;
-
- for ( ;; ) {
-
- if (rc == NGX_AGAIN) {
- n = ngx_http_read_request_header(r);
-
- if (n == NGX_AGAIN || n == NGX_ERROR) {
- return;
- }
- }
-
- rc = ngx_http_parse_request_line(r, r->header_in);
-
- if (rc == NGX_OK) {
-
- /* the request line has been parsed successfully */
-
- r->request_line.len = r->request_end - r->request_start;
- r->request_line.data = r->request_start;
- r->request_length = r->header_in->pos - r->request_start;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http request line: \"%V\"", &r->request_line);
-
- r->method_name.len = r->method_end - r->request_start + 1;
- r->method_name.data = r->request_line.data;
-
- if (r->http_protocol.data) {
- r->http_protocol.len = r->request_end - r->http_protocol.data;
- }
-
- if (ngx_http_process_request_uri(r) != NGX_OK) {
- return;
- }
-
- if (r->host_start && r->host_end) {
-
- host.len = r->host_end - r->host_start;
- host.data = r->host_start;
-
- rc = ngx_http_validate_host(&host, r->pool, 0);
-
- if (rc == NGX_DECLINED) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid host in request line");
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return;
- }
-
- if (rc == NGX_ERROR) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- if (ngx_http_set_virtual_server(r, &host) == NGX_ERROR) {
- return;
- }
-
- r->headers_in.server = host;
- }
-
- if (r->http_version < NGX_HTTP_VERSION_10) {
-
- if (r->headers_in.server.len == 0
- && ngx_http_set_virtual_server(r, &r->headers_in.server)
- == NGX_ERROR)
- {
- return;
- }
-
- ngx_http_process_request(r);
- return;
- }
-
-
- if (ngx_list_init(&r->headers_in.headers, r->pool, 20,
- sizeof(ngx_table_elt_t))
- != NGX_OK)
- {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- c->log->action = "reading client request headers";
-
- rev->handler = ngx_http_process_request_headers;
- ngx_http_process_request_headers(rev);
-
- return;
- }
-
- if (rc != NGX_AGAIN) {
-
- /* there was error while a request line parsing */
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- ngx_http_client_errors[rc - NGX_HTTP_CLIENT_ERROR]);
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return;
- }
-
- /* NGX_AGAIN: a request line parsing is still incomplete */
-
- if (r->header_in->pos == r->header_in->end) {
-
- rv = ngx_http_alloc_large_header_buffer(r, 1);
-
- if (rv == NGX_ERROR) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- if (rv == NGX_DECLINED) {
- r->request_line.len = r->header_in->end - r->request_start;
- r->request_line.data = r->request_start;
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent too long URI");
- ngx_http_finalize_request(r, NGX_HTTP_REQUEST_URI_TOO_LARGE);
- return;
- }
- }
- }
-}
-
-
-ngx_int_t
-ngx_http_process_request_uri(ngx_http_request_t *r)
-{
- ngx_http_core_srv_conf_t *cscf;
-
- if (r->args_start) {
- r->uri.len = r->args_start - 1 - r->uri_start;
- } else {
- r->uri.len = r->uri_end - r->uri_start;
- }
-
- if (r->complex_uri || r->quoted_uri) {
-
- r->uri.data = ngx_pnalloc(r->pool, r->uri.len + 1);
- if (r->uri.data == NULL) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_ERROR;
- }
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- if (ngx_http_parse_complex_uri(r, cscf->merge_slashes) != NGX_OK) {
- r->uri.len = 0;
-
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent invalid request");
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return NGX_ERROR;
- }
-
- } else {
- r->uri.data = r->uri_start;
- }
-
- r->unparsed_uri.len = r->uri_end - r->uri_start;
- r->unparsed_uri.data = r->uri_start;
-
- r->valid_unparsed_uri = r->space_in_uri ? 0 : 1;
-
- if (r->uri_ext) {
- if (r->args_start) {
- r->exten.len = r->args_start - 1 - r->uri_ext;
- } else {
- r->exten.len = r->uri_end - r->uri_ext;
- }
-
- r->exten.data = r->uri_ext;
- }
-
- if (r->args_start && r->uri_end > r->args_start) {
- r->args.len = r->uri_end - r->args_start;
- r->args.data = r->args_start;
- }
-
-#if (NGX_WIN32)
- {
- u_char *p, *last;
-
- p = r->uri.data;
- last = r->uri.data + r->uri.len;
-
- while (p < last) {
-
- if (*p++ == ':') {
-
- /*
- * this check covers "::$data", "::$index_allocation" and
- * ":$i30:$index_allocation"
- */
-
- if (p < last && *p == '$') {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent unsafe win32 URI");
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return NGX_ERROR;
- }
- }
- }
-
- p = r->uri.data + r->uri.len - 1;
-
- while (p > r->uri.data) {
-
- if (*p == ' ') {
- p--;
- continue;
- }
-
- if (*p == '.') {
- p--;
- continue;
- }
-
- break;
- }
-
- if (p != r->uri.data + r->uri.len - 1) {
- r->uri.len = p + 1 - r->uri.data;
- ngx_http_set_exten(r);
- }
-
- }
-#endif
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http uri: \"%V\"", &r->uri);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http args: \"%V\"", &r->args);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http exten: \"%V\"", &r->exten);
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_process_request_headers(ngx_event_t *rev)
-{
- u_char *p;
- size_t len;
- ssize_t n;
- ngx_int_t rc, rv;
- ngx_table_elt_t *h;
- ngx_connection_t *c;
- ngx_http_header_t *hh;
- ngx_http_request_t *r;
- ngx_http_core_srv_conf_t *cscf;
- ngx_http_core_main_conf_t *cmcf;
-
- c = rev->data;
- r = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0,
- "http process request header line");
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- c->timedout = 1;
- ngx_http_close_request(r, NGX_HTTP_REQUEST_TIME_OUT);
- return;
- }
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- rc = NGX_AGAIN;
-
- for ( ;; ) {
-
- if (rc == NGX_AGAIN) {
-
- if (r->header_in->pos == r->header_in->end) {
-
- rv = ngx_http_alloc_large_header_buffer(r, 0);
-
- if (rv == NGX_ERROR) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- if (rv == NGX_DECLINED) {
- p = r->header_name_start;
-
- r->lingering_close = 1;
-
- if (p == NULL) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent too large request");
- ngx_http_finalize_request(r,
- NGX_HTTP_REQUEST_HEADER_TOO_LARGE);
- return;
- }
-
- len = r->header_in->end - p;
-
- if (len > NGX_MAX_ERROR_STR - 300) {
- len = NGX_MAX_ERROR_STR - 300;
- p[len++] = '.'; p[len++] = '.'; p[len++] = '.';
- }
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent too long header line: \"%*s\"",
- len, r->header_name_start);
-
- ngx_http_finalize_request(r,
- NGX_HTTP_REQUEST_HEADER_TOO_LARGE);
- return;
- }
- }
-
- n = ngx_http_read_request_header(r);
-
- if (n == NGX_AGAIN || n == NGX_ERROR) {
- return;
- }
- }
-
- /* the host header could change the server configuration context */
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- rc = ngx_http_parse_header_line(r, r->header_in,
- cscf->underscores_in_headers);
-
- if (rc == NGX_OK) {
-
- r->request_length += r->header_in->pos - r->header_name_start;
-
- if (r->invalid_header && cscf->ignore_invalid_headers) {
-
- /* there was error while a header line parsing */
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid header line: \"%*s\"",
- r->header_end - r->header_name_start,
- r->header_name_start);
- continue;
- }
-
- /* a header line has been parsed successfully */
-
- h = ngx_list_push(&r->headers_in.headers);
- if (h == NULL) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- h->hash = r->header_hash;
-
- h->key.len = r->header_name_end - r->header_name_start;
- h->key.data = r->header_name_start;
- h->key.data[h->key.len] = '\0';
-
- h->value.len = r->header_end - r->header_start;
- h->value.data = r->header_start;
- h->value.data[h->value.len] = '\0';
-
- h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);
- if (h->lowcase_key == NULL) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- if (h->key.len == r->lowcase_index) {
- ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);
-
- } else {
- ngx_strlow(h->lowcase_key, h->key.data, h->key.len);
- }
-
- hh = ngx_hash_find(&cmcf->headers_in_hash, h->hash,
- h->lowcase_key, h->key.len);
-
- if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {
- return;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http header: \"%V: %V\"",
- &h->key, &h->value);
-
- continue;
- }
-
- if (rc == NGX_HTTP_PARSE_HEADER_DONE) {
-
- /* a whole header has been parsed successfully */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http header done");
-
- r->request_length += r->header_in->pos - r->header_name_start;
-
- r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE;
-
- rc = ngx_http_process_request_header(r);
-
- if (rc != NGX_OK) {
- return;
- }
-
- ngx_http_process_request(r);
-
- return;
- }
-
- if (rc == NGX_AGAIN) {
-
- /* a header line parsing is still not complete */
-
- continue;
- }
-
- /* rc == NGX_HTTP_PARSE_INVALID_HEADER: "\r" is not followed by "\n" */
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid header line: \"%*s\\r...\"",
- r->header_end - r->header_name_start,
- r->header_name_start);
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return;
- }
-}
-
-
-static ssize_t
-ngx_http_read_request_header(ngx_http_request_t *r)
-{
- ssize_t n;
- ngx_event_t *rev;
- ngx_connection_t *c;
- ngx_http_core_srv_conf_t *cscf;
-
- c = r->connection;
- rev = c->read;
-
- n = r->header_in->last - r->header_in->pos;
-
- if (n > 0) {
- return n;
- }
-
- if (rev->ready) {
- n = c->recv(c, r->header_in->last,
- r->header_in->end - r->header_in->last);
- } else {
- n = NGX_AGAIN;
- }
-
- if (n == NGX_AGAIN) {
- if (!rev->timer_set) {
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
- ngx_add_timer(rev, cscf->client_header_timeout);
- }
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_ERROR;
- }
-
- return NGX_AGAIN;
- }
-
- if (n == 0) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client prematurely closed connection");
- }
-
- if (n == 0 || n == NGX_ERROR) {
- c->error = 1;
- c->log->action = "reading client request headers";
-
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return NGX_ERROR;
- }
-
- r->header_in->last += n;
-
- return n;
-}
-
-
-static ngx_int_t
-ngx_http_alloc_large_header_buffer(ngx_http_request_t *r,
- ngx_uint_t request_line)
-{
- u_char *old, *new;
- ngx_buf_t *b;
- ngx_http_connection_t *hc;
- ngx_http_core_srv_conf_t *cscf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http alloc large header buffer");
-
- if (request_line && r->state == 0) {
-
- /* the client fills up the buffer with "\r\n" */
-
- r->header_in->pos = r->header_in->start;
- r->header_in->last = r->header_in->start;
-
- return NGX_OK;
- }
-
- old = request_line ? r->request_start : r->header_name_start;
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- if (r->state != 0
- && (size_t) (r->header_in->pos - old)
- >= cscf->large_client_header_buffers.size)
- {
- return NGX_DECLINED;
- }
-
- hc = r->http_connection;
-
- if (hc->nfree) {
- b = hc->free[--hc->nfree];
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http large header free: %p %uz",
- b->pos, b->end - b->last);
-
- } else if (hc->nbusy < cscf->large_client_header_buffers.num) {
-
- if (hc->busy == NULL) {
- hc->busy = ngx_palloc(r->connection->pool,
- cscf->large_client_header_buffers.num * sizeof(ngx_buf_t *));
- if (hc->busy == NULL) {
- return NGX_ERROR;
- }
- }
-
- b = ngx_create_temp_buf(r->connection->pool,
- cscf->large_client_header_buffers.size);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http large header alloc: %p %uz",
- b->pos, b->end - b->last);
-
- } else {
- return NGX_DECLINED;
- }
-
- hc->busy[hc->nbusy++] = b;
-
- if (r->state == 0) {
- /*
- * r->state == 0 means that a header line was parsed successfully
- * and we do not need to copy incomplete header line and
- * to relocate the parser header pointers
- */
-
- r->header_in = b;
-
- return NGX_OK;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http large header copy: %d", r->header_in->pos - old);
-
- new = b->start;
-
- ngx_memcpy(new, old, r->header_in->pos - old);
-
- b->pos = new + (r->header_in->pos - old);
- b->last = new + (r->header_in->pos - old);
-
- if (request_line) {
- r->request_start = new;
-
- if (r->request_end) {
- r->request_end = new + (r->request_end - old);
- }
-
- r->method_end = new + (r->method_end - old);
-
- r->uri_start = new + (r->uri_start - old);
- r->uri_end = new + (r->uri_end - old);
-
- if (r->schema_start) {
- r->schema_start = new + (r->schema_start - old);
- r->schema_end = new + (r->schema_end - old);
- }
-
- if (r->host_start) {
- r->host_start = new + (r->host_start - old);
- if (r->host_end) {
- r->host_end = new + (r->host_end - old);
- }
- }
-
- if (r->port_start) {
- r->port_start = new + (r->port_start - old);
- r->port_end = new + (r->port_end - old);
- }
-
- if (r->uri_ext) {
- r->uri_ext = new + (r->uri_ext - old);
- }
-
- if (r->args_start) {
- r->args_start = new + (r->args_start - old);
- }
-
- if (r->http_protocol.data) {
- r->http_protocol.data = new + (r->http_protocol.data - old);
- }
-
- } else {
- r->header_name_start = new;
- r->header_name_end = new + (r->header_name_end - old);
- r->header_start = new + (r->header_start - old);
- r->header_end = new + (r->header_end - old);
- }
-
- r->header_in = b;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_process_header_line(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_table_elt_t **ph;
-
- ph = (ngx_table_elt_t **) ((char *) &r->headers_in + offset);
-
- if (*ph == NULL) {
- *ph = h;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_process_unique_header_line(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_table_elt_t **ph;
-
- ph = (ngx_table_elt_t **) ((char *) &r->headers_in + offset);
-
- if (*ph == NULL) {
- *ph = h;
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent duplicate header line: \"%V: %V\", "
- "previous value: \"%V: %V\"",
- &h->key, &h->value, &(*ph)->key, &(*ph)->value);
-
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_process_host(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_int_t rc;
- ngx_str_t host;
-
- if (r->headers_in.host == NULL) {
- r->headers_in.host = h;
- }
-
- host = h->value;
-
- rc = ngx_http_validate_host(&host, r->pool, 0);
-
- if (rc == NGX_DECLINED) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent invalid host header");
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return NGX_ERROR;
- }
-
- if (rc == NGX_ERROR) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_ERROR;
- }
-
- if (r->headers_in.server.len) {
- return NGX_OK;
- }
-
- if (ngx_http_set_virtual_server(r, &host) == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- r->headers_in.server = host;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_process_connection(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- if (ngx_strcasestrn(h->value.data, "close", 5 - 1)) {
- r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE;
-
- } else if (ngx_strcasestrn(h->value.data, "keep-alive", 10 - 1)) {
- r->headers_in.connection_type = NGX_HTTP_CONNECTION_KEEP_ALIVE;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_process_user_agent(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- u_char *user_agent, *msie;
-
- if (r->headers_in.user_agent) {
- return NGX_OK;
- }
-
- r->headers_in.user_agent = h;
-
- /* check some widespread browsers while the header is in CPU cache */
-
- user_agent = h->value.data;
-
- msie = ngx_strstrn(user_agent, "MSIE ", 5 - 1);
-
- if (msie && msie + 7 < user_agent + h->value.len) {
-
- r->headers_in.msie = 1;
-
- if (msie[6] == '.') {
-
- switch (msie[5]) {
- case '4':
- case '5':
- r->headers_in.msie6 = 1;
- break;
- case '6':
- if (ngx_strstrn(msie + 8, "SV1", 3 - 1) == NULL) {
- r->headers_in.msie6 = 1;
- }
- break;
- }
- }
-
-#if 0
- /* MSIE ignores the SSL "close notify" alert */
- if (c->ssl) {
- c->ssl->no_send_shutdown = 1;
- }
-#endif
- }
-
- if (ngx_strstrn(user_agent, "Opera", 5 - 1)) {
- r->headers_in.opera = 1;
- r->headers_in.msie = 0;
- r->headers_in.msie6 = 0;
- }
-
- if (!r->headers_in.msie && !r->headers_in.opera) {
-
- if (ngx_strstrn(user_agent, "Gecko/", 6 - 1)) {
- r->headers_in.gecko = 1;
-
- } else if (ngx_strstrn(user_agent, "Chrome/", 7 - 1)) {
- r->headers_in.chrome = 1;
-
- } else if (ngx_strstrn(user_agent, "Safari/", 7 - 1)
- && ngx_strstrn(user_agent, "Mac OS X", 8 - 1))
- {
- r->headers_in.safari = 1;
-
- } else if (ngx_strstrn(user_agent, "Konqueror", 9 - 1)) {
- r->headers_in.konqueror = 1;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_process_multi_header_lines(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_array_t *headers;
- ngx_table_elt_t **ph;
-
- headers = (ngx_array_t *) ((char *) &r->headers_in + offset);
-
- if (headers->elts == NULL) {
- if (ngx_array_init(headers, r->pool, 1, sizeof(ngx_table_elt_t *))
- != NGX_OK)
- {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_ERROR;
- }
- }
-
- ph = ngx_array_push(headers);
- if (ph == NULL) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_ERROR;
- }
-
- *ph = h;
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_process_request_header(ngx_http_request_t *r)
-{
- if (r->headers_in.server.len == 0
- && ngx_http_set_virtual_server(r, &r->headers_in.server)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
-
- if (r->headers_in.host == NULL && r->http_version > NGX_HTTP_VERSION_10) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent HTTP/1.1 request without \"Host\" header");
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return NGX_ERROR;
- }
-
- if (r->headers_in.content_length) {
- r->headers_in.content_length_n =
- ngx_atoof(r->headers_in.content_length->value.data,
- r->headers_in.content_length->value.len);
-
- if (r->headers_in.content_length_n == NGX_ERROR) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent invalid \"Content-Length\" header");
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return NGX_ERROR;
- }
- }
-
- if (r->method & NGX_HTTP_TRACE) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent TRACE method");
- ngx_http_finalize_request(r, NGX_HTTP_NOT_ALLOWED);
- return NGX_ERROR;
- }
-
- if (r->headers_in.transfer_encoding) {
- if (r->headers_in.transfer_encoding->value.len == 7
- && ngx_strncasecmp(r->headers_in.transfer_encoding->value.data,
- (u_char *) "chunked", 7) == 0)
- {
- r->headers_in.content_length = NULL;
- r->headers_in.content_length_n = -1;
- r->headers_in.chunked = 1;
-
- } else if (r->headers_in.transfer_encoding->value.len != 8
- || ngx_strncasecmp(r->headers_in.transfer_encoding->value.data,
- (u_char *) "identity", 8) != 0)
- {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent unknown \"Transfer-Encoding\": \"%V\"",
- &r->headers_in.transfer_encoding->value);
- ngx_http_finalize_request(r, NGX_HTTP_NOT_IMPLEMENTED);
- return NGX_ERROR;
- }
- }
-
- if (r->headers_in.connection_type == NGX_HTTP_CONNECTION_KEEP_ALIVE) {
- if (r->headers_in.keep_alive) {
- r->headers_in.keep_alive_n =
- ngx_atotm(r->headers_in.keep_alive->value.data,
- r->headers_in.keep_alive->value.len);
- }
- }
-
- return NGX_OK;
-}
-
-
-void
-ngx_http_process_request(ngx_http_request_t *r)
-{
- ngx_connection_t *c;
-
- c = r->connection;
-
-#if (NGX_HTTP_SSL)
-
- if (r->http_connection->ssl) {
- long rc;
- X509 *cert;
- ngx_http_ssl_srv_conf_t *sscf;
-
- if (c->ssl == NULL) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent plain HTTP request to HTTPS port");
- ngx_http_finalize_request(r, NGX_HTTP_TO_HTTPS);
- return;
- }
-
- sscf = ngx_http_get_module_srv_conf(r, ngx_http_ssl_module);
-
- if (sscf->verify) {
- rc = SSL_get_verify_result(c->ssl->connection);
-
- if (rc != X509_V_OK
- && (sscf->verify != 3 || !ngx_ssl_verify_error_optional(rc)))
- {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client SSL certificate verify error: (%l:%s)",
- rc, X509_verify_cert_error_string(rc));
-
- ngx_ssl_remove_cached_session(sscf->ssl.ctx,
- (SSL_get0_session(c->ssl->connection)));
-
- ngx_http_finalize_request(r, NGX_HTTPS_CERT_ERROR);
- return;
- }
-
- if (sscf->verify == 1) {
- cert = SSL_get_peer_certificate(c->ssl->connection);
-
- if (cert == NULL) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent no required SSL certificate");
-
- ngx_ssl_remove_cached_session(sscf->ssl.ctx,
- (SSL_get0_session(c->ssl->connection)));
-
- ngx_http_finalize_request(r, NGX_HTTPS_NO_CERT);
- return;
- }
-
- X509_free(cert);
- }
- }
- }
-
-#endif
-
- if (c->read->timer_set) {
- ngx_del_timer(c->read);
- }
-
-#if (NGX_STAT_STUB)
- (void) ngx_atomic_fetch_add(ngx_stat_reading, -1);
- r->stat_reading = 0;
- (void) ngx_atomic_fetch_add(ngx_stat_writing, 1);
- r->stat_writing = 1;
-#endif
-
- c->read->handler = ngx_http_request_handler;
- c->write->handler = ngx_http_request_handler;
- r->read_event_handler = ngx_http_block_reading;
-
- ngx_http_handler(r);
-
- ngx_http_run_posted_requests(c);
-}
-
-
-static ngx_int_t
-ngx_http_validate_host(ngx_str_t *host, ngx_pool_t *pool, ngx_uint_t alloc)
-{
- u_char *h, ch;
- size_t i, dot_pos, host_len;
-
- enum {
- sw_usual = 0,
- sw_literal,
- sw_rest
- } state;
-
- dot_pos = host->len;
- host_len = host->len;
-
- h = host->data;
-
- state = sw_usual;
-
- for (i = 0; i < host->len; i++) {
- ch = h[i];
-
- switch (ch) {
-
- case '.':
- if (dot_pos == i - 1) {
- return NGX_DECLINED;
- }
- dot_pos = i;
- break;
-
- case ':':
- if (state == sw_usual) {
- host_len = i;
- state = sw_rest;
- }
- break;
-
- case '[':
- if (i == 0) {
- state = sw_literal;
- }
- break;
-
- case ']':
- if (state == sw_literal) {
- host_len = i + 1;
- state = sw_rest;
- }
- break;
-
- case '\0':
- return NGX_DECLINED;
-
- default:
-
- if (ngx_path_separator(ch)) {
- return NGX_DECLINED;
- }
-
- if (ch >= 'A' && ch <= 'Z') {
- alloc = 1;
- }
-
- break;
- }
- }
-
- if (dot_pos == host_len - 1) {
- host_len--;
- }
-
- if (host_len == 0) {
- return NGX_DECLINED;
- }
-
- if (alloc) {
- host->data = ngx_pnalloc(pool, host_len);
- if (host->data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_strlow(host->data, h, host_len);
- }
-
- host->len = host_len;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_set_virtual_server(ngx_http_request_t *r, ngx_str_t *host)
-{
- ngx_int_t rc;
- ngx_http_connection_t *hc;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t *cscf;
-
-#if (NGX_SUPPRESS_WARN)
- cscf = NULL;
-#endif
-
- hc = r->http_connection;
-
-#if (NGX_HTTP_SSL && defined SSL_CTRL_SET_TLSEXT_HOSTNAME)
-
- if (hc->ssl_servername) {
- if (hc->ssl_servername->len == host->len
- && ngx_strncmp(hc->ssl_servername->data,
- host->data, host->len) == 0)
- {
-#if (NGX_PCRE)
- if (hc->ssl_servername_regex
- && ngx_http_regex_exec(r, hc->ssl_servername_regex,
- hc->ssl_servername) != NGX_OK)
- {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_ERROR;
- }
-#endif
- return NGX_OK;
- }
- }
-
-#endif
-
- rc = ngx_http_find_virtual_server(r->connection,
- hc->addr_conf->virtual_names,
- host, r, &cscf);
-
- if (rc == NGX_ERROR) {
- ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_ERROR;
- }
-
-#if (NGX_HTTP_SSL && defined SSL_CTRL_SET_TLSEXT_HOSTNAME)
-
- if (hc->ssl_servername) {
- ngx_http_ssl_srv_conf_t *sscf;
-
- if (rc == NGX_DECLINED) {
- cscf = hc->addr_conf->default_server;
- rc = NGX_OK;
- }
-
- sscf = ngx_http_get_module_srv_conf(cscf->ctx, ngx_http_ssl_module);
-
- if (sscf->verify) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client attempted to request the server name "
- "different from that one was negotiated");
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return NGX_ERROR;
- }
- }
-
-#endif
-
- if (rc == NGX_DECLINED) {
- return NGX_OK;
- }
-
- r->srv_conf = cscf->ctx->srv_conf;
- r->loc_conf = cscf->ctx->loc_conf;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ngx_http_set_connection_log(r->connection, clcf->error_log);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_find_virtual_server(ngx_connection_t *c,
- ngx_http_virtual_names_t *virtual_names, ngx_str_t *host,
- ngx_http_request_t *r, ngx_http_core_srv_conf_t **cscfp)
-{
- ngx_http_core_srv_conf_t *cscf;
-
- if (virtual_names == NULL) {
- return NGX_DECLINED;
- }
-
- cscf = ngx_hash_find_combined(&virtual_names->names,
- ngx_hash_key(host->data, host->len),
- host->data, host->len);
-
- if (cscf) {
- *cscfp = cscf;
- return NGX_OK;
- }
-
-#if (NGX_PCRE)
-
- if (host->len && virtual_names->nregex) {
- ngx_int_t n;
- ngx_uint_t i;
- ngx_http_server_name_t *sn;
-
- sn = virtual_names->regex;
-
-#if (NGX_HTTP_SSL && defined SSL_CTRL_SET_TLSEXT_HOSTNAME)
-
- if (r == NULL) {
- ngx_http_connection_t *hc;
-
- for (i = 0; i < virtual_names->nregex; i++) {
-
- n = ngx_regex_exec(sn[i].regex->regex, host, NULL, 0);
-
- if (n == NGX_REGEX_NO_MATCHED) {
- continue;
- }
-
- if (n >= 0) {
- hc = c->data;
- hc->ssl_servername_regex = sn[i].regex;
-
- *cscfp = sn[i].server;
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- ngx_regex_exec_n " failed: %i "
- "on \"%V\" using \"%V\"",
- n, host, &sn[i].regex->name);
-
- return NGX_ERROR;
- }
-
- return NGX_DECLINED;
- }
-
-#endif /* NGX_HTTP_SSL && defined SSL_CTRL_SET_TLSEXT_HOSTNAME */
-
- for (i = 0; i < virtual_names->nregex; i++) {
-
- n = ngx_http_regex_exec(r, sn[i].regex, host);
-
- if (n == NGX_DECLINED) {
- continue;
- }
-
- if (n == NGX_OK) {
- *cscfp = sn[i].server;
- return NGX_OK;
- }
-
- return NGX_ERROR;
- }
- }
-
-#endif /* NGX_PCRE */
-
- return NGX_DECLINED;
-}
-
-
-static void
-ngx_http_request_handler(ngx_event_t *ev)
-{
- ngx_connection_t *c;
- ngx_http_request_t *r;
- ngx_http_log_ctx_t *ctx;
-
- c = ev->data;
- r = c->data;
-
- ctx = c->log->data;
- ctx->current_request = r;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http run request: \"%V?%V\"", &r->uri, &r->args);
-
- if (ev->write) {
- r->write_event_handler(r);
-
- } else {
- r->read_event_handler(r);
- }
-
- ngx_http_run_posted_requests(c);
-}
-
-
-void
-ngx_http_run_posted_requests(ngx_connection_t *c)
-{
- ngx_http_request_t *r;
- ngx_http_log_ctx_t *ctx;
- ngx_http_posted_request_t *pr;
-
- for ( ;; ) {
-
- if (c->destroyed) {
- return;
- }
-
- r = c->data;
- pr = r->main->posted_requests;
-
- if (pr == NULL) {
- return;
- }
-
- r->main->posted_requests = pr->next;
-
- r = pr->request;
-
- ctx = c->log->data;
- ctx->current_request = r;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http posted request: \"%V?%V\"", &r->uri, &r->args);
-
- r->write_event_handler(r);
- }
-}
-
-
-ngx_int_t
-ngx_http_post_request(ngx_http_request_t *r, ngx_http_posted_request_t *pr)
-{
- ngx_http_posted_request_t **p;
-
- if (pr == NULL) {
- pr = ngx_palloc(r->pool, sizeof(ngx_http_posted_request_t));
- if (pr == NULL) {
- return NGX_ERROR;
- }
- }
-
- pr->request = r;
- pr->next = NULL;
-
- for (p = &r->main->posted_requests; *p; p = &(*p)->next) { /* void */ }
-
- *p = pr;
-
- return NGX_OK;
-}
-
-
-void
-ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
-{
- ngx_connection_t *c;
- ngx_http_request_t *pr;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->connection;
-
- ngx_log_debug5(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http finalize request: %d, \"%V?%V\" a:%d, c:%d",
- rc, &r->uri, &r->args, r == c->data, r->main->count);
-
- if (rc == NGX_DONE) {
- ngx_http_finalize_connection(r);
- return;
- }
-
- if (rc == NGX_OK && r->filter_finalize) {
- c->error = 1;
- }
-
- if (rc == NGX_DECLINED) {
- r->content_handler = NULL;
- r->write_event_handler = ngx_http_core_run_phases;
- ngx_http_core_run_phases(r);
- return;
- }
-
- if (r != r->main && r->post_subrequest) {
- rc = r->post_subrequest->handler(r, r->post_subrequest->data, rc);
- }
-
- if (rc == NGX_ERROR
- || rc == NGX_HTTP_REQUEST_TIME_OUT
- || rc == NGX_HTTP_CLIENT_CLOSED_REQUEST
- || c->error)
- {
- if (ngx_http_post_action(r) == NGX_OK) {
- return;
- }
-
- if (r->main->blocked) {
- r->write_event_handler = ngx_http_request_finalizer;
- }
-
- ngx_http_terminate_request(r, rc);
- return;
- }
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE
- || rc == NGX_HTTP_CREATED
- || rc == NGX_HTTP_NO_CONTENT)
- {
- if (rc == NGX_HTTP_CLOSE) {
- ngx_http_terminate_request(r, rc);
- return;
- }
-
- if (r == r->main) {
- if (c->read->timer_set) {
- ngx_del_timer(c->read);
- }
-
- if (c->write->timer_set) {
- ngx_del_timer(c->write);
- }
- }
-
- c->read->handler = ngx_http_request_handler;
- c->write->handler = ngx_http_request_handler;
-
- ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));
- return;
- }
-
- if (r != r->main) {
-
- if (r->buffered || r->postponed) {
-
- if (ngx_http_set_write_handler(r) != NGX_OK) {
- ngx_http_terminate_request(r, 0);
- }
-
- return;
- }
-
- pr = r->parent;
-
- if (r == c->data) {
-
- r->main->count--;
- r->main->subrequests++;
-
- if (!r->logged) {
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->log_subrequest) {
- ngx_http_log_request(r);
- }
-
- r->logged = 1;
-
- } else {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "subrequest: \"%V?%V\" logged again",
- &r->uri, &r->args);
- }
-
- r->done = 1;
-
- if (pr->postponed && pr->postponed->request == r) {
- pr->postponed = pr->postponed->next;
- }
-
- c->data = pr;
-
- } else {
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http finalize non-active request: \"%V?%V\"",
- &r->uri, &r->args);
-
- r->write_event_handler = ngx_http_request_finalizer;
-
- if (r->waited) {
- r->done = 1;
- }
- }
-
- if (ngx_http_post_request(pr, NULL) != NGX_OK) {
- r->main->count++;
- ngx_http_terminate_request(r, 0);
- return;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http wake parent request: \"%V?%V\"",
- &pr->uri, &pr->args);
-
- return;
- }
-
- if (r->buffered || c->buffered || r->postponed || r->blocked) {
-
- if (ngx_http_set_write_handler(r) != NGX_OK) {
- ngx_http_terminate_request(r, 0);
- }
-
- return;
- }
-
- if (r != c->data) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "http finalize non-active request: \"%V?%V\"",
- &r->uri, &r->args);
- return;
- }
-
- r->done = 1;
- r->write_event_handler = ngx_http_request_empty_handler;
-
- if (!r->post_action) {
- r->request_complete = 1;
- }
-
- if (ngx_http_post_action(r) == NGX_OK) {
- return;
- }
-
- if (c->read->timer_set) {
- ngx_del_timer(c->read);
- }
-
- if (c->write->timer_set) {
- c->write->delayed = 0;
- ngx_del_timer(c->write);
- }
-
- if (c->read->eof) {
- ngx_http_close_request(r, 0);
- return;
- }
-
- ngx_http_finalize_connection(r);
-}
-
-
-static void
-ngx_http_terminate_request(ngx_http_request_t *r, ngx_int_t rc)
-{
- ngx_http_cleanup_t *cln;
- ngx_http_request_t *mr;
- ngx_http_ephemeral_t *e;
-
- mr = r->main;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http terminate request count:%d", mr->count);
-
- if (rc > 0 && (mr->headers_out.status == 0 || mr->connection->sent == 0)) {
- mr->headers_out.status = rc;
- }
-
- cln = mr->cleanup;
- mr->cleanup = NULL;
-
- while (cln) {
- if (cln->handler) {
- cln->handler(cln->data);
- }
-
- cln = cln->next;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http terminate cleanup count:%d blk:%d",
- mr->count, mr->blocked);
-
- if (mr->write_event_handler) {
-
- if (mr->blocked) {
- return;
- }
-
- e = ngx_http_ephemeral(mr);
- mr->posted_requests = NULL;
- mr->write_event_handler = ngx_http_terminate_handler;
- (void) ngx_http_post_request(mr, &e->terminal_posted_request);
- return;
- }
-
- ngx_http_close_request(mr, rc);
-}
-
-
-static void
-ngx_http_terminate_handler(ngx_http_request_t *r)
-{
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http terminate handler count:%d", r->count);
-
- r->count = 1;
-
- ngx_http_close_request(r, 0);
-}
-
-
-static void
-ngx_http_finalize_connection(ngx_http_request_t *r)
-{
- ngx_http_core_loc_conf_t *clcf;
-
-#if (NGX_HTTP_SPDY)
- if (r->spdy_stream) {
- ngx_http_close_request(r, 0);
- return;
- }
-#endif
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (r->main->count != 1) {
-
- if (r->discard_body) {
- r->read_event_handler = ngx_http_discarded_request_body_handler;
- ngx_add_timer(r->connection->read, clcf->lingering_timeout);
-
- if (r->lingering_time == 0) {
- r->lingering_time = ngx_time()
- + (time_t) (clcf->lingering_time / 1000);
- }
- }
-
- ngx_http_close_request(r, 0);
- return;
- }
-
- if (!ngx_terminate
- && !ngx_exiting
- && r->keepalive
- && clcf->keepalive_timeout > 0)
- {
- ngx_http_set_keepalive(r);
- return;
- }
-
- if (clcf->lingering_close == NGX_HTTP_LINGERING_ALWAYS
- || (clcf->lingering_close == NGX_HTTP_LINGERING_ON
- && (r->lingering_close
- || r->header_in->pos < r->header_in->last
- || r->connection->read->ready)))
- {
- ngx_http_set_lingering_close(r);
- return;
- }
-
- ngx_http_close_request(r, 0);
-}
-
-
-static ngx_int_t
-ngx_http_set_write_handler(ngx_http_request_t *r)
-{
- ngx_event_t *wev;
- ngx_http_core_loc_conf_t *clcf;
-
- r->http_state = NGX_HTTP_WRITING_REQUEST_STATE;
-
- r->read_event_handler = r->discard_body ?
- ngx_http_discarded_request_body_handler:
- ngx_http_test_reading;
- r->write_event_handler = ngx_http_writer;
-
-#if (NGX_HTTP_SPDY)
- if (r->spdy_stream) {
- return NGX_OK;
- }
-#endif
-
- wev = r->connection->write;
-
- if (wev->ready && wev->delayed) {
- return NGX_OK;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- if (!wev->delayed) {
- ngx_add_timer(wev, clcf->send_timeout);
- }
-
- if (ngx_handle_write_event(wev, clcf->send_lowat) != NGX_OK) {
- ngx_http_close_request(r, 0);
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_writer(ngx_http_request_t *r)
-{
- int rc;
- ngx_event_t *wev;
- ngx_connection_t *c;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->connection;
- wev = c->write;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, wev->log, 0,
- "http writer handler: \"%V?%V\"", &r->uri, &r->args);
-
- clcf = ngx_http_get_module_loc_conf(r->main, ngx_http_core_module);
-
- if (wev->timedout) {
- if (!wev->delayed) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
- "client timed out");
- c->timedout = 1;
-
- ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT);
- return;
- }
-
- wev->timedout = 0;
- wev->delayed = 0;
-
- if (!wev->ready) {
- ngx_add_timer(wev, clcf->send_timeout);
-
- if (ngx_handle_write_event(wev, clcf->send_lowat) != NGX_OK) {
- ngx_http_close_request(r, 0);
- }
-
- return;
- }
-
- }
-
- if (wev->delayed || r->aio) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, wev->log, 0,
- "http writer delayed");
-
- if (ngx_handle_write_event(wev, clcf->send_lowat) != NGX_OK) {
- ngx_http_close_request(r, 0);
- }
-
- return;
- }
-
- rc = ngx_http_output_filter(r, NULL);
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http writer output filter: %d, \"%V?%V\"",
- rc, &r->uri, &r->args);
-
- if (rc == NGX_ERROR) {
- ngx_http_finalize_request(r, rc);
- return;
- }
-
- if (r->buffered || r->postponed || (r == r->main && c->buffered)) {
-
-#if (NGX_HTTP_SPDY)
- if (r->spdy_stream) {
- return;
- }
-#endif
-
- if (!wev->delayed) {
- ngx_add_timer(wev, clcf->send_timeout);
- }
-
- if (ngx_handle_write_event(wev, clcf->send_lowat) != NGX_OK) {
- ngx_http_close_request(r, 0);
- }
-
- return;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, wev->log, 0,
- "http writer done: \"%V?%V\"", &r->uri, &r->args);
-
- r->write_event_handler = ngx_http_request_empty_handler;
-
- ngx_http_finalize_request(r, rc);
-}
-
-
-static void
-ngx_http_request_finalizer(ngx_http_request_t *r)
-{
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http finalizer done: \"%V?%V\"", &r->uri, &r->args);
-
- ngx_http_finalize_request(r, 0);
-}
-
-
-void
-ngx_http_block_reading(ngx_http_request_t *r)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http reading blocked");
-
- /* aio does not call this handler */
-
- if ((ngx_event_flags & NGX_USE_LEVEL_EVENT)
- && r->connection->read->active)
- {
- if (ngx_del_event(r->connection->read, NGX_READ_EVENT, 0) != NGX_OK) {
- ngx_http_close_request(r, 0);
- }
- }
-}
-
-
-void
-ngx_http_test_reading(ngx_http_request_t *r)
-{
- int n;
- char buf[1];
- ngx_err_t err;
- ngx_event_t *rev;
- ngx_connection_t *c;
-
- c = r->connection;
- rev = c->read;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http test reading");
-
-#if (NGX_HTTP_SPDY)
-
- if (r->spdy_stream) {
- if (c->error) {
- err = 0;
- goto closed;
- }
-
- return;
- }
-
-#endif
-
-#if (NGX_HAVE_KQUEUE)
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
-
- if (!rev->pending_eof) {
- return;
- }
-
- rev->eof = 1;
- c->error = 1;
- err = rev->kq_errno;
-
- goto closed;
- }
-
-#endif
-
-#if (NGX_HAVE_EPOLLRDHUP)
-
- if ((ngx_event_flags & NGX_USE_EPOLL_EVENT) && rev->pending_eof) {
- socklen_t len;
-
- rev->eof = 1;
- c->error = 1;
-
- err = 0;
- len = sizeof(ngx_err_t);
-
- /*
- * BSDs and Linux return 0 and set a pending error in err
- * Solaris returns -1 and sets errno
- */
-
- if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len)
- == -1)
- {
- err = ngx_socket_errno;
- }
-
- goto closed;
- }
-
-#endif
-
- n = recv(c->fd, buf, 1, MSG_PEEK);
-
- if (n == 0) {
- rev->eof = 1;
- c->error = 1;
- err = 0;
-
- goto closed;
-
- } else if (n == -1) {
- err = ngx_socket_errno;
-
- if (err != NGX_EAGAIN) {
- rev->eof = 1;
- c->error = 1;
-
- goto closed;
- }
- }
-
- /* aio does not call this handler */
-
- if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) && rev->active) {
-
- if (ngx_del_event(rev, NGX_READ_EVENT, 0) != NGX_OK) {
- ngx_http_close_request(r, 0);
- }
- }
-
- return;
-
-closed:
-
- if (err) {
- rev->error = 1;
- }
-
- ngx_log_error(NGX_LOG_INFO, c->log, err,
- "client prematurely closed connection");
-
- ngx_http_finalize_request(r, NGX_HTTP_CLIENT_CLOSED_REQUEST);
-}
-
-
-static void
-ngx_http_set_keepalive(ngx_http_request_t *r)
-{
- int tcp_nodelay;
- ngx_int_t i;
- ngx_buf_t *b, *f;
- ngx_event_t *rev, *wev;
- ngx_connection_t *c;
- ngx_http_connection_t *hc;
- ngx_http_core_srv_conf_t *cscf;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->connection;
- rev = c->read;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "set http keepalive handler");
-
- if (r->discard_body) {
- r->write_event_handler = ngx_http_request_empty_handler;
- r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000);
- ngx_add_timer(rev, clcf->lingering_timeout);
- return;
- }
-
- c->log->action = "closing request";
-
- hc = r->http_connection;
- b = r->header_in;
-
- if (b->pos < b->last) {
-
- /* the pipelined request */
-
- if (b != c->buffer) {
-
- /*
- * If the large header buffers were allocated while the previous
- * request processing then we do not use c->buffer for
- * the pipelined request (see ngx_http_create_request()).
- *
- * Now we would move the large header buffers to the free list.
- */
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- if (hc->free == NULL) {
- hc->free = ngx_palloc(c->pool,
- cscf->large_client_header_buffers.num * sizeof(ngx_buf_t *));
-
- if (hc->free == NULL) {
- ngx_http_close_request(r, 0);
- return;
- }
- }
-
- for (i = 0; i < hc->nbusy - 1; i++) {
- f = hc->busy[i];
- hc->free[hc->nfree++] = f;
- f->pos = f->start;
- f->last = f->start;
- }
-
- hc->busy[0] = b;
- hc->nbusy = 1;
- }
- }
-
- /* guard against recursive call from ngx_http_finalize_connection() */
- r->keepalive = 0;
-
- ngx_http_free_request(r, 0);
-
- c->data = hc;
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_close_connection(c);
- return;
- }
-
- wev = c->write;
- wev->handler = ngx_http_empty_handler;
-
- if (b->pos < b->last) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "pipelined request");
-
- c->log->action = "reading client pipelined request line";
-
- r = ngx_http_create_request(c);
- if (r == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- r->pipeline = 1;
-
- c->data = r;
-
- c->sent = 0;
- c->destroyed = 0;
-
- if (rev->timer_set) {
- ngx_del_timer(rev);
- }
-
- rev->handler = ngx_http_process_request_line;
- ngx_post_event(rev, &ngx_posted_events);
- return;
- }
-
- /*
- * To keep a memory footprint as small as possible for an idle keepalive
- * connection we try to free c->buffer's memory if it was allocated outside
- * the c->pool. The large header buffers are always allocated outside the
- * c->pool and are freed too.
- */
-
- b = c->buffer;
-
- if (ngx_pfree(c->pool, b->start) == NGX_OK) {
-
- /*
- * the special note for ngx_http_keepalive_handler() that
- * c->buffer's memory was freed
- */
-
- b->pos = NULL;
-
- } else {
- b->pos = b->start;
- b->last = b->start;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc free: %p %d",
- hc->free, hc->nfree);
-
- if (hc->free) {
- for (i = 0; i < hc->nfree; i++) {
- ngx_pfree(c->pool, hc->free[i]->start);
- hc->free[i] = NULL;
- }
-
- hc->nfree = 0;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc busy: %p %d",
- hc->busy, hc->nbusy);
-
- if (hc->busy) {
- for (i = 0; i < hc->nbusy; i++) {
- ngx_pfree(c->pool, hc->busy[i]->start);
- hc->busy[i] = NULL;
- }
-
- hc->nbusy = 0;
- }
-
-#if (NGX_HTTP_SSL)
- if (c->ssl) {
- ngx_ssl_free_buffer(c);
- }
-#endif
-
- rev->handler = ngx_http_keepalive_handler;
-
- if (wev->active && (ngx_event_flags & NGX_USE_LEVEL_EVENT)) {
- if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) != NGX_OK) {
- ngx_http_close_connection(c);
- return;
- }
- }
-
- c->log->action = "keepalive";
-
- if (c->tcp_nopush == NGX_TCP_NOPUSH_SET) {
- if (ngx_tcp_push(c->fd) == -1) {
- ngx_connection_error(c, ngx_socket_errno, ngx_tcp_push_n " failed");
- ngx_http_close_connection(c);
- return;
- }
-
- c->tcp_nopush = NGX_TCP_NOPUSH_UNSET;
- tcp_nodelay = ngx_tcp_nodelay_and_tcp_nopush ? 1 : 0;
-
- } else {
- tcp_nodelay = 1;
- }
-
- if (tcp_nodelay
- && clcf->tcp_nodelay
- && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET)
- {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay");
-
- if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
- (const void *) &tcp_nodelay, sizeof(int))
- == -1)
- {
-#if (NGX_SOLARIS)
- /* Solaris returns EINVAL if a socket has been shut down */
- c->log_error = NGX_ERROR_IGNORE_EINVAL;
-#endif
-
- ngx_connection_error(c, ngx_socket_errno,
- "setsockopt(TCP_NODELAY) failed");
-
- c->log_error = NGX_ERROR_INFO;
- ngx_http_close_connection(c);
- return;
- }
-
- c->tcp_nodelay = NGX_TCP_NODELAY_SET;
- }
-
-#if 0
- /* if ngx_http_request_t was freed then we need some other place */
- r->http_state = NGX_HTTP_KEEPALIVE_STATE;
-#endif
-
- c->idle = 1;
- ngx_reusable_connection(c, 1);
-
- ngx_add_timer(rev, clcf->keepalive_timeout);
-
- if (rev->ready) {
- ngx_post_event(rev, &ngx_posted_events);
- }
-}
-
-
-static void
-ngx_http_keepalive_handler(ngx_event_t *rev)
-{
- size_t size;
- ssize_t n;
- ngx_buf_t *b;
- ngx_connection_t *c;
-
- c = rev->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http keepalive handler");
-
- if (rev->timedout || c->close) {
- ngx_http_close_connection(c);
- return;
- }
-
-#if (NGX_HAVE_KQUEUE)
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- if (rev->pending_eof) {
- c->log->handler = NULL;
- ngx_log_error(NGX_LOG_INFO, c->log, rev->kq_errno,
- "kevent() reported that client %V closed "
- "keepalive connection", &c->addr_text);
-#if (NGX_HTTP_SSL)
- if (c->ssl) {
- c->ssl->no_send_shutdown = 1;
- }
-#endif
- ngx_http_close_connection(c);
- return;
- }
- }
-
-#endif
-
- b = c->buffer;
- size = b->end - b->start;
-
- if (b->pos == NULL) {
-
- /*
- * The c->buffer's memory was freed by ngx_http_set_keepalive().
- * However, the c->buffer->start and c->buffer->end were not changed
- * to keep the buffer size.
- */
-
- b->pos = ngx_palloc(c->pool, size);
- if (b->pos == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- b->start = b->pos;
- b->last = b->pos;
- b->end = b->pos + size;
- }
-
- /*
- * MSIE closes a keepalive connection with RST flag
- * so we ignore ECONNRESET here.
- */
-
- c->log_error = NGX_ERROR_IGNORE_ECONNRESET;
- ngx_set_socket_errno(0);
-
- n = c->recv(c, b->last, size);
- c->log_error = NGX_ERROR_INFO;
-
- if (n == NGX_AGAIN) {
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_close_connection(c);
- return;
- }
-
- /*
- * Like ngx_http_set_keepalive() we are trying to not hold
- * c->buffer's memory for a keepalive connection.
- */
-
- if (ngx_pfree(c->pool, b->start) == NGX_OK) {
-
- /*
- * the special note that c->buffer's memory was freed
- */
-
- b->pos = NULL;
- }
-
- return;
- }
-
- if (n == NGX_ERROR) {
- ngx_http_close_connection(c);
- return;
- }
-
- c->log->handler = NULL;
-
- if (n == 0) {
- ngx_log_error(NGX_LOG_INFO, c->log, ngx_socket_errno,
- "client %V closed keepalive connection", &c->addr_text);
- ngx_http_close_connection(c);
- return;
- }
-
- b->last += n;
-
- c->log->handler = ngx_http_log_error;
- c->log->action = "reading client request line";
-
- c->idle = 0;
- ngx_reusable_connection(c, 0);
-
- c->data = ngx_http_create_request(c);
- if (c->data == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- c->sent = 0;
- c->destroyed = 0;
-
- ngx_del_timer(rev);
-
- rev->handler = ngx_http_process_request_line;
- ngx_http_process_request_line(rev);
-}
-
-
-static void
-ngx_http_set_lingering_close(ngx_http_request_t *r)
-{
- ngx_event_t *rev, *wev;
- ngx_connection_t *c;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->connection;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- rev = c->read;
- rev->handler = ngx_http_lingering_close_handler;
-
- r->lingering_time = ngx_time() + (time_t) (clcf->lingering_time / 1000);
- ngx_add_timer(rev, clcf->lingering_timeout);
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_close_request(r, 0);
- return;
- }
-
- wev = c->write;
- wev->handler = ngx_http_empty_handler;
-
- if (wev->active && (ngx_event_flags & NGX_USE_LEVEL_EVENT)) {
- if (ngx_del_event(wev, NGX_WRITE_EVENT, 0) != NGX_OK) {
- ngx_http_close_request(r, 0);
- return;
- }
- }
-
- if (ngx_shutdown_socket(c->fd, NGX_WRITE_SHUTDOWN) == -1) {
- ngx_connection_error(c, ngx_socket_errno,
- ngx_shutdown_socket_n " failed");
- ngx_http_close_request(r, 0);
- return;
- }
-
- if (rev->ready) {
- ngx_http_lingering_close_handler(rev);
- }
-}
-
-
-static void
-ngx_http_lingering_close_handler(ngx_event_t *rev)
-{
- ssize_t n;
- ngx_msec_t timer;
- ngx_connection_t *c;
- ngx_http_request_t *r;
- ngx_http_core_loc_conf_t *clcf;
- u_char buffer[NGX_HTTP_LINGERING_BUFFER_SIZE];
-
- c = rev->data;
- r = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http lingering close handler");
-
- if (rev->timedout) {
- ngx_http_close_request(r, 0);
- return;
- }
-
- timer = (ngx_msec_t) r->lingering_time - (ngx_msec_t) ngx_time();
- if ((ngx_msec_int_t) timer <= 0) {
- ngx_http_close_request(r, 0);
- return;
- }
-
- do {
- n = c->recv(c, buffer, NGX_HTTP_LINGERING_BUFFER_SIZE);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "lingering read: %d", n);
-
- if (n == NGX_ERROR || n == 0) {
- ngx_http_close_request(r, 0);
- return;
- }
-
- } while (rev->ready);
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_close_request(r, 0);
- return;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- timer *= 1000;
-
- if (timer > clcf->lingering_timeout) {
- timer = clcf->lingering_timeout;
- }
-
- ngx_add_timer(rev, timer);
-}
-
-
-void
-ngx_http_empty_handler(ngx_event_t *wev)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, wev->log, 0, "http empty handler");
-
- return;
-}
-
-
-void
-ngx_http_request_empty_handler(ngx_http_request_t *r)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http request empty handler");
-
- return;
-}
-
-
-ngx_int_t
-ngx_http_send_special(ngx_http_request_t *r, ngx_uint_t flags)
-{
- ngx_buf_t *b;
- ngx_chain_t out;
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- if (flags & NGX_HTTP_LAST) {
-
- if (r == r->main && !r->post_action) {
- b->last_buf = 1;
-
- } else {
- b->sync = 1;
- b->last_in_chain = 1;
- }
- }
-
- if (flags & NGX_HTTP_FLUSH) {
- b->flush = 1;
- }
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_output_filter(r, &out);
-}
-
-
-static ngx_int_t
-ngx_http_post_action(ngx_http_request_t *r)
-{
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->post_action.data == NULL) {
- return NGX_DECLINED;
- }
-
- if (r->post_action && r->uri_changes == 0) {
- return NGX_DECLINED;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "post action: \"%V\"", &clcf->post_action);
-
- r->main->count--;
-
- r->http_version = NGX_HTTP_VERSION_9;
- r->header_only = 1;
- r->post_action = 1;
-
- r->read_event_handler = ngx_http_block_reading;
-
- if (clcf->post_action.data[0] == '/') {
- ngx_http_internal_redirect(r, &clcf->post_action, NULL);
-
- } else {
- ngx_http_named_location(r, &clcf->post_action);
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_close_request(ngx_http_request_t *r, ngx_int_t rc)
-{
- ngx_connection_t *c;
-
- r = r->main;
- c = r->connection;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http request count:%d blk:%d", r->count, r->blocked);
-
- if (r->count == 0) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0, "http request count is zero");
- }
-
- r->count--;
-
- if (r->count || r->blocked) {
- return;
- }
-
-#if (NGX_HTTP_SPDY)
- if (r->spdy_stream) {
- ngx_http_spdy_close_stream(r->spdy_stream, rc);
- return;
- }
-#endif
-
- ngx_http_free_request(r, rc);
- ngx_http_close_connection(c);
-}
-
-
-void
-ngx_http_free_request(ngx_http_request_t *r, ngx_int_t rc)
-{
- ngx_log_t *log;
- ngx_pool_t *pool;
- struct linger linger;
- ngx_http_cleanup_t *cln;
- ngx_http_log_ctx_t *ctx;
- ngx_http_core_loc_conf_t *clcf;
-
- log = r->connection->log;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http close request");
-
- if (r->pool == NULL) {
- ngx_log_error(NGX_LOG_ALERT, log, 0, "http request already closed");
- return;
- }
-
- cln = r->cleanup;
- r->cleanup = NULL;
-
- while (cln) {
- if (cln->handler) {
- cln->handler(cln->data);
- }
-
- cln = cln->next;
- }
-
-#if (NGX_STAT_STUB)
-
- if (r->stat_reading) {
- (void) ngx_atomic_fetch_add(ngx_stat_reading, -1);
- }
-
- if (r->stat_writing) {
- (void) ngx_atomic_fetch_add(ngx_stat_writing, -1);
- }
-
-#endif
-
- if (rc > 0 && (r->headers_out.status == 0 || r->connection->sent == 0)) {
- r->headers_out.status = rc;
- }
-
- log->action = "logging request";
-
- ngx_http_log_request(r);
-
- log->action = "closing request";
-
- if (r->connection->timedout) {
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->reset_timedout_connection) {
- linger.l_onoff = 1;
- linger.l_linger = 0;
-
- if (setsockopt(r->connection->fd, SOL_SOCKET, SO_LINGER,
- (const void *) &linger, sizeof(struct linger)) == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_socket_errno,
- "setsockopt(SO_LINGER) failed");
- }
- }
- }
-
- /* the various request strings were allocated from r->pool */
- ctx = log->data;
- ctx->request = NULL;
-
- r->request_line.len = 0;
-
- r->connection->destroyed = 1;
-
- /*
- * Setting r->pool to NULL will increase probability to catch double close
- * of request since the request object is allocated from its own pool.
- */
-
- pool = r->pool;
- r->pool = NULL;
-
- ngx_destroy_pool(pool);
-}
-
-
-static void
-ngx_http_log_request(ngx_http_request_t *r)
-{
- ngx_uint_t i, n;
- ngx_http_handler_pt *log_handler;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- log_handler = cmcf->phases[NGX_HTTP_LOG_PHASE].handlers.elts;
- n = cmcf->phases[NGX_HTTP_LOG_PHASE].handlers.nelts;
-
- for (i = 0; i < n; i++) {
- log_handler[i](r);
- }
-}
-
-
-void
-ngx_http_close_connection(ngx_connection_t *c)
-{
- ngx_pool_t *pool;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "close http connection: %d", c->fd);
-
-#if (NGX_HTTP_SSL)
-
- if (c->ssl) {
- if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
- c->ssl->handler = ngx_http_close_connection;
- return;
- }
- }
-
-#endif
-
-#if (NGX_STAT_STUB)
- (void) ngx_atomic_fetch_add(ngx_stat_active, -1);
-#endif
-
- c->destroyed = 1;
-
- pool = c->pool;
-
- ngx_close_connection(c);
-
- ngx_destroy_pool(pool);
-}
-
-
-static u_char *
-ngx_http_log_error(ngx_log_t *log, u_char *buf, size_t len)
-{
- u_char *p;
- ngx_http_request_t *r;
- ngx_http_log_ctx_t *ctx;
-
- if (log->action) {
- p = ngx_snprintf(buf, len, " while %s", log->action);
- len -= p - buf;
- buf = p;
- }
-
- ctx = log->data;
-
- p = ngx_snprintf(buf, len, ", client: %V", &ctx->connection->addr_text);
- len -= p - buf;
-
- r = ctx->request;
-
- if (r) {
- return r->log_handler(r, ctx->current_request, p, len);
-
- } else {
- p = ngx_snprintf(p, len, ", server: %V",
- &ctx->connection->listening->addr_text);
- }
-
- return p;
-}
-
-
-static u_char *
-ngx_http_log_error_handler(ngx_http_request_t *r, ngx_http_request_t *sr,
- u_char *buf, size_t len)
-{
- char *uri_separator;
- u_char *p;
- ngx_http_upstream_t *u;
- ngx_http_core_srv_conf_t *cscf;
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- p = ngx_snprintf(buf, len, ", server: %V", &cscf->server_name);
- len -= p - buf;
- buf = p;
-
- if (r->request_line.data == NULL && r->request_start) {
- for (p = r->request_start; p < r->header_in->last; p++) {
- if (*p == CR || *p == LF) {
- break;
- }
- }
-
- r->request_line.len = p - r->request_start;
- r->request_line.data = r->request_start;
- }
-
- if (r->request_line.len) {
- p = ngx_snprintf(buf, len, ", request: \"%V\"", &r->request_line);
- len -= p - buf;
- buf = p;
- }
-
- if (r != sr) {
- p = ngx_snprintf(buf, len, ", subrequest: \"%V\"", &sr->uri);
- len -= p - buf;
- buf = p;
- }
-
- u = sr->upstream;
-
- if (u && u->peer.name) {
-
- uri_separator = "";
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- if (u->peer.sockaddr && u->peer.sockaddr->sa_family == AF_UNIX) {
- uri_separator = ":";
- }
-#endif
-
- p = ngx_snprintf(buf, len, ", upstream: \"%V%V%s%V\"",
- &u->schema, u->peer.name,
- uri_separator, &u->uri);
- len -= p - buf;
- buf = p;
- }
-
- if (r->headers_in.host) {
- p = ngx_snprintf(buf, len, ", host: \"%V\"",
- &r->headers_in.host->value);
- len -= p - buf;
- buf = p;
- }
-
- if (r->headers_in.referer) {
- p = ngx_snprintf(buf, len, ", referrer: \"%V\"",
- &r->headers_in.referer->value);
- buf = p;
- }
-
- return buf;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.h
deleted file mode 100644
index f6ea6fb56e7..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request.h
+++ /dev/null
@@ -1,598 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_REQUEST_H_INCLUDED_
-#define _NGX_HTTP_REQUEST_H_INCLUDED_
-
-
-#define NGX_HTTP_MAX_URI_CHANGES 10
-#define NGX_HTTP_MAX_SUBREQUESTS 200
-
-/* must be 2^n */
-#define NGX_HTTP_LC_HEADER_LEN 32
-
-
-#define NGX_HTTP_DISCARD_BUFFER_SIZE 4096
-#define NGX_HTTP_LINGERING_BUFFER_SIZE 4096
-
-
-#define NGX_HTTP_VERSION_9 9
-#define NGX_HTTP_VERSION_10 1000
-#define NGX_HTTP_VERSION_11 1001
-
-#define NGX_HTTP_UNKNOWN 0x0001
-#define NGX_HTTP_GET 0x0002
-#define NGX_HTTP_HEAD 0x0004
-#define NGX_HTTP_POST 0x0008
-#define NGX_HTTP_PUT 0x0010
-#define NGX_HTTP_DELETE 0x0020
-#define NGX_HTTP_MKCOL 0x0040
-#define NGX_HTTP_COPY 0x0080
-#define NGX_HTTP_MOVE 0x0100
-#define NGX_HTTP_OPTIONS 0x0200
-#define NGX_HTTP_PROPFIND 0x0400
-#define NGX_HTTP_PROPPATCH 0x0800
-#define NGX_HTTP_LOCK 0x1000
-#define NGX_HTTP_UNLOCK 0x2000
-#define NGX_HTTP_PATCH 0x4000
-#define NGX_HTTP_TRACE 0x8000
-
-#define NGX_HTTP_CONNECTION_CLOSE 1
-#define NGX_HTTP_CONNECTION_KEEP_ALIVE 2
-
-
-#define NGX_NONE 1
-
-
-#define NGX_HTTP_PARSE_HEADER_DONE 1
-
-#define NGX_HTTP_CLIENT_ERROR 10
-#define NGX_HTTP_PARSE_INVALID_METHOD 10
-#define NGX_HTTP_PARSE_INVALID_REQUEST 11
-#define NGX_HTTP_PARSE_INVALID_09_METHOD 12
-
-#define NGX_HTTP_PARSE_INVALID_HEADER 13
-
-
-/* unused 1 */
-#define NGX_HTTP_SUBREQUEST_IN_MEMORY 2
-#define NGX_HTTP_SUBREQUEST_WAITED 4
-#define NGX_HTTP_LOG_UNSAFE 8
-
-
-#define NGX_HTTP_CONTINUE 100
-#define NGX_HTTP_SWITCHING_PROTOCOLS 101
-#define NGX_HTTP_PROCESSING 102
-
-#define NGX_HTTP_OK 200
-#define NGX_HTTP_CREATED 201
-#define NGX_HTTP_ACCEPTED 202
-#define NGX_HTTP_NO_CONTENT 204
-#define NGX_HTTP_PARTIAL_CONTENT 206
-
-#define NGX_HTTP_SPECIAL_RESPONSE 300
-#define NGX_HTTP_MOVED_PERMANENTLY 301
-#define NGX_HTTP_MOVED_TEMPORARILY 302
-#define NGX_HTTP_SEE_OTHER 303
-#define NGX_HTTP_NOT_MODIFIED 304
-#define NGX_HTTP_TEMPORARY_REDIRECT 307
-
-#define NGX_HTTP_BAD_REQUEST 400
-#define NGX_HTTP_UNAUTHORIZED 401
-#define NGX_HTTP_FORBIDDEN 403
-#define NGX_HTTP_NOT_FOUND 404
-#define NGX_HTTP_NOT_ALLOWED 405
-#define NGX_HTTP_REQUEST_TIME_OUT 408
-#define NGX_HTTP_CONFLICT 409
-#define NGX_HTTP_LENGTH_REQUIRED 411
-#define NGX_HTTP_PRECONDITION_FAILED 412
-#define NGX_HTTP_REQUEST_ENTITY_TOO_LARGE 413
-#define NGX_HTTP_REQUEST_URI_TOO_LARGE 414
-#define NGX_HTTP_UNSUPPORTED_MEDIA_TYPE 415
-#define NGX_HTTP_RANGE_NOT_SATISFIABLE 416
-
-
-/* Our own HTTP codes */
-
-/* The special code to close connection without any response */
-#define NGX_HTTP_CLOSE 444
-
-#define NGX_HTTP_NGINX_CODES 494
-
-#define NGX_HTTP_REQUEST_HEADER_TOO_LARGE 494
-
-#define NGX_HTTPS_CERT_ERROR 495
-#define NGX_HTTPS_NO_CERT 496
-
-/*
- * We use the special code for the plain HTTP requests that are sent to
- * HTTPS port to distinguish it from 4XX in an error page redirection
- */
-#define NGX_HTTP_TO_HTTPS 497
-
-/* 498 is the canceled code for the requests with invalid host name */
-
-/*
- * HTTP does not define the code for the case when a client closed
- * the connection while we are processing its request so we introduce
- * own code to log such situation when a client has closed the connection
- * before we even try to send the HTTP header to it
- */
-#define NGX_HTTP_CLIENT_CLOSED_REQUEST 499
-
-
-#define NGX_HTTP_INTERNAL_SERVER_ERROR 500
-#define NGX_HTTP_NOT_IMPLEMENTED 501
-#define NGX_HTTP_BAD_GATEWAY 502
-#define NGX_HTTP_SERVICE_UNAVAILABLE 503
-#define NGX_HTTP_GATEWAY_TIME_OUT 504
-#define NGX_HTTP_INSUFFICIENT_STORAGE 507
-
-
-#define NGX_HTTP_LOWLEVEL_BUFFERED 0xf0
-#define NGX_HTTP_WRITE_BUFFERED 0x10
-#define NGX_HTTP_GZIP_BUFFERED 0x20
-#define NGX_HTTP_SSI_BUFFERED 0x01
-#define NGX_HTTP_SUB_BUFFERED 0x02
-#define NGX_HTTP_COPY_BUFFERED 0x04
-
-
-typedef enum {
- NGX_HTTP_INITING_REQUEST_STATE = 0,
- NGX_HTTP_READING_REQUEST_STATE,
- NGX_HTTP_PROCESS_REQUEST_STATE,
-
- NGX_HTTP_CONNECT_UPSTREAM_STATE,
- NGX_HTTP_WRITING_UPSTREAM_STATE,
- NGX_HTTP_READING_UPSTREAM_STATE,
-
- NGX_HTTP_WRITING_REQUEST_STATE,
- NGX_HTTP_LINGERING_CLOSE_STATE,
- NGX_HTTP_KEEPALIVE_STATE
-} ngx_http_state_e;
-
-
-typedef struct {
- ngx_str_t name;
- ngx_uint_t offset;
- ngx_http_header_handler_pt handler;
-} ngx_http_header_t;
-
-
-typedef struct {
- ngx_str_t name;
- ngx_uint_t offset;
-} ngx_http_header_out_t;
-
-
-typedef struct {
- ngx_list_t headers;
-
- ngx_table_elt_t *host;
- ngx_table_elt_t *connection;
- ngx_table_elt_t *if_modified_since;
- ngx_table_elt_t *if_unmodified_since;
- ngx_table_elt_t *if_match;
- ngx_table_elt_t *if_none_match;
- ngx_table_elt_t *user_agent;
- ngx_table_elt_t *referer;
- ngx_table_elt_t *content_length;
- ngx_table_elt_t *content_type;
-
- ngx_table_elt_t *range;
- ngx_table_elt_t *if_range;
-
- ngx_table_elt_t *transfer_encoding;
- ngx_table_elt_t *expect;
- ngx_table_elt_t *upgrade;
-
-#if (NGX_HTTP_GZIP)
- ngx_table_elt_t *accept_encoding;
- ngx_table_elt_t *via;
-#endif
-
- ngx_table_elt_t *authorization;
-
- ngx_table_elt_t *keep_alive;
-
-#if (NGX_HTTP_X_FORWARDED_FOR)
- ngx_array_t x_forwarded_for;
-#endif
-
-#if (NGX_HTTP_REALIP)
- ngx_table_elt_t *x_real_ip;
-#endif
-
-#if (NGX_HTTP_HEADERS)
- ngx_table_elt_t *accept;
- ngx_table_elt_t *accept_language;
-#endif
-
-#if (NGX_HTTP_DAV)
- ngx_table_elt_t *depth;
- ngx_table_elt_t *destination;
- ngx_table_elt_t *overwrite;
- ngx_table_elt_t *date;
-#endif
-
- ngx_str_t user;
- ngx_str_t passwd;
-
- ngx_array_t cookies;
-
- ngx_str_t server;
- off_t content_length_n;
- time_t keep_alive_n;
-
- unsigned connection_type:2;
- unsigned chunked:1;
- unsigned msie:1;
- unsigned msie6:1;
- unsigned opera:1;
- unsigned gecko:1;
- unsigned chrome:1;
- unsigned safari:1;
- unsigned konqueror:1;
-} ngx_http_headers_in_t;
-
-
-typedef struct {
- ngx_list_t headers;
-
- ngx_uint_t status;
- ngx_str_t status_line;
-
- ngx_table_elt_t *server;
- ngx_table_elt_t *date;
- ngx_table_elt_t *content_length;
- ngx_table_elt_t *content_encoding;
- ngx_table_elt_t *location;
- ngx_table_elt_t *refresh;
- ngx_table_elt_t *last_modified;
- ngx_table_elt_t *content_range;
- ngx_table_elt_t *accept_ranges;
- ngx_table_elt_t *www_authenticate;
- ngx_table_elt_t *expires;
- ngx_table_elt_t *etag;
-
- ngx_str_t *override_charset;
-
- size_t content_type_len;
- ngx_str_t content_type;
- ngx_str_t charset;
- u_char *content_type_lowcase;
- ngx_uint_t content_type_hash;
-
- ngx_array_t cache_control;
-
- off_t content_length_n;
- time_t date_time;
- time_t last_modified_time;
-} ngx_http_headers_out_t;
-
-
-typedef void (*ngx_http_client_body_handler_pt)(ngx_http_request_t *r);
-
-typedef struct {
- ngx_temp_file_t *temp_file;
- ngx_chain_t *bufs;
- ngx_buf_t *buf;
- off_t rest;
- ngx_chain_t *free;
- ngx_chain_t *busy;
- ngx_http_chunked_t *chunked;
- ngx_http_client_body_handler_pt post_handler;
-} ngx_http_request_body_t;
-
-
-typedef struct ngx_http_addr_conf_s ngx_http_addr_conf_t;
-
-typedef struct {
- ngx_http_addr_conf_t *addr_conf;
- ngx_http_conf_ctx_t *conf_ctx;
-
-#if (NGX_HTTP_SSL && defined SSL_CTRL_SET_TLSEXT_HOSTNAME)
- ngx_str_t *ssl_servername;
-#if (NGX_PCRE)
- ngx_http_regex_t *ssl_servername_regex;
-#endif
-#endif
-
- ngx_buf_t **busy;
- ngx_int_t nbusy;
-
- ngx_buf_t **free;
- ngx_int_t nfree;
-
-#if (NGX_HTTP_SSL)
- unsigned ssl:1;
-#endif
- unsigned proxy_protocol:1;
-} ngx_http_connection_t;
-
-
-typedef void (*ngx_http_cleanup_pt)(void *data);
-
-typedef struct ngx_http_cleanup_s ngx_http_cleanup_t;
-
-struct ngx_http_cleanup_s {
- ngx_http_cleanup_pt handler;
- void *data;
- ngx_http_cleanup_t *next;
-};
-
-
-typedef ngx_int_t (*ngx_http_post_subrequest_pt)(ngx_http_request_t *r,
- void *data, ngx_int_t rc);
-
-typedef struct {
- ngx_http_post_subrequest_pt handler;
- void *data;
-} ngx_http_post_subrequest_t;
-
-
-typedef struct ngx_http_postponed_request_s ngx_http_postponed_request_t;
-
-struct ngx_http_postponed_request_s {
- ngx_http_request_t *request;
- ngx_chain_t *out;
- ngx_http_postponed_request_t *next;
-};
-
-
-typedef struct ngx_http_posted_request_s ngx_http_posted_request_t;
-
-struct ngx_http_posted_request_s {
- ngx_http_request_t *request;
- ngx_http_posted_request_t *next;
-};
-
-
-typedef ngx_int_t (*ngx_http_handler_pt)(ngx_http_request_t *r);
-typedef void (*ngx_http_event_handler_pt)(ngx_http_request_t *r);
-
-
-struct ngx_http_request_s {
- uint32_t signature; /* "HTTP" */
-
- ngx_connection_t *connection;
-
- void **ctx;
- void **main_conf;
- void **srv_conf;
- void **loc_conf;
-
- ngx_http_event_handler_pt read_event_handler;
- ngx_http_event_handler_pt write_event_handler;
-
-#if (NGX_HTTP_CACHE)
- ngx_http_cache_t *cache;
-#endif
-
- ngx_http_upstream_t *upstream;
- ngx_array_t *upstream_states;
- /* of ngx_http_upstream_state_t */
-
- ngx_pool_t *pool;
- ngx_buf_t *header_in;
-
- ngx_http_headers_in_t headers_in;
- ngx_http_headers_out_t headers_out;
-
- ngx_http_request_body_t *request_body;
-
- time_t lingering_time;
- time_t start_sec;
- ngx_msec_t start_msec;
-
- ngx_uint_t method;
- ngx_uint_t http_version;
-
- ngx_str_t request_line;
- ngx_str_t uri;
- ngx_str_t args;
- ngx_str_t exten;
- ngx_str_t unparsed_uri;
-
- ngx_str_t method_name;
- ngx_str_t http_protocol;
-
- ngx_chain_t *out;
- ngx_http_request_t *main;
- ngx_http_request_t *parent;
- ngx_http_postponed_request_t *postponed;
- ngx_http_post_subrequest_t *post_subrequest;
- ngx_http_posted_request_t *posted_requests;
-
- ngx_int_t phase_handler;
- ngx_http_handler_pt content_handler;
- ngx_uint_t access_code;
-
- ngx_http_variable_value_t *variables;
-
-#if (NGX_PCRE)
- ngx_uint_t ncaptures;
- int *captures;
- u_char *captures_data;
-#endif
-
- size_t limit_rate;
- size_t limit_rate_after;
-
- /* used to learn the Apache compatible response length without a header */
- size_t header_size;
-
- off_t request_length;
-
- ngx_uint_t err_status;
-
- ngx_http_connection_t *http_connection;
-#if (NGX_HTTP_SPDY)
- ngx_http_spdy_stream_t *spdy_stream;
-#endif
-
- ngx_http_log_handler_pt log_handler;
-
- ngx_http_cleanup_t *cleanup;
-
- unsigned subrequests:8;
- unsigned count:8;
- unsigned blocked:8;
-
- unsigned aio:1;
-
- unsigned http_state:4;
-
- /* URI with "/." and on Win32 with "//" */
- unsigned complex_uri:1;
-
- /* URI with "%" */
- unsigned quoted_uri:1;
-
- /* URI with "+" */
- unsigned plus_in_uri:1;
-
- /* URI with " " */
- unsigned space_in_uri:1;
-
- unsigned invalid_header:1;
-
- unsigned add_uri_to_alias:1;
- unsigned valid_location:1;
- unsigned valid_unparsed_uri:1;
- unsigned uri_changed:1;
- unsigned uri_changes:4;
-
- unsigned request_body_in_single_buf:1;
- unsigned request_body_in_file_only:1;
- unsigned request_body_in_persistent_file:1;
- unsigned request_body_in_clean_file:1;
- unsigned request_body_file_group_access:1;
- unsigned request_body_file_log_level:3;
-
- unsigned subrequest_in_memory:1;
- unsigned waited:1;
-
-#if (NGX_HTTP_CACHE)
- unsigned cached:1;
-#endif
-
-#if (NGX_HTTP_GZIP)
- unsigned gzip_tested:1;
- unsigned gzip_ok:1;
- unsigned gzip_vary:1;
-#endif
-
- unsigned proxy:1;
- unsigned bypass_cache:1;
- unsigned no_cache:1;
-
- /*
- * instead of using the request context data in
- * ngx_http_limit_conn_module and ngx_http_limit_req_module
- * we use the single bits in the request structure
- */
- unsigned limit_conn_set:1;
- unsigned limit_req_set:1;
-
-#if 0
- unsigned cacheable:1;
-#endif
-
- unsigned pipeline:1;
- unsigned chunked:1;
- unsigned header_only:1;
- unsigned keepalive:1;
- unsigned lingering_close:1;
- unsigned discard_body:1;
- unsigned internal:1;
- unsigned error_page:1;
- unsigned filter_finalize:1;
- unsigned post_action:1;
- unsigned request_complete:1;
- unsigned request_output:1;
- unsigned header_sent:1;
- unsigned expect_tested:1;
- unsigned root_tested:1;
- unsigned done:1;
- unsigned logged:1;
-
- unsigned buffered:4;
-
- unsigned main_filter_need_in_memory:1;
- unsigned filter_need_in_memory:1;
- unsigned filter_need_temporary:1;
- unsigned allow_ranges:1;
- unsigned single_range:1;
- unsigned disable_not_modified:1;
-
-#if (NGX_STAT_STUB)
- unsigned stat_reading:1;
- unsigned stat_writing:1;
-#endif
-
- /* used to parse HTTP headers */
-
- ngx_uint_t state;
-
- ngx_uint_t header_hash;
- ngx_uint_t lowcase_index;
- u_char lowcase_header[NGX_HTTP_LC_HEADER_LEN];
-
- u_char *header_name_start;
- u_char *header_name_end;
- u_char *header_start;
- u_char *header_end;
-
- /*
- * a memory that can be reused after parsing a request line
- * via ngx_http_ephemeral_t
- */
-
- u_char *uri_start;
- u_char *uri_end;
- u_char *uri_ext;
- u_char *args_start;
- u_char *request_start;
- u_char *request_end;
- u_char *method_end;
- u_char *schema_start;
- u_char *schema_end;
- u_char *host_start;
- u_char *host_end;
- u_char *port_start;
- u_char *port_end;
-
- unsigned http_minor:16;
- unsigned http_major:16;
-};
-
-
-typedef struct {
- ngx_http_posted_request_t terminal_posted_request;
-#if (NGX_HAVE_AIO_SENDFILE)
- u_char aio_preload;
-#endif
-} ngx_http_ephemeral_t;
-
-
-extern ngx_http_header_t ngx_http_headers_in[];
-extern ngx_http_header_out_t ngx_http_headers_out[];
-
-
-#define ngx_http_set_connection_log(c, l) \
- \
- c->log->file = l->file; \
- c->log->next = l->next; \
- c->log->writer = l->writer; \
- c->log->wdata = l->wdata; \
- if (!(c->log->log_level & NGX_LOG_DEBUG_CONNECTION)) { \
- c->log->log_level = l->log_level; \
- }
-
-
-#endif /* _NGX_HTTP_REQUEST_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request_body.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request_body.c
deleted file mode 100644
index bbf16fd2576..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_request_body.c
+++ /dev/null
@@ -1,1099 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static void ngx_http_read_client_request_body_handler(ngx_http_request_t *r);
-static ngx_int_t ngx_http_do_read_client_request_body(ngx_http_request_t *r);
-static ngx_int_t ngx_http_write_request_body(ngx_http_request_t *r);
-static ngx_int_t ngx_http_read_discarded_request_body(ngx_http_request_t *r);
-static ngx_int_t ngx_http_discard_request_body_filter(ngx_http_request_t *r,
- ngx_buf_t *b);
-static ngx_int_t ngx_http_test_expect(ngx_http_request_t *r);
-
-static ngx_int_t ngx_http_request_body_filter(ngx_http_request_t *r,
- ngx_chain_t *in);
-static ngx_int_t ngx_http_request_body_length_filter(ngx_http_request_t *r,
- ngx_chain_t *in);
-static ngx_int_t ngx_http_request_body_chunked_filter(ngx_http_request_t *r,
- ngx_chain_t *in);
-static ngx_int_t ngx_http_request_body_save_filter(ngx_http_request_t *r,
- ngx_chain_t *in);
-
-
-ngx_int_t
-ngx_http_read_client_request_body(ngx_http_request_t *r,
- ngx_http_client_body_handler_pt post_handler)
-{
- size_t preread;
- ssize_t size;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t out, *cl;
- ngx_http_request_body_t *rb;
- ngx_http_core_loc_conf_t *clcf;
-
- r->main->count++;
-
-#if (NGX_HTTP_SPDY)
- if (r->spdy_stream && r == r->main) {
- rc = ngx_http_spdy_read_request_body(r, post_handler);
- goto done;
- }
-#endif
-
- if (r != r->main || r->request_body || r->discard_body) {
- post_handler(r);
- return NGX_OK;
- }
-
- if (ngx_http_test_expect(r) != NGX_OK) {
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- goto done;
- }
-
- rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t));
- if (rb == NULL) {
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- goto done;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * rb->bufs = NULL;
- * rb->buf = NULL;
- * rb->free = NULL;
- * rb->busy = NULL;
- * rb->chunked = NULL;
- */
-
- rb->rest = -1;
- rb->post_handler = post_handler;
-
- r->request_body = rb;
-
- if (r->headers_in.content_length_n < 0 && !r->headers_in.chunked) {
- post_handler(r);
- return NGX_OK;
- }
-
- preread = r->header_in->last - r->header_in->pos;
-
- if (preread) {
-
- /* there is the pre-read part of the request body */
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http client request body preread %uz", preread);
-
- out.buf = r->header_in;
- out.next = NULL;
-
- rc = ngx_http_request_body_filter(r, &out);
-
- if (rc != NGX_OK) {
- goto done;
- }
-
- r->request_length += preread - (r->header_in->last - r->header_in->pos);
-
- if (!r->headers_in.chunked
- && rb->rest > 0
- && rb->rest <= (off_t) (r->header_in->end - r->header_in->last))
- {
- /* the whole request body may be placed in r->header_in */
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- goto done;
- }
-
- b->temporary = 1;
- b->start = r->header_in->pos;
- b->pos = r->header_in->pos;
- b->last = r->header_in->last;
- b->end = r->header_in->end;
-
- rb->buf = b;
-
- r->read_event_handler = ngx_http_read_client_request_body_handler;
- r->write_event_handler = ngx_http_request_empty_handler;
-
- rc = ngx_http_do_read_client_request_body(r);
- goto done;
- }
-
- } else {
- /* set rb->rest */
-
- if (ngx_http_request_body_filter(r, NULL) != NGX_OK) {
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- goto done;
- }
- }
-
- if (rb->rest == 0) {
- /* the whole request body was pre-read */
-
- if (r->request_body_in_file_only) {
- if (ngx_http_write_request_body(r) != NGX_OK) {
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- goto done;
- }
-
- if (rb->temp_file->file.offset != 0) {
-
- cl = ngx_chain_get_free_buf(r->pool, &rb->free);
- if (cl == NULL) {
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- goto done;
- }
-
- b = cl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->in_file = 1;
- b->file_last = rb->temp_file->file.offset;
- b->file = &rb->temp_file->file;
-
- rb->bufs = cl;
-
- } else {
- rb->bufs = NULL;
- }
- }
-
- post_handler(r);
-
- return NGX_OK;
- }
-
- if (rb->rest < 0) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "negative request body rest");
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- goto done;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- size = clcf->client_body_buffer_size;
- size += size >> 2;
-
- /* TODO: honor r->request_body_in_single_buf */
-
- if (!r->headers_in.chunked && rb->rest < size) {
- size = (ssize_t) rb->rest;
-
- if (r->request_body_in_single_buf) {
- size += preread;
- }
-
- } else {
- size = clcf->client_body_buffer_size;
- }
-
- rb->buf = ngx_create_temp_buf(r->pool, size);
- if (rb->buf == NULL) {
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- goto done;
- }
-
- r->read_event_handler = ngx_http_read_client_request_body_handler;
- r->write_event_handler = ngx_http_request_empty_handler;
-
- rc = ngx_http_do_read_client_request_body(r);
-
-done:
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- r->main->count--;
- }
-
- return rc;
-}
-
-
-static void
-ngx_http_read_client_request_body_handler(ngx_http_request_t *r)
-{
- ngx_int_t rc;
-
- if (r->connection->read->timedout) {
- r->connection->timedout = 1;
- ngx_http_finalize_request(r, NGX_HTTP_REQUEST_TIME_OUT);
- return;
- }
-
- rc = ngx_http_do_read_client_request_body(r);
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- ngx_http_finalize_request(r, rc);
- }
-}
-
-
-static ngx_int_t
-ngx_http_do_read_client_request_body(ngx_http_request_t *r)
-{
- off_t rest;
- size_t size;
- ssize_t n;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t *cl, out;
- ngx_connection_t *c;
- ngx_http_request_body_t *rb;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->connection;
- rb = r->request_body;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http read client request body");
-
- for ( ;; ) {
- for ( ;; ) {
- if (rb->buf->last == rb->buf->end) {
-
- /* pass buffer to request body filter chain */
-
- out.buf = rb->buf;
- out.next = NULL;
-
- rc = ngx_http_request_body_filter(r, &out);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- /* write to file */
-
- if (ngx_http_write_request_body(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- /* update chains */
-
- rc = ngx_http_request_body_filter(r, NULL);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- if (rb->busy != NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- rb->buf->pos = rb->buf->start;
- rb->buf->last = rb->buf->start;
- }
-
- size = rb->buf->end - rb->buf->last;
- rest = rb->rest - (rb->buf->last - rb->buf->pos);
-
- if ((off_t) size > rest) {
- size = (size_t) rest;
- }
-
- n = c->recv(c, rb->buf->last, size);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http client request body recv %z", n);
-
- if (n == NGX_AGAIN) {
- break;
- }
-
- if (n == 0) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client prematurely closed connection");
- }
-
- if (n == 0 || n == NGX_ERROR) {
- c->error = 1;
- return NGX_HTTP_BAD_REQUEST;
- }
-
- rb->buf->last += n;
- r->request_length += n;
-
- if (n == rest) {
- /* pass buffer to request body filter chain */
-
- out.buf = rb->buf;
- out.next = NULL;
-
- rc = ngx_http_request_body_filter(r, &out);
-
- if (rc != NGX_OK) {
- return rc;
- }
- }
-
- if (rb->rest == 0) {
- break;
- }
-
- if (rb->buf->last < rb->buf->end) {
- break;
- }
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http client request body rest %O", rb->rest);
-
- if (rb->rest == 0) {
- break;
- }
-
- if (!c->read->ready) {
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- ngx_add_timer(c->read, clcf->client_body_timeout);
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- return NGX_AGAIN;
- }
- }
-
- if (c->read->timer_set) {
- ngx_del_timer(c->read);
- }
-
- if (rb->temp_file || r->request_body_in_file_only) {
-
- /* save the last part */
-
- if (ngx_http_write_request_body(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (rb->temp_file->file.offset != 0) {
-
- cl = ngx_chain_get_free_buf(r->pool, &rb->free);
- if (cl == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b = cl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->in_file = 1;
- b->file_last = rb->temp_file->file.offset;
- b->file = &rb->temp_file->file;
-
- rb->bufs = cl;
-
- } else {
- rb->bufs = NULL;
- }
- }
-
- r->read_event_handler = ngx_http_block_reading;
-
- rb->post_handler(r);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_write_request_body(ngx_http_request_t *r)
-{
- ssize_t n;
- ngx_chain_t *cl;
- ngx_temp_file_t *tf;
- ngx_http_request_body_t *rb;
- ngx_http_core_loc_conf_t *clcf;
-
- rb = r->request_body;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http write client request body, bufs %p", rb->bufs);
-
- if (rb->temp_file == NULL) {
- tf = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t));
- if (tf == NULL) {
- return NGX_ERROR;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- tf->file.fd = NGX_INVALID_FILE;
- tf->file.log = r->connection->log;
- tf->path = clcf->client_body_temp_path;
- tf->pool = r->pool;
- tf->warn = "a client request body is buffered to a temporary file";
- tf->log_level = r->request_body_file_log_level;
- tf->persistent = r->request_body_in_persistent_file;
- tf->clean = r->request_body_in_clean_file;
-
- if (r->request_body_file_group_access) {
- tf->access = 0660;
- }
-
- rb->temp_file = tf;
-
- if (rb->bufs == NULL) {
- /* empty body with r->request_body_in_file_only */
-
- if (ngx_create_temp_file(&tf->file, tf->path, tf->pool,
- tf->persistent, tf->clean, tf->access)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- return NGX_OK;
- }
- }
-
- if (rb->bufs == NULL) {
- return NGX_OK;
- }
-
- n = ngx_write_chain_to_temp_file(rb->temp_file, rb->bufs);
-
- /* TODO: n == 0 or not complete and level event */
-
- if (n == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- rb->temp_file->offset += n;
-
- /* mark all buffers as written */
-
- for (cl = rb->bufs; cl; cl = cl->next) {
- cl->buf->pos = cl->buf->last;
- }
-
- rb->bufs = NULL;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_discard_request_body(ngx_http_request_t *r)
-{
- ssize_t size;
- ngx_int_t rc;
- ngx_event_t *rev;
-
-#if (NGX_HTTP_SPDY)
- if (r->spdy_stream && r == r->main) {
- r->spdy_stream->skip_data = NGX_SPDY_DATA_DISCARD;
- return NGX_OK;
- }
-#endif
-
- if (r != r->main || r->discard_body || r->request_body) {
- return NGX_OK;
- }
-
- if (ngx_http_test_expect(r) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- rev = r->connection->read;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0, "http set discard body");
-
- if (rev->timer_set) {
- ngx_del_timer(rev);
- }
-
- if (r->headers_in.content_length_n <= 0 && !r->headers_in.chunked) {
- return NGX_OK;
- }
-
- size = r->header_in->last - r->header_in->pos;
-
- if (size || r->headers_in.chunked) {
- rc = ngx_http_discard_request_body_filter(r, r->header_in);
-
- if (rc != NGX_OK) {
- return rc;
- }
-
- if (r->headers_in.content_length_n == 0) {
- return NGX_OK;
- }
- }
-
- rc = ngx_http_read_discarded_request_body(r);
-
- if (rc == NGX_OK) {
- r->lingering_close = 0;
- return NGX_OK;
- }
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- return rc;
- }
-
- /* rc == NGX_AGAIN */
-
- r->read_event_handler = ngx_http_discarded_request_body_handler;
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- r->count++;
- r->discard_body = 1;
-
- return NGX_OK;
-}
-
-
-void
-ngx_http_discarded_request_body_handler(ngx_http_request_t *r)
-{
- ngx_int_t rc;
- ngx_msec_t timer;
- ngx_event_t *rev;
- ngx_connection_t *c;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->connection;
- rev = c->read;
-
- if (rev->timedout) {
- c->timedout = 1;
- c->error = 1;
- ngx_http_finalize_request(r, NGX_ERROR);
- return;
- }
-
- if (r->lingering_time) {
- timer = (ngx_msec_t) r->lingering_time - (ngx_msec_t) ngx_time();
-
- if ((ngx_msec_int_t) timer <= 0) {
- r->discard_body = 0;
- r->lingering_close = 0;
- ngx_http_finalize_request(r, NGX_ERROR);
- return;
- }
-
- } else {
- timer = 0;
- }
-
- rc = ngx_http_read_discarded_request_body(r);
-
- if (rc == NGX_OK) {
- r->discard_body = 0;
- r->lingering_close = 0;
- ngx_http_finalize_request(r, NGX_DONE);
- return;
- }
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- c->error = 1;
- ngx_http_finalize_request(r, NGX_ERROR);
- return;
- }
-
- /* rc == NGX_AGAIN */
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- c->error = 1;
- ngx_http_finalize_request(r, NGX_ERROR);
- return;
- }
-
- if (timer) {
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- timer *= 1000;
-
- if (timer > clcf->lingering_timeout) {
- timer = clcf->lingering_timeout;
- }
-
- ngx_add_timer(rev, timer);
- }
-}
-
-
-static ngx_int_t
-ngx_http_read_discarded_request_body(ngx_http_request_t *r)
-{
- size_t size;
- ssize_t n;
- ngx_int_t rc;
- ngx_buf_t b;
- u_char buffer[NGX_HTTP_DISCARD_BUFFER_SIZE];
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http read discarded body");
-
- ngx_memzero(&b, sizeof(ngx_buf_t));
-
- b.temporary = 1;
-
- for ( ;; ) {
- if (r->headers_in.content_length_n == 0) {
- r->read_event_handler = ngx_http_block_reading;
- return NGX_OK;
- }
-
- if (!r->connection->read->ready) {
- return NGX_AGAIN;
- }
-
- size = (size_t) ngx_min(r->headers_in.content_length_n,
- NGX_HTTP_DISCARD_BUFFER_SIZE);
-
- n = r->connection->recv(r->connection, buffer, size);
-
- if (n == NGX_ERROR) {
- r->connection->error = 1;
- return NGX_OK;
- }
-
- if (n == NGX_AGAIN) {
- return NGX_AGAIN;
- }
-
- if (n == 0) {
- return NGX_OK;
- }
-
- b.pos = buffer;
- b.last = buffer + n;
-
- rc = ngx_http_discard_request_body_filter(r, &b);
-
- if (rc != NGX_OK) {
- return rc;
- }
- }
-}
-
-
-static ngx_int_t
-ngx_http_discard_request_body_filter(ngx_http_request_t *r, ngx_buf_t *b)
-{
- size_t size;
- ngx_int_t rc;
- ngx_http_request_body_t *rb;
-
- if (r->headers_in.chunked) {
-
- rb = r->request_body;
-
- if (rb == NULL) {
-
- rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t));
- if (rb == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- rb->chunked = ngx_pcalloc(r->pool, sizeof(ngx_http_chunked_t));
- if (rb->chunked == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- r->request_body = rb;
- }
-
- for ( ;; ) {
-
- rc = ngx_http_parse_chunked(r, b, rb->chunked);
-
- if (rc == NGX_OK) {
-
- /* a chunk has been parsed successfully */
-
- size = b->last - b->pos;
-
- if ((off_t) size > rb->chunked->size) {
- b->pos += (size_t) rb->chunked->size;
- rb->chunked->size = 0;
-
- } else {
- rb->chunked->size -= size;
- b->pos = b->last;
- }
-
- continue;
- }
-
- if (rc == NGX_DONE) {
-
- /* a whole response has been parsed successfully */
-
- r->headers_in.content_length_n = 0;
- break;
- }
-
- if (rc == NGX_AGAIN) {
-
- /* set amount of data we want to see next time */
-
- r->headers_in.content_length_n = rb->chunked->length;
- break;
- }
-
- /* invalid */
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client sent invalid chunked body");
-
- return NGX_HTTP_BAD_REQUEST;
- }
-
- } else {
- size = b->last - b->pos;
-
- if ((off_t) size > r->headers_in.content_length_n) {
- b->pos += (size_t) r->headers_in.content_length_n;
- r->headers_in.content_length_n = 0;
-
- } else {
- b->pos = b->last;
- r->headers_in.content_length_n -= size;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_test_expect(ngx_http_request_t *r)
-{
- ngx_int_t n;
- ngx_str_t *expect;
-
- if (r->expect_tested
- || r->headers_in.expect == NULL
- || r->http_version < NGX_HTTP_VERSION_11)
- {
- return NGX_OK;
- }
-
- r->expect_tested = 1;
-
- expect = &r->headers_in.expect->value;
-
- if (expect->len != sizeof("100-continue") - 1
- || ngx_strncasecmp(expect->data, (u_char *) "100-continue",
- sizeof("100-continue") - 1)
- != 0)
- {
- return NGX_OK;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "send 100 Continue");
-
- n = r->connection->send(r->connection,
- (u_char *) "HTTP/1.1 100 Continue" CRLF CRLF,
- sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1);
-
- if (n == sizeof("HTTP/1.1 100 Continue" CRLF CRLF) - 1) {
- return NGX_OK;
- }
-
- /* we assume that such small packet should be send successfully */
-
- return NGX_ERROR;
-}
-
-
-static ngx_int_t
-ngx_http_request_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- if (r->headers_in.chunked) {
- return ngx_http_request_body_chunked_filter(r, in);
-
- } else {
- return ngx_http_request_body_length_filter(r, in);
- }
-}
-
-
-static ngx_int_t
-ngx_http_request_body_length_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- size_t size;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t *cl, *tl, *out, **ll;
- ngx_http_request_body_t *rb;
-
- rb = r->request_body;
-
- if (rb->rest == -1) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http request body content length filter");
-
- rb->rest = r->headers_in.content_length_n;
- }
-
- out = NULL;
- ll = &out;
-
- for (cl = in; cl; cl = cl->next) {
-
- if (rb->rest == 0) {
- break;
- }
-
- tl = ngx_chain_get_free_buf(r->pool, &rb->free);
- if (tl == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b = tl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->temporary = 1;
- b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body;
- b->start = cl->buf->pos;
- b->pos = cl->buf->pos;
- b->last = cl->buf->last;
- b->end = cl->buf->end;
-
- size = cl->buf->last - cl->buf->pos;
-
- if ((off_t) size < rb->rest) {
- cl->buf->pos = cl->buf->last;
- rb->rest -= size;
-
- } else {
- cl->buf->pos += (size_t) rb->rest;
- rb->rest = 0;
- b->last = cl->buf->pos;
- b->last_buf = 1;
- }
-
- *ll = tl;
- ll = &tl->next;
- }
-
- rc = ngx_http_request_body_save_filter(r, out);
-
- ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out,
- (ngx_buf_tag_t) &ngx_http_read_client_request_body);
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_request_body_chunked_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- size_t size;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t *cl, *out, *tl, **ll;
- ngx_http_request_body_t *rb;
- ngx_http_core_loc_conf_t *clcf;
-
- rb = r->request_body;
-
- if (rb->rest == -1) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http request body chunked filter");
-
- rb->chunked = ngx_pcalloc(r->pool, sizeof(ngx_http_chunked_t));
- if (rb->chunked == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- r->headers_in.content_length_n = 0;
- rb->rest = 3;
- }
-
- out = NULL;
- ll = &out;
-
- for (cl = in; cl; cl = cl->next) {
-
- for ( ;; ) {
-
- ngx_log_debug7(NGX_LOG_DEBUG_EVENT, r->connection->log, 0,
- "http body chunked buf "
- "t:%d f:%d %p, pos %p, size: %z file: %O, size: %z",
- cl->buf->temporary, cl->buf->in_file,
- cl->buf->start, cl->buf->pos,
- cl->buf->last - cl->buf->pos,
- cl->buf->file_pos,
- cl->buf->file_last - cl->buf->file_pos);
-
- rc = ngx_http_parse_chunked(r, cl->buf, rb->chunked);
-
- if (rc == NGX_OK) {
-
- /* a chunk has been parsed successfully */
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->client_max_body_size
- && clcf->client_max_body_size
- - r->headers_in.content_length_n < rb->chunked->size)
- {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client intended to send too large chunked "
- "body: %O+%O bytes",
- r->headers_in.content_length_n,
- rb->chunked->size);
-
- r->lingering_close = 1;
-
- return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE;
- }
-
- tl = ngx_chain_get_free_buf(r->pool, &rb->free);
- if (tl == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b = tl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->temporary = 1;
- b->tag = (ngx_buf_tag_t) &ngx_http_read_client_request_body;
- b->start = cl->buf->pos;
- b->pos = cl->buf->pos;
- b->last = cl->buf->last;
- b->end = cl->buf->end;
-
- *ll = tl;
- ll = &tl->next;
-
- size = cl->buf->last - cl->buf->pos;
-
- if ((off_t) size > rb->chunked->size) {
- cl->buf->pos += (size_t) rb->chunked->size;
- r->headers_in.content_length_n += rb->chunked->size;
- rb->chunked->size = 0;
-
- } else {
- rb->chunked->size -= size;
- r->headers_in.content_length_n += size;
- cl->buf->pos = cl->buf->last;
- }
-
- b->last = cl->buf->pos;
-
- continue;
- }
-
- if (rc == NGX_DONE) {
-
- /* a whole response has been parsed successfully */
-
- rb->rest = 0;
-
- tl = ngx_chain_get_free_buf(r->pool, &rb->free);
- if (tl == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- b = tl->buf;
-
- ngx_memzero(b, sizeof(ngx_buf_t));
-
- b->last_buf = 1;
-
- *ll = tl;
- ll = &tl->next;
-
- break;
- }
-
- if (rc == NGX_AGAIN) {
-
- /* set rb->rest, amount of data we want to see next time */
-
- rb->rest = rb->chunked->length;
-
- break;
- }
-
- /* invalid */
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client sent invalid chunked body");
-
- return NGX_HTTP_BAD_REQUEST;
- }
- }
-
- rc = ngx_http_request_body_save_filter(r, out);
-
- ngx_chain_update_chains(r->pool, &rb->free, &rb->busy, &out,
- (ngx_buf_tag_t) &ngx_http_read_client_request_body);
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_http_request_body_save_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
-#if (NGX_DEBUG)
- ngx_chain_t *cl;
-#endif
- ngx_http_request_body_t *rb;
-
- rb = r->request_body;
-
-#if (NGX_DEBUG)
-
- for (cl = rb->bufs; cl; cl = cl->next) {
- ngx_log_debug7(NGX_LOG_DEBUG_EVENT, r->connection->log, 0,
- "http body old buf t:%d f:%d %p, pos %p, size: %z "
- "file: %O, size: %z",
- cl->buf->temporary, cl->buf->in_file,
- cl->buf->start, cl->buf->pos,
- cl->buf->last - cl->buf->pos,
- cl->buf->file_pos,
- cl->buf->file_last - cl->buf->file_pos);
- }
-
- for (cl = in; cl; cl = cl->next) {
- ngx_log_debug7(NGX_LOG_DEBUG_EVENT, r->connection->log, 0,
- "http body new buf t:%d f:%d %p, pos %p, size: %z "
- "file: %O, size: %z",
- cl->buf->temporary, cl->buf->in_file,
- cl->buf->start, cl->buf->pos,
- cl->buf->last - cl->buf->pos,
- cl->buf->file_pos,
- cl->buf->file_last - cl->buf->file_pos);
- }
-
-#endif
-
- /* TODO: coalesce neighbouring buffers */
-
- if (ngx_chain_add_copy(r->pool, &rb->bufs, in) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.c
deleted file mode 100644
index 02e2be3bb80..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.c
+++ /dev/null
@@ -1,1754 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static ngx_int_t ngx_http_script_init_arrays(ngx_http_script_compile_t *sc);
-static ngx_int_t ngx_http_script_done(ngx_http_script_compile_t *sc);
-static ngx_int_t ngx_http_script_add_copy_code(ngx_http_script_compile_t *sc,
- ngx_str_t *value, ngx_uint_t last);
-static ngx_int_t ngx_http_script_add_var_code(ngx_http_script_compile_t *sc,
- ngx_str_t *name);
-static ngx_int_t ngx_http_script_add_args_code(ngx_http_script_compile_t *sc);
-#if (NGX_PCRE)
-static ngx_int_t ngx_http_script_add_capture_code(ngx_http_script_compile_t *sc,
- ngx_uint_t n);
-#endif
-static ngx_int_t
- ngx_http_script_add_full_name_code(ngx_http_script_compile_t *sc);
-static size_t ngx_http_script_full_name_len_code(ngx_http_script_engine_t *e);
-static void ngx_http_script_full_name_code(ngx_http_script_engine_t *e);
-
-
-#define ngx_http_script_exit (u_char *) &ngx_http_script_exit_code
-
-static uintptr_t ngx_http_script_exit_code = (uintptr_t) NULL;
-
-
-void
-ngx_http_script_flush_complex_value(ngx_http_request_t *r,
- ngx_http_complex_value_t *val)
-{
- ngx_uint_t *index;
-
- index = val->flushes;
-
- if (index) {
- while (*index != (ngx_uint_t) -1) {
-
- if (r->variables[*index].no_cacheable) {
- r->variables[*index].valid = 0;
- r->variables[*index].not_found = 0;
- }
-
- index++;
- }
- }
-}
-
-
-ngx_int_t
-ngx_http_complex_value(ngx_http_request_t *r, ngx_http_complex_value_t *val,
- ngx_str_t *value)
-{
- size_t len;
- ngx_http_script_code_pt code;
- ngx_http_script_len_code_pt lcode;
- ngx_http_script_engine_t e;
-
- if (val->lengths == NULL) {
- *value = val->value;
- return NGX_OK;
- }
-
- ngx_http_script_flush_complex_value(r, val);
-
- ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
-
- e.ip = val->lengths;
- e.request = r;
- e.flushed = 1;
-
- len = 0;
-
- while (*(uintptr_t *) e.ip) {
- lcode = *(ngx_http_script_len_code_pt *) e.ip;
- len += lcode(&e);
- }
-
- value->len = len;
- value->data = ngx_pnalloc(r->pool, len);
- if (value->data == NULL) {
- return NGX_ERROR;
- }
-
- e.ip = val->values;
- e.pos = value->data;
- e.buf = *value;
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
-
- *value = e.buf;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_compile_complex_value(ngx_http_compile_complex_value_t *ccv)
-{
- ngx_str_t *v;
- ngx_uint_t i, n, nv, nc;
- ngx_array_t flushes, lengths, values, *pf, *pl, *pv;
- ngx_http_script_compile_t sc;
-
- v = ccv->value;
-
- nv = 0;
- nc = 0;
-
- for (i = 0; i < v->len; i++) {
- if (v->data[i] == '$') {
- if (v->data[i + 1] >= '1' && v->data[i + 1] <= '9') {
- nc++;
-
- } else {
- nv++;
- }
- }
- }
-
- if ((v->len == 0 || v->data[0] != '$')
- && (ccv->conf_prefix || ccv->root_prefix))
- {
- if (ngx_conf_full_name(ccv->cf->cycle, v, ccv->conf_prefix) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ccv->conf_prefix = 0;
- ccv->root_prefix = 0;
- }
-
- ccv->complex_value->value = *v;
- ccv->complex_value->flushes = NULL;
- ccv->complex_value->lengths = NULL;
- ccv->complex_value->values = NULL;
-
- if (nv == 0 && nc == 0) {
- return NGX_OK;
- }
-
- n = nv + 1;
-
- if (ngx_array_init(&flushes, ccv->cf->pool, n, sizeof(ngx_uint_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- n = nv * (2 * sizeof(ngx_http_script_copy_code_t)
- + sizeof(ngx_http_script_var_code_t))
- + sizeof(uintptr_t);
-
- if (ngx_array_init(&lengths, ccv->cf->pool, n, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- n = (nv * (2 * sizeof(ngx_http_script_copy_code_t)
- + sizeof(ngx_http_script_var_code_t))
- + sizeof(uintptr_t)
- + v->len
- + sizeof(uintptr_t) - 1)
- & ~(sizeof(uintptr_t) - 1);
-
- if (ngx_array_init(&values, ccv->cf->pool, n, 1) != NGX_OK) {
- return NGX_ERROR;
- }
-
- pf = &flushes;
- pl = &lengths;
- pv = &values;
-
- ngx_memzero(&sc, sizeof(ngx_http_script_compile_t));
-
- sc.cf = ccv->cf;
- sc.source = v;
- sc.flushes = &pf;
- sc.lengths = &pl;
- sc.values = &pv;
- sc.complete_lengths = 1;
- sc.complete_values = 1;
- sc.zero = ccv->zero;
- sc.conf_prefix = ccv->conf_prefix;
- sc.root_prefix = ccv->root_prefix;
-
- if (ngx_http_script_compile(&sc) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (flushes.nelts) {
- ccv->complex_value->flushes = flushes.elts;
- ccv->complex_value->flushes[flushes.nelts] = (ngx_uint_t) -1;
- }
-
- ccv->complex_value->lengths = lengths.elts;
- ccv->complex_value->values = values.elts;
-
- return NGX_OK;
-}
-
-
-char *
-ngx_http_set_complex_value_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *p = conf;
-
- ngx_str_t *value;
- ngx_http_complex_value_t **cv;
- ngx_http_compile_complex_value_t ccv;
-
- cv = (ngx_http_complex_value_t **) (p + cmd->offset);
-
- if (*cv != NULL) {
- return "duplicate";
- }
-
- *cv = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
- if (*cv == NULL) {
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = *cv;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-ngx_int_t
-ngx_http_test_predicates(ngx_http_request_t *r, ngx_array_t *predicates)
-{
- ngx_str_t val;
- ngx_uint_t i;
- ngx_http_complex_value_t *cv;
-
- if (predicates == NULL) {
- return NGX_OK;
- }
-
- cv = predicates->elts;
-
- for (i = 0; i < predicates->nelts; i++) {
- if (ngx_http_complex_value(r, &cv[i], &val) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (val.len && (val.len != 1 || val.data[0] != '0')) {
- return NGX_DECLINED;
- }
- }
-
- return NGX_OK;
-}
-
-
-char *
-ngx_http_set_predicate_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *p = conf;
-
- ngx_str_t *value;
- ngx_uint_t i;
- ngx_array_t **a;
- ngx_http_complex_value_t *cv;
- ngx_http_compile_complex_value_t ccv;
-
- a = (ngx_array_t **) (p + cmd->offset);
-
- if (*a == NGX_CONF_UNSET_PTR) {
- *a = ngx_array_create(cf->pool, 1, sizeof(ngx_http_complex_value_t));
- if (*a == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
- cv = ngx_array_push(*a);
- if (cv == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[i];
- ccv.complex_value = cv;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- return NGX_CONF_OK;
-}
-
-
-ngx_uint_t
-ngx_http_script_variables_count(ngx_str_t *value)
-{
- ngx_uint_t i, n;
-
- for (n = 0, i = 0; i < value->len; i++) {
- if (value->data[i] == '$') {
- n++;
- }
- }
-
- return n;
-}
-
-
-ngx_int_t
-ngx_http_script_compile(ngx_http_script_compile_t *sc)
-{
- u_char ch;
- ngx_str_t name;
- ngx_uint_t i, bracket;
-
- if (ngx_http_script_init_arrays(sc) != NGX_OK) {
- return NGX_ERROR;
- }
-
- for (i = 0; i < sc->source->len; /* void */ ) {
-
- name.len = 0;
-
- if (sc->source->data[i] == '$') {
-
- if (++i == sc->source->len) {
- goto invalid_variable;
- }
-
-#if (NGX_PCRE)
- {
- ngx_uint_t n;
-
- if (sc->source->data[i] >= '1' && sc->source->data[i] <= '9') {
-
- n = sc->source->data[i] - '0';
-
- if (sc->captures_mask & (1 << n)) {
- sc->dup_capture = 1;
- }
-
- sc->captures_mask |= 1 << n;
-
- if (ngx_http_script_add_capture_code(sc, n) != NGX_OK) {
- return NGX_ERROR;
- }
-
- i++;
-
- continue;
- }
- }
-#endif
-
- if (sc->source->data[i] == '{') {
- bracket = 1;
-
- if (++i == sc->source->len) {
- goto invalid_variable;
- }
-
- name.data = &sc->source->data[i];
-
- } else {
- bracket = 0;
- name.data = &sc->source->data[i];
- }
-
- for ( /* void */ ; i < sc->source->len; i++, name.len++) {
- ch = sc->source->data[i];
-
- if (ch == '}' && bracket) {
- i++;
- bracket = 0;
- break;
- }
-
- if ((ch >= 'A' && ch <= 'Z')
- || (ch >= 'a' && ch <= 'z')
- || (ch >= '0' && ch <= '9')
- || ch == '_')
- {
- continue;
- }
-
- break;
- }
-
- if (bracket) {
- ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0,
- "the closing bracket in \"%V\" "
- "variable is missing", &name);
- return NGX_ERROR;
- }
-
- if (name.len == 0) {
- goto invalid_variable;
- }
-
- sc->variables++;
-
- if (ngx_http_script_add_var_code(sc, &name) != NGX_OK) {
- return NGX_ERROR;
- }
-
- continue;
- }
-
- if (sc->source->data[i] == '?' && sc->compile_args) {
- sc->args = 1;
- sc->compile_args = 0;
-
- if (ngx_http_script_add_args_code(sc) != NGX_OK) {
- return NGX_ERROR;
- }
-
- i++;
-
- continue;
- }
-
- name.data = &sc->source->data[i];
-
- while (i < sc->source->len) {
-
- if (sc->source->data[i] == '$') {
- break;
- }
-
- if (sc->source->data[i] == '?') {
-
- sc->args = 1;
-
- if (sc->compile_args) {
- break;
- }
- }
-
- i++;
- name.len++;
- }
-
- sc->size += name.len;
-
- if (ngx_http_script_add_copy_code(sc, &name, (i == sc->source->len))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
-
- return ngx_http_script_done(sc);
-
-invalid_variable:
-
- ngx_conf_log_error(NGX_LOG_EMERG, sc->cf, 0, "invalid variable name");
-
- return NGX_ERROR;
-}
-
-
-u_char *
-ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
- void *code_lengths, size_t len, void *code_values)
-{
- ngx_uint_t i;
- ngx_http_script_code_pt code;
- ngx_http_script_len_code_pt lcode;
- ngx_http_script_engine_t e;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- for (i = 0; i < cmcf->variables.nelts; i++) {
- if (r->variables[i].no_cacheable) {
- r->variables[i].valid = 0;
- r->variables[i].not_found = 0;
- }
- }
-
- ngx_memzero(&e, sizeof(ngx_http_script_engine_t));
-
- e.ip = code_lengths;
- e.request = r;
- e.flushed = 1;
-
- while (*(uintptr_t *) e.ip) {
- lcode = *(ngx_http_script_len_code_pt *) e.ip;
- len += lcode(&e);
- }
-
-
- value->len = len;
- value->data = ngx_pnalloc(r->pool, len);
- if (value->data == NULL) {
- return NULL;
- }
-
- e.ip = code_values;
- e.pos = value->data;
-
- while (*(uintptr_t *) e.ip) {
- code = *(ngx_http_script_code_pt *) e.ip;
- code((ngx_http_script_engine_t *) &e);
- }
-
- return e.pos;
-}
-
-
-void
-ngx_http_script_flush_no_cacheable_variables(ngx_http_request_t *r,
- ngx_array_t *indices)
-{
- ngx_uint_t n, *index;
-
- if (indices) {
- index = indices->elts;
- for (n = 0; n < indices->nelts; n++) {
- if (r->variables[index[n]].no_cacheable) {
- r->variables[index[n]].valid = 0;
- r->variables[index[n]].not_found = 0;
- }
- }
- }
-}
-
-
-static ngx_int_t
-ngx_http_script_init_arrays(ngx_http_script_compile_t *sc)
-{
- ngx_uint_t n;
-
- if (sc->flushes && *sc->flushes == NULL) {
- n = sc->variables ? sc->variables : 1;
- *sc->flushes = ngx_array_create(sc->cf->pool, n, sizeof(ngx_uint_t));
- if (*sc->flushes == NULL) {
- return NGX_ERROR;
- }
- }
-
- if (*sc->lengths == NULL) {
- n = sc->variables * (2 * sizeof(ngx_http_script_copy_code_t)
- + sizeof(ngx_http_script_var_code_t))
- + sizeof(uintptr_t);
-
- *sc->lengths = ngx_array_create(sc->cf->pool, n, 1);
- if (*sc->lengths == NULL) {
- return NGX_ERROR;
- }
- }
-
- if (*sc->values == NULL) {
- n = (sc->variables * (2 * sizeof(ngx_http_script_copy_code_t)
- + sizeof(ngx_http_script_var_code_t))
- + sizeof(uintptr_t)
- + sc->source->len
- + sizeof(uintptr_t) - 1)
- & ~(sizeof(uintptr_t) - 1);
-
- *sc->values = ngx_array_create(sc->cf->pool, n, 1);
- if (*sc->values == NULL) {
- return NGX_ERROR;
- }
- }
-
- sc->variables = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_script_done(ngx_http_script_compile_t *sc)
-{
- ngx_str_t zero;
- uintptr_t *code;
-
- if (sc->zero) {
-
- zero.len = 1;
- zero.data = (u_char *) "\0";
-
- if (ngx_http_script_add_copy_code(sc, &zero, 0) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- if (sc->conf_prefix || sc->root_prefix) {
- if (ngx_http_script_add_full_name_code(sc) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- if (sc->complete_lengths) {
- code = ngx_http_script_add_code(*sc->lengths, sizeof(uintptr_t), NULL);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
- }
-
- if (sc->complete_values) {
- code = ngx_http_script_add_code(*sc->values, sizeof(uintptr_t),
- &sc->main);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) NULL;
- }
-
- return NGX_OK;
-}
-
-
-void *
-ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes, size_t size)
-{
- if (*codes == NULL) {
- *codes = ngx_array_create(pool, 256, 1);
- if (*codes == NULL) {
- return NULL;
- }
- }
-
- return ngx_array_push_n(*codes, size);
-}
-
-
-void *
-ngx_http_script_add_code(ngx_array_t *codes, size_t size, void *code)
-{
- u_char *elts, **p;
- void *new;
-
- elts = codes->elts;
-
- new = ngx_array_push_n(codes, size);
- if (new == NULL) {
- return NULL;
- }
-
- if (code) {
- if (elts != codes->elts) {
- p = code;
- *p += (u_char *) codes->elts - elts;
- }
- }
-
- return new;
-}
-
-
-static ngx_int_t
-ngx_http_script_add_copy_code(ngx_http_script_compile_t *sc, ngx_str_t *value,
- ngx_uint_t last)
-{
- u_char *p;
- size_t size, len, zero;
- ngx_http_script_copy_code_t *code;
-
- zero = (sc->zero && last);
- len = value->len + zero;
-
- code = ngx_http_script_add_code(*sc->lengths,
- sizeof(ngx_http_script_copy_code_t), NULL);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- code->code = (ngx_http_script_code_pt) ngx_http_script_copy_len_code;
- code->len = len;
-
- size = (sizeof(ngx_http_script_copy_code_t) + len + sizeof(uintptr_t) - 1)
- & ~(sizeof(uintptr_t) - 1);
-
- code = ngx_http_script_add_code(*sc->values, size, &sc->main);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- code->code = ngx_http_script_copy_code;
- code->len = len;
-
- p = ngx_cpymem((u_char *) code + sizeof(ngx_http_script_copy_code_t),
- value->data, value->len);
-
- if (zero) {
- *p = '\0';
- sc->zero = 0;
- }
-
- return NGX_OK;
-}
-
-
-size_t
-ngx_http_script_copy_len_code(ngx_http_script_engine_t *e)
-{
- ngx_http_script_copy_code_t *code;
-
- code = (ngx_http_script_copy_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_copy_code_t);
-
- return code->len;
-}
-
-
-void
-ngx_http_script_copy_code(ngx_http_script_engine_t *e)
-{
- u_char *p;
- ngx_http_script_copy_code_t *code;
-
- code = (ngx_http_script_copy_code_t *) e->ip;
-
- p = e->pos;
-
- if (!e->skip) {
- e->pos = ngx_copy(p, e->ip + sizeof(ngx_http_script_copy_code_t),
- code->len);
- }
-
- e->ip += sizeof(ngx_http_script_copy_code_t)
- + ((code->len + sizeof(uintptr_t) - 1) & ~(sizeof(uintptr_t) - 1));
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script copy: \"%*s\"", e->pos - p, p);
-}
-
-
-static ngx_int_t
-ngx_http_script_add_var_code(ngx_http_script_compile_t *sc, ngx_str_t *name)
-{
- ngx_int_t index, *p;
- ngx_http_script_var_code_t *code;
-
- index = ngx_http_get_variable_index(sc->cf, name);
-
- if (index == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if (sc->flushes) {
- p = ngx_array_push(*sc->flushes);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- *p = index;
- }
-
- code = ngx_http_script_add_code(*sc->lengths,
- sizeof(ngx_http_script_var_code_t), NULL);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- code->code = (ngx_http_script_code_pt) ngx_http_script_copy_var_len_code;
- code->index = (uintptr_t) index;
-
- code = ngx_http_script_add_code(*sc->values,
- sizeof(ngx_http_script_var_code_t),
- &sc->main);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- code->code = ngx_http_script_copy_var_code;
- code->index = (uintptr_t) index;
-
- return NGX_OK;
-}
-
-
-size_t
-ngx_http_script_copy_var_len_code(ngx_http_script_engine_t *e)
-{
- ngx_http_variable_value_t *value;
- ngx_http_script_var_code_t *code;
-
- code = (ngx_http_script_var_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_var_code_t);
-
- if (e->flushed) {
- value = ngx_http_get_indexed_variable(e->request, code->index);
-
- } else {
- value = ngx_http_get_flushed_variable(e->request, code->index);
- }
-
- if (value && !value->not_found) {
- return value->len;
- }
-
- return 0;
-}
-
-
-void
-ngx_http_script_copy_var_code(ngx_http_script_engine_t *e)
-{
- u_char *p;
- ngx_http_variable_value_t *value;
- ngx_http_script_var_code_t *code;
-
- code = (ngx_http_script_var_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_var_code_t);
-
- if (!e->skip) {
-
- if (e->flushed) {
- value = ngx_http_get_indexed_variable(e->request, code->index);
-
- } else {
- value = ngx_http_get_flushed_variable(e->request, code->index);
- }
-
- if (value && !value->not_found) {
- p = e->pos;
- e->pos = ngx_copy(p, value->data, value->len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP,
- e->request->connection->log, 0,
- "http script var: \"%*s\"", e->pos - p, p);
- }
- }
-}
-
-
-static ngx_int_t
-ngx_http_script_add_args_code(ngx_http_script_compile_t *sc)
-{
- uintptr_t *code;
-
- code = ngx_http_script_add_code(*sc->lengths, sizeof(uintptr_t), NULL);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) ngx_http_script_mark_args_code;
-
- code = ngx_http_script_add_code(*sc->values, sizeof(uintptr_t), &sc->main);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- *code = (uintptr_t) ngx_http_script_start_args_code;
-
- return NGX_OK;
-}
-
-
-size_t
-ngx_http_script_mark_args_code(ngx_http_script_engine_t *e)
-{
- e->is_args = 1;
- e->ip += sizeof(uintptr_t);
-
- return 1;
-}
-
-
-void
-ngx_http_script_start_args_code(ngx_http_script_engine_t *e)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script args");
-
- e->is_args = 1;
- e->args = e->pos;
- e->ip += sizeof(uintptr_t);
-}
-
-
-#if (NGX_PCRE)
-
-void
-ngx_http_script_regex_start_code(ngx_http_script_engine_t *e)
-{
- size_t len;
- ngx_int_t rc;
- ngx_uint_t n;
- ngx_http_request_t *r;
- ngx_http_script_engine_t le;
- ngx_http_script_len_code_pt lcode;
- ngx_http_script_regex_code_t *code;
-
- code = (ngx_http_script_regex_code_t *) e->ip;
-
- r = e->request;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http script regex: \"%V\"", &code->name);
-
- if (code->uri) {
- e->line = r->uri;
- } else {
- e->sp--;
- e->line.len = e->sp->len;
- e->line.data = e->sp->data;
- }
-
- rc = ngx_http_regex_exec(r, code->regex, &e->line);
-
- if (rc == NGX_DECLINED) {
- if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {
- ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
- "\"%V\" does not match \"%V\"",
- &code->name, &e->line);
- }
-
- r->ncaptures = 0;
-
- if (code->test) {
- if (code->negative_test) {
- e->sp->len = 1;
- e->sp->data = (u_char *) "1";
-
- } else {
- e->sp->len = 0;
- e->sp->data = (u_char *) "";
- }
-
- e->sp++;
-
- e->ip += sizeof(ngx_http_script_regex_code_t);
- return;
- }
-
- e->ip += code->next;
- return;
- }
-
- if (rc == NGX_ERROR) {
- e->ip = ngx_http_script_exit;
- e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
- return;
- }
-
- if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {
- ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
- "\"%V\" matches \"%V\"", &code->name, &e->line);
- }
-
- if (code->test) {
- if (code->negative_test) {
- e->sp->len = 0;
- e->sp->data = (u_char *) "";
-
- } else {
- e->sp->len = 1;
- e->sp->data = (u_char *) "1";
- }
-
- e->sp++;
-
- e->ip += sizeof(ngx_http_script_regex_code_t);
- return;
- }
-
- if (code->status) {
- e->status = code->status;
-
- if (!code->redirect) {
- e->ip = ngx_http_script_exit;
- return;
- }
- }
-
- if (code->uri) {
- r->internal = 1;
- r->valid_unparsed_uri = 0;
-
- if (code->break_cycle) {
- r->valid_location = 0;
- r->uri_changed = 0;
-
- } else {
- r->uri_changed = 1;
- }
- }
-
- if (code->lengths == NULL) {
- e->buf.len = code->size;
-
- if (code->uri) {
- if (r->ncaptures && (r->quoted_uri || r->plus_in_uri)) {
- e->buf.len += 2 * ngx_escape_uri(NULL, r->uri.data, r->uri.len,
- NGX_ESCAPE_ARGS);
- }
- }
-
- for (n = 2; n < r->ncaptures; n += 2) {
- e->buf.len += r->captures[n + 1] - r->captures[n];
- }
-
- } else {
- ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
-
- le.ip = code->lengths->elts;
- le.line = e->line;
- le.request = r;
- le.quote = code->redirect;
-
- len = 0;
-
- while (*(uintptr_t *) le.ip) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- len += lcode(&le);
- }
-
- e->buf.len = len;
- }
-
- if (code->add_args && r->args.len) {
- e->buf.len += r->args.len + 1;
- }
-
- e->buf.data = ngx_pnalloc(r->pool, e->buf.len);
- if (e->buf.data == NULL) {
- e->ip = ngx_http_script_exit;
- e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
- return;
- }
-
- e->quote = code->redirect;
-
- e->pos = e->buf.data;
-
- e->ip += sizeof(ngx_http_script_regex_code_t);
-}
-
-
-void
-ngx_http_script_regex_end_code(ngx_http_script_engine_t *e)
-{
- u_char *dst, *src;
- ngx_http_request_t *r;
- ngx_http_script_regex_end_code_t *code;
-
- code = (ngx_http_script_regex_end_code_t *) e->ip;
-
- r = e->request;
-
- e->quote = 0;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http script regex end");
-
- if (code->redirect) {
-
- dst = e->buf.data;
- src = e->buf.data;
-
- ngx_unescape_uri(&dst, &src, e->pos - e->buf.data,
- NGX_UNESCAPE_REDIRECT);
-
- if (src < e->pos) {
- dst = ngx_movemem(dst, src, e->pos - src);
- }
-
- e->pos = dst;
-
- if (code->add_args && r->args.len) {
- *e->pos++ = (u_char) (code->args ? '&' : '?');
- e->pos = ngx_copy(e->pos, r->args.data, r->args.len);
- }
-
- e->buf.len = e->pos - e->buf.data;
-
- if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {
- ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
- "rewritten redirect: \"%V\"", &e->buf);
- }
-
- ngx_http_clear_location(r);
-
- r->headers_out.location = ngx_list_push(&r->headers_out.headers);
- if (r->headers_out.location == NULL) {
- e->ip = ngx_http_script_exit;
- e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
- return;
- }
-
- r->headers_out.location->hash = 1;
- ngx_str_set(&r->headers_out.location->key, "Location");
- r->headers_out.location->value = e->buf;
-
- e->ip += sizeof(ngx_http_script_regex_end_code_t);
- return;
- }
-
- if (e->args) {
- e->buf.len = e->args - e->buf.data;
-
- if (code->add_args && r->args.len) {
- *e->pos++ = '&';
- e->pos = ngx_copy(e->pos, r->args.data, r->args.len);
- }
-
- r->args.len = e->pos - e->args;
- r->args.data = e->args;
-
- e->args = NULL;
-
- } else {
- e->buf.len = e->pos - e->buf.data;
-
- if (!code->add_args) {
- r->args.len = 0;
- }
- }
-
- if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {
- ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,
- "rewritten data: \"%V\", args: \"%V\"",
- &e->buf, &r->args);
- }
-
- if (code->uri) {
- r->uri = e->buf;
-
- if (r->uri.len == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "the rewritten URI has a zero length");
- e->ip = ngx_http_script_exit;
- e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
- return;
- }
-
- ngx_http_set_exten(r);
- }
-
- e->ip += sizeof(ngx_http_script_regex_end_code_t);
-}
-
-
-static ngx_int_t
-ngx_http_script_add_capture_code(ngx_http_script_compile_t *sc, ngx_uint_t n)
-{
- ngx_http_script_copy_capture_code_t *code;
-
- code = ngx_http_script_add_code(*sc->lengths,
- sizeof(ngx_http_script_copy_capture_code_t),
- NULL);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- code->code = (ngx_http_script_code_pt)
- ngx_http_script_copy_capture_len_code;
- code->n = 2 * n;
-
-
- code = ngx_http_script_add_code(*sc->values,
- sizeof(ngx_http_script_copy_capture_code_t),
- &sc->main);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- code->code = ngx_http_script_copy_capture_code;
- code->n = 2 * n;
-
- if (sc->ncaptures < n) {
- sc->ncaptures = n;
- }
-
- return NGX_OK;
-}
-
-
-size_t
-ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e)
-{
- int *cap;
- u_char *p;
- ngx_uint_t n;
- ngx_http_request_t *r;
- ngx_http_script_copy_capture_code_t *code;
-
- r = e->request;
-
- code = (ngx_http_script_copy_capture_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_copy_capture_code_t);
-
- n = code->n;
-
- if (n < r->ncaptures) {
-
- cap = r->captures;
-
- if ((e->is_args || e->quote)
- && (e->request->quoted_uri || e->request->plus_in_uri))
- {
- p = r->captures_data;
-
- return cap[n + 1] - cap[n]
- + 2 * ngx_escape_uri(NULL, &p[cap[n]], cap[n + 1] - cap[n],
- NGX_ESCAPE_ARGS);
- } else {
- return cap[n + 1] - cap[n];
- }
- }
-
- return 0;
-}
-
-
-void
-ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e)
-{
- int *cap;
- u_char *p, *pos;
- ngx_uint_t n;
- ngx_http_request_t *r;
- ngx_http_script_copy_capture_code_t *code;
-
- r = e->request;
-
- code = (ngx_http_script_copy_capture_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_copy_capture_code_t);
-
- n = code->n;
-
- pos = e->pos;
-
- if (n < r->ncaptures) {
-
- cap = r->captures;
- p = r->captures_data;
-
- if ((e->is_args || e->quote)
- && (e->request->quoted_uri || e->request->plus_in_uri))
- {
- e->pos = (u_char *) ngx_escape_uri(pos, &p[cap[n]],
- cap[n + 1] - cap[n],
- NGX_ESCAPE_ARGS);
- } else {
- e->pos = ngx_copy(pos, &p[cap[n]], cap[n + 1] - cap[n]);
- }
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script capture: \"%*s\"", e->pos - pos, pos);
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_script_add_full_name_code(ngx_http_script_compile_t *sc)
-{
- ngx_http_script_full_name_code_t *code;
-
- code = ngx_http_script_add_code(*sc->lengths,
- sizeof(ngx_http_script_full_name_code_t),
- NULL);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- code->code = (ngx_http_script_code_pt) ngx_http_script_full_name_len_code;
- code->conf_prefix = sc->conf_prefix;
-
- code = ngx_http_script_add_code(*sc->values,
- sizeof(ngx_http_script_full_name_code_t),
- &sc->main);
- if (code == NULL) {
- return NGX_ERROR;
- }
-
- code->code = ngx_http_script_full_name_code;
- code->conf_prefix = sc->conf_prefix;
-
- return NGX_OK;
-}
-
-
-static size_t
-ngx_http_script_full_name_len_code(ngx_http_script_engine_t *e)
-{
- ngx_http_script_full_name_code_t *code;
-
- code = (ngx_http_script_full_name_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_full_name_code_t);
-
- return code->conf_prefix ? ngx_cycle->conf_prefix.len:
- ngx_cycle->prefix.len;
-}
-
-
-static void
-ngx_http_script_full_name_code(ngx_http_script_engine_t *e)
-{
- ngx_http_script_full_name_code_t *code;
-
- ngx_str_t value, *prefix;
-
- code = (ngx_http_script_full_name_code_t *) e->ip;
-
- value.data = e->buf.data;
- value.len = e->pos - e->buf.data;
-
- prefix = code->conf_prefix ? (ngx_str_t *) &ngx_cycle->conf_prefix:
- (ngx_str_t *) &ngx_cycle->prefix;
-
- if (ngx_get_full_name(e->request->pool, prefix, &value) != NGX_OK) {
- e->ip = ngx_http_script_exit;
- e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
- return;
- }
-
- e->buf = value;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script fullname: \"%V\"", &value);
-
- e->ip += sizeof(ngx_http_script_full_name_code_t);
-}
-
-
-void
-ngx_http_script_return_code(ngx_http_script_engine_t *e)
-{
- ngx_http_script_return_code_t *code;
-
- code = (ngx_http_script_return_code_t *) e->ip;
-
- if (code->status < NGX_HTTP_BAD_REQUEST
- || code->text.value.len
- || code->text.lengths)
- {
- e->status = ngx_http_send_response(e->request, code->status, NULL,
- &code->text);
- } else {
- e->status = code->status;
- }
-
- e->ip = ngx_http_script_exit;
-}
-
-
-void
-ngx_http_script_break_code(ngx_http_script_engine_t *e)
-{
- e->request->uri_changed = 0;
-
- e->ip = ngx_http_script_exit;
-}
-
-
-void
-ngx_http_script_if_code(ngx_http_script_engine_t *e)
-{
- ngx_http_script_if_code_t *code;
-
- code = (ngx_http_script_if_code_t *) e->ip;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script if");
-
- e->sp--;
-
- if (e->sp->len && (e->sp->len != 1 || e->sp->data[0] != '0')) {
- if (code->loc_conf) {
- e->request->loc_conf = code->loc_conf;
- ngx_http_update_location_config(e->request);
- }
-
- e->ip += sizeof(ngx_http_script_if_code_t);
- return;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script if: false");
-
- e->ip += code->next;
-}
-
-
-void
-ngx_http_script_equal_code(ngx_http_script_engine_t *e)
-{
- ngx_http_variable_value_t *val, *res;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script equal");
-
- e->sp--;
- val = e->sp;
- res = e->sp - 1;
-
- e->ip += sizeof(uintptr_t);
-
- if (val->len == res->len
- && ngx_strncmp(val->data, res->data, res->len) == 0)
- {
- *res = ngx_http_variable_true_value;
- return;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script equal: no");
-
- *res = ngx_http_variable_null_value;
-}
-
-
-void
-ngx_http_script_not_equal_code(ngx_http_script_engine_t *e)
-{
- ngx_http_variable_value_t *val, *res;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script not equal");
-
- e->sp--;
- val = e->sp;
- res = e->sp - 1;
-
- e->ip += sizeof(uintptr_t);
-
- if (val->len == res->len
- && ngx_strncmp(val->data, res->data, res->len) == 0)
- {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script not equal: no");
-
- *res = ngx_http_variable_null_value;
- return;
- }
-
- *res = ngx_http_variable_true_value;
-}
-
-
-void
-ngx_http_script_file_code(ngx_http_script_engine_t *e)
-{
- ngx_str_t path;
- ngx_http_request_t *r;
- ngx_open_file_info_t of;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_variable_value_t *value;
- ngx_http_script_file_code_t *code;
-
- value = e->sp - 1;
-
- code = (ngx_http_script_file_code_t *) e->ip;
- e->ip += sizeof(ngx_http_script_file_code_t);
-
- path.len = value->len - 1;
- path.data = value->data;
-
- r = e->request;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http script file op %p \"%V\"", code->op, &path);
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- ngx_memzero(&of, sizeof(ngx_open_file_info_t));
-
- of.read_ahead = clcf->read_ahead;
- of.directio = clcf->directio;
- of.valid = clcf->open_file_cache_valid;
- of.min_uses = clcf->open_file_cache_min_uses;
- of.test_only = 1;
- of.errors = clcf->open_file_cache_errors;
- of.events = clcf->open_file_cache_events;
-
- if (ngx_http_set_disable_symlinks(r, clcf, &path, &of) != NGX_OK) {
- e->ip = ngx_http_script_exit;
- e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
- return;
- }
-
- if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
- != NGX_OK)
- {
- if (of.err != NGX_ENOENT
- && of.err != NGX_ENOTDIR
- && of.err != NGX_ENAMETOOLONG)
- {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, of.err,
- "%s \"%s\" failed", of.failed, value->data);
- }
-
- switch (code->op) {
-
- case ngx_http_script_file_plain:
- case ngx_http_script_file_dir:
- case ngx_http_script_file_exists:
- case ngx_http_script_file_exec:
- goto false_value;
-
- case ngx_http_script_file_not_plain:
- case ngx_http_script_file_not_dir:
- case ngx_http_script_file_not_exists:
- case ngx_http_script_file_not_exec:
- goto true_value;
- }
-
- goto false_value;
- }
-
- switch (code->op) {
- case ngx_http_script_file_plain:
- if (of.is_file) {
- goto true_value;
- }
- goto false_value;
-
- case ngx_http_script_file_not_plain:
- if (of.is_file) {
- goto false_value;
- }
- goto true_value;
-
- case ngx_http_script_file_dir:
- if (of.is_dir) {
- goto true_value;
- }
- goto false_value;
-
- case ngx_http_script_file_not_dir:
- if (of.is_dir) {
- goto false_value;
- }
- goto true_value;
-
- case ngx_http_script_file_exists:
- if (of.is_file || of.is_dir || of.is_link) {
- goto true_value;
- }
- goto false_value;
-
- case ngx_http_script_file_not_exists:
- if (of.is_file || of.is_dir || of.is_link) {
- goto false_value;
- }
- goto true_value;
-
- case ngx_http_script_file_exec:
- if (of.is_exec) {
- goto true_value;
- }
- goto false_value;
-
- case ngx_http_script_file_not_exec:
- if (of.is_exec) {
- goto false_value;
- }
- goto true_value;
- }
-
-false_value:
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http script file op false");
-
- *value = ngx_http_variable_null_value;
- return;
-
-true_value:
-
- *value = ngx_http_variable_true_value;
- return;
-}
-
-
-void
-ngx_http_script_complex_value_code(ngx_http_script_engine_t *e)
-{
- size_t len;
- ngx_http_script_engine_t le;
- ngx_http_script_len_code_pt lcode;
- ngx_http_script_complex_value_code_t *code;
-
- code = (ngx_http_script_complex_value_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_complex_value_code_t);
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script complex value");
-
- ngx_memzero(&le, sizeof(ngx_http_script_engine_t));
-
- le.ip = code->lengths->elts;
- le.line = e->line;
- le.request = e->request;
- le.quote = e->quote;
-
- for (len = 0; *(uintptr_t *) le.ip; len += lcode(&le)) {
- lcode = *(ngx_http_script_len_code_pt *) le.ip;
- }
-
- e->buf.len = len;
- e->buf.data = ngx_pnalloc(e->request->pool, len);
- if (e->buf.data == NULL) {
- e->ip = ngx_http_script_exit;
- e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;
- return;
- }
-
- e->pos = e->buf.data;
-
- e->sp->len = e->buf.len;
- e->sp->data = e->buf.data;
- e->sp++;
-}
-
-
-void
-ngx_http_script_value_code(ngx_http_script_engine_t *e)
-{
- ngx_http_script_value_code_t *code;
-
- code = (ngx_http_script_value_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_value_code_t);
-
- e->sp->len = code->text_len;
- e->sp->data = (u_char *) code->text_data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script value: \"%v\"", e->sp);
-
- e->sp++;
-}
-
-
-void
-ngx_http_script_set_var_code(ngx_http_script_engine_t *e)
-{
- ngx_http_request_t *r;
- ngx_http_script_var_code_t *code;
-
- code = (ngx_http_script_var_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_var_code_t);
-
- r = e->request;
-
- e->sp--;
-
- r->variables[code->index].len = e->sp->len;
- r->variables[code->index].valid = 1;
- r->variables[code->index].no_cacheable = 0;
- r->variables[code->index].not_found = 0;
- r->variables[code->index].data = e->sp->data;
-
-#if (NGX_DEBUG)
- {
- ngx_http_variable_t *v;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- v = cmcf->variables.elts;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script set $%V", &v[code->index].name);
- }
-#endif
-}
-
-
-void
-ngx_http_script_var_set_handler_code(ngx_http_script_engine_t *e)
-{
- ngx_http_script_var_handler_code_t *code;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script set var handler");
-
- code = (ngx_http_script_var_handler_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_var_handler_code_t);
-
- e->sp--;
-
- code->handler(e->request, e->sp, code->data);
-}
-
-
-void
-ngx_http_script_var_code(ngx_http_script_engine_t *e)
-{
- ngx_http_variable_value_t *value;
- ngx_http_script_var_code_t *code;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script var");
-
- code = (ngx_http_script_var_code_t *) e->ip;
-
- e->ip += sizeof(ngx_http_script_var_code_t);
-
- value = ngx_http_get_flushed_variable(e->request, code->index);
-
- if (value && !value->not_found) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, e->request->connection->log, 0,
- "http script var: \"%v\"", value);
-
- *e->sp = *value;
- e->sp++;
-
- return;
- }
-
- *e->sp = ngx_http_variable_null_value;
- e->sp++;
-}
-
-
-void
-ngx_http_script_nop_code(ngx_http_script_engine_t *e)
-{
- e->ip += sizeof(uintptr_t);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.h
deleted file mode 100644
index 46592ab0155..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_script.h
+++ /dev/null
@@ -1,257 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_SCRIPT_H_INCLUDED_
-#define _NGX_HTTP_SCRIPT_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- u_char *ip;
- u_char *pos;
- ngx_http_variable_value_t *sp;
-
- ngx_str_t buf;
- ngx_str_t line;
-
- /* the start of the rewritten arguments */
- u_char *args;
-
- unsigned flushed:1;
- unsigned skip:1;
- unsigned quote:1;
- unsigned is_args:1;
- unsigned log:1;
-
- ngx_int_t status;
- ngx_http_request_t *request;
-} ngx_http_script_engine_t;
-
-
-typedef struct {
- ngx_conf_t *cf;
- ngx_str_t *source;
-
- ngx_array_t **flushes;
- ngx_array_t **lengths;
- ngx_array_t **values;
-
- ngx_uint_t variables;
- ngx_uint_t ncaptures;
- ngx_uint_t captures_mask;
- ngx_uint_t size;
-
- void *main;
-
- unsigned compile_args:1;
- unsigned complete_lengths:1;
- unsigned complete_values:1;
- unsigned zero:1;
- unsigned conf_prefix:1;
- unsigned root_prefix:1;
-
- unsigned dup_capture:1;
- unsigned args:1;
-} ngx_http_script_compile_t;
-
-
-typedef struct {
- ngx_str_t value;
- ngx_uint_t *flushes;
- void *lengths;
- void *values;
-} ngx_http_complex_value_t;
-
-
-typedef struct {
- ngx_conf_t *cf;
- ngx_str_t *value;
- ngx_http_complex_value_t *complex_value;
-
- unsigned zero:1;
- unsigned conf_prefix:1;
- unsigned root_prefix:1;
-} ngx_http_compile_complex_value_t;
-
-
-typedef void (*ngx_http_script_code_pt) (ngx_http_script_engine_t *e);
-typedef size_t (*ngx_http_script_len_code_pt) (ngx_http_script_engine_t *e);
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- uintptr_t len;
-} ngx_http_script_copy_code_t;
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- uintptr_t index;
-} ngx_http_script_var_code_t;
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- ngx_http_set_variable_pt handler;
- uintptr_t data;
-} ngx_http_script_var_handler_code_t;
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- uintptr_t n;
-} ngx_http_script_copy_capture_code_t;
-
-
-#if (NGX_PCRE)
-
-typedef struct {
- ngx_http_script_code_pt code;
- ngx_http_regex_t *regex;
- ngx_array_t *lengths;
- uintptr_t size;
- uintptr_t status;
- uintptr_t next;
-
- uintptr_t test:1;
- uintptr_t negative_test:1;
- uintptr_t uri:1;
- uintptr_t args:1;
-
- /* add the r->args to the new arguments */
- uintptr_t add_args:1;
-
- uintptr_t redirect:1;
- uintptr_t break_cycle:1;
-
- ngx_str_t name;
-} ngx_http_script_regex_code_t;
-
-
-typedef struct {
- ngx_http_script_code_pt code;
-
- uintptr_t uri:1;
- uintptr_t args:1;
-
- /* add the r->args to the new arguments */
- uintptr_t add_args:1;
-
- uintptr_t redirect:1;
-} ngx_http_script_regex_end_code_t;
-
-#endif
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- uintptr_t conf_prefix;
-} ngx_http_script_full_name_code_t;
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- uintptr_t status;
- ngx_http_complex_value_t text;
-} ngx_http_script_return_code_t;
-
-
-typedef enum {
- ngx_http_script_file_plain = 0,
- ngx_http_script_file_not_plain,
- ngx_http_script_file_dir,
- ngx_http_script_file_not_dir,
- ngx_http_script_file_exists,
- ngx_http_script_file_not_exists,
- ngx_http_script_file_exec,
- ngx_http_script_file_not_exec
-} ngx_http_script_file_op_e;
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- uintptr_t op;
-} ngx_http_script_file_code_t;
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- uintptr_t next;
- void **loc_conf;
-} ngx_http_script_if_code_t;
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- ngx_array_t *lengths;
-} ngx_http_script_complex_value_code_t;
-
-
-typedef struct {
- ngx_http_script_code_pt code;
- uintptr_t value;
- uintptr_t text_len;
- uintptr_t text_data;
-} ngx_http_script_value_code_t;
-
-
-void ngx_http_script_flush_complex_value(ngx_http_request_t *r,
- ngx_http_complex_value_t *val);
-ngx_int_t ngx_http_complex_value(ngx_http_request_t *r,
- ngx_http_complex_value_t *val, ngx_str_t *value);
-ngx_int_t ngx_http_compile_complex_value(ngx_http_compile_complex_value_t *ccv);
-char *ngx_http_set_complex_value_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-ngx_int_t ngx_http_test_predicates(ngx_http_request_t *r,
- ngx_array_t *predicates);
-char *ngx_http_set_predicate_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-ngx_uint_t ngx_http_script_variables_count(ngx_str_t *value);
-ngx_int_t ngx_http_script_compile(ngx_http_script_compile_t *sc);
-u_char *ngx_http_script_run(ngx_http_request_t *r, ngx_str_t *value,
- void *code_lengths, size_t reserved, void *code_values);
-void ngx_http_script_flush_no_cacheable_variables(ngx_http_request_t *r,
- ngx_array_t *indices);
-
-void *ngx_http_script_start_code(ngx_pool_t *pool, ngx_array_t **codes,
- size_t size);
-void *ngx_http_script_add_code(ngx_array_t *codes, size_t size, void *code);
-
-size_t ngx_http_script_copy_len_code(ngx_http_script_engine_t *e);
-void ngx_http_script_copy_code(ngx_http_script_engine_t *e);
-size_t ngx_http_script_copy_var_len_code(ngx_http_script_engine_t *e);
-void ngx_http_script_copy_var_code(ngx_http_script_engine_t *e);
-size_t ngx_http_script_copy_capture_len_code(ngx_http_script_engine_t *e);
-void ngx_http_script_copy_capture_code(ngx_http_script_engine_t *e);
-size_t ngx_http_script_mark_args_code(ngx_http_script_engine_t *e);
-void ngx_http_script_start_args_code(ngx_http_script_engine_t *e);
-#if (NGX_PCRE)
-void ngx_http_script_regex_start_code(ngx_http_script_engine_t *e);
-void ngx_http_script_regex_end_code(ngx_http_script_engine_t *e);
-#endif
-void ngx_http_script_return_code(ngx_http_script_engine_t *e);
-void ngx_http_script_break_code(ngx_http_script_engine_t *e);
-void ngx_http_script_if_code(ngx_http_script_engine_t *e);
-void ngx_http_script_equal_code(ngx_http_script_engine_t *e);
-void ngx_http_script_not_equal_code(ngx_http_script_engine_t *e);
-void ngx_http_script_file_code(ngx_http_script_engine_t *e);
-void ngx_http_script_complex_value_code(ngx_http_script_engine_t *e);
-void ngx_http_script_value_code(ngx_http_script_engine_t *e);
-void ngx_http_script_set_var_code(ngx_http_script_engine_t *e);
-void ngx_http_script_var_set_handler_code(ngx_http_script_engine_t *e);
-void ngx_http_script_var_code(ngx_http_script_engine_t *e);
-void ngx_http_script_nop_code(ngx_http_script_engine_t *e);
-
-
-#endif /* _NGX_HTTP_SCRIPT_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.c
deleted file mode 100644
index 3c57882a6ad..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.c
+++ /dev/null
@@ -1,3647 +0,0 @@
-
-/*
- * Copyright (C) Nginx, Inc.
- * Copyright (C) Valentin V. Bartenev
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <ngx_http_spdy_module.h>
-
-#include <zlib.h>
-
-
-#if (NGX_HAVE_LITTLE_ENDIAN && NGX_HAVE_NONALIGNED)
-
-#define ngx_str5cmp(m, c0, c1, c2, c3, c4) \
- *(uint32_t *) m == (c3 << 24 | c2 << 16 | c1 << 8 | c0) \
- && m[4] == c4
-
-#else
-
-#define ngx_str5cmp(m, c0, c1, c2, c3, c4) \
- m[0] == c0 && m[1] == c1 && m[2] == c2 && m[3] == c3 && m[4] == c4
-
-#endif
-
-
-#if (NGX_HAVE_NONALIGNED)
-
-#define ngx_spdy_frame_parse_uint16(p) ntohs(*(uint16_t *) (p))
-#define ngx_spdy_frame_parse_uint32(p) ntohl(*(uint32_t *) (p))
-
-#else
-
-#define ngx_spdy_frame_parse_uint16(p) ((p)[0] << 8 | (p)[1])
-#define ngx_spdy_frame_parse_uint32(p) \
- ((p)[0] << 24 | (p)[1] << 16 | (p)[2] << 8 | (p)[3])
-
-#endif
-
-#define ngx_spdy_frame_parse_sid(p) \
- (ngx_spdy_frame_parse_uint32(p) & 0x7fffffff)
-#define ngx_spdy_frame_parse_delta(p) \
- (ngx_spdy_frame_parse_uint32(p) & 0x7fffffff)
-
-
-#define ngx_spdy_ctl_frame_check(h) \
- (((h) & 0xffff0000) == ngx_spdy_ctl_frame_head(0))
-#define ngx_spdy_data_frame_check(h) \
- (!((h) & (uint32_t) NGX_SPDY_CTL_BIT << 31))
-
-#define ngx_spdy_ctl_frame_type(h) ((h) & 0x0000ffff)
-#define ngx_spdy_frame_flags(p) ((p) >> 24)
-#define ngx_spdy_frame_length(p) ((p) & 0x00ffffff)
-#define ngx_spdy_frame_id(p) ((p) & 0x00ffffff)
-
-
-#define NGX_SPDY_SKIP_HEADERS_BUFFER_SIZE 4096
-#define NGX_SPDY_CTL_FRAME_BUFFER_SIZE 16
-
-#define NGX_SPDY_PROTOCOL_ERROR 1
-#define NGX_SPDY_INVALID_STREAM 2
-#define NGX_SPDY_REFUSED_STREAM 3
-#define NGX_SPDY_UNSUPPORTED_VERSION 4
-#define NGX_SPDY_CANCEL 5
-#define NGX_SPDY_INTERNAL_ERROR 6
-#define NGX_SPDY_FLOW_CONTROL_ERROR 7
-#define NGX_SPDY_STREAM_IN_USE 8
-#define NGX_SPDY_STREAM_ALREADY_CLOSED 9
-/* deprecated 10 */
-#define NGX_SPDY_FRAME_TOO_LARGE 11
-
-#define NGX_SPDY_SETTINGS_MAX_STREAMS 4
-#define NGX_SPDY_SETTINGS_INIT_WINDOW 7
-
-#define NGX_SPDY_SETTINGS_FLAG_PERSIST 0x01
-#define NGX_SPDY_SETTINGS_FLAG_PERSISTED 0x02
-
-#define NGX_SPDY_MAX_WINDOW NGX_MAX_INT32_VALUE
-#define NGX_SPDY_CONNECTION_WINDOW 65536
-#define NGX_SPDY_INIT_STREAM_WINDOW 65536
-#define NGX_SPDY_STREAM_WINDOW NGX_SPDY_MAX_WINDOW
-
-typedef struct {
- ngx_uint_t hash;
- u_char len;
- u_char header[7];
- ngx_int_t (*handler)(ngx_http_request_t *r);
-} ngx_http_spdy_request_header_t;
-
-
-static void ngx_http_spdy_read_handler(ngx_event_t *rev);
-static void ngx_http_spdy_write_handler(ngx_event_t *wev);
-static void ngx_http_spdy_handle_connection(ngx_http_spdy_connection_t *sc);
-
-static u_char *ngx_http_spdy_proxy_protocol(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_head(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_syn_stream(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_headers(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_headers_skip(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_headers_error(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_window_update(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_data(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_read_data(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_rst_stream(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_ping(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_skip(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_settings(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_complete(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-static u_char *ngx_http_spdy_state_save(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end, ngx_http_spdy_handler_pt handler);
-
-static u_char *ngx_http_spdy_state_inflate_error(
- ngx_http_spdy_connection_t *sc, int rc);
-static u_char *ngx_http_spdy_state_protocol_error(
- ngx_http_spdy_connection_t *sc);
-static u_char *ngx_http_spdy_state_internal_error(
- ngx_http_spdy_connection_t *sc);
-
-static ngx_int_t ngx_http_spdy_send_window_update(
- ngx_http_spdy_connection_t *sc, ngx_uint_t sid, ngx_uint_t delta);
-static ngx_int_t ngx_http_spdy_send_rst_stream(ngx_http_spdy_connection_t *sc,
- ngx_uint_t sid, ngx_uint_t status, ngx_uint_t priority);
-static ngx_int_t ngx_http_spdy_send_settings(ngx_http_spdy_connection_t *sc);
-static ngx_int_t ngx_http_spdy_settings_frame_handler(
- ngx_http_spdy_connection_t *sc, ngx_http_spdy_out_frame_t *frame);
-static ngx_http_spdy_out_frame_t *ngx_http_spdy_get_ctl_frame(
- ngx_http_spdy_connection_t *sc, size_t size, ngx_uint_t priority);
-static ngx_int_t ngx_http_spdy_ctl_frame_handler(
- ngx_http_spdy_connection_t *sc, ngx_http_spdy_out_frame_t *frame);
-
-static ngx_http_spdy_stream_t *ngx_http_spdy_create_stream(
- ngx_http_spdy_connection_t *sc, ngx_uint_t id, ngx_uint_t priority);
-static ngx_http_spdy_stream_t *ngx_http_spdy_get_stream_by_id(
- ngx_http_spdy_connection_t *sc, ngx_uint_t sid);
-#define ngx_http_spdy_streams_index_size(sscf) (sscf->streams_index_mask + 1)
-#define ngx_http_spdy_stream_index(sscf, sid) \
- ((sid >> 1) & sscf->streams_index_mask)
-
-static ngx_int_t ngx_http_spdy_parse_header(ngx_http_request_t *r);
-static ngx_int_t ngx_http_spdy_alloc_large_header_buffer(ngx_http_request_t *r);
-
-static ngx_int_t ngx_http_spdy_handle_request_header(ngx_http_request_t *r);
-static ngx_int_t ngx_http_spdy_parse_method(ngx_http_request_t *r);
-static ngx_int_t ngx_http_spdy_parse_scheme(ngx_http_request_t *r);
-static ngx_int_t ngx_http_spdy_parse_host(ngx_http_request_t *r);
-static ngx_int_t ngx_http_spdy_parse_path(ngx_http_request_t *r);
-static ngx_int_t ngx_http_spdy_parse_version(ngx_http_request_t *r);
-
-static ngx_int_t ngx_http_spdy_construct_request_line(ngx_http_request_t *r);
-static void ngx_http_spdy_run_request(ngx_http_request_t *r);
-static ngx_int_t ngx_http_spdy_init_request_body(ngx_http_request_t *r);
-
-static ngx_int_t ngx_http_spdy_terminate_stream(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_stream_t *stream, ngx_uint_t status);
-
-static void ngx_http_spdy_close_stream_handler(ngx_event_t *ev);
-
-static void ngx_http_spdy_handle_connection_handler(ngx_event_t *rev);
-static void ngx_http_spdy_keepalive_handler(ngx_event_t *rev);
-static void ngx_http_spdy_finalize_connection(ngx_http_spdy_connection_t *sc,
- ngx_int_t rc);
-
-static ngx_int_t ngx_http_spdy_adjust_windows(ngx_http_spdy_connection_t *sc,
- ssize_t delta);
-
-static void ngx_http_spdy_pool_cleanup(void *data);
-
-static void *ngx_http_spdy_zalloc(void *opaque, u_int items, u_int size);
-static void ngx_http_spdy_zfree(void *opaque, void *address);
-
-
-static const u_char ngx_http_spdy_dict[] = {
- 0x00, 0x00, 0x00, 0x07, 0x6f, 0x70, 0x74, 0x69, /* - - - - o p t i */
- 0x6f, 0x6e, 0x73, 0x00, 0x00, 0x00, 0x04, 0x68, /* o n s - - - - h */
- 0x65, 0x61, 0x64, 0x00, 0x00, 0x00, 0x04, 0x70, /* e a d - - - - p */
- 0x6f, 0x73, 0x74, 0x00, 0x00, 0x00, 0x03, 0x70, /* o s t - - - - p */
- 0x75, 0x74, 0x00, 0x00, 0x00, 0x06, 0x64, 0x65, /* u t - - - - d e */
- 0x6c, 0x65, 0x74, 0x65, 0x00, 0x00, 0x00, 0x05, /* l e t e - - - - */
- 0x74, 0x72, 0x61, 0x63, 0x65, 0x00, 0x00, 0x00, /* t r a c e - - - */
- 0x06, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x00, /* - a c c e p t - */
- 0x00, 0x00, 0x0e, 0x61, 0x63, 0x63, 0x65, 0x70, /* - - - a c c e p */
- 0x74, 0x2d, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, /* t - c h a r s e */
- 0x74, 0x00, 0x00, 0x00, 0x0f, 0x61, 0x63, 0x63, /* t - - - - a c c */
- 0x65, 0x70, 0x74, 0x2d, 0x65, 0x6e, 0x63, 0x6f, /* e p t - e n c o */
- 0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x0f, /* d i n g - - - - */
- 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x6c, /* a c c e p t - l */
- 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x00, /* a n g u a g e - */
- 0x00, 0x00, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x70, /* - - - a c c e p */
- 0x74, 0x2d, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, /* t - r a n g e s */
- 0x00, 0x00, 0x00, 0x03, 0x61, 0x67, 0x65, 0x00, /* - - - - a g e - */
- 0x00, 0x00, 0x05, 0x61, 0x6c, 0x6c, 0x6f, 0x77, /* - - - a l l o w */
- 0x00, 0x00, 0x00, 0x0d, 0x61, 0x75, 0x74, 0x68, /* - - - - a u t h */
- 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, /* o r i z a t i o */
- 0x6e, 0x00, 0x00, 0x00, 0x0d, 0x63, 0x61, 0x63, /* n - - - - c a c */
- 0x68, 0x65, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, /* h e - c o n t r */
- 0x6f, 0x6c, 0x00, 0x00, 0x00, 0x0a, 0x63, 0x6f, /* o l - - - - c o */
- 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, /* n n e c t i o n */
- 0x00, 0x00, 0x00, 0x0c, 0x63, 0x6f, 0x6e, 0x74, /* - - - - c o n t */
- 0x65, 0x6e, 0x74, 0x2d, 0x62, 0x61, 0x73, 0x65, /* e n t - b a s e */
- 0x00, 0x00, 0x00, 0x10, 0x63, 0x6f, 0x6e, 0x74, /* - - - - c o n t */
- 0x65, 0x6e, 0x74, 0x2d, 0x65, 0x6e, 0x63, 0x6f, /* e n t - e n c o */
- 0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x10, /* d i n g - - - - */
- 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, /* c o n t e n t - */
- 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, /* l a n g u a g e */
- 0x00, 0x00, 0x00, 0x0e, 0x63, 0x6f, 0x6e, 0x74, /* - - - - c o n t */
- 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x65, 0x6e, 0x67, /* e n t - l e n g */
- 0x74, 0x68, 0x00, 0x00, 0x00, 0x10, 0x63, 0x6f, /* t h - - - - c o */
- 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x6c, 0x6f, /* n t e n t - l o */
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, /* c a t i o n - - */
- 0x00, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* - - c o n t e n */
- 0x74, 0x2d, 0x6d, 0x64, 0x35, 0x00, 0x00, 0x00, /* t - m d 5 - - - */
- 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, /* - c o n t e n t */
- 0x2d, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x00, /* - r a n g e - - */
- 0x00, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, /* - - c o n t e n */
- 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x00, 0x00, /* t - t y p e - - */
- 0x00, 0x04, 0x64, 0x61, 0x74, 0x65, 0x00, 0x00, /* - - d a t e - - */
- 0x00, 0x04, 0x65, 0x74, 0x61, 0x67, 0x00, 0x00, /* - - e t a g - - */
- 0x00, 0x06, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, /* - - e x p e c t */
- 0x00, 0x00, 0x00, 0x07, 0x65, 0x78, 0x70, 0x69, /* - - - - e x p i */
- 0x72, 0x65, 0x73, 0x00, 0x00, 0x00, 0x04, 0x66, /* r e s - - - - f */
- 0x72, 0x6f, 0x6d, 0x00, 0x00, 0x00, 0x04, 0x68, /* r o m - - - - h */
- 0x6f, 0x73, 0x74, 0x00, 0x00, 0x00, 0x08, 0x69, /* o s t - - - - i */
- 0x66, 0x2d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x00, /* f - m a t c h - */
- 0x00, 0x00, 0x11, 0x69, 0x66, 0x2d, 0x6d, 0x6f, /* - - - i f - m o */
- 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2d, 0x73, /* d i f i e d - s */
- 0x69, 0x6e, 0x63, 0x65, 0x00, 0x00, 0x00, 0x0d, /* i n c e - - - - */
- 0x69, 0x66, 0x2d, 0x6e, 0x6f, 0x6e, 0x65, 0x2d, /* i f - n o n e - */
- 0x6d, 0x61, 0x74, 0x63, 0x68, 0x00, 0x00, 0x00, /* m a t c h - - - */
- 0x08, 0x69, 0x66, 0x2d, 0x72, 0x61, 0x6e, 0x67, /* - i f - r a n g */
- 0x65, 0x00, 0x00, 0x00, 0x13, 0x69, 0x66, 0x2d, /* e - - - - i f - */
- 0x75, 0x6e, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, /* u n m o d i f i */
- 0x65, 0x64, 0x2d, 0x73, 0x69, 0x6e, 0x63, 0x65, /* e d - s i n c e */
- 0x00, 0x00, 0x00, 0x0d, 0x6c, 0x61, 0x73, 0x74, /* - - - - l a s t */
- 0x2d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, /* - m o d i f i e */
- 0x64, 0x00, 0x00, 0x00, 0x08, 0x6c, 0x6f, 0x63, /* d - - - - l o c */
- 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, /* a t i o n - - - */
- 0x0c, 0x6d, 0x61, 0x78, 0x2d, 0x66, 0x6f, 0x72, /* - m a x - f o r */
- 0x77, 0x61, 0x72, 0x64, 0x73, 0x00, 0x00, 0x00, /* w a r d s - - - */
- 0x06, 0x70, 0x72, 0x61, 0x67, 0x6d, 0x61, 0x00, /* - p r a g m a - */
- 0x00, 0x00, 0x12, 0x70, 0x72, 0x6f, 0x78, 0x79, /* - - - p r o x y */
- 0x2d, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, /* - a u t h e n t */
- 0x69, 0x63, 0x61, 0x74, 0x65, 0x00, 0x00, 0x00, /* i c a t e - - - */
- 0x13, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2d, 0x61, /* - p r o x y - a */
- 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, /* u t h o r i z a */
- 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, /* t i o n - - - - */
- 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x00, 0x00, /* r a n g e - - - */
- 0x07, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, /* - r e f e r e r */
- 0x00, 0x00, 0x00, 0x0b, 0x72, 0x65, 0x74, 0x72, /* - - - - r e t r */
- 0x79, 0x2d, 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, /* y - a f t e r - */
- 0x00, 0x00, 0x06, 0x73, 0x65, 0x72, 0x76, 0x65, /* - - - s e r v e */
- 0x72, 0x00, 0x00, 0x00, 0x02, 0x74, 0x65, 0x00, /* r - - - - t e - */
- 0x00, 0x00, 0x07, 0x74, 0x72, 0x61, 0x69, 0x6c, /* - - - t r a i l */
- 0x65, 0x72, 0x00, 0x00, 0x00, 0x11, 0x74, 0x72, /* e r - - - - t r */
- 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x2d, 0x65, /* a n s f e r - e */
- 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x00, /* n c o d i n g - */
- 0x00, 0x00, 0x07, 0x75, 0x70, 0x67, 0x72, 0x61, /* - - - u p g r a */
- 0x64, 0x65, 0x00, 0x00, 0x00, 0x0a, 0x75, 0x73, /* d e - - - - u s */
- 0x65, 0x72, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, /* e r - a g e n t */
- 0x00, 0x00, 0x00, 0x04, 0x76, 0x61, 0x72, 0x79, /* - - - - v a r y */
- 0x00, 0x00, 0x00, 0x03, 0x76, 0x69, 0x61, 0x00, /* - - - - v i a - */
- 0x00, 0x00, 0x07, 0x77, 0x61, 0x72, 0x6e, 0x69, /* - - - w a r n i */
- 0x6e, 0x67, 0x00, 0x00, 0x00, 0x10, 0x77, 0x77, /* n g - - - - w w */
- 0x77, 0x2d, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, /* w - a u t h e n */
- 0x74, 0x69, 0x63, 0x61, 0x74, 0x65, 0x00, 0x00, /* t i c a t e - - */
- 0x00, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, /* - - m e t h o d */
- 0x00, 0x00, 0x00, 0x03, 0x67, 0x65, 0x74, 0x00, /* - - - - g e t - */
- 0x00, 0x00, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, /* - - - s t a t u */
- 0x73, 0x00, 0x00, 0x00, 0x06, 0x32, 0x30, 0x30, /* s - - - - 2 0 0 */
- 0x20, 0x4f, 0x4b, 0x00, 0x00, 0x00, 0x07, 0x76, /* - O K - - - - v */
- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x00, 0x00, /* e r s i o n - - */
- 0x00, 0x08, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, /* - - H T T P - 1 */
- 0x2e, 0x31, 0x00, 0x00, 0x00, 0x03, 0x75, 0x72, /* - 1 - - - - u r */
- 0x6c, 0x00, 0x00, 0x00, 0x06, 0x70, 0x75, 0x62, /* l - - - - p u b */
- 0x6c, 0x69, 0x63, 0x00, 0x00, 0x00, 0x0a, 0x73, /* l i c - - - - s */
- 0x65, 0x74, 0x2d, 0x63, 0x6f, 0x6f, 0x6b, 0x69, /* e t - c o o k i */
- 0x65, 0x00, 0x00, 0x00, 0x0a, 0x6b, 0x65, 0x65, /* e - - - - k e e */
- 0x70, 0x2d, 0x61, 0x6c, 0x69, 0x76, 0x65, 0x00, /* p - a l i v e - */
- 0x00, 0x00, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, /* - - - o r i g i */
- 0x6e, 0x31, 0x30, 0x30, 0x31, 0x30, 0x31, 0x32, /* n 1 0 0 1 0 1 2 */
- 0x30, 0x31, 0x32, 0x30, 0x32, 0x32, 0x30, 0x35, /* 0 1 2 0 2 2 0 5 */
- 0x32, 0x30, 0x36, 0x33, 0x30, 0x30, 0x33, 0x30, /* 2 0 6 3 0 0 3 0 */
- 0x32, 0x33, 0x30, 0x33, 0x33, 0x30, 0x34, 0x33, /* 2 3 0 3 3 0 4 3 */
- 0x30, 0x35, 0x33, 0x30, 0x36, 0x33, 0x30, 0x37, /* 0 5 3 0 6 3 0 7 */
- 0x34, 0x30, 0x32, 0x34, 0x30, 0x35, 0x34, 0x30, /* 4 0 2 4 0 5 4 0 */
- 0x36, 0x34, 0x30, 0x37, 0x34, 0x30, 0x38, 0x34, /* 6 4 0 7 4 0 8 4 */
- 0x30, 0x39, 0x34, 0x31, 0x30, 0x34, 0x31, 0x31, /* 0 9 4 1 0 4 1 1 */
- 0x34, 0x31, 0x32, 0x34, 0x31, 0x33, 0x34, 0x31, /* 4 1 2 4 1 3 4 1 */
- 0x34, 0x34, 0x31, 0x35, 0x34, 0x31, 0x36, 0x34, /* 4 4 1 5 4 1 6 4 */
- 0x31, 0x37, 0x35, 0x30, 0x32, 0x35, 0x30, 0x34, /* 1 7 5 0 2 5 0 4 */
- 0x35, 0x30, 0x35, 0x32, 0x30, 0x33, 0x20, 0x4e, /* 5 0 5 2 0 3 - N */
- 0x6f, 0x6e, 0x2d, 0x41, 0x75, 0x74, 0x68, 0x6f, /* o n - A u t h o */
- 0x72, 0x69, 0x74, 0x61, 0x74, 0x69, 0x76, 0x65, /* r i t a t i v e */
- 0x20, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, /* - I n f o r m a */
- 0x74, 0x69, 0x6f, 0x6e, 0x32, 0x30, 0x34, 0x20, /* t i o n 2 0 4 - */
- 0x4e, 0x6f, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x65, /* N o - C o n t e */
- 0x6e, 0x74, 0x33, 0x30, 0x31, 0x20, 0x4d, 0x6f, /* n t 3 0 1 - M o */
- 0x76, 0x65, 0x64, 0x20, 0x50, 0x65, 0x72, 0x6d, /* v e d - P e r m */
- 0x61, 0x6e, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x34, /* a n e n t l y 4 */
- 0x30, 0x30, 0x20, 0x42, 0x61, 0x64, 0x20, 0x52, /* 0 0 - B a d - R */
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x34, 0x30, /* e q u e s t 4 0 */
- 0x31, 0x20, 0x55, 0x6e, 0x61, 0x75, 0x74, 0x68, /* 1 - U n a u t h */
- 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x34, 0x30, /* o r i z e d 4 0 */
- 0x33, 0x20, 0x46, 0x6f, 0x72, 0x62, 0x69, 0x64, /* 3 - F o r b i d */
- 0x64, 0x65, 0x6e, 0x34, 0x30, 0x34, 0x20, 0x4e, /* d e n 4 0 4 - N */
- 0x6f, 0x74, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, /* o t - F o u n d */
- 0x35, 0x30, 0x30, 0x20, 0x49, 0x6e, 0x74, 0x65, /* 5 0 0 - I n t e */
- 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x53, 0x65, 0x72, /* r n a l - S e r */
- 0x76, 0x65, 0x72, 0x20, 0x45, 0x72, 0x72, 0x6f, /* v e r - E r r o */
- 0x72, 0x35, 0x30, 0x31, 0x20, 0x4e, 0x6f, 0x74, /* r 5 0 1 - N o t */
- 0x20, 0x49, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, /* - I m p l e m e */
- 0x6e, 0x74, 0x65, 0x64, 0x35, 0x30, 0x33, 0x20, /* n t e d 5 0 3 - */
- 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, /* S e r v i c e - */
- 0x55, 0x6e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, /* U n a v a i l a */
- 0x62, 0x6c, 0x65, 0x4a, 0x61, 0x6e, 0x20, 0x46, /* b l e J a n - F */
- 0x65, 0x62, 0x20, 0x4d, 0x61, 0x72, 0x20, 0x41, /* e b - M a r - A */
- 0x70, 0x72, 0x20, 0x4d, 0x61, 0x79, 0x20, 0x4a, /* p r - M a y - J */
- 0x75, 0x6e, 0x20, 0x4a, 0x75, 0x6c, 0x20, 0x41, /* u n - J u l - A */
- 0x75, 0x67, 0x20, 0x53, 0x65, 0x70, 0x74, 0x20, /* u g - S e p t - */
- 0x4f, 0x63, 0x74, 0x20, 0x4e, 0x6f, 0x76, 0x20, /* O c t - N o v - */
- 0x44, 0x65, 0x63, 0x20, 0x30, 0x30, 0x3a, 0x30, /* D e c - 0 0 - 0 */
- 0x30, 0x3a, 0x30, 0x30, 0x20, 0x4d, 0x6f, 0x6e, /* 0 - 0 0 - M o n */
- 0x2c, 0x20, 0x54, 0x75, 0x65, 0x2c, 0x20, 0x57, /* - - T u e - - W */
- 0x65, 0x64, 0x2c, 0x20, 0x54, 0x68, 0x75, 0x2c, /* e d - - T h u - */
- 0x20, 0x46, 0x72, 0x69, 0x2c, 0x20, 0x53, 0x61, /* - F r i - - S a */
- 0x74, 0x2c, 0x20, 0x53, 0x75, 0x6e, 0x2c, 0x20, /* t - - S u n - - */
- 0x47, 0x4d, 0x54, 0x63, 0x68, 0x75, 0x6e, 0x6b, /* G M T c h u n k */
- 0x65, 0x64, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x2f, /* e d - t e x t - */
- 0x68, 0x74, 0x6d, 0x6c, 0x2c, 0x69, 0x6d, 0x61, /* h t m l - i m a */
- 0x67, 0x65, 0x2f, 0x70, 0x6e, 0x67, 0x2c, 0x69, /* g e - p n g - i */
- 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x6a, 0x70, 0x67, /* m a g e - j p g */
- 0x2c, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2f, 0x67, /* - i m a g e - g */
- 0x69, 0x66, 0x2c, 0x61, 0x70, 0x70, 0x6c, 0x69, /* i f - a p p l i */
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, /* c a t i o n - x */
- 0x6d, 0x6c, 0x2c, 0x61, 0x70, 0x70, 0x6c, 0x69, /* m l - a p p l i */
- 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, /* c a t i o n - x */
- 0x68, 0x74, 0x6d, 0x6c, 0x2b, 0x78, 0x6d, 0x6c, /* h t m l - x m l */
- 0x2c, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, /* - t e x t - p l */
- 0x61, 0x69, 0x6e, 0x2c, 0x74, 0x65, 0x78, 0x74, /* a i n - t e x t */
- 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, /* - j a v a s c r */
- 0x69, 0x70, 0x74, 0x2c, 0x70, 0x75, 0x62, 0x6c, /* i p t - p u b l */
- 0x69, 0x63, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, /* i c p r i v a t */
- 0x65, 0x6d, 0x61, 0x78, 0x2d, 0x61, 0x67, 0x65, /* e m a x - a g e */
- 0x3d, 0x67, 0x7a, 0x69, 0x70, 0x2c, 0x64, 0x65, /* - g z i p - d e */
- 0x66, 0x6c, 0x61, 0x74, 0x65, 0x2c, 0x73, 0x64, /* f l a t e - s d */
- 0x63, 0x68, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, /* c h c h a r s e */
- 0x74, 0x3d, 0x75, 0x74, 0x66, 0x2d, 0x38, 0x63, /* t - u t f - 8 c */
- 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x3d, 0x69, /* h a r s e t - i */
- 0x73, 0x6f, 0x2d, 0x38, 0x38, 0x35, 0x39, 0x2d, /* s o - 8 8 5 9 - */
- 0x31, 0x2c, 0x75, 0x74, 0x66, 0x2d, 0x2c, 0x2a, /* 1 - u t f - - - */
- 0x2c, 0x65, 0x6e, 0x71, 0x3d, 0x30, 0x2e /* - e n q - 0 - */
-};
-
-
-static ngx_http_spdy_request_header_t ngx_http_spdy_request_headers[] = {
- { 0, 6, "method", ngx_http_spdy_parse_method },
- { 0, 6, "scheme", ngx_http_spdy_parse_scheme },
- { 0, 4, "host", ngx_http_spdy_parse_host },
- { 0, 4, "path", ngx_http_spdy_parse_path },
- { 0, 7, "version", ngx_http_spdy_parse_version },
-};
-
-#define NGX_SPDY_REQUEST_HEADERS \
- (sizeof(ngx_http_spdy_request_headers) \
- / sizeof(ngx_http_spdy_request_header_t))
-
-
-void
-ngx_http_spdy_init(ngx_event_t *rev)
-{
- int rc;
- ngx_connection_t *c;
- ngx_pool_cleanup_t *cln;
- ngx_http_connection_t *hc;
- ngx_http_spdy_srv_conf_t *sscf;
- ngx_http_spdy_main_conf_t *smcf;
- ngx_http_spdy_connection_t *sc;
-
- c = rev->data;
- hc = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "init spdy request");
-
- c->log->action = "processing SPDY";
-
- smcf = ngx_http_get_module_main_conf(hc->conf_ctx, ngx_http_spdy_module);
-
- if (smcf->recv_buffer == NULL) {
- smcf->recv_buffer = ngx_palloc(ngx_cycle->pool, smcf->recv_buffer_size);
- if (smcf->recv_buffer == NULL) {
- ngx_http_close_connection(c);
- return;
- }
- }
-
- sc = ngx_pcalloc(c->pool, sizeof(ngx_http_spdy_connection_t));
- if (sc == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- sc->connection = c;
- sc->http_connection = hc;
-
- sc->send_window = NGX_SPDY_CONNECTION_WINDOW;
- sc->recv_window = NGX_SPDY_CONNECTION_WINDOW;
-
- sc->init_window = NGX_SPDY_INIT_STREAM_WINDOW;
-
- sc->handler = hc->proxy_protocol ? ngx_http_spdy_proxy_protocol
- : ngx_http_spdy_state_head;
-
- sc->zstream_in.zalloc = ngx_http_spdy_zalloc;
- sc->zstream_in.zfree = ngx_http_spdy_zfree;
- sc->zstream_in.opaque = sc;
-
- rc = inflateInit(&sc->zstream_in);
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "inflateInit() failed: %d", rc);
- ngx_http_close_connection(c);
- return;
- }
-
- sc->zstream_out.zalloc = ngx_http_spdy_zalloc;
- sc->zstream_out.zfree = ngx_http_spdy_zfree;
- sc->zstream_out.opaque = sc;
-
- sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_spdy_module);
-
- rc = deflateInit2(&sc->zstream_out, (int) sscf->headers_comp,
- Z_DEFLATED, 11, 4, Z_DEFAULT_STRATEGY);
-
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "deflateInit2() failed: %d", rc);
- ngx_http_close_connection(c);
- return;
- }
-
- rc = deflateSetDictionary(&sc->zstream_out, ngx_http_spdy_dict,
- sizeof(ngx_http_spdy_dict));
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "deflateSetDictionary() failed: %d", rc);
- ngx_http_close_connection(c);
- return;
- }
-
- sc->pool = ngx_create_pool(sscf->pool_size, sc->connection->log);
- if (sc->pool == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- cln = ngx_pool_cleanup_add(c->pool, sizeof(ngx_pool_cleanup_file_t));
- if (cln == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- cln->handler = ngx_http_spdy_pool_cleanup;
- cln->data = sc;
-
- sc->streams_index = ngx_pcalloc(sc->pool,
- ngx_http_spdy_streams_index_size(sscf)
- * sizeof(ngx_http_spdy_stream_t *));
- if (sc->streams_index == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- if (ngx_http_spdy_send_settings(sc) == NGX_ERROR) {
- ngx_http_close_connection(c);
- return;
- }
-
- if (ngx_http_spdy_send_window_update(sc, 0, NGX_SPDY_MAX_WINDOW
- - sc->recv_window)
- == NGX_ERROR)
- {
- ngx_http_close_connection(c);
- return;
- }
-
- sc->recv_window = NGX_SPDY_MAX_WINDOW;
-
- ngx_queue_init(&sc->waiting);
- ngx_queue_init(&sc->posted);
-
- c->data = sc;
-
- rev->handler = ngx_http_spdy_read_handler;
- c->write->handler = ngx_http_spdy_write_handler;
-
- ngx_http_spdy_read_handler(rev);
-}
-
-
-static void
-ngx_http_spdy_read_handler(ngx_event_t *rev)
-{
- u_char *p, *end;
- size_t available;
- ssize_t n;
- ngx_connection_t *c;
- ngx_http_spdy_main_conf_t *smcf;
- ngx_http_spdy_connection_t *sc;
-
- c = rev->data;
- sc = c->data;
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- ngx_http_spdy_finalize_connection(sc, NGX_HTTP_REQUEST_TIME_OUT);
- return;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "spdy read handler");
-
- sc->blocked = 1;
-
- smcf = ngx_http_get_module_main_conf(sc->http_connection->conf_ctx,
- ngx_http_spdy_module);
-
- available = smcf->recv_buffer_size - 2 * NGX_SPDY_STATE_BUFFER_SIZE;
-
- do {
- p = smcf->recv_buffer;
-
- ngx_memcpy(p, sc->buffer, NGX_SPDY_STATE_BUFFER_SIZE);
- end = p + sc->buffer_used;
-
- n = c->recv(c, end, available);
-
- if (n == NGX_AGAIN) {
- break;
- }
-
- if (n == 0 && (sc->incomplete || sc->processing)) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client prematurely closed connection");
- }
-
- if (n == 0 || n == NGX_ERROR) {
- ngx_http_spdy_finalize_connection(sc,
- NGX_HTTP_CLIENT_CLOSED_REQUEST);
- return;
- }
-
- end += n;
-
- sc->buffer_used = 0;
- sc->incomplete = 0;
-
- do {
- p = sc->handler(sc, p, end);
-
- if (p == NULL) {
- return;
- }
-
- } while (p != end);
-
- } while (rev->ready);
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_spdy_finalize_connection(sc, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- if (sc->last_out && ngx_http_spdy_send_output_queue(sc) == NGX_ERROR) {
- ngx_http_spdy_finalize_connection(sc, NGX_HTTP_CLIENT_CLOSED_REQUEST);
- return;
- }
-
- sc->blocked = 0;
-
- if (sc->processing) {
- if (rev->timer_set) {
- ngx_del_timer(rev);
- }
- return;
- }
-
- ngx_http_spdy_handle_connection(sc);
-}
-
-
-static void
-ngx_http_spdy_write_handler(ngx_event_t *wev)
-{
- ngx_int_t rc;
- ngx_queue_t *q;
- ngx_connection_t *c;
- ngx_http_spdy_stream_t *stream;
- ngx_http_spdy_connection_t *sc;
-
- c = wev->data;
- sc = c->data;
-
- if (wev->timedout) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "spdy write event timed out");
- ngx_http_spdy_finalize_connection(sc, NGX_HTTP_CLIENT_CLOSED_REQUEST);
- return;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "spdy write handler");
-
- sc->blocked = 1;
-
- rc = ngx_http_spdy_send_output_queue(sc);
-
- if (rc == NGX_ERROR) {
- ngx_http_spdy_finalize_connection(sc, NGX_HTTP_CLIENT_CLOSED_REQUEST);
- return;
- }
-
- while (!ngx_queue_empty(&sc->posted)) {
- q = ngx_queue_head(&sc->posted);
-
- ngx_queue_remove(q);
-
- stream = ngx_queue_data(q, ngx_http_spdy_stream_t, queue);
-
- stream->handled = 0;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "run spdy stream %ui", stream->id);
-
- wev = stream->request->connection->write;
- wev->handler(wev);
- }
-
- sc->blocked = 0;
-
- if (rc == NGX_AGAIN) {
- return;
- }
-
- ngx_http_spdy_handle_connection(sc);
-}
-
-
-ngx_int_t
-ngx_http_spdy_send_output_queue(ngx_http_spdy_connection_t *sc)
-{
- ngx_chain_t *cl;
- ngx_event_t *wev;
- ngx_connection_t *c;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_spdy_out_frame_t *out, *frame, *fn;
-
- c = sc->connection;
-
- if (c->error) {
- return NGX_ERROR;
- }
-
- wev = c->write;
-
- if (!wev->ready) {
- return NGX_OK;
- }
-
- cl = NULL;
- out = NULL;
-
- for (frame = sc->last_out; frame; frame = fn) {
- frame->last->next = cl;
- cl = frame->first;
-
- fn = frame->next;
- frame->next = out;
- out = frame;
-
- ngx_log_debug5(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "spdy frame out: %p sid:%ui prio:%ui bl:%d len:%uz",
- out, out->stream ? out->stream->id : 0, out->priority,
- out->blocked, out->length);
- }
-
- cl = c->send_chain(c, cl, 0);
-
- if (cl == NGX_CHAIN_ERROR) {
- c->error = 1;
-
- if (!sc->blocked) {
- ngx_post_event(wev, &ngx_posted_events);
- }
-
- return NGX_ERROR;
- }
-
- clcf = ngx_http_get_module_loc_conf(sc->http_connection->conf_ctx,
- ngx_http_core_module);
-
- if (ngx_handle_write_event(wev, clcf->send_lowat) != NGX_OK) {
- return NGX_ERROR; /* FIXME */
- }
-
- if (cl) {
- ngx_add_timer(wev, clcf->send_timeout);
-
- } else {
- if (wev->timer_set) {
- ngx_del_timer(wev);
- }
- }
-
- for ( /* void */ ; out; out = fn) {
- fn = out->next;
-
- if (out->handler(sc, out) != NGX_OK) {
- out->blocked = 1;
- out->priority = NGX_SPDY_HIGHEST_PRIORITY;
- break;
- }
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "spdy frame sent: %p sid:%ui bl:%d len:%uz",
- out, out->stream ? out->stream->id : 0,
- out->blocked, out->length);
- }
-
- frame = NULL;
-
- for ( /* void */ ; out; out = fn) {
- fn = out->next;
- out->next = frame;
- frame = out;
- }
-
- sc->last_out = frame;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_spdy_handle_connection(ngx_http_spdy_connection_t *sc)
-{
- ngx_connection_t *c;
- ngx_http_spdy_srv_conf_t *sscf;
-
- if (sc->last_out || sc->processing) {
- return;
- }
-
- c = sc->connection;
-
- if (c->error) {
- ngx_http_close_connection(c);
- return;
- }
-
- if (c->buffered) {
- return;
- }
-
- sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
- ngx_http_spdy_module);
- if (sc->incomplete) {
- ngx_add_timer(c->read, sscf->recv_timeout);
- return;
- }
-
- if (ngx_terminate || ngx_exiting) {
- ngx_http_close_connection(c);
- return;
- }
-
- ngx_destroy_pool(sc->pool);
-
- sc->pool = NULL;
- sc->free_ctl_frames = NULL;
- sc->free_fake_connections = NULL;
-
-#if (NGX_HTTP_SSL)
- if (c->ssl) {
- ngx_ssl_free_buffer(c);
- }
-#endif
-
- c->destroyed = 1;
- c->idle = 1;
- ngx_reusable_connection(c, 1);
-
- c->write->handler = ngx_http_empty_handler;
- c->read->handler = ngx_http_spdy_keepalive_handler;
-
- if (c->write->timer_set) {
- ngx_del_timer(c->write);
- }
-
- ngx_add_timer(c->read, sscf->keepalive_timeout);
-}
-
-
-static u_char *
-ngx_http_spdy_proxy_protocol(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- ngx_log_t *log;
-
- log = sc->connection->log;
- log->action = "reading PROXY protocol";
-
- pos = ngx_proxy_protocol_parse(sc->connection, pos, end);
-
- log->action = "processing SPDY";
-
- if (pos == NULL) {
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- return ngx_http_spdy_state_complete(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_head(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- uint32_t head, flen;
- ngx_uint_t type;
-
- if (end - pos < NGX_SPDY_FRAME_HEADER_SIZE) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_head);
- }
-
- head = ngx_spdy_frame_parse_uint32(pos);
-
- pos += sizeof(uint32_t);
-
- flen = ngx_spdy_frame_parse_uint32(pos);
-
- sc->flags = ngx_spdy_frame_flags(flen);
- sc->length = ngx_spdy_frame_length(flen);
-
- pos += sizeof(uint32_t);
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "process spdy frame head:%08XD f:%Xd l:%uz",
- head, sc->flags, sc->length);
-
- if (ngx_spdy_ctl_frame_check(head)) {
- type = ngx_spdy_ctl_frame_type(head);
-
- switch (type) {
-
- case NGX_SPDY_SYN_STREAM:
- return ngx_http_spdy_state_syn_stream(sc, pos, end);
-
- case NGX_SPDY_SYN_REPLY:
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent unexpected SYN_REPLY frame");
- return ngx_http_spdy_state_protocol_error(sc);
-
- case NGX_SPDY_RST_STREAM:
- return ngx_http_spdy_state_rst_stream(sc, pos, end);
-
- case NGX_SPDY_SETTINGS:
- return ngx_http_spdy_state_settings(sc, pos, end);
-
- case NGX_SPDY_PING:
- return ngx_http_spdy_state_ping(sc, pos, end);
-
- case NGX_SPDY_GOAWAY:
- return ngx_http_spdy_state_skip(sc, pos, end); /* TODO */
-
- case NGX_SPDY_HEADERS:
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent unexpected HEADERS frame");
- return ngx_http_spdy_state_protocol_error(sc);
-
- case NGX_SPDY_WINDOW_UPDATE:
- return ngx_http_spdy_state_window_update(sc, pos, end);
-
- default:
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy control frame with unknown type %ui", type);
- return ngx_http_spdy_state_skip(sc, pos, end);
- }
- }
-
- if (ngx_spdy_data_frame_check(head)) {
- sc->stream = ngx_http_spdy_get_stream_by_id(sc, head);
- return ngx_http_spdy_state_data(sc, pos, end);
- }
-
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent invalid frame");
-
- return ngx_http_spdy_state_protocol_error(sc);
-}
-
-
-static u_char *
-ngx_http_spdy_state_syn_stream(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- ngx_uint_t sid, prio;
- ngx_http_spdy_stream_t *stream;
- ngx_http_spdy_srv_conf_t *sscf;
-
- if (end - pos < NGX_SPDY_SYN_STREAM_SIZE) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_syn_stream);
- }
-
- if (sc->length <= NGX_SPDY_SYN_STREAM_SIZE) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent SYN_STREAM frame with incorrect length %uz",
- sc->length);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- sc->length -= NGX_SPDY_SYN_STREAM_SIZE;
-
- sid = ngx_spdy_frame_parse_sid(pos);
- prio = pos[8] >> 5;
-
- pos += NGX_SPDY_SYN_STREAM_SIZE;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy SYN_STREAM frame sid:%ui prio:%ui", sid, prio);
-
- if (sid % 2 == 0 || sid <= sc->last_sid) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent SYN_STREAM frame "
- "with invalid Stream-ID %ui", sid);
-
- stream = ngx_http_spdy_get_stream_by_id(sc, sid);
-
- if (stream) {
- if (ngx_http_spdy_terminate_stream(sc, stream,
- NGX_SPDY_PROTOCOL_ERROR)
- != NGX_OK)
- {
- return ngx_http_spdy_state_internal_error(sc);
- }
- }
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- sc->last_sid = sid;
-
- sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
- ngx_http_spdy_module);
-
- if (sc->processing >= sscf->concurrent_streams) {
-
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "concurrent streams exceeded %ui", sc->processing);
-
- if (ngx_http_spdy_send_rst_stream(sc, sid, NGX_SPDY_REFUSED_STREAM,
- prio)
- != NGX_OK)
- {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- return ngx_http_spdy_state_headers_skip(sc, pos, end);
- }
-
- stream = ngx_http_spdy_create_stream(sc, sid, prio);
- if (stream == NULL) {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- stream->in_closed = (sc->flags & NGX_SPDY_FLAG_FIN) ? 1 : 0;
-
- stream->request->request_length = NGX_SPDY_FRAME_HEADER_SIZE
- + NGX_SPDY_SYN_STREAM_SIZE
- + sc->length;
-
- sc->stream = stream;
-
- return ngx_http_spdy_state_headers(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_headers(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- int z;
- size_t size;
- ngx_buf_t *buf;
- ngx_int_t rc;
- ngx_http_request_t *r;
-
- size = end - pos;
-
- if (size == 0) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_headers);
- }
-
- if (size > sc->length) {
- size = sc->length;
- }
-
- r = sc->stream->request;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "process spdy header block %uz of %uz", size, sc->length);
-
- buf = r->header_in;
-
- sc->zstream_in.next_in = pos;
- sc->zstream_in.avail_in = size;
- sc->zstream_in.next_out = buf->last;
-
- /* one byte is reserved for null-termination of the last header value */
- sc->zstream_in.avail_out = buf->end - buf->last - 1;
-
- z = inflate(&sc->zstream_in, Z_NO_FLUSH);
-
- if (z == Z_NEED_DICT) {
- z = inflateSetDictionary(&sc->zstream_in, ngx_http_spdy_dict,
- sizeof(ngx_http_spdy_dict));
-
- if (z != Z_OK) {
- if (z == Z_DATA_ERROR) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent SYN_STREAM frame with header "
- "block encoded using wrong dictionary: %ul",
- (u_long) sc->zstream_in.adler);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "inflateSetDictionary() failed: %d", z);
-
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy inflateSetDictionary(): %d", z);
-
- z = sc->zstream_in.avail_in ? inflate(&sc->zstream_in, Z_NO_FLUSH)
- : Z_OK;
- }
-
- if (z != Z_OK) {
- return ngx_http_spdy_state_inflate_error(sc, z);
- }
-
- ngx_log_debug5(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy inflate out: ni:%p no:%p ai:%ud ao:%ud rc:%d",
- sc->zstream_in.next_in, sc->zstream_in.next_out,
- sc->zstream_in.avail_in, sc->zstream_in.avail_out,
- z);
-
- sc->length -= sc->zstream_in.next_in - pos;
- pos = sc->zstream_in.next_in;
-
- buf->last = sc->zstream_in.next_out;
-
- if (r->headers_in.headers.part.elts == NULL) {
-
- if (buf->last - buf->pos < NGX_SPDY_NV_NUM_SIZE) {
-
- if (sc->length == 0) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "premature end of spdy header block");
-
- return ngx_http_spdy_state_headers_error(sc, pos, end);
- }
-
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_headers);
- }
-
- sc->entries = ngx_spdy_frame_parse_uint32(buf->pos);
-
- buf->pos += NGX_SPDY_NV_NUM_SIZE;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy header block has %ui entries",
- sc->entries);
-
- if (ngx_list_init(&r->headers_in.headers, r->pool, 20,
- sizeof(ngx_table_elt_t))
- != NGX_OK)
- {
- ngx_http_spdy_close_stream(sc->stream,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return ngx_http_spdy_state_headers_skip(sc, pos, end);
- }
-
- if (ngx_array_init(&r->headers_in.cookies, r->pool, 2,
- sizeof(ngx_table_elt_t *))
- != NGX_OK)
- {
- ngx_http_spdy_close_stream(sc->stream,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return ngx_http_spdy_state_headers_skip(sc, pos, end);
- }
- }
-
- while (sc->entries) {
-
- rc = ngx_http_spdy_parse_header(r);
-
- switch (rc) {
-
- case NGX_DONE:
- sc->entries--;
-
- case NGX_OK:
- break;
-
- case NGX_AGAIN:
-
- if (sc->zstream_in.avail_in) {
-
- rc = ngx_http_spdy_alloc_large_header_buffer(r);
-
- if (rc == NGX_DECLINED) {
- ngx_http_finalize_request(r,
- NGX_HTTP_REQUEST_HEADER_TOO_LARGE);
- return ngx_http_spdy_state_headers_skip(sc, pos, end);
- }
-
- if (rc != NGX_OK) {
- ngx_http_spdy_close_stream(sc->stream,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return ngx_http_spdy_state_headers_skip(sc, pos, end);
- }
-
- /* null-terminate the last processed header name or value */
- *buf->pos = '\0';
-
- buf = r->header_in;
-
- sc->zstream_in.next_out = buf->last;
-
- /* one byte is reserved for null-termination */
- sc->zstream_in.avail_out = buf->end - buf->last - 1;
-
- z = inflate(&sc->zstream_in, Z_NO_FLUSH);
-
- if (z != Z_OK) {
- return ngx_http_spdy_state_inflate_error(sc, z);
- }
-
- sc->length -= sc->zstream_in.next_in - pos;
- pos = sc->zstream_in.next_in;
-
- buf->last = sc->zstream_in.next_out;
-
- continue;
- }
-
- if (sc->length == 0) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "premature end of spdy header block");
-
- return ngx_http_spdy_state_headers_error(sc, pos, end);
- }
-
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_headers);
-
- case NGX_HTTP_PARSE_INVALID_HEADER:
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return ngx_http_spdy_state_headers_skip(sc, pos, end);
-
- default: /* NGX_ERROR */
- return ngx_http_spdy_state_headers_error(sc, pos, end);
- }
-
- /* a header line has been parsed successfully */
-
- rc = ngx_http_spdy_handle_request_header(r);
-
- if (rc != NGX_OK) {
- if (rc == NGX_HTTP_PARSE_INVALID_HEADER) {
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return ngx_http_spdy_state_headers_skip(sc, pos, end);
- }
-
- if (rc != NGX_ABORT) {
- ngx_http_spdy_close_stream(sc->stream,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- }
-
- return ngx_http_spdy_state_headers_skip(sc, pos, end);
- }
- }
-
- if (buf->pos != buf->last || sc->zstream_in.avail_in) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "incorrect number of spdy header block entries");
-
- return ngx_http_spdy_state_headers_error(sc, pos, end);
- }
-
- if (sc->length) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_headers);
- }
-
- /* null-terminate the last header value */
- *buf->pos = '\0';
-
- ngx_http_spdy_run_request(r);
-
- return ngx_http_spdy_state_complete(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_headers_skip(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- int n;
- size_t size;
- u_char buffer[NGX_SPDY_SKIP_HEADERS_BUFFER_SIZE];
-
- if (sc->length == 0) {
- return ngx_http_spdy_state_complete(sc, pos, end);
- }
-
- size = end - pos;
-
- if (size == 0) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_headers_skip);
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy header block skip %uz of %uz", size, sc->length);
-
- sc->zstream_in.next_in = pos;
- sc->zstream_in.avail_in = (size < sc->length) ? size : sc->length;
-
- while (sc->zstream_in.avail_in) {
- sc->zstream_in.next_out = buffer;
- sc->zstream_in.avail_out = NGX_SPDY_SKIP_HEADERS_BUFFER_SIZE;
-
- n = inflate(&sc->zstream_in, Z_NO_FLUSH);
-
- if (n != Z_OK) {
- return ngx_http_spdy_state_inflate_error(sc, n);
- }
- }
-
- pos = sc->zstream_in.next_in;
-
- if (size < sc->length) {
- sc->length -= size;
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_headers_skip);
- }
-
- return ngx_http_spdy_state_complete(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_headers_error(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- ngx_http_spdy_stream_t *stream;
-
- stream = sc->stream;
-
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent SYN_STREAM frame for stream %ui "
- "with invalid header block", stream->id);
-
- if (ngx_http_spdy_send_rst_stream(sc, stream->id, NGX_SPDY_PROTOCOL_ERROR,
- stream->priority)
- != NGX_OK)
- {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- stream->out_closed = 1;
-
- ngx_http_spdy_close_stream(stream, NGX_HTTP_BAD_REQUEST);
-
- return ngx_http_spdy_state_headers_skip(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_window_update(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- size_t delta;
- ngx_uint_t sid;
- ngx_event_t *wev;
- ngx_queue_t *q;
- ngx_http_spdy_stream_t *stream;
-
- if (end - pos < NGX_SPDY_WINDOW_UPDATE_SIZE) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_window_update);
- }
-
- if (sc->length != NGX_SPDY_WINDOW_UPDATE_SIZE) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent WINDOW_UPDATE frame "
- "with incorrect length %uz", sc->length);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- sid = ngx_spdy_frame_parse_sid(pos);
-
- pos += NGX_SPDY_SID_SIZE;
-
- delta = ngx_spdy_frame_parse_delta(pos);
-
- pos += NGX_SPDY_DELTA_SIZE;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy WINDOW_UPDATE sid:%ui delta:%ui", sid, delta);
-
- if (sid) {
- stream = ngx_http_spdy_get_stream_by_id(sc, sid);
-
- if (stream == NULL) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "unknown spdy stream");
-
- return ngx_http_spdy_state_complete(sc, pos, end);
- }
-
- if (stream->send_window > (ssize_t) (NGX_SPDY_MAX_WINDOW - delta)) {
-
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client violated flow control for stream %ui: "
- "received WINDOW_UPDATE frame with delta %uz "
- "not allowed for window %z",
- sid, delta, stream->send_window);
-
- if (ngx_http_spdy_terminate_stream(sc, stream,
- NGX_SPDY_FLOW_CONTROL_ERROR)
- == NGX_ERROR)
- {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- return ngx_http_spdy_state_complete(sc, pos, end);
- }
-
- stream->send_window += delta;
-
- if (stream->exhausted) {
- stream->exhausted = 0;
-
- wev = stream->request->connection->write;
-
- if (!wev->timer_set) {
- wev->delayed = 0;
- wev->handler(wev);
- }
- }
-
- } else {
- sc->send_window += delta;
-
- if (sc->send_window > NGX_SPDY_MAX_WINDOW) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client violated connection flow control: "
- "received WINDOW_UPDATE frame with delta %uz "
- "not allowed for window %uz",
- delta, sc->send_window);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- while (!ngx_queue_empty(&sc->waiting)) {
- q = ngx_queue_head(&sc->waiting);
-
- ngx_queue_remove(q);
-
- stream = ngx_queue_data(q, ngx_http_spdy_stream_t, queue);
-
- stream->handled = 0;
-
- wev = stream->request->connection->write;
-
- if (!wev->timer_set) {
- wev->delayed = 0;
- wev->handler(wev);
-
- if (sc->send_window == 0) {
- break;
- }
- }
- }
- }
-
- return ngx_http_spdy_state_complete(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_data(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- ngx_http_spdy_stream_t *stream;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy DATA frame");
-
- if (sc->length > sc->recv_window) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client violated connection flow control: "
- "received DATA frame length %uz, available window %uz",
- sc->length, sc->recv_window);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- sc->recv_window -= sc->length;
-
- if (sc->recv_window < NGX_SPDY_MAX_WINDOW / 4) {
-
- if (ngx_http_spdy_send_window_update(sc, 0,
- NGX_SPDY_MAX_WINDOW
- - sc->recv_window)
- == NGX_ERROR)
- {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- sc->recv_window = NGX_SPDY_MAX_WINDOW;
- }
-
- stream = sc->stream;
-
- if (stream == NULL) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "unknown spdy stream");
-
- return ngx_http_spdy_state_skip(sc, pos, end);
- }
-
- if (sc->length > stream->recv_window) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client violated flow control for stream %ui: "
- "received DATA frame length %uz, available window %uz",
- stream->id, sc->length, stream->recv_window);
-
- if (ngx_http_spdy_terminate_stream(sc, stream,
- NGX_SPDY_FLOW_CONTROL_ERROR)
- == NGX_ERROR)
- {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- return ngx_http_spdy_state_skip(sc, pos, end);
- }
-
- stream->recv_window -= sc->length;
-
- if (stream->recv_window < NGX_SPDY_STREAM_WINDOW / 4) {
-
- if (ngx_http_spdy_send_window_update(sc, stream->id,
- NGX_SPDY_STREAM_WINDOW
- - stream->recv_window)
- == NGX_ERROR)
- {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- stream->recv_window = NGX_SPDY_STREAM_WINDOW;
- }
-
- if (stream->in_closed) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent DATA frame for half-closed stream %ui",
- stream->id);
-
- if (ngx_http_spdy_terminate_stream(sc, stream,
- NGX_SPDY_STREAM_ALREADY_CLOSED)
- == NGX_ERROR)
- {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- return ngx_http_spdy_state_skip(sc, pos, end);
- }
-
- return ngx_http_spdy_state_read_data(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_read_data(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- size_t size;
- ssize_t n;
- ngx_buf_t *buf;
- ngx_int_t rc;
- ngx_temp_file_t *tf;
- ngx_http_request_t *r;
- ngx_http_spdy_stream_t *stream;
- ngx_http_request_body_t *rb;
- ngx_http_core_loc_conf_t *clcf;
-
- stream = sc->stream;
-
- if (stream == NULL) {
- return ngx_http_spdy_state_skip(sc, pos, end);
- }
-
- if (stream->skip_data) {
-
- if (sc->flags & NGX_SPDY_FLAG_FIN) {
- stream->in_closed = 1;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "skipping spdy DATA frame, reason: %d",
- stream->skip_data);
-
- return ngx_http_spdy_state_skip(sc, pos, end);
- }
-
- size = end - pos;
-
- if (size > sc->length) {
- size = sc->length;
- }
-
- r = stream->request;
-
- if (r->request_body == NULL
- && ngx_http_spdy_init_request_body(r) != NGX_OK)
- {
- stream->skip_data = NGX_SPDY_DATA_INTERNAL_ERROR;
- return ngx_http_spdy_state_skip(sc, pos, end);
- }
-
- rb = r->request_body;
- tf = rb->temp_file;
- buf = rb->buf;
-
- if (size) {
- rb->rest += size;
-
- if (r->headers_in.content_length_n != -1
- && r->headers_in.content_length_n < rb->rest)
- {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client intended to send body data "
- "larger than declared");
-
- stream->skip_data = NGX_SPDY_DATA_ERROR;
- goto error;
-
- } else {
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->client_max_body_size
- && clcf->client_max_body_size < rb->rest)
- {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "client intended to send "
- "too large chunked body: %O bytes", rb->rest);
-
- stream->skip_data = NGX_SPDY_DATA_ERROR;
- goto error;
- }
- }
-
- sc->length -= size;
-
- if (tf) {
- buf->start = pos;
- buf->pos = pos;
-
- pos += size;
-
- buf->end = pos;
- buf->last = pos;
-
- n = ngx_write_chain_to_temp_file(tf, rb->bufs);
-
- /* TODO: n == 0 or not complete and level event */
-
- if (n == NGX_ERROR) {
- stream->skip_data = NGX_SPDY_DATA_INTERNAL_ERROR;
- goto error;
- }
-
- tf->offset += n;
-
- } else {
- buf->last = ngx_cpymem(buf->last, pos, size);
- pos += size;
- }
-
- r->request_length += size;
- }
-
- if (sc->length) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_read_data);
- }
-
- if (sc->flags & NGX_SPDY_FLAG_FIN) {
-
- stream->in_closed = 1;
-
- if (r->headers_in.content_length_n < 0) {
- r->headers_in.content_length_n = rb->rest;
-
- } else if (r->headers_in.content_length_n != rb->rest) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client prematurely closed stream: "
- "only %O out of %O bytes of request body received",
- rb->rest, r->headers_in.content_length_n);
-
- stream->skip_data = NGX_SPDY_DATA_ERROR;
- goto error;
- }
-
- if (tf) {
- ngx_memzero(buf, sizeof(ngx_buf_t));
-
- buf->in_file = 1;
- buf->file_last = tf->file.offset;
- buf->file = &tf->file;
-
- rb->buf = NULL;
- }
-
- if (rb->post_handler) {
- r->read_event_handler = ngx_http_block_reading;
- rb->post_handler(r);
- }
- }
-
- return ngx_http_spdy_state_complete(sc, pos, end);
-
-error:
-
- if (rb->post_handler) {
-
- if (stream->skip_data == NGX_SPDY_DATA_ERROR) {
- rc = (r->headers_in.content_length_n == -1)
- ? NGX_HTTP_REQUEST_ENTITY_TOO_LARGE
- : NGX_HTTP_BAD_REQUEST;
-
- } else {
- rc = NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- ngx_http_finalize_request(r, rc);
- }
-
- return ngx_http_spdy_state_skip(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_rst_stream(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- ngx_uint_t sid, status;
- ngx_event_t *ev;
- ngx_connection_t *fc;
- ngx_http_spdy_stream_t *stream;
-
- if (end - pos < NGX_SPDY_RST_STREAM_SIZE) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_rst_stream);
- }
-
- if (sc->length != NGX_SPDY_RST_STREAM_SIZE) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent RST_STREAM frame with incorrect length %uz",
- sc->length);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- sid = ngx_spdy_frame_parse_sid(pos);
-
- pos += NGX_SPDY_SID_SIZE;
-
- status = ngx_spdy_frame_parse_uint32(pos);
-
- pos += sizeof(uint32_t);
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy RST_STREAM sid:%ui st:%ui", sid, status);
-
- stream = ngx_http_spdy_get_stream_by_id(sc, sid);
-
- if (stream == NULL) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "unknown spdy stream");
-
- return ngx_http_spdy_state_complete(sc, pos, end);
- }
-
- stream->in_closed = 1;
- stream->out_closed = 1;
-
- fc = stream->request->connection;
- fc->error = 1;
-
- switch (status) {
-
- case NGX_SPDY_CANCEL:
- ngx_log_error(NGX_LOG_INFO, fc->log, 0,
- "client canceled stream %ui", sid);
- break;
-
- case NGX_SPDY_INTERNAL_ERROR:
- ngx_log_error(NGX_LOG_INFO, fc->log, 0,
- "client terminated stream %ui due to internal error",
- sid);
- break;
-
- default:
- ngx_log_error(NGX_LOG_INFO, fc->log, 0,
- "client terminated stream %ui with status %ui",
- sid, status);
- break;
- }
-
- ev = fc->read;
- ev->handler(ev);
-
- return ngx_http_spdy_state_complete(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_ping(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- u_char *p;
- ngx_buf_t *buf;
- ngx_http_spdy_out_frame_t *frame;
-
- if (end - pos < NGX_SPDY_PING_SIZE) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_ping);
- }
-
- if (sc->length != NGX_SPDY_PING_SIZE) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent PING frame with incorrect length %uz",
- sc->length);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy PING frame");
-
- frame = ngx_http_spdy_get_ctl_frame(sc, NGX_SPDY_PING_SIZE,
- NGX_SPDY_HIGHEST_PRIORITY);
- if (frame == NULL) {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- buf = frame->first->buf;
-
- p = buf->pos;
-
- p = ngx_spdy_frame_write_head(p, NGX_SPDY_PING);
- p = ngx_spdy_frame_write_flags_and_len(p, 0, NGX_SPDY_PING_SIZE);
-
- p = ngx_cpymem(p, pos, NGX_SPDY_PING_SIZE);
-
- buf->last = p;
-
- ngx_http_spdy_queue_frame(sc, frame);
-
- pos += NGX_SPDY_PING_SIZE;
-
- return ngx_http_spdy_state_complete(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_skip(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- size_t size;
-
- size = end - pos;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy frame skip %uz of %uz", size, sc->length);
-
- if (size < sc->length) {
- sc->length -= size;
- return ngx_http_spdy_state_save(sc, end, end,
- ngx_http_spdy_state_skip);
- }
-
- return ngx_http_spdy_state_complete(sc, pos + sc->length, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_settings(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- ngx_uint_t fid, val;
-
- if (sc->entries == 0) {
-
- if (end - pos < NGX_SPDY_SETTINGS_NUM_SIZE) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_settings);
- }
-
- sc->entries = ngx_spdy_frame_parse_uint32(pos);
-
- pos += NGX_SPDY_SETTINGS_NUM_SIZE;
- sc->length -= NGX_SPDY_SETTINGS_NUM_SIZE;
-
- if (sc->length < sc->entries * NGX_SPDY_SETTINGS_PAIR_SIZE) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent SETTINGS frame with incorrect "
- "length %uz or number of entries %ui",
- sc->length, sc->entries);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy SETTINGS frame has %ui entries", sc->entries);
- }
-
- while (sc->entries) {
- if (end - pos < NGX_SPDY_SETTINGS_PAIR_SIZE) {
- return ngx_http_spdy_state_save(sc, pos, end,
- ngx_http_spdy_state_settings);
- }
-
- sc->entries--;
- sc->length -= NGX_SPDY_SETTINGS_PAIR_SIZE;
-
- fid = ngx_spdy_frame_parse_uint32(pos);
-
- pos += NGX_SPDY_SETTINGS_FID_SIZE;
-
- val = ngx_spdy_frame_parse_uint32(pos);
-
- pos += NGX_SPDY_SETTINGS_VAL_SIZE;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy SETTINGS entry fl:%ui id:%ui val:%ui",
- ngx_spdy_frame_flags(fid), ngx_spdy_frame_id(fid), val);
-
- if (ngx_spdy_frame_flags(fid) == NGX_SPDY_SETTINGS_FLAG_PERSISTED) {
- continue;
- }
-
- switch (ngx_spdy_frame_id(fid)) {
-
- case NGX_SPDY_SETTINGS_INIT_WINDOW:
-
- if (val > NGX_SPDY_MAX_WINDOW) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent SETTINGS frame with "
- "incorrect INIT_WINDOW value: %ui", val);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- if (ngx_http_spdy_adjust_windows(sc, val - sc->init_window)
- != NGX_OK)
- {
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- sc->init_window = val;
-
- continue;
- }
- }
-
- return ngx_http_spdy_state_complete(sc, pos, end);
-}
-
-
-static u_char *
-ngx_http_spdy_state_complete(ngx_http_spdy_connection_t *sc, u_char *pos,
- u_char *end)
-{
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy frame complete pos:%p end:%p", pos, end);
-
- if (pos > end) {
- ngx_log_error(NGX_LOG_ALERT, sc->connection->log, 0,
- "receive buffer overrun");
-
- ngx_debug_point();
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- sc->handler = ngx_http_spdy_state_head;
- sc->stream = NULL;
-
- return pos;
-}
-
-
-static u_char *
-ngx_http_spdy_state_save(ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end, ngx_http_spdy_handler_pt handler)
-{
- size_t size;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy frame state save pos:%p end:%p handler:%p",
- pos, end, handler);
-
- size = end - pos;
-
- if (size > NGX_SPDY_STATE_BUFFER_SIZE) {
- ngx_log_error(NGX_LOG_ALERT, sc->connection->log, 0,
- "state buffer overflow: %uz bytes required", size);
-
- ngx_debug_point();
- return ngx_http_spdy_state_internal_error(sc);
- }
-
- ngx_memcpy(sc->buffer, pos, NGX_SPDY_STATE_BUFFER_SIZE);
-
- sc->buffer_used = size;
- sc->handler = handler;
- sc->incomplete = 1;
-
- return end;
-}
-
-
-static u_char *
-ngx_http_spdy_state_inflate_error(ngx_http_spdy_connection_t *sc, int rc)
-{
- if (rc == Z_DATA_ERROR || rc == Z_STREAM_END) {
- ngx_log_error(NGX_LOG_INFO, sc->connection->log, 0,
- "client sent SYN_STREAM frame with "
- "corrupted header block, inflate() failed: %d", rc);
-
- return ngx_http_spdy_state_protocol_error(sc);
- }
-
- ngx_log_error(NGX_LOG_ERR, sc->connection->log, 0,
- "inflate() failed: %d", rc);
-
- return ngx_http_spdy_state_internal_error(sc);
-}
-
-
-static u_char *
-ngx_http_spdy_state_protocol_error(ngx_http_spdy_connection_t *sc)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy state protocol error");
-
- if (sc->stream) {
- sc->stream->out_closed = 1;
- ngx_http_spdy_close_stream(sc->stream, NGX_HTTP_BAD_REQUEST);
- }
-
- ngx_http_spdy_finalize_connection(sc, NGX_HTTP_CLIENT_CLOSED_REQUEST);
-
- return NULL;
-}
-
-
-static u_char *
-ngx_http_spdy_state_internal_error(ngx_http_spdy_connection_t *sc)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy state internal error");
-
- if (sc->stream) {
- sc->stream->out_closed = 1;
- ngx_http_spdy_close_stream(sc->stream, NGX_HTTP_INTERNAL_SERVER_ERROR);
- }
-
- ngx_http_spdy_finalize_connection(sc, NGX_HTTP_INTERNAL_SERVER_ERROR);
-
- return NULL;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_send_window_update(ngx_http_spdy_connection_t *sc, ngx_uint_t sid,
- ngx_uint_t delta)
-{
- u_char *p;
- ngx_buf_t *buf;
- ngx_http_spdy_out_frame_t *frame;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy send WINDOW_UPDATE sid:%ui delta:%ui", sid, delta);
-
- frame = ngx_http_spdy_get_ctl_frame(sc, NGX_SPDY_WINDOW_UPDATE_SIZE,
- NGX_SPDY_HIGHEST_PRIORITY);
- if (frame == NULL) {
- return NGX_ERROR;
- }
-
- buf = frame->first->buf;
-
- p = buf->pos;
-
- p = ngx_spdy_frame_write_head(p, NGX_SPDY_WINDOW_UPDATE);
- p = ngx_spdy_frame_write_flags_and_len(p, 0, NGX_SPDY_WINDOW_UPDATE_SIZE);
-
- p = ngx_spdy_frame_write_sid(p, sid);
- p = ngx_spdy_frame_aligned_write_uint32(p, delta);
-
- buf->last = p;
-
- ngx_http_spdy_queue_frame(sc, frame);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_send_rst_stream(ngx_http_spdy_connection_t *sc, ngx_uint_t sid,
- ngx_uint_t status, ngx_uint_t priority)
-{
- u_char *p;
- ngx_buf_t *buf;
- ngx_http_spdy_out_frame_t *frame;
-
- if (sc->connection->error) {
- return NGX_OK;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy send RST_STREAM sid:%ui st:%ui", sid, status);
-
- frame = ngx_http_spdy_get_ctl_frame(sc, NGX_SPDY_RST_STREAM_SIZE,
- priority);
- if (frame == NULL) {
- return NGX_ERROR;
- }
-
- buf = frame->first->buf;
-
- p = buf->pos;
-
- p = ngx_spdy_frame_write_head(p, NGX_SPDY_RST_STREAM);
- p = ngx_spdy_frame_write_flags_and_len(p, 0, NGX_SPDY_RST_STREAM_SIZE);
-
- p = ngx_spdy_frame_write_sid(p, sid);
- p = ngx_spdy_frame_aligned_write_uint32(p, status);
-
- buf->last = p;
-
- ngx_http_spdy_queue_frame(sc, frame);
-
- return NGX_OK;
-}
-
-
-#if 0
-static ngx_int_t
-ngx_http_spdy_send_goaway(ngx_http_spdy_connection_t *sc)
-{
- u_char *p;
- ngx_buf_t *buf;
- ngx_http_spdy_out_frame_t *frame;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy send GOAWAY sid:%ui", sc->last_sid);
-
- frame = ngx_http_spdy_get_ctl_frame(sc, NGX_SPDY_GOAWAY_SIZE,
- NGX_SPDY_HIGHEST_PRIORITY);
- if (frame == NULL) {
- return NGX_ERROR;
- }
-
- buf = frame->first->buf;
-
- p = buf->pos;
-
- p = ngx_spdy_frame_write_head(p, NGX_SPDY_GOAWAY);
- p = ngx_spdy_frame_write_flags_and_len(p, 0, NGX_SPDY_GOAWAY_SIZE);
-
- p = ngx_spdy_frame_write_sid(p, sc->last_sid);
-
- buf->last = p;
-
- ngx_http_spdy_queue_frame(sc, frame);
-
- return NGX_OK;
-}
-#endif
-
-
-static ngx_int_t
-ngx_http_spdy_send_settings(ngx_http_spdy_connection_t *sc)
-{
- u_char *p;
- ngx_buf_t *buf;
- ngx_chain_t *cl;
- ngx_http_spdy_srv_conf_t *sscf;
- ngx_http_spdy_out_frame_t *frame;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy send SETTINGS frame");
-
- frame = ngx_palloc(sc->pool, sizeof(ngx_http_spdy_out_frame_t));
- if (frame == NULL) {
- return NGX_ERROR;
- }
-
- cl = ngx_alloc_chain_link(sc->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- buf = ngx_create_temp_buf(sc->pool, NGX_SPDY_FRAME_HEADER_SIZE
- + NGX_SPDY_SETTINGS_NUM_SIZE
- + 2 * NGX_SPDY_SETTINGS_PAIR_SIZE);
- if (buf == NULL) {
- return NGX_ERROR;
- }
-
- buf->last_buf = 1;
-
- cl->buf = buf;
- cl->next = NULL;
-
- frame->first = cl;
- frame->last = cl;
- frame->handler = ngx_http_spdy_settings_frame_handler;
- frame->stream = NULL;
-#if (NGX_DEBUG)
- frame->length = NGX_SPDY_SETTINGS_NUM_SIZE
- + 2 * NGX_SPDY_SETTINGS_PAIR_SIZE;
-#endif
- frame->priority = NGX_SPDY_HIGHEST_PRIORITY;
- frame->blocked = 0;
-
- p = buf->pos;
-
- p = ngx_spdy_frame_write_head(p, NGX_SPDY_SETTINGS);
- p = ngx_spdy_frame_write_flags_and_len(p, NGX_SPDY_FLAG_CLEAR_SETTINGS,
- NGX_SPDY_SETTINGS_NUM_SIZE
- + 2 * NGX_SPDY_SETTINGS_PAIR_SIZE);
-
- p = ngx_spdy_frame_aligned_write_uint32(p, 2);
-
- sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
- ngx_http_spdy_module);
-
- p = ngx_spdy_frame_write_flags_and_id(p, 0, NGX_SPDY_SETTINGS_MAX_STREAMS);
- p = ngx_spdy_frame_aligned_write_uint32(p, sscf->concurrent_streams);
-
- p = ngx_spdy_frame_write_flags_and_id(p, 0, NGX_SPDY_SETTINGS_INIT_WINDOW);
- p = ngx_spdy_frame_aligned_write_uint32(p, NGX_SPDY_STREAM_WINDOW);
-
- buf->last = p;
-
- ngx_http_spdy_queue_frame(sc, frame);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_spdy_settings_frame_handler(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_out_frame_t *frame)
-{
- ngx_buf_t *buf;
-
- buf = frame->first->buf;
-
- if (buf->pos != buf->last) {
- return NGX_AGAIN;
- }
-
- ngx_free_chain(sc->pool, frame->first);
-
- return NGX_OK;
-}
-
-
-static ngx_http_spdy_out_frame_t *
-ngx_http_spdy_get_ctl_frame(ngx_http_spdy_connection_t *sc, size_t length,
- ngx_uint_t priority)
-{
- ngx_chain_t *cl;
- ngx_http_spdy_out_frame_t *frame;
-
- frame = sc->free_ctl_frames;
-
- if (frame) {
- sc->free_ctl_frames = frame->next;
-
- cl = frame->first;
- cl->buf->pos = cl->buf->start;
-
- } else {
- frame = ngx_palloc(sc->pool, sizeof(ngx_http_spdy_out_frame_t));
- if (frame == NULL) {
- return NULL;
- }
-
- cl = ngx_alloc_chain_link(sc->pool);
- if (cl == NULL) {
- return NULL;
- }
-
- cl->buf = ngx_create_temp_buf(sc->pool,
- NGX_SPDY_CTL_FRAME_BUFFER_SIZE);
- if (cl->buf == NULL) {
- return NULL;
- }
-
- cl->buf->last_buf = 1;
-
- frame->first = cl;
- frame->last = cl;
- frame->handler = ngx_http_spdy_ctl_frame_handler;
- frame->stream = NULL;
- }
-
-#if (NGX_DEBUG)
- if (length > NGX_SPDY_CTL_FRAME_BUFFER_SIZE - NGX_SPDY_FRAME_HEADER_SIZE) {
- ngx_log_error(NGX_LOG_ALERT, sc->pool->log, 0,
- "requested control frame is too large: %uz", length);
- return NULL;
- }
-
- frame->length = length;
-#endif
-
- frame->priority = priority;
- frame->blocked = 0;
-
- return frame;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_ctl_frame_handler(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_out_frame_t *frame)
-{
- ngx_buf_t *buf;
-
- buf = frame->first->buf;
-
- if (buf->pos != buf->last) {
- return NGX_AGAIN;
- }
-
- frame->next = sc->free_ctl_frames;
- sc->free_ctl_frames = frame;
-
- return NGX_OK;
-}
-
-
-static ngx_http_spdy_stream_t *
-ngx_http_spdy_create_stream(ngx_http_spdy_connection_t *sc, ngx_uint_t id,
- ngx_uint_t priority)
-{
- ngx_log_t *log;
- ngx_uint_t index;
- ngx_event_t *rev, *wev;
- ngx_connection_t *fc;
- ngx_http_log_ctx_t *ctx;
- ngx_http_request_t *r;
- ngx_http_spdy_stream_t *stream;
- ngx_http_core_srv_conf_t *cscf;
- ngx_http_spdy_srv_conf_t *sscf;
-
- fc = sc->free_fake_connections;
-
- if (fc) {
- sc->free_fake_connections = fc->data;
-
- rev = fc->read;
- wev = fc->write;
- log = fc->log;
- ctx = log->data;
-
- } else {
- fc = ngx_palloc(sc->pool, sizeof(ngx_connection_t));
- if (fc == NULL) {
- return NULL;
- }
-
- rev = ngx_palloc(sc->pool, sizeof(ngx_event_t));
- if (rev == NULL) {
- return NULL;
- }
-
- wev = ngx_palloc(sc->pool, sizeof(ngx_event_t));
- if (wev == NULL) {
- return NULL;
- }
-
- log = ngx_palloc(sc->pool, sizeof(ngx_log_t));
- if (log == NULL) {
- return NULL;
- }
-
- ctx = ngx_palloc(sc->pool, sizeof(ngx_http_log_ctx_t));
- if (ctx == NULL) {
- return NULL;
- }
-
- ctx->connection = fc;
- ctx->request = NULL;
- }
-
- ngx_memcpy(log, sc->connection->log, sizeof(ngx_log_t));
-
- log->data = ctx;
-
- ngx_memzero(rev, sizeof(ngx_event_t));
-
- rev->data = fc;
- rev->ready = 1;
- rev->handler = ngx_http_spdy_close_stream_handler;
- rev->log = log;
-
- ngx_memcpy(wev, rev, sizeof(ngx_event_t));
-
- wev->write = 1;
-
- ngx_memcpy(fc, sc->connection, sizeof(ngx_connection_t));
-
- fc->data = sc->http_connection;
- fc->read = rev;
- fc->write = wev;
- fc->sent = 0;
- fc->log = log;
- fc->buffered = 0;
- fc->sndlowat = 1;
- fc->tcp_nodelay = NGX_TCP_NODELAY_DISABLED;
-
- r = ngx_http_create_request(fc);
- if (r == NULL) {
- return NULL;
- }
-
- r->valid_location = 1;
-
- fc->data = r;
- sc->connection->requests++;
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- r->header_in = ngx_create_temp_buf(r->pool,
- cscf->client_header_buffer_size);
- if (r->header_in == NULL) {
- ngx_http_free_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NULL;
- }
-
- r->headers_in.connection_type = NGX_HTTP_CONNECTION_CLOSE;
-
- stream = ngx_pcalloc(r->pool, sizeof(ngx_http_spdy_stream_t));
- if (stream == NULL) {
- ngx_http_free_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NULL;
- }
-
- r->spdy_stream = stream;
-
- stream->id = id;
- stream->request = r;
- stream->connection = sc;
-
- stream->send_window = sc->init_window;
- stream->recv_window = NGX_SPDY_STREAM_WINDOW;
-
- stream->priority = priority;
-
- sscf = ngx_http_get_module_srv_conf(r, ngx_http_spdy_module);
-
- index = ngx_http_spdy_stream_index(sscf, id);
-
- stream->index = sc->streams_index[index];
- sc->streams_index[index] = stream;
-
- sc->processing++;
-
- return stream;
-}
-
-
-static ngx_http_spdy_stream_t *
-ngx_http_spdy_get_stream_by_id(ngx_http_spdy_connection_t *sc,
- ngx_uint_t sid)
-{
- ngx_http_spdy_stream_t *stream;
- ngx_http_spdy_srv_conf_t *sscf;
-
- sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
- ngx_http_spdy_module);
-
- stream = sc->streams_index[ngx_http_spdy_stream_index(sscf, sid)];
-
- while (stream) {
- if (stream->id == sid) {
- return stream;
- }
-
- stream = stream->index;
- }
-
- return NULL;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_parse_header(ngx_http_request_t *r)
-{
- u_char *p, *end, ch;
- ngx_uint_t hash;
- ngx_http_core_srv_conf_t *cscf;
-
- enum {
- sw_name_len = 0,
- sw_name,
- sw_value_len,
- sw_value
- } state;
-
- state = r->state;
-
- p = r->header_in->pos;
- end = r->header_in->last;
-
- switch (state) {
-
- case sw_name_len:
-
- if (end - p < NGX_SPDY_NV_NLEN_SIZE) {
- return NGX_AGAIN;
- }
-
- r->lowcase_index = ngx_spdy_frame_parse_uint32(p);
-
- if (r->lowcase_index == 0) {
- return NGX_ERROR;
- }
-
- /* null-terminate the previous header value */
- *p = '\0';
-
- p += NGX_SPDY_NV_NLEN_SIZE;
-
- r->invalid_header = 0;
-
- state = sw_name;
-
- /* fall through */
-
- case sw_name:
-
- if ((ngx_uint_t) (end - p) < r->lowcase_index) {
- break;
- }
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- r->header_name_start = p;
- r->header_name_end = p + r->lowcase_index;
-
- if (p[0] == ':') {
- p++;
- }
-
- hash = 0;
-
- for ( /* void */ ; p != r->header_name_end; p++) {
-
- ch = *p;
-
- hash = ngx_hash(hash, ch);
-
- if ((ch >= 'a' && ch <= 'z')
- || (ch == '-')
- || (ch >= '0' && ch <= '9')
- || (ch == '_' && cscf->underscores_in_headers))
- {
- continue;
- }
-
- switch (ch) {
- case '\0':
- case LF:
- case CR:
- case ':':
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent invalid header name: \"%*s\"",
- r->lowcase_index, r->header_name_start);
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- if (ch >= 'A' && ch <= 'Z') {
- return NGX_ERROR;
- }
-
- r->invalid_header = 1;
- }
-
- r->header_hash = hash;
-
- state = sw_value_len;
-
- /* fall through */
-
- case sw_value_len:
-
- if (end - p < NGX_SPDY_NV_VLEN_SIZE) {
- break;
- }
-
- r->lowcase_index = ngx_spdy_frame_parse_uint32(p);
-
- /* null-terminate header name */
- *p = '\0';
-
- p += NGX_SPDY_NV_VLEN_SIZE;
-
- state = sw_value;
-
- /* fall through */
-
- case sw_value:
-
- if ((ngx_uint_t) (end - p) < r->lowcase_index) {
- break;
- }
-
- r->header_start = p;
-
- while (r->lowcase_index--) {
- ch = *p;
-
- if (ch == '\0') {
-
- if (p == r->header_start) {
- return NGX_ERROR;
- }
-
- r->header_end = p;
- r->header_in->pos = p + 1;
-
- r->state = sw_value;
-
- return NGX_OK;
- }
-
- if (ch == CR || ch == LF) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent header \"%*s\" with "
- "invalid value: \"%*s\\%c...\"",
- r->header_name_end - r->header_name_start,
- r->header_name_start,
- p - r->header_start,
- r->header_start,
- ch == CR ? 'r' : 'n');
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- p++;
- }
-
- r->header_end = p;
- r->header_in->pos = p;
-
- r->state = 0;
-
- return NGX_DONE;
- }
-
- r->header_in->pos = p;
- r->state = state;
-
- return NGX_AGAIN;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_alloc_large_header_buffer(ngx_http_request_t *r)
-{
- u_char *old, *new, *p;
- size_t rest;
- ngx_buf_t *buf;
- ngx_http_spdy_stream_t *stream;
- ngx_http_core_srv_conf_t *cscf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy alloc large header buffer");
-
- stream = r->spdy_stream;
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- if (stream->header_buffers
- == (ngx_uint_t) cscf->large_client_header_buffers.num)
- {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent too large request");
-
- return NGX_DECLINED;
- }
-
- rest = r->header_in->last - r->header_in->pos;
-
- /*
- * equality is prohibited since one more byte is needed
- * for null-termination
- */
- if (rest >= cscf->large_client_header_buffers.size) {
- p = r->header_in->pos;
-
- if (rest > NGX_MAX_ERROR_STR - 300) {
- rest = NGX_MAX_ERROR_STR - 300;
- p[rest++] = '.'; p[rest++] = '.'; p[rest++] = '.';
- }
-
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent too long header name or value: \"%*s\"",
- rest, p);
-
- return NGX_DECLINED;
- }
-
- buf = ngx_create_temp_buf(r->pool, cscf->large_client_header_buffers.size);
- if (buf == NULL) {
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy large header alloc: %p %uz",
- buf->pos, buf->end - buf->last);
-
- old = r->header_in->pos;
- new = buf->pos;
-
- if (rest) {
- buf->last = ngx_cpymem(new, old, rest);
- }
-
- r->header_in = buf;
-
- stream->header_buffers++;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_handle_request_header(ngx_http_request_t *r)
-{
- ngx_uint_t i;
- ngx_table_elt_t *h;
- ngx_http_core_srv_conf_t *cscf;
- ngx_http_spdy_request_header_t *sh;
-
- if (r->invalid_header) {
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- if (cscf->ignore_invalid_headers) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent invalid header: \"%*s\"",
- r->header_end - r->header_name_start,
- r->header_name_start);
- return NGX_OK;
- }
-
- }
-
- if (r->header_name_start[0] == ':') {
- r->header_name_start++;
-
- for (i = 0; i < NGX_SPDY_REQUEST_HEADERS; i++) {
- sh = &ngx_http_spdy_request_headers[i];
-
- if (sh->hash != r->header_hash
- || sh->len != r->header_name_end - r->header_name_start
- || ngx_strncmp(sh->header, r->header_name_start, sh->len) != 0)
- {
- continue;
- }
-
- return sh->handler(r);
- }
-
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent invalid header name: \":%*s\"",
- r->header_end - r->header_name_start,
- r->header_name_start);
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- h = ngx_list_push(&r->headers_in.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- h->hash = r->header_hash;
-
- h->key.len = r->header_name_end - r->header_name_start;
- h->key.data = r->header_name_start;
-
- h->value.len = r->header_end - r->header_start;
- h->value.data = r->header_start;
-
- h->lowcase_key = h->key.data;
-
- return NGX_OK;
-}
-
-
-void
-ngx_http_spdy_request_headers_init(void)
-{
- ngx_uint_t i;
- ngx_http_spdy_request_header_t *h;
-
- for (i = 0; i < NGX_SPDY_REQUEST_HEADERS; i++) {
- h = &ngx_http_spdy_request_headers[i];
- h->hash = ngx_hash_key(h->header, h->len);
- }
-}
-
-
-static ngx_int_t
-ngx_http_spdy_parse_method(ngx_http_request_t *r)
-{
- size_t k, len;
- ngx_uint_t n;
- const u_char *p, *m;
-
- /*
- * This array takes less than 256 sequential bytes,
- * and if typical CPU cache line size is 64 bytes,
- * it is prefetched for 4 load operations.
- */
- static const struct {
- u_char len;
- const u_char method[11];
- uint32_t value;
- } tests[] = {
- { 3, "GET", NGX_HTTP_GET },
- { 4, "POST", NGX_HTTP_POST },
- { 4, "HEAD", NGX_HTTP_HEAD },
- { 7, "OPTIONS", NGX_HTTP_OPTIONS },
- { 8, "PROPFIND", NGX_HTTP_PROPFIND },
- { 3, "PUT", NGX_HTTP_PUT },
- { 5, "MKCOL", NGX_HTTP_MKCOL },
- { 6, "DELETE", NGX_HTTP_DELETE },
- { 4, "COPY", NGX_HTTP_COPY },
- { 4, "MOVE", NGX_HTTP_MOVE },
- { 9, "PROPPATCH", NGX_HTTP_PROPPATCH },
- { 4, "LOCK", NGX_HTTP_LOCK },
- { 6, "UNLOCK", NGX_HTTP_UNLOCK },
- { 5, "PATCH", NGX_HTTP_PATCH },
- { 5, "TRACE", NGX_HTTP_TRACE }
- }, *test;
-
- if (r->method_name.len) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent duplicate :method header");
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- len = r->header_end - r->header_start;
-
- r->method_name.len = len;
- r->method_name.data = r->header_start;
-
- test = tests;
- n = sizeof(tests) / sizeof(tests[0]);
-
- do {
- if (len == test->len) {
- p = r->method_name.data;
- m = test->method;
- k = len;
-
- do {
- if (*p++ != *m++) {
- goto next;
- }
- } while (--k);
-
- r->method = test->value;
- return NGX_OK;
- }
-
- next:
- test++;
-
- } while (--n);
-
- p = r->method_name.data;
-
- do {
- if ((*p < 'A' || *p > 'Z') && *p != '_') {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent invalid method: \"%V\"",
- &r->method_name);
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- p++;
-
- } while (--len);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_parse_scheme(ngx_http_request_t *r)
-{
- if (r->schema_start) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent duplicate :schema header");
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- r->schema_start = r->header_start;
- r->schema_end = r->header_end;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_parse_host(ngx_http_request_t *r)
-{
- ngx_table_elt_t *h;
-
- if (r->headers_in.host) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent duplicate :host header");
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- h = ngx_list_push(&r->headers_in.headers);
- if (h == NULL) {
- return NGX_ERROR;
- }
-
- r->headers_in.host = h;
-
- h->hash = r->header_hash;
-
- h->key.len = r->header_name_end - r->header_name_start;
- h->key.data = r->header_name_start;
-
- h->value.len = r->header_end - r->header_start;
- h->value.data = r->header_start;
-
- h->lowcase_key = h->key.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_parse_path(ngx_http_request_t *r)
-{
- if (r->unparsed_uri.len) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent duplicate :path header");
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- r->uri_start = r->header_start;
- r->uri_end = r->header_end;
-
- if (ngx_http_parse_uri(r) != NGX_OK) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent invalid URI: \"%*s\"",
- r->uri_end - r->uri_start, r->uri_start);
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- if (ngx_http_process_request_uri(r) != NGX_OK) {
- /*
- * request has been finalized already
- * in ngx_http_process_request_uri()
- */
- return NGX_ABORT;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_parse_version(ngx_http_request_t *r)
-{
- u_char *p, ch;
-
- if (r->http_protocol.len) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent duplicate :version header");
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
- }
-
- p = r->header_start;
-
- if (r->header_end - p < 8 || !(ngx_str5cmp(p, 'H', 'T', 'T', 'P', '/'))) {
- goto invalid;
- }
-
- ch = *(p + 5);
-
- if (ch < '1' || ch > '9') {
- goto invalid;
- }
-
- r->http_major = ch - '0';
-
- for (p += 6; p != r->header_end - 2; p++) {
-
- ch = *p;
-
- if (ch == '.') {
- break;
- }
-
- if (ch < '0' || ch > '9') {
- goto invalid;
- }
-
- r->http_major = r->http_major * 10 + ch - '0';
- }
-
- if (*p != '.') {
- goto invalid;
- }
-
- ch = *(p + 1);
-
- if (ch < '0' || ch > '9') {
- goto invalid;
- }
-
- r->http_minor = ch - '0';
-
- for (p += 2; p != r->header_end; p++) {
-
- ch = *p;
-
- if (ch < '0' || ch > '9') {
- goto invalid;
- }
-
- r->http_minor = r->http_minor * 10 + ch - '0';
- }
-
- r->http_protocol.len = r->header_end - r->header_start;
- r->http_protocol.data = r->header_start;
- r->http_version = r->http_major * 1000 + r->http_minor;
-
- return NGX_OK;
-
-invalid:
-
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client sent invalid http version: \"%*s\"",
- r->header_end - r->header_start, r->header_start);
-
- return NGX_HTTP_PARSE_INVALID_HEADER;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_construct_request_line(ngx_http_request_t *r)
-{
- u_char *p;
-
- if (r->method_name.len == 0
- || r->unparsed_uri.len == 0
- || r->http_protocol.len == 0)
- {
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return NGX_ERROR;
- }
-
- r->request_line.len = r->method_name.len + 1
- + r->unparsed_uri.len + 1
- + r->http_protocol.len;
-
- p = ngx_pnalloc(r->pool, r->request_line.len + 1);
- if (p == NULL) {
- ngx_http_spdy_close_stream(r->spdy_stream,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_ERROR;
- }
-
- r->request_line.data = p;
-
- p = ngx_cpymem(p, r->method_name.data, r->method_name.len);
-
- *p++ = ' ';
-
- p = ngx_cpymem(p, r->unparsed_uri.data, r->unparsed_uri.len);
-
- *p++ = ' ';
-
- ngx_memcpy(p, r->http_protocol.data, r->http_protocol.len + 1);
-
- /* some modules expect the space character after method name */
- r->method_name.data = r->request_line.data;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_spdy_run_request(ngx_http_request_t *r)
-{
- ngx_uint_t i;
- ngx_list_part_t *part;
- ngx_table_elt_t *h;
- ngx_http_header_t *hh;
- ngx_http_core_main_conf_t *cmcf;
-
- if (ngx_http_spdy_construct_request_line(r) != NGX_OK) {
- return;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy http request line: \"%V\"", &r->request_line);
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- part = &r->headers_in.headers.part;
- h = part->elts;
-
- for (i = 0 ;; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- h = part->elts;
- i = 0;
- }
-
- hh = ngx_hash_find(&cmcf->headers_in_hash, h[i].hash,
- h[i].lowcase_key, h[i].key.len);
-
- if (hh && hh->handler(r, &h[i], hh->offset) != NGX_OK) {
- return;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy http header: \"%V: %V\"", &h[i].key, &h[i].value);
- }
-
- r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE;
-
- if (ngx_http_process_request_header(r) != NGX_OK) {
- return;
- }
-
- if (r->headers_in.content_length_n > 0 && r->spdy_stream->in_closed) {
- ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
- "client prematurely closed stream");
-
- r->spdy_stream->skip_data = NGX_SPDY_DATA_ERROR;
-
- ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
- return;
- }
-
- ngx_http_process_request(r);
-}
-
-
-static ngx_int_t
-ngx_http_spdy_init_request_body(ngx_http_request_t *r)
-{
- ngx_buf_t *buf;
- ngx_temp_file_t *tf;
- ngx_http_request_body_t *rb;
- ngx_http_core_loc_conf_t *clcf;
-
- rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t));
- if (rb == NULL) {
- return NGX_ERROR;
- }
-
- r->request_body = rb;
-
- if (r->spdy_stream->in_closed) {
- return NGX_OK;
- }
-
- rb->rest = r->headers_in.content_length_n;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (r->request_body_in_file_only
- || rb->rest > (off_t) clcf->client_body_buffer_size
- || rb->rest < 0)
- {
- tf = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t));
- if (tf == NULL) {
- return NGX_ERROR;
- }
-
- tf->file.fd = NGX_INVALID_FILE;
- tf->file.log = r->connection->log;
- tf->path = clcf->client_body_temp_path;
- tf->pool = r->pool;
- tf->warn = "a client request body is buffered to a temporary file";
- tf->log_level = r->request_body_file_log_level;
- tf->persistent = r->request_body_in_persistent_file;
- tf->clean = r->request_body_in_clean_file;
-
- if (r->request_body_file_group_access) {
- tf->access = 0660;
- }
-
- rb->temp_file = tf;
-
- if (r->spdy_stream->in_closed
- && ngx_create_temp_file(&tf->file, tf->path, tf->pool,
- tf->persistent, tf->clean, tf->access)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- buf = ngx_calloc_buf(r->pool);
- if (buf == NULL) {
- return NGX_ERROR;
- }
-
- } else {
-
- if (rb->rest == 0) {
- return NGX_OK;
- }
-
- buf = ngx_create_temp_buf(r->pool, (size_t) rb->rest);
- if (buf == NULL) {
- return NGX_ERROR;
- }
- }
-
- rb->buf = buf;
-
- rb->bufs = ngx_alloc_chain_link(r->pool);
- if (rb->bufs == NULL) {
- return NGX_ERROR;
- }
-
- rb->bufs->buf = buf;
- rb->bufs->next = NULL;
-
- rb->rest = 0;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_spdy_read_request_body(ngx_http_request_t *r,
- ngx_http_client_body_handler_pt post_handler)
-{
- ngx_http_spdy_stream_t *stream;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy read request body");
-
- stream = r->spdy_stream;
-
- switch (stream->skip_data) {
-
- case NGX_SPDY_DATA_DISCARD:
- post_handler(r);
- return NGX_OK;
-
- case NGX_SPDY_DATA_ERROR:
- if (r->headers_in.content_length_n == -1) {
- return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE;
- } else {
- return NGX_HTTP_BAD_REQUEST;
- }
-
- case NGX_SPDY_DATA_INTERNAL_ERROR:
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (!r->request_body && ngx_http_spdy_init_request_body(r) != NGX_OK) {
- stream->skip_data = NGX_SPDY_DATA_INTERNAL_ERROR;
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- if (stream->in_closed) {
- post_handler(r);
- return NGX_OK;
- }
-
- r->request_body->post_handler = post_handler;
-
- r->read_event_handler = ngx_http_test_reading;
- r->write_event_handler = ngx_http_request_empty_handler;
-
- return NGX_AGAIN;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_terminate_stream(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_stream_t *stream, ngx_uint_t status)
-{
- ngx_event_t *rev;
- ngx_connection_t *fc;
-
- if (ngx_http_spdy_send_rst_stream(sc, stream->id, status,
- NGX_SPDY_HIGHEST_PRIORITY)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
-
- stream->out_closed = 1;
-
- fc = stream->request->connection;
- fc->error = 1;
-
- rev = fc->read;
- rev->handler(rev);
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_spdy_close_stream_handler(ngx_event_t *ev)
-{
- ngx_connection_t *fc;
- ngx_http_request_t *r;
-
- fc = ev->data;
- r = fc->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy close stream handler");
-
- ngx_http_spdy_close_stream(r->spdy_stream, 0);
-}
-
-
-void
-ngx_http_spdy_close_stream(ngx_http_spdy_stream_t *stream, ngx_int_t rc)
-{
- ngx_event_t *ev;
- ngx_connection_t *fc;
- ngx_http_spdy_stream_t **index, *s;
- ngx_http_spdy_srv_conf_t *sscf;
- ngx_http_spdy_connection_t *sc;
-
- sc = stream->connection;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy close stream %ui, queued %ui, processing %ui",
- stream->id, stream->queued, sc->processing);
-
- fc = stream->request->connection;
-
- if (stream->queued) {
- fc->write->handler = ngx_http_spdy_close_stream_handler;
- return;
- }
-
- if (!stream->out_closed) {
- if (ngx_http_spdy_send_rst_stream(sc, stream->id,
- NGX_SPDY_INTERNAL_ERROR,
- stream->priority)
- != NGX_OK)
- {
- sc->connection->error = 1;
- }
- }
-
- if (sc->stream == stream) {
- sc->stream = NULL;
- }
-
- sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
- ngx_http_spdy_module);
-
- index = sc->streams_index + ngx_http_spdy_stream_index(sscf, stream->id);
-
- for ( ;; ) {
- s = *index;
-
- if (s == NULL) {
- break;
- }
-
- if (s == stream) {
- *index = s->index;
- break;
- }
-
- index = &s->index;
- }
-
- ngx_http_free_request(stream->request, rc);
-
- ev = fc->read;
-
- if (ev->active || ev->disabled) {
- ngx_log_error(NGX_LOG_ALERT, sc->connection->log, 0,
- "fake read event was activated");
- }
-
- if (ev->timer_set) {
- ngx_del_timer(ev);
- }
-
- if (ev->posted) {
- ngx_delete_posted_event(ev);
- }
-
- ev = fc->write;
-
- if (ev->active || ev->disabled) {
- ngx_log_error(NGX_LOG_ALERT, sc->connection->log, 0,
- "fake write event was activated");
- }
-
- if (ev->timer_set) {
- ngx_del_timer(ev);
- }
-
- if (ev->posted) {
- ngx_delete_posted_event(ev);
- }
-
- fc->data = sc->free_fake_connections;
- sc->free_fake_connections = fc;
-
- sc->processing--;
-
- if (sc->processing || sc->blocked) {
- return;
- }
-
- ev = sc->connection->read;
-
- ev->handler = ngx_http_spdy_handle_connection_handler;
- ngx_post_event(ev, &ngx_posted_events);
-}
-
-
-static void
-ngx_http_spdy_handle_connection_handler(ngx_event_t *rev)
-{
- ngx_connection_t *c;
-
- rev->handler = ngx_http_spdy_read_handler;
-
- if (rev->ready) {
- ngx_http_spdy_read_handler(rev);
- return;
- }
-
- c = rev->data;
-
- ngx_http_spdy_handle_connection(c->data);
-}
-
-
-static void
-ngx_http_spdy_keepalive_handler(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_http_spdy_srv_conf_t *sscf;
- ngx_http_spdy_connection_t *sc;
-
- c = rev->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "spdy keepalive handler");
-
- if (rev->timedout || c->close) {
- ngx_http_close_connection(c);
- return;
- }
-
-#if (NGX_HAVE_KQUEUE)
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- if (rev->pending_eof) {
- c->log->handler = NULL;
- ngx_log_error(NGX_LOG_INFO, c->log, rev->kq_errno,
- "kevent() reported that client %V closed "
- "keepalive connection", &c->addr_text);
-#if (NGX_HTTP_SSL)
- if (c->ssl) {
- c->ssl->no_send_shutdown = 1;
- }
-#endif
- ngx_http_close_connection(c);
- return;
- }
- }
-
-#endif
-
- c->destroyed = 0;
- c->idle = 0;
- ngx_reusable_connection(c, 0);
-
- sc = c->data;
-
- sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
- ngx_http_spdy_module);
-
- sc->pool = ngx_create_pool(sscf->pool_size, sc->connection->log);
- if (sc->pool == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- sc->streams_index = ngx_pcalloc(sc->pool,
- ngx_http_spdy_streams_index_size(sscf)
- * sizeof(ngx_http_spdy_stream_t *));
- if (sc->streams_index == NULL) {
- ngx_http_close_connection(c);
- return;
- }
-
- c->write->handler = ngx_http_spdy_write_handler;
-
- rev->handler = ngx_http_spdy_read_handler;
- ngx_http_spdy_read_handler(rev);
-}
-
-
-static void
-ngx_http_spdy_finalize_connection(ngx_http_spdy_connection_t *sc,
- ngx_int_t rc)
-{
- ngx_uint_t i, size;
- ngx_event_t *ev;
- ngx_connection_t *c, *fc;
- ngx_http_request_t *r;
- ngx_http_spdy_stream_t *stream;
- ngx_http_spdy_srv_conf_t *sscf;
-
- c = sc->connection;
-
- if (!sc->processing) {
- ngx_http_close_connection(c);
- return;
- }
-
- c->error = 1;
- c->read->handler = ngx_http_empty_handler;
- c->write->handler = ngx_http_empty_handler;
-
- sc->last_out = NULL;
-
- sc->blocked = 1;
-
- sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
- ngx_http_spdy_module);
-
- size = ngx_http_spdy_streams_index_size(sscf);
-
- for (i = 0; i < size; i++) {
- stream = sc->streams_index[i];
-
- while (stream) {
- stream->handled = 0;
-
- r = stream->request;
- fc = r->connection;
-
- fc->error = 1;
-
- if (stream->queued) {
- stream->queued = 0;
-
- ev = fc->write;
- ev->delayed = 0;
-
- } else {
- ev = fc->read;
- }
-
- stream = stream->index;
-
- ev->eof = 1;
- ev->handler(ev);
- }
- }
-
- sc->blocked = 0;
-
- if (sc->processing) {
- return;
- }
-
- ngx_http_close_connection(c);
-}
-
-
-static ngx_int_t
-ngx_http_spdy_adjust_windows(ngx_http_spdy_connection_t *sc, ssize_t delta)
-{
- ngx_uint_t i, size;
- ngx_event_t *wev;
- ngx_http_spdy_stream_t *stream, *sn;
- ngx_http_spdy_srv_conf_t *sscf;
-
- sscf = ngx_http_get_module_srv_conf(sc->http_connection->conf_ctx,
- ngx_http_spdy_module);
-
- size = ngx_http_spdy_streams_index_size(sscf);
-
- for (i = 0; i < size; i++) {
-
- for (stream = sc->streams_index[i]; stream; stream = sn) {
- sn = stream->index;
-
- if (delta > 0
- && stream->send_window
- > (ssize_t) (NGX_SPDY_MAX_WINDOW - delta))
- {
- if (ngx_http_spdy_terminate_stream(sc, stream,
- NGX_SPDY_FLOW_CONTROL_ERROR)
- == NGX_ERROR)
- {
- return NGX_ERROR;
- }
-
- continue;
- }
-
- stream->send_window += delta;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy:%ui adjust window:%z",
- stream->id, stream->send_window);
-
- if (stream->send_window > 0 && stream->exhausted) {
- stream->exhausted = 0;
-
- wev = stream->request->connection->write;
-
- if (!wev->timer_set) {
- wev->delayed = 0;
- wev->handler(wev);
- }
- }
- }
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_spdy_pool_cleanup(void *data)
-{
- ngx_http_spdy_connection_t *sc = data;
-
- if (sc->pool) {
- ngx_destroy_pool(sc->pool);
- }
-}
-
-
-static void *
-ngx_http_spdy_zalloc(void *opaque, u_int items, u_int size)
-{
- ngx_http_spdy_connection_t *sc = opaque;
-
- return ngx_palloc(sc->connection->pool, items * size);
-}
-
-
-static void
-ngx_http_spdy_zfree(void *opaque, void *address)
-{
-#if 0
- ngx_http_spdy_connection_t *sc = opaque;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy zfree: %p", address);
-#endif
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.h
deleted file mode 100644
index df24495a14e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy.h
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Copyright (C) Nginx, Inc.
- * Copyright (C) Valentin V. Bartenev
- */
-
-
-#ifndef _NGX_HTTP_SPDY_H_INCLUDED_
-#define _NGX_HTTP_SPDY_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-#include <zlib.h>
-
-
-#define NGX_SPDY_VERSION 3
-
-#define NGX_SPDY_NPN_ADVERTISE "\x08spdy/3.1"
-#define NGX_SPDY_NPN_NEGOTIATED "spdy/3.1"
-
-#define NGX_SPDY_STATE_BUFFER_SIZE 16
-
-#define NGX_SPDY_CTL_BIT 1
-
-#define NGX_SPDY_SYN_STREAM 1
-#define NGX_SPDY_SYN_REPLY 2
-#define NGX_SPDY_RST_STREAM 3
-#define NGX_SPDY_SETTINGS 4
-#define NGX_SPDY_PING 6
-#define NGX_SPDY_GOAWAY 7
-#define NGX_SPDY_HEADERS 8
-#define NGX_SPDY_WINDOW_UPDATE 9
-
-#define NGX_SPDY_FRAME_HEADER_SIZE 8
-
-#define NGX_SPDY_SID_SIZE 4
-#define NGX_SPDY_DELTA_SIZE 4
-
-#define NGX_SPDY_SYN_STREAM_SIZE 10
-#define NGX_SPDY_SYN_REPLY_SIZE 4
-#define NGX_SPDY_RST_STREAM_SIZE 8
-#define NGX_SPDY_PING_SIZE 4
-#define NGX_SPDY_GOAWAY_SIZE 8
-#define NGX_SPDY_WINDOW_UPDATE_SIZE 8
-#define NGX_SPDY_NV_NUM_SIZE 4
-#define NGX_SPDY_NV_NLEN_SIZE 4
-#define NGX_SPDY_NV_VLEN_SIZE 4
-#define NGX_SPDY_SETTINGS_NUM_SIZE 4
-#define NGX_SPDY_SETTINGS_FID_SIZE 4
-#define NGX_SPDY_SETTINGS_VAL_SIZE 4
-
-#define NGX_SPDY_SETTINGS_PAIR_SIZE \
- (NGX_SPDY_SETTINGS_FID_SIZE + NGX_SPDY_SETTINGS_VAL_SIZE)
-
-#define NGX_SPDY_HIGHEST_PRIORITY 0
-#define NGX_SPDY_LOWEST_PRIORITY 7
-
-#define NGX_SPDY_FLAG_FIN 0x01
-#define NGX_SPDY_FLAG_UNIDIRECTIONAL 0x02
-#define NGX_SPDY_FLAG_CLEAR_SETTINGS 0x01
-
-#define NGX_SPDY_MAX_FRAME_SIZE ((1 << 24) - 1)
-
-#define NGX_SPDY_DATA_DISCARD 1
-#define NGX_SPDY_DATA_ERROR 2
-#define NGX_SPDY_DATA_INTERNAL_ERROR 3
-
-
-typedef struct ngx_http_spdy_connection_s ngx_http_spdy_connection_t;
-typedef struct ngx_http_spdy_out_frame_s ngx_http_spdy_out_frame_t;
-
-
-typedef u_char *(*ngx_http_spdy_handler_pt) (ngx_http_spdy_connection_t *sc,
- u_char *pos, u_char *end);
-
-struct ngx_http_spdy_connection_s {
- ngx_connection_t *connection;
- ngx_http_connection_t *http_connection;
-
- ngx_uint_t processing;
-
- size_t send_window;
- size_t recv_window;
- size_t init_window;
-
- ngx_queue_t waiting;
-
- u_char buffer[NGX_SPDY_STATE_BUFFER_SIZE];
- size_t buffer_used;
- ngx_http_spdy_handler_pt handler;
-
- z_stream zstream_in;
- z_stream zstream_out;
-
- ngx_pool_t *pool;
-
- ngx_http_spdy_out_frame_t *free_ctl_frames;
- ngx_connection_t *free_fake_connections;
-
- ngx_http_spdy_stream_t **streams_index;
-
- ngx_http_spdy_out_frame_t *last_out;
-
- ngx_queue_t posted;
-
- ngx_http_spdy_stream_t *stream;
-
- ngx_uint_t entries;
- size_t length;
- u_char flags;
-
- ngx_uint_t last_sid;
-
- unsigned blocked:1;
- unsigned incomplete:1;
-};
-
-
-struct ngx_http_spdy_stream_s {
- ngx_uint_t id;
- ngx_http_request_t *request;
- ngx_http_spdy_connection_t *connection;
- ngx_http_spdy_stream_t *index;
-
- ngx_uint_t header_buffers;
- ngx_uint_t queued;
-
- /*
- * A change to SETTINGS_INITIAL_WINDOW_SIZE could cause the
- * send_window to become negative, hence it's signed.
- */
- ssize_t send_window;
- size_t recv_window;
-
- ngx_http_spdy_out_frame_t *free_frames;
- ngx_chain_t *free_data_headers;
- ngx_chain_t *free_bufs;
-
- ngx_queue_t queue;
-
- unsigned priority:3;
- unsigned handled:1;
- unsigned blocked:1;
- unsigned exhausted:1;
- unsigned in_closed:1;
- unsigned out_closed:1;
- unsigned skip_data:2;
-};
-
-
-struct ngx_http_spdy_out_frame_s {
- ngx_http_spdy_out_frame_t *next;
- ngx_chain_t *first;
- ngx_chain_t *last;
- ngx_int_t (*handler)(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_out_frame_t *frame);
-
- ngx_http_spdy_stream_t *stream;
- size_t length;
-
- ngx_uint_t priority;
- unsigned blocked:1;
- unsigned fin:1;
-};
-
-
-static ngx_inline void
-ngx_http_spdy_queue_frame(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_out_frame_t *frame)
-{
- ngx_http_spdy_out_frame_t **out;
-
- for (out = &sc->last_out; *out; out = &(*out)->next)
- {
- /*
- * NB: higher values represent lower priorities.
- */
- if (frame->priority >= (*out)->priority) {
- break;
- }
- }
-
- frame->next = *out;
- *out = frame;
-}
-
-
-static ngx_inline void
-ngx_http_spdy_queue_blocked_frame(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_out_frame_t *frame)
-{
- ngx_http_spdy_out_frame_t **out;
-
- for (out = &sc->last_out; *out; out = &(*out)->next)
- {
- if ((*out)->blocked) {
- break;
- }
- }
-
- frame->next = *out;
- *out = frame;
-}
-
-
-void ngx_http_spdy_init(ngx_event_t *rev);
-void ngx_http_spdy_request_headers_init(void);
-
-ngx_int_t ngx_http_spdy_read_request_body(ngx_http_request_t *r,
- ngx_http_client_body_handler_pt post_handler);
-
-void ngx_http_spdy_close_stream(ngx_http_spdy_stream_t *stream, ngx_int_t rc);
-
-ngx_int_t ngx_http_spdy_send_output_queue(ngx_http_spdy_connection_t *sc);
-
-
-#define ngx_spdy_frame_aligned_write_uint16(p, s) \
- (*(uint16_t *) (p) = htons((uint16_t) (s)), (p) + sizeof(uint16_t))
-
-#define ngx_spdy_frame_aligned_write_uint32(p, s) \
- (*(uint32_t *) (p) = htonl((uint32_t) (s)), (p) + sizeof(uint32_t))
-
-#if (NGX_HAVE_NONALIGNED)
-
-#define ngx_spdy_frame_write_uint16 ngx_spdy_frame_aligned_write_uint16
-#define ngx_spdy_frame_write_uint32 ngx_spdy_frame_aligned_write_uint32
-
-#else
-
-#define ngx_spdy_frame_write_uint16(p, s) \
- ((p)[0] = (u_char) ((s) >> 8), \
- (p)[1] = (u_char) (s), \
- (p) + sizeof(uint16_t))
-
-#define ngx_spdy_frame_write_uint32(p, s) \
- ((p)[0] = (u_char) ((s) >> 24), \
- (p)[1] = (u_char) ((s) >> 16), \
- (p)[2] = (u_char) ((s) >> 8), \
- (p)[3] = (u_char) (s), \
- (p) + sizeof(uint32_t))
-
-#endif
-
-
-#define ngx_spdy_ctl_frame_head(t) \
- ((uint32_t) NGX_SPDY_CTL_BIT << 31 | NGX_SPDY_VERSION << 16 | (t))
-
-#define ngx_spdy_frame_write_head(p, t) \
- ngx_spdy_frame_aligned_write_uint32(p, ngx_spdy_ctl_frame_head(t))
-
-#define ngx_spdy_frame_write_flags_and_len(p, f, l) \
- ngx_spdy_frame_aligned_write_uint32(p, (f) << 24 | (l))
-#define ngx_spdy_frame_write_flags_and_id(p, f, i) \
- ngx_spdy_frame_aligned_write_uint32(p, (f) << 24 | (i))
-
-#define ngx_spdy_frame_write_sid ngx_spdy_frame_aligned_write_uint32
-#define ngx_spdy_frame_write_window ngx_spdy_frame_aligned_write_uint32
-
-#endif /* _NGX_HTTP_SPDY_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_filter_module.c
deleted file mode 100644
index d1406a665b0..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_filter_module.c
+++ /dev/null
@@ -1,1218 +0,0 @@
-
-/*
- * Copyright (C) Nginx, Inc.
- * Copyright (C) Valentin V. Bartenev
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <nginx.h>
-#include <ngx_http_spdy_module.h>
-
-#include <zlib.h>
-
-
-#define ngx_http_spdy_nv_nsize(h) (NGX_SPDY_NV_NLEN_SIZE + sizeof(h) - 1)
-#define ngx_http_spdy_nv_vsize(h) (NGX_SPDY_NV_VLEN_SIZE + sizeof(h) - 1)
-
-#define ngx_http_spdy_nv_write_num ngx_spdy_frame_write_uint32
-#define ngx_http_spdy_nv_write_nlen ngx_spdy_frame_write_uint32
-#define ngx_http_spdy_nv_write_vlen ngx_spdy_frame_write_uint32
-
-#define ngx_http_spdy_nv_write_name(p, h) \
- ngx_cpymem(ngx_http_spdy_nv_write_nlen(p, sizeof(h) - 1), h, sizeof(h) - 1)
-
-#define ngx_http_spdy_nv_write_val(p, h) \
- ngx_cpymem(ngx_http_spdy_nv_write_vlen(p, sizeof(h) - 1), h, sizeof(h) - 1)
-
-
-static ngx_chain_t *ngx_http_spdy_send_chain(ngx_connection_t *fc,
- ngx_chain_t *in, off_t limit);
-
-static ngx_inline ngx_int_t ngx_http_spdy_filter_send(
- ngx_connection_t *fc, ngx_http_spdy_stream_t *stream);
-static ngx_inline ngx_int_t ngx_http_spdy_flow_control(
- ngx_http_spdy_connection_t *sc, ngx_http_spdy_stream_t *stream);
-static void ngx_http_spdy_waiting_queue(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_stream_t *stream);
-
-static ngx_chain_t *ngx_http_spdy_filter_get_shadow(
- ngx_http_spdy_stream_t *stream, ngx_buf_t *buf, off_t offset, off_t size);
-static ngx_http_spdy_out_frame_t *ngx_http_spdy_filter_get_data_frame(
- ngx_http_spdy_stream_t *stream, size_t len, ngx_chain_t *first,
- ngx_chain_t *last);
-
-static ngx_int_t ngx_http_spdy_syn_frame_handler(
- ngx_http_spdy_connection_t *sc, ngx_http_spdy_out_frame_t *frame);
-static ngx_int_t ngx_http_spdy_data_frame_handler(
- ngx_http_spdy_connection_t *sc, ngx_http_spdy_out_frame_t *frame);
-static ngx_inline void ngx_http_spdy_handle_frame(
- ngx_http_spdy_stream_t *stream, ngx_http_spdy_out_frame_t *frame);
-static ngx_inline void ngx_http_spdy_handle_stream(
- ngx_http_spdy_connection_t *sc, ngx_http_spdy_stream_t *stream);
-
-static void ngx_http_spdy_filter_cleanup(void *data);
-
-static ngx_int_t ngx_http_spdy_filter_init(ngx_conf_t *cf);
-
-
-static ngx_http_module_t ngx_http_spdy_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_spdy_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_spdy_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_spdy_filter_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_output_header_filter_pt ngx_http_next_header_filter;
-
-
-static ngx_int_t
-ngx_http_spdy_header_filter(ngx_http_request_t *r)
-{
- int rc;
- size_t len;
- u_char *p, *buf, *last;
- ngx_buf_t *b;
- ngx_str_t host;
- ngx_uint_t i, j, count, port;
- ngx_chain_t *cl;
- ngx_list_part_t *part, *pt;
- ngx_table_elt_t *header, *h;
- ngx_connection_t *c;
- ngx_http_cleanup_t *cln;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t *cscf;
- ngx_http_spdy_stream_t *stream;
- ngx_http_spdy_out_frame_t *frame;
- ngx_http_spdy_connection_t *sc;
- struct sockaddr_in *sin;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
- u_char addr[NGX_SOCKADDR_STRLEN];
-
- if (!r->spdy_stream) {
- return ngx_http_next_header_filter(r);
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "spdy header filter");
-
- if (r->header_sent) {
- return NGX_OK;
- }
-
- r->header_sent = 1;
-
- if (r != r->main) {
- return NGX_OK;
- }
-
- c = r->connection;
-
- if (r->method == NGX_HTTP_HEAD) {
- r->header_only = 1;
- }
-
- switch (r->headers_out.status) {
-
- case NGX_HTTP_OK:
- case NGX_HTTP_PARTIAL_CONTENT:
- break;
-
- case NGX_HTTP_NOT_MODIFIED:
- r->header_only = 1;
- break;
-
- case NGX_HTTP_NO_CONTENT:
- r->header_only = 1;
-
- ngx_str_null(&r->headers_out.content_type);
-
- r->headers_out.content_length = NULL;
- r->headers_out.content_length_n = -1;
-
- /* fall through */
-
- default:
- r->headers_out.last_modified_time = -1;
- r->headers_out.last_modified = NULL;
- }
-
- len = NGX_SPDY_NV_NUM_SIZE
- + ngx_http_spdy_nv_nsize(":version")
- + ngx_http_spdy_nv_vsize("HTTP/1.1")
- + ngx_http_spdy_nv_nsize(":status")
- + (r->headers_out.status_line.len
- ? NGX_SPDY_NV_VLEN_SIZE + r->headers_out.status_line.len
- : ngx_http_spdy_nv_vsize("418"));
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (r->headers_out.server == NULL) {
- len += ngx_http_spdy_nv_nsize("server");
- len += clcf->server_tokens ? ngx_http_spdy_nv_vsize(NGINX_VER)
- : ngx_http_spdy_nv_vsize("nginx");
- }
-
- if (r->headers_out.date == NULL) {
- len += ngx_http_spdy_nv_nsize("date")
- + ngx_http_spdy_nv_vsize("Wed, 31 Dec 1986 10:00:00 GMT");
- }
-
- if (r->headers_out.content_type.len) {
- len += ngx_http_spdy_nv_nsize("content-type")
- + NGX_SPDY_NV_VLEN_SIZE + r->headers_out.content_type.len;
-
- if (r->headers_out.content_type_len == r->headers_out.content_type.len
- && r->headers_out.charset.len)
- {
- len += sizeof("; charset=") - 1 + r->headers_out.charset.len;
- }
- }
-
- if (r->headers_out.content_length == NULL
- && r->headers_out.content_length_n >= 0)
- {
- len += ngx_http_spdy_nv_nsize("content-length")
- + NGX_SPDY_NV_VLEN_SIZE + NGX_OFF_T_LEN;
- }
-
- if (r->headers_out.last_modified == NULL
- && r->headers_out.last_modified_time != -1)
- {
- len += ngx_http_spdy_nv_nsize("last-modified")
- + ngx_http_spdy_nv_vsize("Wed, 31 Dec 1986 10:00:00 GMT");
- }
-
- if (r->headers_out.location
- && r->headers_out.location->value.len
- && r->headers_out.location->value.data[0] == '/')
- {
- r->headers_out.location->hash = 0;
-
- if (clcf->server_name_in_redirect) {
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
- host = cscf->server_name;
-
- } else if (r->headers_in.server.len) {
- host = r->headers_in.server;
-
- } else {
- host.len = NGX_SOCKADDR_STRLEN;
- host.data = addr;
-
- if (ngx_connection_local_sockaddr(c, &host, 0) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- switch (c->local_sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) c->local_sockaddr;
- port = ntohs(sin6->sin6_port);
- break;
-#endif
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- port = 0;
- break;
-#endif
- default: /* AF_INET */
- sin = (struct sockaddr_in *) c->local_sockaddr;
- port = ntohs(sin->sin_port);
- break;
- }
-
- len += ngx_http_spdy_nv_nsize("location")
- + ngx_http_spdy_nv_vsize("https://")
- + host.len
- + r->headers_out.location->value.len;
-
- if (clcf->port_in_redirect) {
-
-#if (NGX_HTTP_SSL)
- if (c->ssl)
- port = (port == 443) ? 0 : port;
- else
-#endif
- port = (port == 80) ? 0 : port;
-
- } else {
- port = 0;
- }
-
- if (port) {
- len += sizeof(":65535") - 1;
- }
-
- } else {
- ngx_str_null(&host);
- port = 0;
- }
-
- part = &r->headers_out.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (header[i].hash == 0) {
- continue;
- }
-
- len += NGX_SPDY_NV_NLEN_SIZE + header[i].key.len
- + NGX_SPDY_NV_VLEN_SIZE + header[i].value.len;
- }
-
- buf = ngx_alloc(len, r->pool->log);
- if (buf == NULL) {
- return NGX_ERROR;
- }
-
- last = buf + NGX_SPDY_NV_NUM_SIZE;
-
- last = ngx_http_spdy_nv_write_name(last, ":version");
- last = ngx_http_spdy_nv_write_val(last, "HTTP/1.1");
-
- last = ngx_http_spdy_nv_write_name(last, ":status");
-
- if (r->headers_out.status_line.len) {
- last = ngx_http_spdy_nv_write_vlen(last,
- r->headers_out.status_line.len);
- last = ngx_cpymem(last, r->headers_out.status_line.data,
- r->headers_out.status_line.len);
- } else {
- last = ngx_http_spdy_nv_write_vlen(last, 3);
- last = ngx_sprintf(last, "%03ui", r->headers_out.status);
- }
-
- count = 2;
-
- if (r->headers_out.server == NULL) {
- last = ngx_http_spdy_nv_write_name(last, "server");
- last = clcf->server_tokens
- ? ngx_http_spdy_nv_write_val(last, NGINX_VER)
- : ngx_http_spdy_nv_write_val(last, "nginx");
-
- count++;
- }
-
- if (r->headers_out.date == NULL) {
- last = ngx_http_spdy_nv_write_name(last, "date");
-
- last = ngx_http_spdy_nv_write_vlen(last, ngx_cached_http_time.len);
-
- last = ngx_cpymem(last, ngx_cached_http_time.data,
- ngx_cached_http_time.len);
-
- count++;
- }
-
- if (r->headers_out.content_type.len) {
-
- last = ngx_http_spdy_nv_write_name(last, "content-type");
-
- p = last + NGX_SPDY_NV_VLEN_SIZE;
-
- last = ngx_cpymem(p, r->headers_out.content_type.data,
- r->headers_out.content_type.len);
-
- if (r->headers_out.content_type_len == r->headers_out.content_type.len
- && r->headers_out.charset.len)
- {
- last = ngx_cpymem(last, "; charset=", sizeof("; charset=") - 1);
-
- last = ngx_cpymem(last, r->headers_out.charset.data,
- r->headers_out.charset.len);
-
- /* update r->headers_out.content_type for possible logging */
-
- r->headers_out.content_type.len = last - p;
- r->headers_out.content_type.data = p;
- }
-
- (void) ngx_http_spdy_nv_write_vlen(p - NGX_SPDY_NV_VLEN_SIZE,
- r->headers_out.content_type.len);
-
- count++;
- }
-
- if (r->headers_out.content_length == NULL
- && r->headers_out.content_length_n >= 0)
- {
- last = ngx_http_spdy_nv_write_name(last, "content-length");
-
- p = last + NGX_SPDY_NV_VLEN_SIZE;
-
- last = ngx_sprintf(p, "%O", r->headers_out.content_length_n);
-
- (void) ngx_http_spdy_nv_write_vlen(p - NGX_SPDY_NV_VLEN_SIZE,
- last - p);
-
- count++;
- }
-
- if (r->headers_out.last_modified == NULL
- && r->headers_out.last_modified_time != -1)
- {
- last = ngx_http_spdy_nv_write_name(last, "last-modified");
-
- p = last + NGX_SPDY_NV_VLEN_SIZE;
-
- last = ngx_http_time(p, r->headers_out.last_modified_time);
-
- (void) ngx_http_spdy_nv_write_vlen(p - NGX_SPDY_NV_VLEN_SIZE,
- last - p);
-
- count++;
- }
-
- if (host.data) {
-
- last = ngx_http_spdy_nv_write_name(last, "location");
-
- p = last + NGX_SPDY_NV_VLEN_SIZE;
-
- last = ngx_cpymem(p, "http", sizeof("http") - 1);
-
-#if (NGX_HTTP_SSL)
- if (c->ssl) {
- *last++ ='s';
- }
-#endif
-
- *last++ = ':'; *last++ = '/'; *last++ = '/';
-
- last = ngx_cpymem(last, host.data, host.len);
-
- if (port) {
- last = ngx_sprintf(last, ":%ui", port);
- }
-
- last = ngx_cpymem(last, r->headers_out.location->value.data,
- r->headers_out.location->value.len);
-
- /* update r->headers_out.location->value for possible logging */
-
- r->headers_out.location->value.len = last - p;
- r->headers_out.location->value.data = p;
- ngx_str_set(&r->headers_out.location->key, "location");
-
- (void) ngx_http_spdy_nv_write_vlen(p - NGX_SPDY_NV_VLEN_SIZE,
- r->headers_out.location->value.len);
-
- count++;
- }
-
- part = &r->headers_out.headers.part;
- header = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (header[i].hash == 0 || header[i].hash == 2) {
- continue;
- }
-
- last = ngx_http_spdy_nv_write_nlen(last, header[i].key.len);
-
- ngx_strlow(last, header[i].key.data, header[i].key.len);
- last += header[i].key.len;
-
- p = last + NGX_SPDY_NV_VLEN_SIZE;
-
- last = ngx_cpymem(p, header[i].value.data, header[i].value.len);
-
- pt = part;
- h = header;
-
- for (j = i + 1; /* void */; j++) {
-
- if (j >= pt->nelts) {
- if (pt->next == NULL) {
- break;
- }
-
- pt = pt->next;
- h = pt->elts;
- j = 0;
- }
-
- if (h[j].hash == 0 || h[j].hash == 2
- || h[j].key.len != header[i].key.len
- || ngx_strncasecmp(header[i].key.data, h[j].key.data,
- header[i].key.len))
- {
- continue;
- }
-
- *last++ = '\0';
-
- last = ngx_cpymem(last, h[j].value.data, h[j].value.len);
-
- h[j].hash = 2;
- }
-
- (void) ngx_http_spdy_nv_write_vlen(p - NGX_SPDY_NV_VLEN_SIZE,
- last - p);
-
- count++;
- }
-
- (void) ngx_http_spdy_nv_write_num(buf, count);
-
- stream = r->spdy_stream;
- sc = stream->connection;
-
- len = last - buf;
-
- b = ngx_create_temp_buf(r->pool, NGX_SPDY_FRAME_HEADER_SIZE
- + NGX_SPDY_SYN_REPLY_SIZE
- + deflateBound(&sc->zstream_out, len));
- if (b == NULL) {
- ngx_free(buf);
- return NGX_ERROR;
- }
-
- b->last += NGX_SPDY_FRAME_HEADER_SIZE + NGX_SPDY_SYN_REPLY_SIZE;
-
- sc->zstream_out.next_in = buf;
- sc->zstream_out.avail_in = len;
- sc->zstream_out.next_out = b->last;
- sc->zstream_out.avail_out = b->end - b->last;
-
- rc = deflate(&sc->zstream_out, Z_SYNC_FLUSH);
-
- ngx_free(buf);
-
- if (rc != Z_OK) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0, "deflate() failed: %d", rc);
- return NGX_ERROR;
- }
-
- ngx_log_debug5(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "spdy deflate out: ni:%p no:%p ai:%ud ao:%ud rc:%d",
- sc->zstream_out.next_in, sc->zstream_out.next_out,
- sc->zstream_out.avail_in, sc->zstream_out.avail_out,
- rc);
-
- b->last = sc->zstream_out.next_out;
-
- p = b->pos;
- p = ngx_spdy_frame_write_head(p, NGX_SPDY_SYN_REPLY);
-
- len = b->last - b->pos;
-
- r->header_size = len;
-
- len -= NGX_SPDY_FRAME_HEADER_SIZE;
-
- if (r->header_only) {
- b->last_buf = 1;
- p = ngx_spdy_frame_write_flags_and_len(p, NGX_SPDY_FLAG_FIN, len);
-
- } else {
- p = ngx_spdy_frame_write_flags_and_len(p, 0, len);
- }
-
- (void) ngx_spdy_frame_write_sid(p, stream->id);
-
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = b;
- cl->next = NULL;
-
- frame = ngx_palloc(r->pool, sizeof(ngx_http_spdy_out_frame_t));
- if (frame == NULL) {
- return NGX_ERROR;
- }
-
- frame->first = cl;
- frame->last = cl;
- frame->handler = ngx_http_spdy_syn_frame_handler;
- frame->stream = stream;
- frame->length = len;
- frame->priority = stream->priority;
- frame->blocked = 1;
- frame->fin = r->header_only;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, stream->request->connection->log, 0,
- "spdy:%ui create SYN_REPLY frame %p: len:%uz",
- stream->id, frame, frame->length);
-
- ngx_http_spdy_queue_blocked_frame(sc, frame);
-
- cln = ngx_http_cleanup_add(r, 0);
- if (cln == NULL) {
- return NGX_ERROR;
- }
-
- cln->handler = ngx_http_spdy_filter_cleanup;
- cln->data = stream;
-
- stream->queued = 1;
-
- c->send_chain = ngx_http_spdy_send_chain;
- c->need_last_buf = 1;
-
- return ngx_http_spdy_filter_send(c, stream);
-}
-
-
-static ngx_chain_t *
-ngx_http_spdy_send_chain(ngx_connection_t *fc, ngx_chain_t *in, off_t limit)
-{
- off_t size, offset;
- size_t rest, frame_size;
- ngx_chain_t *cl, *out, **ln;
- ngx_http_request_t *r;
- ngx_http_spdy_stream_t *stream;
- ngx_http_spdy_loc_conf_t *slcf;
- ngx_http_spdy_out_frame_t *frame;
- ngx_http_spdy_connection_t *sc;
-
- r = fc->data;
- stream = r->spdy_stream;
-
-#if (NGX_SUPPRESS_WARN)
- size = 0;
-#endif
-
- while (in) {
- size = ngx_buf_size(in->buf);
-
- if (size || in->buf->last_buf) {
- break;
- }
-
- in = in->next;
- }
-
- if (in == NULL) {
-
- if (stream->queued) {
- fc->write->delayed = 1;
- } else {
- fc->buffered &= ~NGX_SPDY_BUFFERED;
- }
-
- return NULL;
- }
-
- sc = stream->connection;
-
- if (size && ngx_http_spdy_flow_control(sc, stream) == NGX_DECLINED) {
- fc->write->delayed = 1;
- return in;
- }
-
- if (limit == 0 || limit > (off_t) sc->send_window) {
- limit = sc->send_window;
- }
-
- if (limit > stream->send_window) {
- limit = (stream->send_window > 0) ? stream->send_window : 0;
- }
-
- if (in->buf->tag == (ngx_buf_tag_t) &ngx_http_spdy_filter_get_shadow) {
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- cl->buf = in->buf;
- in->buf = cl->buf->shadow;
-
- offset = ngx_buf_in_memory(in->buf)
- ? (cl->buf->pos - in->buf->pos)
- : (cl->buf->file_pos - in->buf->file_pos);
-
- cl->next = stream->free_bufs;
- stream->free_bufs = cl;
-
- } else {
- offset = 0;
- }
-
-#if (NGX_SUPPRESS_WARN)
- cl = NULL;
-#endif
-
- slcf = ngx_http_get_module_loc_conf(r, ngx_http_spdy_module);
-
- frame_size = (limit <= (off_t) slcf->chunk_size) ? (size_t) limit
- : slcf->chunk_size;
-
- for ( ;; ) {
- ln = &out;
- rest = frame_size;
-
- while ((off_t) rest >= size) {
-
- if (offset) {
- cl = ngx_http_spdy_filter_get_shadow(stream, in->buf,
- offset, size);
- if (cl == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- offset = 0;
-
- } else {
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- cl->buf = in->buf;
- }
-
- *ln = cl;
- ln = &cl->next;
-
- rest -= (size_t) size;
- in = in->next;
-
- if (in == NULL) {
- frame_size -= rest;
- rest = 0;
- break;
- }
-
- size = ngx_buf_size(in->buf);
- }
-
- if (rest) {
- cl = ngx_http_spdy_filter_get_shadow(stream, in->buf,
- offset, rest);
- if (cl == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- cl->buf->flush = 0;
- cl->buf->last_buf = 0;
-
- *ln = cl;
-
- offset += rest;
- size -= rest;
- }
-
- frame = ngx_http_spdy_filter_get_data_frame(stream, frame_size,
- out, cl);
- if (frame == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- ngx_http_spdy_queue_frame(sc, frame);
-
- sc->send_window -= frame_size;
-
- stream->send_window -= frame_size;
- stream->queued++;
-
- if (in == NULL) {
- break;
- }
-
- limit -= frame_size;
-
- if (limit == 0) {
- break;
- }
-
- if (limit < (off_t) slcf->chunk_size) {
- frame_size = (size_t) limit;
- }
- }
-
- if (offset) {
- cl = ngx_http_spdy_filter_get_shadow(stream, in->buf, offset, size);
- if (cl == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- in->buf = cl->buf;
- ngx_free_chain(r->pool, cl);
- }
-
- if (ngx_http_spdy_filter_send(fc, stream) == NGX_ERROR) {
- return NGX_CHAIN_ERROR;
- }
-
- if (in && ngx_http_spdy_flow_control(sc, stream) == NGX_DECLINED) {
- fc->write->delayed = 1;
- }
-
- return in;
-}
-
-
-static ngx_chain_t *
-ngx_http_spdy_filter_get_shadow(ngx_http_spdy_stream_t *stream, ngx_buf_t *buf,
- off_t offset, off_t size)
-{
- ngx_buf_t *chunk;
- ngx_chain_t *cl;
-
- cl = ngx_chain_get_free_buf(stream->request->pool, &stream->free_bufs);
- if (cl == NULL) {
- return NULL;
- }
-
- chunk = cl->buf;
-
- ngx_memcpy(chunk, buf, sizeof(ngx_buf_t));
-
- chunk->tag = (ngx_buf_tag_t) &ngx_http_spdy_filter_get_shadow;
- chunk->shadow = buf;
-
- if (ngx_buf_in_memory(chunk)) {
- chunk->pos += offset;
- chunk->last = chunk->pos + size;
- }
-
- if (chunk->in_file) {
- chunk->file_pos += offset;
- chunk->file_last = chunk->file_pos + size;
- }
-
- return cl;
-}
-
-
-static ngx_http_spdy_out_frame_t *
-ngx_http_spdy_filter_get_data_frame(ngx_http_spdy_stream_t *stream,
- size_t len, ngx_chain_t *first, ngx_chain_t *last)
-{
- u_char *p;
- ngx_buf_t *buf;
- ngx_uint_t flags;
- ngx_chain_t *cl;
- ngx_http_spdy_out_frame_t *frame;
-
-
- frame = stream->free_frames;
-
- if (frame) {
- stream->free_frames = frame->next;
-
- } else {
- frame = ngx_palloc(stream->request->pool,
- sizeof(ngx_http_spdy_out_frame_t));
- if (frame == NULL) {
- return NULL;
- }
- }
-
- flags = last->buf->last_buf ? NGX_SPDY_FLAG_FIN : 0;
-
- ngx_log_debug4(NGX_LOG_DEBUG_HTTP, stream->request->connection->log, 0,
- "spdy:%ui create DATA frame %p: len:%uz flags:%ui",
- stream->id, frame, len, flags);
-
- cl = ngx_chain_get_free_buf(stream->request->pool,
- &stream->free_data_headers);
- if (cl == NULL) {
- return NULL;
- }
-
- buf = cl->buf;
-
- if (buf->start) {
- p = buf->start;
- buf->pos = p;
-
- p += NGX_SPDY_SID_SIZE;
-
- (void) ngx_spdy_frame_write_flags_and_len(p, flags, len);
-
- } else {
- p = ngx_palloc(stream->request->pool, NGX_SPDY_FRAME_HEADER_SIZE);
- if (p == NULL) {
- return NULL;
- }
-
- buf->pos = p;
- buf->start = p;
-
- p = ngx_spdy_frame_write_sid(p, stream->id);
- p = ngx_spdy_frame_write_flags_and_len(p, flags, len);
-
- buf->last = p;
- buf->end = p;
-
- buf->tag = (ngx_buf_tag_t) &ngx_http_spdy_filter_get_data_frame;
- buf->memory = 1;
- }
-
- cl->next = first;
- first = cl;
-
- last->buf->flush = 1;
-
- frame->first = first;
- frame->last = last;
- frame->handler = ngx_http_spdy_data_frame_handler;
- frame->stream = stream;
- frame->length = len;
- frame->priority = stream->priority;
- frame->blocked = 0;
- frame->fin = last->buf->last_buf;
-
- return frame;
-}
-
-
-static ngx_inline ngx_int_t
-ngx_http_spdy_filter_send(ngx_connection_t *fc, ngx_http_spdy_stream_t *stream)
-{
- stream->blocked = 1;
-
- if (ngx_http_spdy_send_output_queue(stream->connection) == NGX_ERROR) {
- fc->error = 1;
- return NGX_ERROR;
- }
-
- stream->blocked = 0;
-
- if (stream->queued) {
- fc->buffered |= NGX_SPDY_BUFFERED;
- fc->write->delayed = 1;
- return NGX_AGAIN;
- }
-
- fc->buffered &= ~NGX_SPDY_BUFFERED;
-
- return NGX_OK;
-}
-
-
-static ngx_inline ngx_int_t
-ngx_http_spdy_flow_control(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_stream_t *stream)
-{
- if (stream->send_window <= 0) {
- stream->exhausted = 1;
- return NGX_DECLINED;
- }
-
- if (sc->send_window == 0) {
- ngx_http_spdy_waiting_queue(sc, stream);
- return NGX_DECLINED;
- }
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_spdy_waiting_queue(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_stream_t *stream)
-{
- ngx_queue_t *q;
- ngx_http_spdy_stream_t *s;
-
- if (stream->handled) {
- return;
- }
-
- stream->handled = 1;
-
- for (q = ngx_queue_last(&sc->waiting);
- q != ngx_queue_sentinel(&sc->waiting);
- q = ngx_queue_prev(q))
- {
- s = ngx_queue_data(q, ngx_http_spdy_stream_t, queue);
-
- /*
- * NB: higher values represent lower priorities.
- */
- if (stream->priority >= s->priority) {
- break;
- }
- }
-
- ngx_queue_insert_after(q, &stream->queue);
-}
-
-
-static ngx_int_t
-ngx_http_spdy_syn_frame_handler(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_out_frame_t *frame)
-{
- ngx_buf_t *buf;
- ngx_http_spdy_stream_t *stream;
-
- buf = frame->first->buf;
-
- if (buf->pos != buf->last) {
- return NGX_AGAIN;
- }
-
- stream = frame->stream;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy:%ui SYN_REPLY frame %p was sent", stream->id, frame);
-
- ngx_free_chain(stream->request->pool, frame->first);
-
- ngx_http_spdy_handle_frame(stream, frame);
-
- ngx_http_spdy_handle_stream(sc, stream);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_data_frame_handler(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_out_frame_t *frame)
-{
- ngx_buf_t *buf;
- ngx_chain_t *cl, *ln;
- ngx_http_spdy_stream_t *stream;
-
- stream = frame->stream;
-
- cl = frame->first;
-
- if (cl->buf->tag == (ngx_buf_tag_t) &ngx_http_spdy_filter_get_data_frame) {
-
- if (cl->buf->pos != cl->buf->last) {
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy:%ui DATA frame %p was sent partially",
- stream->id, frame);
-
- return NGX_AGAIN;
- }
-
- ln = cl->next;
-
- cl->next = stream->free_data_headers;
- stream->free_data_headers = cl;
-
- if (cl == frame->last) {
- goto done;
- }
-
- cl = ln;
- }
-
- for ( ;; ) {
- if (cl->buf->tag == (ngx_buf_tag_t) &ngx_http_spdy_filter_get_shadow) {
- buf = cl->buf->shadow;
-
- if (ngx_buf_in_memory(buf)) {
- buf->pos = cl->buf->pos;
- }
-
- if (buf->in_file) {
- buf->file_pos = cl->buf->file_pos;
- }
- }
-
- if (ngx_buf_size(cl->buf) != 0) {
-
- if (cl != frame->first) {
- frame->first = cl;
- ngx_http_spdy_handle_stream(sc, stream);
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy:%ui DATA frame %p was sent partially",
- stream->id, frame);
-
- return NGX_AGAIN;
- }
-
- ln = cl->next;
-
- if (cl->buf->tag == (ngx_buf_tag_t) &ngx_http_spdy_filter_get_shadow) {
- cl->next = stream->free_bufs;
- stream->free_bufs = cl;
-
- } else {
- ngx_free_chain(stream->request->pool, cl);
- }
-
- if (cl == frame->last) {
- goto done;
- }
-
- cl = ln;
- }
-
-done:
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, sc->connection->log, 0,
- "spdy:%ui DATA frame %p was sent", stream->id, frame);
-
- stream->request->header_size += NGX_SPDY_FRAME_HEADER_SIZE;
-
- ngx_http_spdy_handle_frame(stream, frame);
-
- ngx_http_spdy_handle_stream(sc, stream);
-
- return NGX_OK;
-}
-
-
-static ngx_inline void
-ngx_http_spdy_handle_frame(ngx_http_spdy_stream_t *stream,
- ngx_http_spdy_out_frame_t *frame)
-{
- ngx_http_request_t *r;
-
- r = stream->request;
-
- r->connection->sent += NGX_SPDY_FRAME_HEADER_SIZE + frame->length;
-
- if (frame->fin) {
- stream->out_closed = 1;
- }
-
- frame->next = stream->free_frames;
- stream->free_frames = frame;
-
- stream->queued--;
-}
-
-
-static ngx_inline void
-ngx_http_spdy_handle_stream(ngx_http_spdy_connection_t *sc,
- ngx_http_spdy_stream_t *stream)
-{
- ngx_event_t *wev;
-
- if (stream->handled || stream->blocked || stream->exhausted) {
- return;
- }
-
- wev = stream->request->connection->write;
-
- /*
- * This timer can only be set if the stream was delayed because of rate
- * limit. In that case the event should be triggered by the timer.
- */
-
- if (!wev->timer_set) {
- wev->delayed = 0;
-
- stream->handled = 1;
- ngx_queue_insert_tail(&sc->posted, &stream->queue);
- }
-}
-
-
-static void
-ngx_http_spdy_filter_cleanup(void *data)
-{
- ngx_http_spdy_stream_t *stream = data;
-
- size_t delta;
- ngx_http_spdy_out_frame_t *frame, **fn;
- ngx_http_spdy_connection_t *sc;
-
- if (stream->handled) {
- stream->handled = 0;
- ngx_queue_remove(&stream->queue);
- }
-
- if (stream->queued == 0) {
- return;
- }
-
- delta = 0;
- sc = stream->connection;
- fn = &sc->last_out;
-
- for ( ;; ) {
- frame = *fn;
-
- if (frame == NULL) {
- break;
- }
-
- if (frame->stream == stream && !frame->blocked) {
- *fn = frame->next;
-
- delta += frame->length;
-
- if (--stream->queued == 0) {
- break;
- }
-
- continue;
- }
-
- fn = &frame->next;
- }
-
- if (sc->send_window == 0 && delta && !ngx_queue_empty(&sc->waiting)) {
- ngx_queue_add(&sc->posted, &sc->waiting);
- ngx_queue_init(&sc->waiting);
- }
-
- sc->send_window += delta;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_filter_init(ngx_conf_t *cf)
-{
- ngx_http_next_header_filter = ngx_http_top_header_filter;
- ngx_http_top_header_filter = ngx_http_spdy_header_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.c
deleted file mode 100644
index 5178a36f239..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.c
+++ /dev/null
@@ -1,408 +0,0 @@
-
-/*
- * Copyright (C) Nginx, Inc.
- * Copyright (C) Valentin V. Bartenev
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <ngx_http_spdy_module.h>
-
-
-static ngx_int_t ngx_http_spdy_add_variables(ngx_conf_t *cf);
-
-static ngx_int_t ngx_http_spdy_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_spdy_request_priority_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-static ngx_int_t ngx_http_spdy_module_init(ngx_cycle_t *cycle);
-
-static void *ngx_http_spdy_create_main_conf(ngx_conf_t *cf);
-static char *ngx_http_spdy_init_main_conf(ngx_conf_t *cf, void *conf);
-static void *ngx_http_spdy_create_srv_conf(ngx_conf_t *cf);
-static char *ngx_http_spdy_merge_srv_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static void *ngx_http_spdy_create_loc_conf(ngx_conf_t *cf);
-static char *ngx_http_spdy_merge_loc_conf(ngx_conf_t *cf, void *parent,
- void *child);
-
-static char *ngx_http_spdy_recv_buffer_size(ngx_conf_t *cf, void *post,
- void *data);
-static char *ngx_http_spdy_pool_size(ngx_conf_t *cf, void *post, void *data);
-static char *ngx_http_spdy_streams_index_mask(ngx_conf_t *cf, void *post,
- void *data);
-static char *ngx_http_spdy_chunk_size(ngx_conf_t *cf, void *post, void *data);
-
-
-static ngx_conf_num_bounds_t ngx_http_spdy_headers_comp_bounds = {
- ngx_conf_check_num_bounds, 0, 9
-};
-
-static ngx_conf_post_t ngx_http_spdy_recv_buffer_size_post =
- { ngx_http_spdy_recv_buffer_size };
-static ngx_conf_post_t ngx_http_spdy_pool_size_post =
- { ngx_http_spdy_pool_size };
-static ngx_conf_post_t ngx_http_spdy_streams_index_mask_post =
- { ngx_http_spdy_streams_index_mask };
-static ngx_conf_post_t ngx_http_spdy_chunk_size_post =
- { ngx_http_spdy_chunk_size };
-
-
-static ngx_command_t ngx_http_spdy_commands[] = {
-
- { ngx_string("spdy_recv_buffer_size"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_MAIN_CONF_OFFSET,
- offsetof(ngx_http_spdy_main_conf_t, recv_buffer_size),
- &ngx_http_spdy_recv_buffer_size_post },
-
- { ngx_string("spdy_pool_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_spdy_srv_conf_t, pool_size),
- &ngx_http_spdy_pool_size_post },
-
- { ngx_string("spdy_max_concurrent_streams"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_spdy_srv_conf_t, concurrent_streams),
- NULL },
-
- { ngx_string("spdy_streams_index_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_spdy_srv_conf_t, streams_index_mask),
- &ngx_http_spdy_streams_index_mask_post },
-
- { ngx_string("spdy_recv_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_spdy_srv_conf_t, recv_timeout),
- NULL },
-
- { ngx_string("spdy_keepalive_timeout"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_spdy_srv_conf_t, keepalive_timeout),
- NULL },
-
- { ngx_string("spdy_headers_comp"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_num_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_spdy_srv_conf_t, headers_comp),
- &ngx_http_spdy_headers_comp_bounds },
-
- { ngx_string("spdy_chunk_size"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_spdy_loc_conf_t, chunk_size),
- &ngx_http_spdy_chunk_size_post },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_spdy_module_ctx = {
- ngx_http_spdy_add_variables, /* preconfiguration */
- NULL, /* postconfiguration */
-
- ngx_http_spdy_create_main_conf, /* create main configuration */
- ngx_http_spdy_init_main_conf, /* init main configuration */
-
- ngx_http_spdy_create_srv_conf, /* create server configuration */
- ngx_http_spdy_merge_srv_conf, /* merge server configuration */
-
- ngx_http_spdy_create_loc_conf, /* create location configuration */
- ngx_http_spdy_merge_loc_conf /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_spdy_module = {
- NGX_MODULE_V1,
- &ngx_http_spdy_module_ctx, /* module context */
- ngx_http_spdy_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- ngx_http_spdy_module_init, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_variable_t ngx_http_spdy_vars[] = {
-
- { ngx_string("spdy"), NULL,
- ngx_http_spdy_variable, 0, 0, 0 },
-
- { ngx_string("spdy_request_priority"), NULL,
- ngx_http_spdy_request_priority_variable, 0, 0, 0 },
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-static ngx_int_t
-ngx_http_spdy_add_variables(ngx_conf_t *cf)
-{
- ngx_http_variable_t *var, *v;
-
- for (v = ngx_http_spdy_vars; v->name.len; v++) {
- var = ngx_http_add_variable(cf, &v->name, v->flags);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = v->get_handler;
- var->data = v->data;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- if (r->spdy_stream) {
- v->len = sizeof("3.1") - 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) "3.1";
-
- return NGX_OK;
- }
-
- *v = ngx_http_variable_null_value;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_request_priority_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- if (r->spdy_stream) {
- v->len = 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- v->data = ngx_pnalloc(r->pool, 1);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- v->data[0] = '0' + (u_char) r->spdy_stream->priority;
-
- return NGX_OK;
- }
-
- *v = ngx_http_variable_null_value;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_spdy_module_init(ngx_cycle_t *cycle)
-{
- ngx_http_spdy_request_headers_init();
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_http_spdy_create_main_conf(ngx_conf_t *cf)
-{
- ngx_http_spdy_main_conf_t *smcf;
-
- smcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_spdy_main_conf_t));
- if (smcf == NULL) {
- return NULL;
- }
-
- smcf->recv_buffer_size = NGX_CONF_UNSET_SIZE;
-
- return smcf;
-}
-
-
-static char *
-ngx_http_spdy_init_main_conf(ngx_conf_t *cf, void *conf)
-{
- ngx_http_spdy_main_conf_t *smcf = conf;
-
- ngx_conf_init_size_value(smcf->recv_buffer_size, 256 * 1024);
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_http_spdy_create_srv_conf(ngx_conf_t *cf)
-{
- ngx_http_spdy_srv_conf_t *sscf;
-
- sscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_spdy_srv_conf_t));
- if (sscf == NULL) {
- return NULL;
- }
-
- sscf->pool_size = NGX_CONF_UNSET_SIZE;
-
- sscf->concurrent_streams = NGX_CONF_UNSET_UINT;
- sscf->streams_index_mask = NGX_CONF_UNSET_UINT;
-
- sscf->recv_timeout = NGX_CONF_UNSET_MSEC;
- sscf->keepalive_timeout = NGX_CONF_UNSET_MSEC;
-
- sscf->headers_comp = NGX_CONF_UNSET;
-
- return sscf;
-}
-
-
-static char *
-ngx_http_spdy_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_spdy_srv_conf_t *prev = parent;
- ngx_http_spdy_srv_conf_t *conf = child;
-
- ngx_conf_merge_size_value(conf->pool_size, prev->pool_size, 4096);
-
- ngx_conf_merge_uint_value(conf->concurrent_streams,
- prev->concurrent_streams, 100);
-
- ngx_conf_merge_uint_value(conf->streams_index_mask,
- prev->streams_index_mask, 32 - 1);
-
- ngx_conf_merge_msec_value(conf->recv_timeout,
- prev->recv_timeout, 30000);
- ngx_conf_merge_msec_value(conf->keepalive_timeout,
- prev->keepalive_timeout, 180000);
-
- ngx_conf_merge_value(conf->headers_comp, prev->headers_comp, 0);
-
- return NGX_CONF_OK;
-}
-
-
-static void *
-ngx_http_spdy_create_loc_conf(ngx_conf_t *cf)
-{
- ngx_http_spdy_loc_conf_t *slcf;
-
- slcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_spdy_loc_conf_t));
- if (slcf == NULL) {
- return NULL;
- }
-
- slcf->chunk_size = NGX_CONF_UNSET_SIZE;
-
- return slcf;
-}
-
-
-static char *
-ngx_http_spdy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_http_spdy_loc_conf_t *prev = parent;
- ngx_http_spdy_loc_conf_t *conf = child;
-
- ngx_conf_merge_size_value(conf->chunk_size, prev->chunk_size, 8 * 1024);
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_spdy_recv_buffer_size(ngx_conf_t *cf, void *post, void *data)
-{
- size_t *sp = data;
-
- if (*sp <= 2 * NGX_SPDY_STATE_BUFFER_SIZE) {
- return "value is too small";
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_spdy_pool_size(ngx_conf_t *cf, void *post, void *data)
-{
- size_t *sp = data;
-
- if (*sp < NGX_MIN_POOL_SIZE) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the pool size must be no less than %uz",
- NGX_MIN_POOL_SIZE);
- return NGX_CONF_ERROR;
- }
-
- if (*sp % NGX_POOL_ALIGNMENT) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the pool size must be a multiple of %uz",
- NGX_POOL_ALIGNMENT);
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_spdy_streams_index_mask(ngx_conf_t *cf, void *post, void *data)
-{
- ngx_uint_t *np = data;
-
- ngx_uint_t mask;
-
- mask = *np - 1;
-
- if (*np == 0 || (*np & mask)) {
- return "must be a power of two";
- }
-
- *np = mask;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_http_spdy_chunk_size(ngx_conf_t *cf, void *post, void *data)
-{
- size_t *sp = data;
-
- if (*sp == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the spdy chunk size cannot be zero");
- return NGX_CONF_ERROR;
- }
-
- if (*sp > NGX_SPDY_MAX_FRAME_SIZE) {
- *sp = NGX_SPDY_MAX_FRAME_SIZE;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.h
deleted file mode 100644
index 5242322b3d6..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_spdy_module.h
+++ /dev/null
@@ -1,41 +0,0 @@
-
-/*
- * Copyright (C) Nginx, Inc.
- * Copyright (C) Valentin V. Bartenev
- */
-
-
-#ifndef _NGX_HTTP_SPDY_MODULE_H_INCLUDED_
-#define _NGX_HTTP_SPDY_MODULE_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- size_t recv_buffer_size;
- u_char *recv_buffer;
-} ngx_http_spdy_main_conf_t;
-
-
-typedef struct {
- size_t pool_size;
- ngx_uint_t concurrent_streams;
- ngx_uint_t streams_index_mask;
- ngx_msec_t recv_timeout;
- ngx_msec_t keepalive_timeout;
- ngx_int_t headers_comp;
-} ngx_http_spdy_srv_conf_t;
-
-
-typedef struct {
- size_t chunk_size;
-} ngx_http_spdy_loc_conf_t;
-
-
-extern ngx_module_t ngx_http_spdy_module;
-
-
-#endif /* _NGX_HTTP_SPDY_MODULE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_special_response.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_special_response.c
deleted file mode 100644
index 546400539ba..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_special_response.c
+++ /dev/null
@@ -1,792 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <nginx.h>
-
-
-static ngx_int_t ngx_http_send_error_page(ngx_http_request_t *r,
- ngx_http_err_page_t *err_page);
-static ngx_int_t ngx_http_send_special_response(ngx_http_request_t *r,
- ngx_http_core_loc_conf_t *clcf, ngx_uint_t err);
-static ngx_int_t ngx_http_send_refresh(ngx_http_request_t *r);
-
-
-static u_char ngx_http_error_full_tail[] =
-"<hr><center>" NGINX_VER "</center>" CRLF
-"</body>" CRLF
-"</html>" CRLF
-;
-
-
-static u_char ngx_http_error_tail[] =
-"<hr><center>nginx</center>" CRLF
-"</body>" CRLF
-"</html>" CRLF
-;
-
-
-static u_char ngx_http_msie_padding[] =
-"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
-"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
-"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
-"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
-"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
-"<!-- a padding to disable MSIE and Chrome friendly error page -->" CRLF
-;
-
-
-static u_char ngx_http_msie_refresh_head[] =
-"<html><head><meta http-equiv=\"Refresh\" content=\"0; URL=";
-
-
-static u_char ngx_http_msie_refresh_tail[] =
-"\"></head><body></body></html>" CRLF;
-
-
-static char ngx_http_error_301_page[] =
-"<html>" CRLF
-"<head><title>301 Moved Permanently</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>301 Moved Permanently</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_302_page[] =
-"<html>" CRLF
-"<head><title>302 Found</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>302 Found</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_303_page[] =
-"<html>" CRLF
-"<head><title>303 See Other</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>303 See Other</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_307_page[] =
-"<html>" CRLF
-"<head><title>307 Temporary Redirect</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>307 Temporary Redirect</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_400_page[] =
-"<html>" CRLF
-"<head><title>400 Bad Request</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>400 Bad Request</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_401_page[] =
-"<html>" CRLF
-"<head><title>401 Authorization Required</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>401 Authorization Required</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_402_page[] =
-"<html>" CRLF
-"<head><title>402 Payment Required</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>402 Payment Required</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_403_page[] =
-"<html>" CRLF
-"<head><title>403 Forbidden</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>403 Forbidden</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_404_page[] =
-"<html>" CRLF
-"<head><title>404 Not Found</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>404 Not Found</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_405_page[] =
-"<html>" CRLF
-"<head><title>405 Not Allowed</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>405 Not Allowed</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_406_page[] =
-"<html>" CRLF
-"<head><title>406 Not Acceptable</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>406 Not Acceptable</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_408_page[] =
-"<html>" CRLF
-"<head><title>408 Request Time-out</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>408 Request Time-out</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_409_page[] =
-"<html>" CRLF
-"<head><title>409 Conflict</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>409 Conflict</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_410_page[] =
-"<html>" CRLF
-"<head><title>410 Gone</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>410 Gone</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_411_page[] =
-"<html>" CRLF
-"<head><title>411 Length Required</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>411 Length Required</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_412_page[] =
-"<html>" CRLF
-"<head><title>412 Precondition Failed</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>412 Precondition Failed</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_413_page[] =
-"<html>" CRLF
-"<head><title>413 Request Entity Too Large</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>413 Request Entity Too Large</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_414_page[] =
-"<html>" CRLF
-"<head><title>414 Request-URI Too Large</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>414 Request-URI Too Large</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_415_page[] =
-"<html>" CRLF
-"<head><title>415 Unsupported Media Type</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>415 Unsupported Media Type</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_416_page[] =
-"<html>" CRLF
-"<head><title>416 Requested Range Not Satisfiable</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>416 Requested Range Not Satisfiable</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_494_page[] =
-"<html>" CRLF
-"<head><title>400 Request Header Or Cookie Too Large</title></head>"
-CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>400 Bad Request</h1></center>" CRLF
-"<center>Request Header Or Cookie Too Large</center>" CRLF
-;
-
-
-static char ngx_http_error_495_page[] =
-"<html>" CRLF
-"<head><title>400 The SSL certificate error</title></head>"
-CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>400 Bad Request</h1></center>" CRLF
-"<center>The SSL certificate error</center>" CRLF
-;
-
-
-static char ngx_http_error_496_page[] =
-"<html>" CRLF
-"<head><title>400 No required SSL certificate was sent</title></head>"
-CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>400 Bad Request</h1></center>" CRLF
-"<center>No required SSL certificate was sent</center>" CRLF
-;
-
-
-static char ngx_http_error_497_page[] =
-"<html>" CRLF
-"<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>"
-CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>400 Bad Request</h1></center>" CRLF
-"<center>The plain HTTP request was sent to HTTPS port</center>" CRLF
-;
-
-
-static char ngx_http_error_500_page[] =
-"<html>" CRLF
-"<head><title>500 Internal Server Error</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>500 Internal Server Error</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_501_page[] =
-"<html>" CRLF
-"<head><title>501 Not Implemented</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>501 Not Implemented</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_502_page[] =
-"<html>" CRLF
-"<head><title>502 Bad Gateway</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>502 Bad Gateway</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_503_page[] =
-"<html>" CRLF
-"<head><title>503 Service Temporarily Unavailable</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>503 Service Temporarily Unavailable</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_504_page[] =
-"<html>" CRLF
-"<head><title>504 Gateway Time-out</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>504 Gateway Time-out</h1></center>" CRLF
-;
-
-
-static char ngx_http_error_507_page[] =
-"<html>" CRLF
-"<head><title>507 Insufficient Storage</title></head>" CRLF
-"<body bgcolor=\"white\">" CRLF
-"<center><h1>507 Insufficient Storage</h1></center>" CRLF
-;
-
-
-static ngx_str_t ngx_http_error_pages[] = {
-
- ngx_null_string, /* 201, 204 */
-
-#define NGX_HTTP_LAST_2XX 202
-#define NGX_HTTP_OFF_3XX (NGX_HTTP_LAST_2XX - 201)
-
- /* ngx_null_string, */ /* 300 */
- ngx_string(ngx_http_error_301_page),
- ngx_string(ngx_http_error_302_page),
- ngx_string(ngx_http_error_303_page),
- ngx_null_string, /* 304 */
- ngx_null_string, /* 305 */
- ngx_null_string, /* 306 */
- ngx_string(ngx_http_error_307_page),
-
-#define NGX_HTTP_LAST_3XX 308
-#define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX)
-
- ngx_string(ngx_http_error_400_page),
- ngx_string(ngx_http_error_401_page),
- ngx_string(ngx_http_error_402_page),
- ngx_string(ngx_http_error_403_page),
- ngx_string(ngx_http_error_404_page),
- ngx_string(ngx_http_error_405_page),
- ngx_string(ngx_http_error_406_page),
- ngx_null_string, /* 407 */
- ngx_string(ngx_http_error_408_page),
- ngx_string(ngx_http_error_409_page),
- ngx_string(ngx_http_error_410_page),
- ngx_string(ngx_http_error_411_page),
- ngx_string(ngx_http_error_412_page),
- ngx_string(ngx_http_error_413_page),
- ngx_string(ngx_http_error_414_page),
- ngx_string(ngx_http_error_415_page),
- ngx_string(ngx_http_error_416_page),
-
-#define NGX_HTTP_LAST_4XX 417
-#define NGX_HTTP_OFF_5XX (NGX_HTTP_LAST_4XX - 400 + NGX_HTTP_OFF_4XX)
-
- ngx_string(ngx_http_error_494_page), /* 494, request header too large */
- ngx_string(ngx_http_error_495_page), /* 495, https certificate error */
- ngx_string(ngx_http_error_496_page), /* 496, https no certificate */
- ngx_string(ngx_http_error_497_page), /* 497, http to https */
- ngx_string(ngx_http_error_404_page), /* 498, canceled */
- ngx_null_string, /* 499, client has closed connection */
-
- ngx_string(ngx_http_error_500_page),
- ngx_string(ngx_http_error_501_page),
- ngx_string(ngx_http_error_502_page),
- ngx_string(ngx_http_error_503_page),
- ngx_string(ngx_http_error_504_page),
- ngx_null_string, /* 505 */
- ngx_null_string, /* 506 */
- ngx_string(ngx_http_error_507_page)
-
-#define NGX_HTTP_LAST_5XX 508
-
-};
-
-
-static ngx_str_t ngx_http_get_name = { 3, (u_char *) "GET " };
-
-
-ngx_int_t
-ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
-{
- ngx_uint_t i, err;
- ngx_http_err_page_t *err_page;
- ngx_http_core_loc_conf_t *clcf;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http special response: %i, \"%V?%V\"",
- error, &r->uri, &r->args);
-
- r->err_status = error;
-
- if (r->keepalive) {
- switch (error) {
- case NGX_HTTP_BAD_REQUEST:
- case NGX_HTTP_REQUEST_ENTITY_TOO_LARGE:
- case NGX_HTTP_REQUEST_URI_TOO_LARGE:
- case NGX_HTTP_TO_HTTPS:
- case NGX_HTTPS_CERT_ERROR:
- case NGX_HTTPS_NO_CERT:
- case NGX_HTTP_INTERNAL_SERVER_ERROR:
- case NGX_HTTP_NOT_IMPLEMENTED:
- r->keepalive = 0;
- }
- }
-
- if (r->lingering_close) {
- switch (error) {
- case NGX_HTTP_BAD_REQUEST:
- case NGX_HTTP_TO_HTTPS:
- case NGX_HTTPS_CERT_ERROR:
- case NGX_HTTPS_NO_CERT:
- r->lingering_close = 0;
- }
- }
-
- r->headers_out.content_type.len = 0;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (!r->error_page && clcf->error_pages && r->uri_changes != 0) {
-
- if (clcf->recursive_error_pages == 0) {
- r->error_page = 1;
- }
-
- err_page = clcf->error_pages->elts;
-
- for (i = 0; i < clcf->error_pages->nelts; i++) {
- if (err_page[i].status == error) {
- return ngx_http_send_error_page(r, &err_page[i]);
- }
- }
- }
-
- r->expect_tested = 1;
-
- if (ngx_http_discard_request_body(r) != NGX_OK) {
- r->keepalive = 0;
- }
-
- if (clcf->msie_refresh
- && r->headers_in.msie
- && (error == NGX_HTTP_MOVED_PERMANENTLY
- || error == NGX_HTTP_MOVED_TEMPORARILY))
- {
- return ngx_http_send_refresh(r);
- }
-
- if (error == NGX_HTTP_CREATED) {
- /* 201 */
- err = 0;
-
- } else if (error == NGX_HTTP_NO_CONTENT) {
- /* 204 */
- err = 0;
-
- } else if (error >= NGX_HTTP_MOVED_PERMANENTLY
- && error < NGX_HTTP_LAST_3XX)
- {
- /* 3XX */
- err = error - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_OFF_3XX;
-
- } else if (error >= NGX_HTTP_BAD_REQUEST
- && error < NGX_HTTP_LAST_4XX)
- {
- /* 4XX */
- err = error - NGX_HTTP_BAD_REQUEST + NGX_HTTP_OFF_4XX;
-
- } else if (error >= NGX_HTTP_NGINX_CODES
- && error < NGX_HTTP_LAST_5XX)
- {
- /* 49X, 5XX */
- err = error - NGX_HTTP_NGINX_CODES + NGX_HTTP_OFF_5XX;
- switch (error) {
- case NGX_HTTP_TO_HTTPS:
- case NGX_HTTPS_CERT_ERROR:
- case NGX_HTTPS_NO_CERT:
- case NGX_HTTP_REQUEST_HEADER_TOO_LARGE:
- r->err_status = NGX_HTTP_BAD_REQUEST;
- break;
- }
-
- } else {
- /* unknown code, zero body */
- err = 0;
- }
-
- return ngx_http_send_special_response(r, clcf, err);
-}
-
-
-ngx_int_t
-ngx_http_filter_finalize_request(ngx_http_request_t *r, ngx_module_t *m,
- ngx_int_t error)
-{
- void *ctx;
- ngx_int_t rc;
-
- ngx_http_clean_header(r);
-
- ctx = NULL;
-
- if (m) {
- ctx = r->ctx[m->ctx_index];
- }
-
- /* clear the modules contexts */
- ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
-
- if (m) {
- r->ctx[m->ctx_index] = ctx;
- }
-
- r->filter_finalize = 1;
-
- rc = ngx_http_special_response_handler(r, error);
-
- /* NGX_ERROR resets any pending data */
-
- switch (rc) {
-
- case NGX_OK:
- case NGX_DONE:
- return NGX_ERROR;
-
- default:
- return rc;
- }
-}
-
-
-void
-ngx_http_clean_header(ngx_http_request_t *r)
-{
- ngx_memzero(&r->headers_out.status,
- sizeof(ngx_http_headers_out_t)
- - offsetof(ngx_http_headers_out_t, status));
-
- r->headers_out.headers.part.nelts = 0;
- r->headers_out.headers.part.next = NULL;
- r->headers_out.headers.last = &r->headers_out.headers.part;
-
- r->headers_out.content_length_n = -1;
- r->headers_out.last_modified_time = -1;
-}
-
-
-static ngx_int_t
-ngx_http_send_error_page(ngx_http_request_t *r, ngx_http_err_page_t *err_page)
-{
- ngx_int_t overwrite;
- ngx_str_t uri, args;
- ngx_table_elt_t *location;
- ngx_http_core_loc_conf_t *clcf;
-
- overwrite = err_page->overwrite;
-
- if (overwrite && overwrite != NGX_HTTP_OK) {
- r->expect_tested = 1;
- }
-
- if (overwrite >= 0) {
- r->err_status = overwrite;
- }
-
- if (ngx_http_complex_value(r, &err_page->value, &uri) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (uri.data[0] == '/') {
-
- if (err_page->value.lengths) {
- ngx_http_split_args(r, &uri, &args);
-
- } else {
- args = err_page->args;
- }
-
- if (r->method != NGX_HTTP_HEAD) {
- r->method = NGX_HTTP_GET;
- r->method_name = ngx_http_get_name;
- }
-
- return ngx_http_internal_redirect(r, &uri, &args);
- }
-
- if (uri.data[0] == '@') {
- return ngx_http_named_location(r, &uri);
- }
-
- location = ngx_list_push(&r->headers_out.headers);
-
- if (location == NULL) {
- return NGX_ERROR;
- }
-
- if (overwrite != NGX_HTTP_MOVED_PERMANENTLY
- && overwrite != NGX_HTTP_MOVED_TEMPORARILY
- && overwrite != NGX_HTTP_SEE_OTHER
- && overwrite != NGX_HTTP_TEMPORARY_REDIRECT)
- {
- r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
- }
-
- location->hash = 1;
- ngx_str_set(&location->key, "Location");
- location->value = uri;
-
- ngx_http_clear_location(r);
-
- r->headers_out.location = location;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->msie_refresh && r->headers_in.msie) {
- return ngx_http_send_refresh(r);
- }
-
- return ngx_http_send_special_response(r, clcf, r->err_status
- - NGX_HTTP_MOVED_PERMANENTLY
- + NGX_HTTP_OFF_3XX);
-}
-
-
-static ngx_int_t
-ngx_http_send_special_response(ngx_http_request_t *r,
- ngx_http_core_loc_conf_t *clcf, ngx_uint_t err)
-{
- u_char *tail;
- size_t len;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_uint_t msie_padding;
- ngx_chain_t out[3];
-
- if (clcf->server_tokens) {
- len = sizeof(ngx_http_error_full_tail) - 1;
- tail = ngx_http_error_full_tail;
-
- } else {
- len = sizeof(ngx_http_error_tail) - 1;
- tail = ngx_http_error_tail;
- }
-
- msie_padding = 0;
-
- if (ngx_http_error_pages[err].len) {
- r->headers_out.content_length_n = ngx_http_error_pages[err].len + len;
- if (clcf->msie_padding
- && (r->headers_in.msie || r->headers_in.chrome)
- && r->http_version >= NGX_HTTP_VERSION_10
- && err >= NGX_HTTP_OFF_4XX)
- {
- r->headers_out.content_length_n +=
- sizeof(ngx_http_msie_padding) - 1;
- msie_padding = 1;
- }
-
- r->headers_out.content_type_len = sizeof("text/html") - 1;
- ngx_str_set(&r->headers_out.content_type, "text/html");
- r->headers_out.content_type_lowcase = NULL;
-
- } else {
- r->headers_out.content_length_n = 0;
- }
-
- if (r->headers_out.content_length) {
- r->headers_out.content_length->hash = 0;
- r->headers_out.content_length = NULL;
- }
-
- ngx_http_clear_accept_ranges(r);
- ngx_http_clear_last_modified(r);
- ngx_http_clear_etag(r);
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || r->header_only) {
- return rc;
- }
-
- if (ngx_http_error_pages[err].len == 0) {
- return ngx_http_send_special(r, NGX_HTTP_LAST);
- }
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- b->memory = 1;
- b->pos = ngx_http_error_pages[err].data;
- b->last = ngx_http_error_pages[err].data + ngx_http_error_pages[err].len;
-
- out[0].buf = b;
- out[0].next = &out[1];
-
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- b->memory = 1;
-
- b->pos = tail;
- b->last = tail + len;
-
- out[1].buf = b;
- out[1].next = NULL;
-
- if (msie_padding) {
- b = ngx_calloc_buf(r->pool);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- b->memory = 1;
- b->pos = ngx_http_msie_padding;
- b->last = ngx_http_msie_padding + sizeof(ngx_http_msie_padding) - 1;
-
- out[1].next = &out[2];
- out[2].buf = b;
- out[2].next = NULL;
- }
-
- if (r == r->main) {
- b->last_buf = 1;
- }
-
- b->last_in_chain = 1;
-
- return ngx_http_output_filter(r, &out[0]);
-}
-
-
-static ngx_int_t
-ngx_http_send_refresh(ngx_http_request_t *r)
-{
- u_char *p, *location;
- size_t len, size;
- uintptr_t escape;
- ngx_int_t rc;
- ngx_buf_t *b;
- ngx_chain_t out;
-
- len = r->headers_out.location->value.len;
- location = r->headers_out.location->value.data;
-
- escape = 2 * ngx_escape_uri(NULL, location, len, NGX_ESCAPE_REFRESH);
-
- size = sizeof(ngx_http_msie_refresh_head) - 1
- + escape + len
- + sizeof(ngx_http_msie_refresh_tail) - 1;
-
- r->err_status = NGX_HTTP_OK;
-
- r->headers_out.content_type_len = sizeof("text/html") - 1;
- ngx_str_set(&r->headers_out.content_type, "text/html");
- r->headers_out.content_type_lowcase = NULL;
-
- r->headers_out.location->hash = 0;
- r->headers_out.location = NULL;
-
- r->headers_out.content_length_n = size;
-
- if (r->headers_out.content_length) {
- r->headers_out.content_length->hash = 0;
- r->headers_out.content_length = NULL;
- }
-
- ngx_http_clear_accept_ranges(r);
- ngx_http_clear_last_modified(r);
- ngx_http_clear_etag(r);
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || r->header_only) {
- return rc;
- }
-
- b = ngx_create_temp_buf(r->pool, size);
- if (b == NULL) {
- return NGX_ERROR;
- }
-
- p = ngx_cpymem(b->pos, ngx_http_msie_refresh_head,
- sizeof(ngx_http_msie_refresh_head) - 1);
-
- if (escape == 0) {
- p = ngx_cpymem(p, location, len);
-
- } else {
- p = (u_char *) ngx_escape_uri(p, location, len, NGX_ESCAPE_REFRESH);
- }
-
- b->last = ngx_cpymem(p, ngx_http_msie_refresh_tail,
- sizeof(ngx_http_msie_refresh_tail) - 1);
-
- b->last_buf = 1;
- b->last_in_chain = 1;
-
- out.buf = b;
- out.next = NULL;
-
- return ngx_http_output_filter(r, &out);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.c
deleted file mode 100644
index d547ca74e3f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.c
+++ /dev/null
@@ -1,5587 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#if (NGX_HTTP_CACHE)
-static ngx_int_t ngx_http_upstream_cache(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static ngx_int_t ngx_http_upstream_cache_send(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static ngx_int_t ngx_http_upstream_cache_status(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_upstream_cache_last_modified(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_upstream_cache_etag(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-#endif
-
-static void ngx_http_upstream_init_request(ngx_http_request_t *r);
-static void ngx_http_upstream_resolve_handler(ngx_resolver_ctx_t *ctx);
-static void ngx_http_upstream_rd_check_broken_connection(ngx_http_request_t *r);
-static void ngx_http_upstream_wr_check_broken_connection(ngx_http_request_t *r);
-static void ngx_http_upstream_check_broken_connection(ngx_http_request_t *r,
- ngx_event_t *ev);
-static void ngx_http_upstream_connect(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static ngx_int_t ngx_http_upstream_reinit(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_send_request(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_send_request_handler(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_process_header(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static ngx_int_t ngx_http_upstream_test_next(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static ngx_int_t ngx_http_upstream_intercept_errors(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static ngx_int_t ngx_http_upstream_test_connect(ngx_connection_t *c);
-static ngx_int_t ngx_http_upstream_process_headers(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_process_body_in_memory(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_send_response(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_upgrade(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_upgraded_read_downstream(ngx_http_request_t *r);
-static void ngx_http_upstream_upgraded_write_downstream(ngx_http_request_t *r);
-static void ngx_http_upstream_upgraded_read_upstream(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_upgraded_write_upstream(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_process_upgraded(ngx_http_request_t *r,
- ngx_uint_t from_upstream, ngx_uint_t do_write);
-static void
- ngx_http_upstream_process_non_buffered_downstream(ngx_http_request_t *r);
-static void
- ngx_http_upstream_process_non_buffered_upstream(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void
- ngx_http_upstream_process_non_buffered_request(ngx_http_request_t *r,
- ngx_uint_t do_write);
-static ngx_int_t ngx_http_upstream_non_buffered_filter_init(void *data);
-static ngx_int_t ngx_http_upstream_non_buffered_filter(void *data,
- ssize_t bytes);
-static void ngx_http_upstream_process_downstream(ngx_http_request_t *r);
-static void ngx_http_upstream_process_upstream(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_process_request(ngx_http_request_t *r);
-static void ngx_http_upstream_store(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_dummy_handler(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-static void ngx_http_upstream_next(ngx_http_request_t *r,
- ngx_http_upstream_t *u, ngx_uint_t ft_type);
-static void ngx_http_upstream_cleanup(void *data);
-static void ngx_http_upstream_finalize_request(ngx_http_request_t *r,
- ngx_http_upstream_t *u, ngx_int_t rc);
-
-static ngx_int_t ngx_http_upstream_process_header_line(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_process_content_length(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_process_last_modified(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_process_set_cookie(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t
- ngx_http_upstream_process_cache_control(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_ignore_header_line(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_process_expires(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_process_accel_expires(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_process_limit_rate(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_process_buffering(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_process_charset(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_process_connection(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t
- ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_copy_header_line(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t
- ngx_http_upstream_copy_multi_header_lines(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_copy_content_type(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_copy_last_modified(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_rewrite_location(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_rewrite_refresh(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_rewrite_set_cookie(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-static ngx_int_t ngx_http_upstream_copy_allow_ranges(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-
-#if (NGX_HTTP_GZIP)
-static ngx_int_t ngx_http_upstream_copy_content_encoding(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset);
-#endif
-
-static ngx_int_t ngx_http_upstream_add_variables(ngx_conf_t *cf);
-static ngx_int_t ngx_http_upstream_addr_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_upstream_status_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_upstream_response_time_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_upstream_response_length_variable(
- ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data);
-
-static char *ngx_http_upstream(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy);
-static char *ngx_http_upstream_server(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-static ngx_addr_t *ngx_http_upstream_get_local(ngx_http_request_t *r,
- ngx_http_upstream_local_t *local);
-
-static void *ngx_http_upstream_create_main_conf(ngx_conf_t *cf);
-static char *ngx_http_upstream_init_main_conf(ngx_conf_t *cf, void *conf);
-
-#if (NGX_HTTP_SSL)
-static void ngx_http_upstream_ssl_init_connection(ngx_http_request_t *,
- ngx_http_upstream_t *u, ngx_connection_t *c);
-static void ngx_http_upstream_ssl_handshake(ngx_connection_t *c);
-static ngx_int_t ngx_http_upstream_ssl_name(ngx_http_request_t *r,
- ngx_http_upstream_t *u, ngx_connection_t *c);
-#endif
-
-
-ngx_http_upstream_header_t ngx_http_upstream_headers_in[] = {
-
- { ngx_string("Status"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, status),
- ngx_http_upstream_copy_header_line, 0, 0 },
-
- { ngx_string("Content-Type"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, content_type),
- ngx_http_upstream_copy_content_type, 0, 1 },
-
- { ngx_string("Content-Length"),
- ngx_http_upstream_process_content_length, 0,
- ngx_http_upstream_ignore_header_line, 0, 0 },
-
- { ngx_string("Date"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, date),
- ngx_http_upstream_copy_header_line,
- offsetof(ngx_http_headers_out_t, date), 0 },
-
- { ngx_string("Last-Modified"),
- ngx_http_upstream_process_last_modified, 0,
- ngx_http_upstream_copy_last_modified, 0, 0 },
-
- { ngx_string("ETag"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, etag),
- ngx_http_upstream_copy_header_line,
- offsetof(ngx_http_headers_out_t, etag), 0 },
-
- { ngx_string("Server"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, server),
- ngx_http_upstream_copy_header_line,
- offsetof(ngx_http_headers_out_t, server), 0 },
-
- { ngx_string("WWW-Authenticate"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, www_authenticate),
- ngx_http_upstream_copy_header_line, 0, 0 },
-
- { ngx_string("Location"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, location),
- ngx_http_upstream_rewrite_location, 0, 0 },
-
- { ngx_string("Refresh"),
- ngx_http_upstream_ignore_header_line, 0,
- ngx_http_upstream_rewrite_refresh, 0, 0 },
-
- { ngx_string("Set-Cookie"),
- ngx_http_upstream_process_set_cookie,
- offsetof(ngx_http_upstream_headers_in_t, cookies),
- ngx_http_upstream_rewrite_set_cookie, 0, 1 },
-
- { ngx_string("Content-Disposition"),
- ngx_http_upstream_ignore_header_line, 0,
- ngx_http_upstream_copy_header_line, 0, 1 },
-
- { ngx_string("Cache-Control"),
- ngx_http_upstream_process_cache_control, 0,
- ngx_http_upstream_copy_multi_header_lines,
- offsetof(ngx_http_headers_out_t, cache_control), 1 },
-
- { ngx_string("Expires"),
- ngx_http_upstream_process_expires, 0,
- ngx_http_upstream_copy_header_line,
- offsetof(ngx_http_headers_out_t, expires), 1 },
-
- { ngx_string("Accept-Ranges"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, accept_ranges),
- ngx_http_upstream_copy_allow_ranges,
- offsetof(ngx_http_headers_out_t, accept_ranges), 1 },
-
- { ngx_string("Connection"),
- ngx_http_upstream_process_connection, 0,
- ngx_http_upstream_ignore_header_line, 0, 0 },
-
- { ngx_string("Keep-Alive"),
- ngx_http_upstream_ignore_header_line, 0,
- ngx_http_upstream_ignore_header_line, 0, 0 },
-
- { ngx_string("X-Powered-By"),
- ngx_http_upstream_ignore_header_line, 0,
- ngx_http_upstream_copy_header_line, 0, 0 },
-
- { ngx_string("X-Accel-Expires"),
- ngx_http_upstream_process_accel_expires, 0,
- ngx_http_upstream_copy_header_line, 0, 0 },
-
- { ngx_string("X-Accel-Redirect"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, x_accel_redirect),
- ngx_http_upstream_copy_header_line, 0, 0 },
-
- { ngx_string("X-Accel-Limit-Rate"),
- ngx_http_upstream_process_limit_rate, 0,
- ngx_http_upstream_copy_header_line, 0, 0 },
-
- { ngx_string("X-Accel-Buffering"),
- ngx_http_upstream_process_buffering, 0,
- ngx_http_upstream_copy_header_line, 0, 0 },
-
- { ngx_string("X-Accel-Charset"),
- ngx_http_upstream_process_charset, 0,
- ngx_http_upstream_copy_header_line, 0, 0 },
-
- { ngx_string("Transfer-Encoding"),
- ngx_http_upstream_process_transfer_encoding, 0,
- ngx_http_upstream_ignore_header_line, 0, 0 },
-
-#if (NGX_HTTP_GZIP)
- { ngx_string("Content-Encoding"),
- ngx_http_upstream_process_header_line,
- offsetof(ngx_http_upstream_headers_in_t, content_encoding),
- ngx_http_upstream_copy_content_encoding, 0, 0 },
-#endif
-
- { ngx_null_string, NULL, 0, NULL, 0, 0 }
-};
-
-
-static ngx_command_t ngx_http_upstream_commands[] = {
-
- { ngx_string("upstream"),
- NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE1,
- ngx_http_upstream,
- 0,
- 0,
- NULL },
-
- { ngx_string("server"),
- NGX_HTTP_UPS_CONF|NGX_CONF_1MORE,
- ngx_http_upstream_server,
- NGX_HTTP_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_http_module_t ngx_http_upstream_module_ctx = {
- ngx_http_upstream_add_variables, /* preconfiguration */
- NULL, /* postconfiguration */
-
- ngx_http_upstream_create_main_conf, /* create main configuration */
- ngx_http_upstream_init_main_conf, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_upstream_module = {
- NGX_MODULE_V1,
- &ngx_http_upstream_module_ctx, /* module context */
- ngx_http_upstream_commands, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_http_variable_t ngx_http_upstream_vars[] = {
-
- { ngx_string("upstream_addr"), NULL,
- ngx_http_upstream_addr_variable, 0,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("upstream_status"), NULL,
- ngx_http_upstream_status_variable, 0,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("upstream_response_time"), NULL,
- ngx_http_upstream_response_time_variable, 0,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("upstream_response_length"), NULL,
- ngx_http_upstream_response_length_variable, 0,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
-#if (NGX_HTTP_CACHE)
-
- { ngx_string("upstream_cache_status"), NULL,
- ngx_http_upstream_cache_status, 0,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("upstream_cache_last_modified"), NULL,
- ngx_http_upstream_cache_last_modified, 0,
- NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-
- { ngx_string("upstream_cache_etag"), NULL,
- ngx_http_upstream_cache_etag, 0,
- NGX_HTTP_VAR_NOCACHEABLE|NGX_HTTP_VAR_NOHASH, 0 },
-
-#endif
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-static ngx_http_upstream_next_t ngx_http_upstream_next_errors[] = {
- { 500, NGX_HTTP_UPSTREAM_FT_HTTP_500 },
- { 502, NGX_HTTP_UPSTREAM_FT_HTTP_502 },
- { 503, NGX_HTTP_UPSTREAM_FT_HTTP_503 },
- { 504, NGX_HTTP_UPSTREAM_FT_HTTP_504 },
- { 403, NGX_HTTP_UPSTREAM_FT_HTTP_403 },
- { 404, NGX_HTTP_UPSTREAM_FT_HTTP_404 },
- { 0, 0 }
-};
-
-
-ngx_conf_bitmask_t ngx_http_upstream_cache_method_mask[] = {
- { ngx_string("GET"), NGX_HTTP_GET},
- { ngx_string("HEAD"), NGX_HTTP_HEAD },
- { ngx_string("POST"), NGX_HTTP_POST },
- { ngx_null_string, 0 }
-};
-
-
-ngx_conf_bitmask_t ngx_http_upstream_ignore_headers_masks[] = {
- { ngx_string("X-Accel-Redirect"), NGX_HTTP_UPSTREAM_IGN_XA_REDIRECT },
- { ngx_string("X-Accel-Expires"), NGX_HTTP_UPSTREAM_IGN_XA_EXPIRES },
- { ngx_string("X-Accel-Limit-Rate"), NGX_HTTP_UPSTREAM_IGN_XA_LIMIT_RATE },
- { ngx_string("X-Accel-Buffering"), NGX_HTTP_UPSTREAM_IGN_XA_BUFFERING },
- { ngx_string("X-Accel-Charset"), NGX_HTTP_UPSTREAM_IGN_XA_CHARSET },
- { ngx_string("Expires"), NGX_HTTP_UPSTREAM_IGN_EXPIRES },
- { ngx_string("Cache-Control"), NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL },
- { ngx_string("Set-Cookie"), NGX_HTTP_UPSTREAM_IGN_SET_COOKIE },
- { ngx_null_string, 0 }
-};
-
-
-ngx_int_t
-ngx_http_upstream_create(ngx_http_request_t *r)
-{
- ngx_http_upstream_t *u;
-
- u = r->upstream;
-
- if (u && u->cleanup) {
- r->main->count++;
- ngx_http_upstream_cleanup(r);
- }
-
- u = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_t));
- if (u == NULL) {
- return NGX_ERROR;
- }
-
- r->upstream = u;
-
- u->peer.log = r->connection->log;
- u->peer.log_error = NGX_ERROR_ERR;
-#if (NGX_THREADS)
- u->peer.lock = &r->connection->lock;
-#endif
-
-#if (NGX_HTTP_CACHE)
- r->cache = NULL;
-#endif
-
- u->headers_in.content_length_n = -1;
-
- return NGX_OK;
-}
-
-
-void
-ngx_http_upstream_init(ngx_http_request_t *r)
-{
- ngx_connection_t *c;
-
- c = r->connection;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http init upstream, client timer: %d", c->read->timer_set);
-
-#if (NGX_HTTP_SPDY)
- if (r->spdy_stream) {
- ngx_http_upstream_init_request(r);
- return;
- }
-#endif
-
- if (c->read->timer_set) {
- ngx_del_timer(c->read);
- }
-
- if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
-
- if (!c->write->active) {
- if (ngx_add_event(c->write, NGX_WRITE_EVENT, NGX_CLEAR_EVENT)
- == NGX_ERROR)
- {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
- }
- }
-
- ngx_http_upstream_init_request(r);
-}
-
-
-static void
-ngx_http_upstream_init_request(ngx_http_request_t *r)
-{
- ngx_str_t *host;
- ngx_uint_t i;
- ngx_resolver_ctx_t *ctx, temp;
- ngx_http_cleanup_t *cln;
- ngx_http_upstream_t *u;
- ngx_http_core_loc_conf_t *clcf;
- ngx_http_upstream_srv_conf_t *uscf, **uscfp;
- ngx_http_upstream_main_conf_t *umcf;
-
- if (r->aio) {
- return;
- }
-
- u = r->upstream;
-
-#if (NGX_HTTP_CACHE)
-
- if (u->conf->cache) {
- ngx_int_t rc;
-
- rc = ngx_http_upstream_cache(r, u);
-
- if (rc == NGX_BUSY) {
- r->write_event_handler = ngx_http_upstream_init_request;
- return;
- }
-
- r->write_event_handler = ngx_http_request_empty_handler;
-
- if (rc == NGX_DONE) {
- return;
- }
-
- if (rc == NGX_ERROR) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- if (rc != NGX_DECLINED) {
- ngx_http_finalize_request(r, rc);
- return;
- }
- }
-
-#endif
-
- u->store = (u->conf->store || u->conf->store_lengths);
-
- if (!u->store && !r->post_action && !u->conf->ignore_client_abort) {
- r->read_event_handler = ngx_http_upstream_rd_check_broken_connection;
- r->write_event_handler = ngx_http_upstream_wr_check_broken_connection;
- }
-
- if (r->request_body) {
- u->request_bufs = r->request_body->bufs;
- }
-
- if (u->create_request(r) != NGX_OK) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- u->peer.local = ngx_http_upstream_get_local(r, u->conf->local);
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- u->output.alignment = clcf->directio_alignment;
- u->output.pool = r->pool;
- u->output.bufs.num = 1;
- u->output.bufs.size = clcf->client_body_buffer_size;
- u->output.output_filter = ngx_chain_writer;
- u->output.filter_ctx = &u->writer;
-
- u->writer.pool = r->pool;
-
- if (r->upstream_states == NULL) {
-
- r->upstream_states = ngx_array_create(r->pool, 1,
- sizeof(ngx_http_upstream_state_t));
- if (r->upstream_states == NULL) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- } else {
-
- u->state = ngx_array_push(r->upstream_states);
- if (u->state == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- ngx_memzero(u->state, sizeof(ngx_http_upstream_state_t));
- }
-
- cln = ngx_http_cleanup_add(r, 0);
- if (cln == NULL) {
- ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- cln->handler = ngx_http_upstream_cleanup;
- cln->data = r;
- u->cleanup = &cln->handler;
-
- if (u->resolved == NULL) {
-
- uscf = u->conf->upstream;
-
- } else {
-
-#if (NGX_HTTP_SSL)
- u->ssl_name = u->resolved->host;
-#endif
-
- if (u->resolved->sockaddr) {
-
- if (ngx_http_upstream_create_round_robin_peer(r, u->resolved)
- != NGX_OK)
- {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- ngx_http_upstream_connect(r, u);
-
- return;
- }
-
- host = &u->resolved->host;
-
- umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
-
- uscfp = umcf->upstreams.elts;
-
- for (i = 0; i < umcf->upstreams.nelts; i++) {
-
- uscf = uscfp[i];
-
- if (uscf->host.len == host->len
- && ((uscf->port == 0 && u->resolved->no_port)
- || uscf->port == u->resolved->port)
- && ngx_strncasecmp(uscf->host.data, host->data, host->len) == 0)
- {
- goto found;
- }
- }
-
- if (u->resolved->port == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "no port in upstream \"%V\"", host);
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- temp.name = *host;
-
- ctx = ngx_resolve_start(clcf->resolver, &temp);
- if (ctx == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- if (ctx == NGX_NO_RESOLVER) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "no resolver defined to resolve %V", host);
-
- ngx_http_upstream_finalize_request(r, u, NGX_HTTP_BAD_GATEWAY);
- return;
- }
-
- ctx->name = *host;
- ctx->handler = ngx_http_upstream_resolve_handler;
- ctx->data = r;
- ctx->timeout = clcf->resolver_timeout;
-
- u->resolved->ctx = ctx;
-
- if (ngx_resolve_name(ctx) != NGX_OK) {
- u->resolved->ctx = NULL;
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- return;
- }
-
-found:
-
- if (uscf == NULL) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "no upstream configuration");
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
-#if (NGX_HTTP_SSL)
- u->ssl_name = uscf->host;
-#endif
-
- if (uscf->peer.init(r, uscf) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- u->peer.start_time = ngx_current_msec;
-
- if (u->conf->next_upstream_tries
- && u->peer.tries > u->conf->next_upstream_tries)
- {
- u->peer.tries = u->conf->next_upstream_tries;
- }
-
- ngx_http_upstream_connect(r, u);
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-static ngx_int_t
-ngx_http_upstream_cache(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- ngx_int_t rc;
- ngx_http_cache_t *c;
-
- c = r->cache;
-
- if (c == NULL) {
-
- if (!(r->method & u->conf->cache_methods)) {
- return NGX_DECLINED;
- }
-
- if (r->method & NGX_HTTP_HEAD) {
- u->method = ngx_http_core_get_method;
- }
-
- if (ngx_http_file_cache_new(r) != NGX_OK) {
- return NGX_ERROR;
- }
-
- if (u->create_key(r) != NGX_OK) {
- return NGX_ERROR;
- }
-
- /* TODO: add keys */
-
- ngx_http_file_cache_create_key(r);
-
- if (r->cache->header_start + 256 >= u->conf->buffer_size) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "%V_buffer_size %uz is not enough for cache key, "
- "it should be increased to at least %uz",
- &u->conf->module, u->conf->buffer_size,
- ngx_align(r->cache->header_start + 256, 1024));
-
- r->cache = NULL;
- return NGX_DECLINED;
- }
-
- u->cacheable = 1;
-
- switch (ngx_http_test_predicates(r, u->conf->cache_bypass)) {
-
- case NGX_ERROR:
- return NGX_ERROR;
-
- case NGX_DECLINED:
- u->cache_status = NGX_HTTP_CACHE_BYPASS;
- return NGX_DECLINED;
-
- default: /* NGX_OK */
- break;
- }
-
- c = r->cache;
-
- c->min_uses = u->conf->cache_min_uses;
- c->body_start = u->conf->buffer_size;
- c->file_cache = u->conf->cache->data;
-
- c->lock = u->conf->cache_lock;
- c->lock_timeout = u->conf->cache_lock_timeout;
-
- u->cache_status = NGX_HTTP_CACHE_MISS;
- }
-
- rc = ngx_http_file_cache_open(r);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http upstream cache: %i", rc);
-
- switch (rc) {
-
- case NGX_HTTP_CACHE_UPDATING:
-
- if (u->conf->cache_use_stale & NGX_HTTP_UPSTREAM_FT_UPDATING) {
- u->cache_status = rc;
- rc = NGX_OK;
-
- } else {
- rc = NGX_HTTP_CACHE_STALE;
- }
-
- break;
-
- case NGX_OK:
- u->cache_status = NGX_HTTP_CACHE_HIT;
- }
-
- switch (rc) {
-
- case NGX_OK:
-
- rc = ngx_http_upstream_cache_send(r, u);
-
- if (rc != NGX_HTTP_UPSTREAM_INVALID_HEADER) {
- return rc;
- }
-
- break;
-
- case NGX_HTTP_CACHE_STALE:
-
- c->valid_sec = 0;
- u->buffer.start = NULL;
- u->cache_status = NGX_HTTP_CACHE_EXPIRED;
-
- break;
-
- case NGX_DECLINED:
-
- if ((size_t) (u->buffer.end - u->buffer.start) < u->conf->buffer_size) {
- u->buffer.start = NULL;
-
- } else {
- u->buffer.pos = u->buffer.start + c->header_start;
- u->buffer.last = u->buffer.pos;
- }
-
- break;
-
- case NGX_HTTP_CACHE_SCARCE:
-
- u->cacheable = 0;
-
- break;
-
- case NGX_AGAIN:
-
- return NGX_BUSY;
-
- case NGX_ERROR:
-
- return NGX_ERROR;
-
- default:
-
- /* cached NGX_HTTP_BAD_GATEWAY, NGX_HTTP_GATEWAY_TIME_OUT, etc. */
-
- u->cache_status = NGX_HTTP_CACHE_HIT;
-
- return rc;
- }
-
- r->cached = 0;
-
- return NGX_DECLINED;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_cache_send(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- ngx_int_t rc;
- ngx_http_cache_t *c;
-
- r->cached = 1;
- c = r->cache;
-
- if (c->header_start == c->body_start) {
- r->http_version = NGX_HTTP_VERSION_9;
- return ngx_http_cache_send(r);
- }
-
- /* TODO: cache stack */
-
- u->buffer = *c->buf;
- u->buffer.pos += c->header_start;
-
- ngx_memzero(&u->headers_in, sizeof(ngx_http_upstream_headers_in_t));
- u->headers_in.content_length_n = -1;
-
- if (ngx_list_init(&u->headers_in.headers, r->pool, 8,
- sizeof(ngx_table_elt_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- rc = u->process_header(r);
-
- if (rc == NGX_OK) {
-
- if (ngx_http_upstream_process_headers(r, u) != NGX_OK) {
- return NGX_DONE;
- }
-
- return ngx_http_cache_send(r);
- }
-
- if (rc == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- /* rc == NGX_HTTP_UPSTREAM_INVALID_HEADER */
-
- /* TODO: delete file */
-
- return rc;
-}
-
-#endif
-
-
-static void
-ngx_http_upstream_resolve_handler(ngx_resolver_ctx_t *ctx)
-{
- ngx_connection_t *c;
- ngx_http_request_t *r;
- ngx_http_upstream_t *u;
- ngx_http_upstream_resolved_t *ur;
-
- r = ctx->data;
- c = r->connection;
-
- u = r->upstream;
- ur = u->resolved;
-
- if (ctx->state) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "%V could not be resolved (%i: %s)",
- &ctx->name, ctx->state,
- ngx_resolver_strerror(ctx->state));
-
- ngx_http_upstream_finalize_request(r, u, NGX_HTTP_BAD_GATEWAY);
- goto failed;
- }
-
- ur->naddrs = ctx->naddrs;
- ur->addrs = ctx->addrs;
-
-#if (NGX_DEBUG)
- {
- u_char text[NGX_SOCKADDR_STRLEN];
- ngx_str_t addr;
- ngx_uint_t i;
-
- addr.data = text;
-
- for (i = 0; i < ctx->naddrs; i++) {
- addr.len = ngx_sock_ntop(ur->addrs[i].sockaddr, ur->addrs[i].socklen,
- text, NGX_SOCKADDR_STRLEN, 0);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "name was resolved to %V", &addr);
- }
- }
-#endif
-
- if (ngx_http_upstream_create_round_robin_peer(r, ur) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- goto failed;
- }
-
- ngx_resolve_name_done(ctx);
- ur->ctx = NULL;
-
- ngx_http_upstream_connect(r, u);
-
-failed:
-
- ngx_http_run_posted_requests(c);
-}
-
-
-static void
-ngx_http_upstream_handler(ngx_event_t *ev)
-{
- ngx_connection_t *c;
- ngx_http_request_t *r;
- ngx_http_log_ctx_t *ctx;
- ngx_http_upstream_t *u;
-
- c = ev->data;
- r = c->data;
-
- u = r->upstream;
- c = r->connection;
-
- ctx = c->log->data;
- ctx->current_request = r;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream request: \"%V?%V\"", &r->uri, &r->args);
-
- if (ev->write) {
- u->write_event_handler(r, u);
-
- } else {
- u->read_event_handler(r, u);
- }
-
- ngx_http_run_posted_requests(c);
-}
-
-
-static void
-ngx_http_upstream_rd_check_broken_connection(ngx_http_request_t *r)
-{
- ngx_http_upstream_check_broken_connection(r, r->connection->read);
-}
-
-
-static void
-ngx_http_upstream_wr_check_broken_connection(ngx_http_request_t *r)
-{
- ngx_http_upstream_check_broken_connection(r, r->connection->write);
-}
-
-
-static void
-ngx_http_upstream_check_broken_connection(ngx_http_request_t *r,
- ngx_event_t *ev)
-{
- int n;
- char buf[1];
- ngx_err_t err;
- ngx_int_t event;
- ngx_connection_t *c;
- ngx_http_upstream_t *u;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, ev->log, 0,
- "http upstream check client, write event:%d, \"%V\"",
- ev->write, &r->uri);
-
- c = r->connection;
- u = r->upstream;
-
- if (c->error) {
- if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) && ev->active) {
-
- event = ev->write ? NGX_WRITE_EVENT : NGX_READ_EVENT;
-
- if (ngx_del_event(ev, event, 0) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
- }
-
- if (!u->cacheable) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_CLIENT_CLOSED_REQUEST);
- }
-
- return;
- }
-
-#if (NGX_HTTP_SPDY)
- if (r->spdy_stream) {
- return;
- }
-#endif
-
-#if (NGX_HAVE_KQUEUE)
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
-
- if (!ev->pending_eof) {
- return;
- }
-
- ev->eof = 1;
- c->error = 1;
-
- if (ev->kq_errno) {
- ev->error = 1;
- }
-
- if (!u->cacheable && u->peer.connection) {
- ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno,
- "kevent() reported that client prematurely closed "
- "connection, so upstream connection is closed too");
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_CLIENT_CLOSED_REQUEST);
- return;
- }
-
- ngx_log_error(NGX_LOG_INFO, ev->log, ev->kq_errno,
- "kevent() reported that client prematurely closed "
- "connection");
-
- if (u->peer.connection == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_CLIENT_CLOSED_REQUEST);
- }
-
- return;
- }
-
-#endif
-
-#if (NGX_HAVE_EPOLLRDHUP)
-
- if ((ngx_event_flags & NGX_USE_EPOLL_EVENT) && ev->pending_eof) {
- socklen_t len;
-
- ev->eof = 1;
- c->error = 1;
-
- err = 0;
- len = sizeof(ngx_err_t);
-
- /*
- * BSDs and Linux return 0 and set a pending error in err
- * Solaris returns -1 and sets errno
- */
-
- if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len)
- == -1)
- {
- err = ngx_socket_errno;
- }
-
- if (err) {
- ev->error = 1;
- }
-
- if (!u->cacheable && u->peer.connection) {
- ngx_log_error(NGX_LOG_INFO, ev->log, err,
- "epoll_wait() reported that client prematurely closed "
- "connection, so upstream connection is closed too");
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_CLIENT_CLOSED_REQUEST);
- return;
- }
-
- ngx_log_error(NGX_LOG_INFO, ev->log, err,
- "epoll_wait() reported that client prematurely closed "
- "connection");
-
- if (u->peer.connection == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_CLIENT_CLOSED_REQUEST);
- }
-
- return;
- }
-
-#endif
-
- n = recv(c->fd, buf, 1, MSG_PEEK);
-
- err = ngx_socket_errno;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ev->log, err,
- "http upstream recv(): %d", n);
-
- if (ev->write && (n >= 0 || err == NGX_EAGAIN)) {
- return;
- }
-
- if ((ngx_event_flags & NGX_USE_LEVEL_EVENT) && ev->active) {
-
- event = ev->write ? NGX_WRITE_EVENT : NGX_READ_EVENT;
-
- if (ngx_del_event(ev, event, 0) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
- }
-
- if (n > 0) {
- return;
- }
-
- if (n == -1) {
- if (err == NGX_EAGAIN) {
- return;
- }
-
- ev->error = 1;
-
- } else { /* n == 0 */
- err = 0;
- }
-
- ev->eof = 1;
- c->error = 1;
-
- if (!u->cacheable && u->peer.connection) {
- ngx_log_error(NGX_LOG_INFO, ev->log, err,
- "client prematurely closed connection, "
- "so upstream connection is closed too");
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_CLIENT_CLOSED_REQUEST);
- return;
- }
-
- ngx_log_error(NGX_LOG_INFO, ev->log, err,
- "client prematurely closed connection");
-
- if (u->peer.connection == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_CLIENT_CLOSED_REQUEST);
- }
-}
-
-
-static void
-ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- ngx_int_t rc;
- ngx_time_t *tp;
- ngx_connection_t *c;
-
- r->connection->log->action = "connecting to upstream";
-
- if (u->state && u->state->response_sec) {
- tp = ngx_timeofday();
- u->state->response_sec = tp->sec - u->state->response_sec;
- u->state->response_msec = tp->msec - u->state->response_msec;
- }
-
- u->state = ngx_array_push(r->upstream_states);
- if (u->state == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- ngx_memzero(u->state, sizeof(ngx_http_upstream_state_t));
-
- tp = ngx_timeofday();
- u->state->response_sec = tp->sec;
- u->state->response_msec = tp->msec;
-
- rc = ngx_event_connect_peer(&u->peer);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http upstream connect: %i", rc);
-
- if (rc == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- u->state->peer = u->peer.name;
-
- if (rc == NGX_BUSY) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no live upstreams");
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_NOLIVE);
- return;
- }
-
- if (rc == NGX_DECLINED) {
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR);
- return;
- }
-
- /* rc == NGX_OK || rc == NGX_AGAIN || rc == NGX_DONE */
-
- c = u->peer.connection;
-
- c->data = r;
-
- c->write->handler = ngx_http_upstream_handler;
- c->read->handler = ngx_http_upstream_handler;
-
- u->write_event_handler = ngx_http_upstream_send_request_handler;
- u->read_event_handler = ngx_http_upstream_process_header;
-
- c->sendfile &= r->connection->sendfile;
- u->output.sendfile = c->sendfile;
-
- if (c->pool == NULL) {
-
- /* we need separate pool here to be able to cache SSL connections */
-
- c->pool = ngx_create_pool(128, r->connection->log);
- if (c->pool == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
- }
-
- c->log = r->connection->log;
- c->pool->log = c->log;
- c->read->log = c->log;
- c->write->log = c->log;
-
- /* init or reinit the ngx_output_chain() and ngx_chain_writer() contexts */
-
- u->writer.out = NULL;
- u->writer.last = &u->writer.out;
- u->writer.connection = c;
- u->writer.limit = 0;
-
- if (u->request_sent) {
- if (ngx_http_upstream_reinit(r, u) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
- }
-
- if (r->request_body
- && r->request_body->buf
- && r->request_body->temp_file
- && r == r->main)
- {
- /*
- * the r->request_body->buf can be reused for one request only,
- * the subrequests should allocate their own temporary bufs
- */
-
- u->output.free = ngx_alloc_chain_link(r->pool);
- if (u->output.free == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- u->output.free->buf = r->request_body->buf;
- u->output.free->next = NULL;
- u->output.allocated = 1;
-
- r->request_body->buf->pos = r->request_body->buf->start;
- r->request_body->buf->last = r->request_body->buf->start;
- r->request_body->buf->tag = u->output.tag;
- }
-
- u->request_sent = 0;
-
- if (rc == NGX_AGAIN) {
- ngx_add_timer(c->write, u->conf->connect_timeout);
- return;
- }
-
-#if (NGX_HTTP_SSL)
-
- if (u->ssl && c->ssl == NULL) {
- ngx_http_upstream_ssl_init_connection(r, u, c);
- return;
- }
-
-#endif
-
- ngx_http_upstream_send_request(r, u);
-}
-
-
-#if (NGX_HTTP_SSL)
-
-static void
-ngx_http_upstream_ssl_init_connection(ngx_http_request_t *r,
- ngx_http_upstream_t *u, ngx_connection_t *c)
-{
- ngx_int_t rc;
-
- if (ngx_http_upstream_test_connect(c) != NGX_OK) {
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR);
- return;
- }
-
- if (ngx_ssl_create_connection(u->conf->ssl, c,
- NGX_SSL_BUFFER|NGX_SSL_CLIENT)
- != NGX_OK)
- {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- c->sendfile = 0;
- u->output.sendfile = 0;
-
- if (u->conf->ssl_server_name || u->conf->ssl_verify) {
- if (ngx_http_upstream_ssl_name(r, u, c) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
- }
-
- if (u->conf->ssl_session_reuse) {
- if (u->peer.set_session(&u->peer, u->peer.data) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
- }
-
- r->connection->log->action = "SSL handshaking to upstream";
-
- rc = ngx_ssl_handshake(c);
-
- if (rc == NGX_AGAIN) {
-
- if (!c->write->timer_set) {
- ngx_add_timer(c->write, u->conf->connect_timeout);
- }
-
- c->ssl->handler = ngx_http_upstream_ssl_handshake;
- return;
- }
-
- ngx_http_upstream_ssl_handshake(c);
-}
-
-
-static void
-ngx_http_upstream_ssl_handshake(ngx_connection_t *c)
-{
- long rc;
- ngx_http_request_t *r;
- ngx_http_upstream_t *u;
-
- r = c->data;
- u = r->upstream;
-
- if (c->ssl->handshaked) {
-
- if (u->conf->ssl_verify) {
- rc = SSL_get_verify_result(c->ssl->connection);
-
- if (rc != X509_V_OK) {
- ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "upstream SSL certificate verify error: (%l:%s)",
- rc, X509_verify_cert_error_string(rc));
- goto failed;
- }
-
- if (ngx_ssl_check_host(c, &u->ssl_name) != NGX_OK) {
- ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "upstream SSL certificate does not match \"%V\"",
- &u->ssl_name);
- goto failed;
- }
- }
-
- if (u->conf->ssl_session_reuse) {
- u->peer.save_session(&u->peer, u->peer.data);
- }
-
- c->write->handler = ngx_http_upstream_handler;
- c->read->handler = ngx_http_upstream_handler;
-
- c = r->connection;
-
- ngx_http_upstream_send_request(r, u);
-
- ngx_http_run_posted_requests(c);
- return;
- }
-
-failed:
-
- c = r->connection;
-
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR);
-
- ngx_http_run_posted_requests(c);
-}
-
-
-static ngx_int_t
-ngx_http_upstream_ssl_name(ngx_http_request_t *r, ngx_http_upstream_t *u,
- ngx_connection_t *c)
-{
- u_char *p, *last;
- ngx_str_t name;
-
- if (u->conf->ssl_name) {
- if (ngx_http_complex_value(r, u->conf->ssl_name, &name) != NGX_OK) {
- return NGX_ERROR;
- }
-
- } else {
- name = u->ssl_name;
- }
-
- if (name.len == 0) {
- goto done;
- }
-
- /*
- * ssl name here may contain port, notably if derived from $proxy_host
- * or $http_host; we have to strip it
- */
-
- p = name.data;
- last = name.data + name.len;
-
- if (*p == '[') {
- p = ngx_strlchr(p, last, ']');
-
- if (p == NULL) {
- p = name.data;
- }
- }
-
- p = ngx_strlchr(p, last, ':');
-
- if (p != NULL) {
- name.len = p - name.data;
- }
-
- if (!u->conf->ssl_server_name) {
- goto done;
- }
-
-#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
-
- /* as per RFC 6066, literal IPv4 and IPv6 addresses are not permitted */
-
- if (name.len == 0 || *name.data == '[') {
- goto done;
- }
-
- if (ngx_inet_addr(name.data, name.len) != INADDR_NONE) {
- goto done;
- }
-
- /*
- * SSL_set_tlsext_host_name() needs a null-terminated string,
- * hence we explicitly null-terminate name here
- */
-
- p = ngx_pnalloc(r->pool, name.len + 1);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- (void) ngx_cpystrn(p, name.data, name.len + 1);
-
- name.data = p;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "upstream SSL server name: \"%s\"", name.data);
-
- if (SSL_set_tlsext_host_name(c->ssl->connection, name.data) == 0) {
- ngx_ssl_error(NGX_LOG_ERR, r->connection->log, 0,
- "SSL_set_tlsext_host_name(\"%s\") failed", name.data);
- return NGX_ERROR;
- }
-
-#endif
-
-done:
-
- u->ssl_name = name;
-
- return NGX_OK;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_upstream_reinit(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- off_t file_pos;
- ngx_chain_t *cl;
-
- if (u->reinit_request(r) != NGX_OK) {
- return NGX_ERROR;
- }
-
- u->keepalive = 0;
- u->upgrade = 0;
-
- ngx_memzero(&u->headers_in, sizeof(ngx_http_upstream_headers_in_t));
- u->headers_in.content_length_n = -1;
-
- if (ngx_list_init(&u->headers_in.headers, r->pool, 8,
- sizeof(ngx_table_elt_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- /* reinit the request chain */
-
- file_pos = 0;
-
- for (cl = u->request_bufs; cl; cl = cl->next) {
- cl->buf->pos = cl->buf->start;
-
- /* there is at most one file */
-
- if (cl->buf->in_file) {
- cl->buf->file_pos = file_pos;
- file_pos = cl->buf->file_last;
- }
- }
-
- /* reinit the subrequest's ngx_output_chain() context */
-
- if (r->request_body && r->request_body->temp_file
- && r != r->main && u->output.buf)
- {
- u->output.free = ngx_alloc_chain_link(r->pool);
- if (u->output.free == NULL) {
- return NGX_ERROR;
- }
-
- u->output.free->buf = u->output.buf;
- u->output.free->next = NULL;
-
- u->output.buf->pos = u->output.buf->start;
- u->output.buf->last = u->output.buf->start;
- }
-
- u->output.buf = NULL;
- u->output.in = NULL;
- u->output.busy = NULL;
-
- /* reinit u->buffer */
-
- u->buffer.pos = u->buffer.start;
-
-#if (NGX_HTTP_CACHE)
-
- if (r->cache) {
- u->buffer.pos += r->cache->header_start;
- }
-
-#endif
-
- u->buffer.last = u->buffer.pos;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- ngx_int_t rc;
- ngx_connection_t *c;
-
- c = u->peer.connection;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream send request");
-
- if (!u->request_sent && ngx_http_upstream_test_connect(c) != NGX_OK) {
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR);
- return;
- }
-
- c->log->action = "sending request to upstream";
-
- rc = ngx_output_chain(&u->output, u->request_sent ? NULL : u->request_bufs);
-
- u->request_sent = 1;
-
- if (rc == NGX_ERROR) {
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR);
- return;
- }
-
- if (c->write->timer_set) {
- ngx_del_timer(c->write);
- }
-
- if (rc == NGX_AGAIN) {
- ngx_add_timer(c->write, u->conf->send_timeout);
-
- if (ngx_handle_write_event(c->write, u->conf->send_lowat) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- return;
- }
-
- /* rc == NGX_OK */
-
- if (c->tcp_nopush == NGX_TCP_NOPUSH_SET) {
- if (ngx_tcp_push(c->fd) == NGX_ERROR) {
- ngx_log_error(NGX_LOG_CRIT, c->log, ngx_socket_errno,
- ngx_tcp_push_n " failed");
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- c->tcp_nopush = NGX_TCP_NOPUSH_UNSET;
- }
-
- u->write_event_handler = ngx_http_upstream_dummy_handler;
-
- if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- ngx_add_timer(c->read, u->conf->read_timeout);
-
- if (c->read->ready) {
- ngx_http_upstream_process_header(r, u);
- return;
- }
-}
-
-
-static void
-ngx_http_upstream_send_request_handler(ngx_http_request_t *r,
- ngx_http_upstream_t *u)
-{
- ngx_connection_t *c;
-
- c = u->peer.connection;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http upstream send request handler");
-
- if (c->write->timedout) {
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_TIMEOUT);
- return;
- }
-
-#if (NGX_HTTP_SSL)
-
- if (u->ssl && c->ssl == NULL) {
- ngx_http_upstream_ssl_init_connection(r, u, c);
- return;
- }
-
-#endif
-
- if (u->header_sent) {
- u->write_event_handler = ngx_http_upstream_dummy_handler;
-
- (void) ngx_handle_write_event(c->write, 0);
-
- return;
- }
-
- ngx_http_upstream_send_request(r, u);
-}
-
-
-static void
-ngx_http_upstream_process_header(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- ssize_t n;
- ngx_int_t rc;
- ngx_connection_t *c;
-
- c = u->peer.connection;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream process header");
-
- c->log->action = "reading response header from upstream";
-
- if (c->read->timedout) {
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_TIMEOUT);
- return;
- }
-
- if (!u->request_sent && ngx_http_upstream_test_connect(c) != NGX_OK) {
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR);
- return;
- }
-
- if (u->buffer.start == NULL) {
- u->buffer.start = ngx_palloc(r->pool, u->conf->buffer_size);
- if (u->buffer.start == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- u->buffer.pos = u->buffer.start;
- u->buffer.last = u->buffer.start;
- u->buffer.end = u->buffer.start + u->conf->buffer_size;
- u->buffer.temporary = 1;
-
- u->buffer.tag = u->output.tag;
-
- if (ngx_list_init(&u->headers_in.headers, r->pool, 8,
- sizeof(ngx_table_elt_t))
- != NGX_OK)
- {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (r->cache) {
- u->buffer.pos += r->cache->header_start;
- u->buffer.last = u->buffer.pos;
- }
-#endif
- }
-
- for ( ;; ) {
-
- n = c->recv(c, u->buffer.last, u->buffer.end - u->buffer.last);
-
- if (n == NGX_AGAIN) {
-#if 0
- ngx_add_timer(rev, u->read_timeout);
-#endif
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- return;
- }
-
- if (n == 0) {
- ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "upstream prematurely closed connection");
- }
-
- if (n == NGX_ERROR || n == 0) {
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_ERROR);
- return;
- }
-
- u->buffer.last += n;
-
-#if 0
- u->valid_header_in = 0;
-
- u->peer.cached = 0;
-#endif
-
- rc = u->process_header(r);
-
- if (rc == NGX_AGAIN) {
-
- if (u->buffer.last == u->buffer.end) {
- ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "upstream sent too big header");
-
- ngx_http_upstream_next(r, u,
- NGX_HTTP_UPSTREAM_FT_INVALID_HEADER);
- return;
- }
-
- continue;
- }
-
- break;
- }
-
- if (rc == NGX_HTTP_UPSTREAM_INVALID_HEADER) {
- ngx_http_upstream_next(r, u, NGX_HTTP_UPSTREAM_FT_INVALID_HEADER);
- return;
- }
-
- if (rc == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return;
- }
-
- /* rc == NGX_OK */
-
- if (u->headers_in.status_n >= NGX_HTTP_SPECIAL_RESPONSE) {
-
- if (ngx_http_upstream_test_next(r, u) == NGX_OK) {
- return;
- }
-
- if (ngx_http_upstream_intercept_errors(r, u) == NGX_OK) {
- return;
- }
- }
-
- if (ngx_http_upstream_process_headers(r, u) != NGX_OK) {
- return;
- }
-
- if (!r->subrequest_in_memory) {
- ngx_http_upstream_send_response(r, u);
- return;
- }
-
- /* subrequest content in memory */
-
- if (u->input_filter == NULL) {
- u->input_filter_init = ngx_http_upstream_non_buffered_filter_init;
- u->input_filter = ngx_http_upstream_non_buffered_filter;
- u->input_filter_ctx = r;
- }
-
- if (u->input_filter_init(u->input_filter_ctx) == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- n = u->buffer.last - u->buffer.pos;
-
- if (n) {
- u->buffer.last = u->buffer.pos;
-
- u->state->response_length += n;
-
- if (u->input_filter(u->input_filter_ctx, n) == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
- }
-
- if (u->length == 0) {
- ngx_http_upstream_finalize_request(r, u, 0);
- return;
- }
-
- u->read_event_handler = ngx_http_upstream_process_body_in_memory;
-
- ngx_http_upstream_process_body_in_memory(r, u);
-}
-
-
-static ngx_int_t
-ngx_http_upstream_test_next(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- ngx_uint_t status;
- ngx_http_upstream_next_t *un;
-
- status = u->headers_in.status_n;
-
- for (un = ngx_http_upstream_next_errors; un->status; un++) {
-
- if (status != un->status) {
- continue;
- }
-
- if (u->peer.tries > 1 && (u->conf->next_upstream & un->mask)) {
- ngx_http_upstream_next(r, u, un->mask);
- return NGX_OK;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (u->cache_status == NGX_HTTP_CACHE_EXPIRED
- && (u->conf->cache_use_stale & un->mask))
- {
- ngx_int_t rc;
-
- rc = u->reinit_request(r);
-
- if (rc == NGX_OK) {
- u->cache_status = NGX_HTTP_CACHE_STALE;
- rc = ngx_http_upstream_cache_send(r, u);
- }
-
- ngx_http_upstream_finalize_request(r, u, rc);
- return NGX_OK;
- }
-
-#endif
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (status == NGX_HTTP_NOT_MODIFIED
- && u->cache_status == NGX_HTTP_CACHE_EXPIRED
- && u->conf->cache_revalidate)
- {
- time_t now, valid;
- ngx_int_t rc;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http upstream not modified");
-
- now = ngx_time();
- valid = r->cache->valid_sec;
-
- rc = u->reinit_request(r);
-
- if (rc != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u, rc);
- return NGX_OK;
- }
-
- u->cache_status = NGX_HTTP_CACHE_REVALIDATED;
- rc = ngx_http_upstream_cache_send(r, u);
-
- if (valid == 0) {
- valid = r->cache->valid_sec;
- }
-
- if (valid == 0) {
- valid = ngx_http_file_cache_valid(u->conf->cache_valid,
- u->headers_in.status_n);
- if (valid) {
- valid = now + valid;
- }
- }
-
- if (valid) {
- r->cache->valid_sec = valid;
- r->cache->date = now;
-
- ngx_http_file_cache_update_header(r);
- }
-
- ngx_http_upstream_finalize_request(r, u, rc);
- return NGX_OK;
- }
-
-#endif
-
- return NGX_DECLINED;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_intercept_errors(ngx_http_request_t *r,
- ngx_http_upstream_t *u)
-{
- ngx_int_t status;
- ngx_uint_t i;
- ngx_table_elt_t *h;
- ngx_http_err_page_t *err_page;
- ngx_http_core_loc_conf_t *clcf;
-
- status = u->headers_in.status_n;
-
- if (status == NGX_HTTP_NOT_FOUND && u->conf->intercept_404) {
- ngx_http_upstream_finalize_request(r, u, NGX_HTTP_NOT_FOUND);
- return NGX_OK;
- }
-
- if (!u->conf->intercept_errors) {
- return NGX_DECLINED;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->error_pages == NULL) {
- return NGX_DECLINED;
- }
-
- err_page = clcf->error_pages->elts;
- for (i = 0; i < clcf->error_pages->nelts; i++) {
-
- if (err_page[i].status == status) {
-
- if (status == NGX_HTTP_UNAUTHORIZED
- && u->headers_in.www_authenticate)
- {
- h = ngx_list_push(&r->headers_out.headers);
-
- if (h == NULL) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_OK;
- }
-
- *h = *u->headers_in.www_authenticate;
-
- r->headers_out.www_authenticate = h;
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (r->cache) {
- time_t valid;
-
- valid = ngx_http_file_cache_valid(u->conf->cache_valid, status);
-
- if (valid) {
- r->cache->valid_sec = ngx_time() + valid;
- r->cache->error = status;
- }
-
- ngx_http_file_cache_free(r->cache, u->pipe->temp_file);
- }
-#endif
- ngx_http_upstream_finalize_request(r, u, status);
-
- return NGX_OK;
- }
- }
-
- return NGX_DECLINED;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_test_connect(ngx_connection_t *c)
-{
- int err;
- socklen_t len;
-
-#if (NGX_HAVE_KQUEUE)
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- if (c->write->pending_eof || c->read->pending_eof) {
- if (c->write->pending_eof) {
- err = c->write->kq_errno;
-
- } else {
- err = c->read->kq_errno;
- }
-
- c->log->action = "connecting to upstream";
- (void) ngx_connection_error(c, err,
- "kevent() reported that connect() failed");
- return NGX_ERROR;
- }
-
- } else
-#endif
- {
- err = 0;
- len = sizeof(int);
-
- /*
- * BSDs and Linux return 0 and set a pending error in err
- * Solaris returns -1 and sets errno
- */
-
- if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len)
- == -1)
- {
- err = ngx_socket_errno;
- }
-
- if (err) {
- c->log->action = "connecting to upstream";
- (void) ngx_connection_error(c, err, "connect() failed");
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_headers(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- ngx_str_t uri, args;
- ngx_uint_t i, flags;
- ngx_list_part_t *part;
- ngx_table_elt_t *h;
- ngx_http_upstream_header_t *hh;
- ngx_http_upstream_main_conf_t *umcf;
-
- umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
-
- if (u->headers_in.x_accel_redirect
- && !(u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_XA_REDIRECT))
- {
- ngx_http_upstream_finalize_request(r, u, NGX_DECLINED);
-
- part = &u->headers_in.headers.part;
- h = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- h = part->elts;
- i = 0;
- }
-
- hh = ngx_hash_find(&umcf->headers_in_hash, h[i].hash,
- h[i].lowcase_key, h[i].key.len);
-
- if (hh && hh->redirect) {
- if (hh->copy_handler(r, &h[i], hh->conf) != NGX_OK) {
- ngx_http_finalize_request(r,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_DONE;
- }
- }
- }
-
- uri = u->headers_in.x_accel_redirect->value;
- ngx_str_null(&args);
- flags = NGX_HTTP_LOG_UNSAFE;
-
- if (ngx_http_parse_unsafe_uri(r, &uri, &args, &flags) != NGX_OK) {
- ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
- return NGX_DONE;
- }
-
- if (r->method != NGX_HTTP_HEAD) {
- r->method = NGX_HTTP_GET;
- }
-
- ngx_http_internal_redirect(r, &uri, &args);
- ngx_http_finalize_request(r, NGX_DONE);
- return NGX_DONE;
- }
-
- part = &u->headers_in.headers.part;
- h = part->elts;
-
- for (i = 0; /* void */; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- h = part->elts;
- i = 0;
- }
-
- if (ngx_hash_find(&u->conf->hide_headers_hash, h[i].hash,
- h[i].lowcase_key, h[i].key.len))
- {
- continue;
- }
-
- hh = ngx_hash_find(&umcf->headers_in_hash, h[i].hash,
- h[i].lowcase_key, h[i].key.len);
-
- if (hh) {
- if (hh->copy_handler(r, &h[i], hh->conf) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_DONE;
- }
-
- continue;
- }
-
- if (ngx_http_upstream_copy_header_line(r, &h[i], 0) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_INTERNAL_SERVER_ERROR);
- return NGX_DONE;
- }
- }
-
- if (r->headers_out.server && r->headers_out.server->value.data == NULL) {
- r->headers_out.server->hash = 0;
- }
-
- if (r->headers_out.date && r->headers_out.date->value.data == NULL) {
- r->headers_out.date->hash = 0;
- }
-
- r->headers_out.status = u->headers_in.status_n;
- r->headers_out.status_line = u->headers_in.status_line;
-
- r->headers_out.content_length_n = u->headers_in.content_length_n;
-
- r->disable_not_modified = !u->cacheable;
-
- u->length = -1;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_upstream_process_body_in_memory(ngx_http_request_t *r,
- ngx_http_upstream_t *u)
-{
- size_t size;
- ssize_t n;
- ngx_buf_t *b;
- ngx_event_t *rev;
- ngx_connection_t *c;
-
- c = u->peer.connection;
- rev = c->read;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream process body on memory");
-
- if (rev->timedout) {
- ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
- ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT);
- return;
- }
-
- b = &u->buffer;
-
- for ( ;; ) {
-
- size = b->end - b->last;
-
- if (size == 0) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "upstream buffer is too small to read response");
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- n = c->recv(c, b->last, size);
-
- if (n == NGX_AGAIN) {
- break;
- }
-
- if (n == 0 || n == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, n);
- return;
- }
-
- u->state->response_length += n;
-
- if (u->input_filter(u->input_filter_ctx, n) == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (!rev->ready) {
- break;
- }
- }
-
- if (u->length == 0) {
- ngx_http_upstream_finalize_request(r, u, 0);
- return;
- }
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (rev->active) {
- ngx_add_timer(rev, u->conf->read_timeout);
-
- } else if (rev->timer_set) {
- ngx_del_timer(rev);
- }
-}
-
-
-static void
-ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- int tcp_nodelay;
- ssize_t n;
- ngx_int_t rc;
- ngx_event_pipe_t *p;
- ngx_connection_t *c;
- ngx_http_core_loc_conf_t *clcf;
-
- rc = ngx_http_send_header(r);
-
- if (rc == NGX_ERROR || rc > NGX_OK || r->post_action) {
- ngx_http_upstream_finalize_request(r, u, rc);
- return;
- }
-
- u->header_sent = 1;
-
- if (u->upgrade) {
- ngx_http_upstream_upgrade(r, u);
- return;
- }
-
- c = r->connection;
-
- if (r->header_only) {
-
- if (!u->buffering) {
- ngx_http_upstream_finalize_request(r, u, rc);
- return;
- }
-
- if (!u->cacheable && !u->store) {
- ngx_http_upstream_finalize_request(r, u, rc);
- return;
- }
-
- u->pipe->downstream_error = 1;
- }
-
- if (r->request_body && r->request_body->temp_file) {
- ngx_pool_run_cleanup_file(r->pool, r->request_body->temp_file->file.fd);
- r->request_body->temp_file->file.fd = NGX_INVALID_FILE;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (!u->buffering) {
-
- if (u->input_filter == NULL) {
- u->input_filter_init = ngx_http_upstream_non_buffered_filter_init;
- u->input_filter = ngx_http_upstream_non_buffered_filter;
- u->input_filter_ctx = r;
- }
-
- u->read_event_handler = ngx_http_upstream_process_non_buffered_upstream;
- r->write_event_handler =
- ngx_http_upstream_process_non_buffered_downstream;
-
- r->limit_rate = 0;
-
- if (u->input_filter_init(u->input_filter_ctx) == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (clcf->tcp_nodelay && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay");
-
- tcp_nodelay = 1;
-
- if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
- (const void *) &tcp_nodelay, sizeof(int)) == -1)
- {
- ngx_connection_error(c, ngx_socket_errno,
- "setsockopt(TCP_NODELAY) failed");
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- c->tcp_nodelay = NGX_TCP_NODELAY_SET;
- }
-
- n = u->buffer.last - u->buffer.pos;
-
- if (n) {
- u->buffer.last = u->buffer.pos;
-
- u->state->response_length += n;
-
- if (u->input_filter(u->input_filter_ctx, n) == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- ngx_http_upstream_process_non_buffered_downstream(r);
-
- } else {
- u->buffer.pos = u->buffer.start;
- u->buffer.last = u->buffer.start;
-
- if (ngx_http_send_special(r, NGX_HTTP_FLUSH) == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (u->peer.connection->read->ready || u->length == 0) {
- ngx_http_upstream_process_non_buffered_upstream(r, u);
- }
- }
-
- return;
- }
-
- /* TODO: preallocate event_pipe bufs, look "Content-Length" */
-
-#if (NGX_HTTP_CACHE)
-
- if (r->cache && r->cache->file.fd != NGX_INVALID_FILE) {
- ngx_pool_run_cleanup_file(r->pool, r->cache->file.fd);
- r->cache->file.fd = NGX_INVALID_FILE;
- }
-
- switch (ngx_http_test_predicates(r, u->conf->no_cache)) {
-
- case NGX_ERROR:
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
-
- case NGX_DECLINED:
- u->cacheable = 0;
- break;
-
- default: /* NGX_OK */
-
- if (u->cache_status == NGX_HTTP_CACHE_BYPASS) {
-
- r->cache->min_uses = u->conf->cache_min_uses;
- r->cache->body_start = u->conf->buffer_size;
- r->cache->file_cache = u->conf->cache->data;
-
- if (ngx_http_file_cache_create(r) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
- }
-
- break;
- }
-
- if (u->cacheable) {
- time_t now, valid;
-
- now = ngx_time();
-
- valid = r->cache->valid_sec;
-
- if (valid == 0) {
- valid = ngx_http_file_cache_valid(u->conf->cache_valid,
- u->headers_in.status_n);
- if (valid) {
- r->cache->valid_sec = now + valid;
- }
- }
-
- if (valid) {
- r->cache->last_modified = u->headers_in.last_modified_time;
- r->cache->date = now;
- r->cache->body_start = (u_short) (u->buffer.pos - u->buffer.start);
-
- if (u->headers_in.etag) {
- r->cache->etag = u->headers_in.etag->value;
- }
-
- ngx_http_file_cache_set_header(r, u->buffer.start);
-
- } else {
- u->cacheable = 0;
- }
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http cacheable: %d", u->cacheable);
-
- if (u->cacheable == 0 && r->cache) {
- ngx_http_file_cache_free(r->cache, u->pipe->temp_file);
- }
-
-#endif
-
- p = u->pipe;
-
- p->output_filter = (ngx_event_pipe_output_filter_pt) ngx_http_output_filter;
- p->output_ctx = r;
- p->tag = u->output.tag;
- p->bufs = u->conf->bufs;
- p->busy_size = u->conf->busy_buffers_size;
- p->upstream = u->peer.connection;
- p->downstream = c;
- p->pool = r->pool;
- p->log = c->log;
-
- p->cacheable = u->cacheable || u->store;
-
- p->temp_file = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t));
- if (p->temp_file == NULL) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- p->temp_file->file.fd = NGX_INVALID_FILE;
- p->temp_file->file.log = c->log;
- p->temp_file->path = u->conf->temp_path;
- p->temp_file->pool = r->pool;
-
- if (p->cacheable) {
- p->temp_file->persistent = 1;
-
- } else {
- p->temp_file->log_level = NGX_LOG_WARN;
- p->temp_file->warn = "an upstream response is buffered "
- "to a temporary file";
- }
-
- p->max_temp_file_size = u->conf->max_temp_file_size;
- p->temp_file_write_size = u->conf->temp_file_write_size;
-
- p->preread_bufs = ngx_alloc_chain_link(r->pool);
- if (p->preread_bufs == NULL) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- p->preread_bufs->buf = &u->buffer;
- p->preread_bufs->next = NULL;
- u->buffer.recycled = 1;
-
- p->preread_size = u->buffer.last - u->buffer.pos;
-
- if (u->cacheable) {
-
- p->buf_to_file = ngx_calloc_buf(r->pool);
- if (p->buf_to_file == NULL) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- p->buf_to_file->start = u->buffer.start;
- p->buf_to_file->pos = u->buffer.start;
- p->buf_to_file->last = u->buffer.pos;
- p->buf_to_file->temporary = 1;
- }
-
- if (ngx_event_flags & NGX_USE_AIO_EVENT) {
- /* the posted aio operation may corrupt a shadow buffer */
- p->single_buf = 1;
- }
-
- /* TODO: p->free_bufs = 0 if use ngx_create_chain_of_bufs() */
- p->free_bufs = 1;
-
- /*
- * event_pipe would do u->buffer.last += p->preread_size
- * as though these bytes were read
- */
- u->buffer.last = u->buffer.pos;
-
- if (u->conf->cyclic_temp_file) {
-
- /*
- * we need to disable the use of sendfile() if we use cyclic temp file
- * because the writing a new data may interfere with sendfile()
- * that uses the same kernel file pages (at least on FreeBSD)
- */
-
- p->cyclic_temp_file = 1;
- c->sendfile = 0;
-
- } else {
- p->cyclic_temp_file = 0;
- }
-
- p->read_timeout = u->conf->read_timeout;
- p->send_timeout = clcf->send_timeout;
- p->send_lowat = clcf->send_lowat;
-
- p->length = -1;
-
- if (u->input_filter_init
- && u->input_filter_init(p->input_ctx) != NGX_OK)
- {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- u->read_event_handler = ngx_http_upstream_process_upstream;
- r->write_event_handler = ngx_http_upstream_process_downstream;
-
- ngx_http_upstream_process_upstream(r, u);
-}
-
-
-static void
-ngx_http_upstream_upgrade(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- int tcp_nodelay;
- ngx_connection_t *c;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->connection;
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- /* TODO: prevent upgrade if not requested or not possible */
-
- r->keepalive = 0;
- c->log->action = "proxying upgraded connection";
-
- u->read_event_handler = ngx_http_upstream_upgraded_read_upstream;
- u->write_event_handler = ngx_http_upstream_upgraded_write_upstream;
- r->read_event_handler = ngx_http_upstream_upgraded_read_downstream;
- r->write_event_handler = ngx_http_upstream_upgraded_write_downstream;
-
- if (clcf->tcp_nodelay) {
- tcp_nodelay = 1;
-
- if (c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay");
-
- if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
- (const void *) &tcp_nodelay, sizeof(int)) == -1)
- {
- ngx_connection_error(c, ngx_socket_errno,
- "setsockopt(TCP_NODELAY) failed");
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- c->tcp_nodelay = NGX_TCP_NODELAY_SET;
- }
-
- if (u->peer.connection->tcp_nodelay == NGX_TCP_NODELAY_UNSET) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, u->peer.connection->log, 0,
- "tcp_nodelay");
-
- if (setsockopt(u->peer.connection->fd, IPPROTO_TCP, TCP_NODELAY,
- (const void *) &tcp_nodelay, sizeof(int)) == -1)
- {
- ngx_connection_error(u->peer.connection, ngx_socket_errno,
- "setsockopt(TCP_NODELAY) failed");
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- u->peer.connection->tcp_nodelay = NGX_TCP_NODELAY_SET;
- }
- }
-
- if (ngx_http_send_special(r, NGX_HTTP_FLUSH) == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (u->peer.connection->read->ready
- || u->buffer.pos != u->buffer.last)
- {
- ngx_post_event(c->read, &ngx_posted_events);
- ngx_http_upstream_process_upgraded(r, 1, 1);
- return;
- }
-
- ngx_http_upstream_process_upgraded(r, 0, 1);
-}
-
-
-static void
-ngx_http_upstream_upgraded_read_downstream(ngx_http_request_t *r)
-{
- ngx_http_upstream_process_upgraded(r, 0, 0);
-}
-
-
-static void
-ngx_http_upstream_upgraded_write_downstream(ngx_http_request_t *r)
-{
- ngx_http_upstream_process_upgraded(r, 1, 1);
-}
-
-
-static void
-ngx_http_upstream_upgraded_read_upstream(ngx_http_request_t *r,
- ngx_http_upstream_t *u)
-{
- ngx_http_upstream_process_upgraded(r, 1, 0);
-}
-
-
-static void
-ngx_http_upstream_upgraded_write_upstream(ngx_http_request_t *r,
- ngx_http_upstream_t *u)
-{
- ngx_http_upstream_process_upgraded(r, 0, 1);
-}
-
-
-static void
-ngx_http_upstream_process_upgraded(ngx_http_request_t *r,
- ngx_uint_t from_upstream, ngx_uint_t do_write)
-{
- size_t size;
- ssize_t n;
- ngx_buf_t *b;
- ngx_connection_t *c, *downstream, *upstream, *dst, *src;
- ngx_http_upstream_t *u;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->connection;
- u = r->upstream;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream process upgraded, fu:%ui", from_upstream);
-
- downstream = c;
- upstream = u->peer.connection;
-
- if (downstream->write->timedout) {
- c->timedout = 1;
- ngx_connection_error(c, NGX_ETIMEDOUT, "client timed out");
- ngx_http_upstream_finalize_request(r, u, NGX_HTTP_REQUEST_TIME_OUT);
- return;
- }
-
- if (upstream->read->timedout || upstream->write->timedout) {
- ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
- ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT);
- return;
- }
-
- if (from_upstream) {
- src = upstream;
- dst = downstream;
- b = &u->buffer;
-
- } else {
- src = downstream;
- dst = upstream;
- b = &u->from_client;
-
- if (r->header_in->last > r->header_in->pos) {
- b = r->header_in;
- b->end = b->last;
- do_write = 1;
- }
-
- if (b->start == NULL) {
- b->start = ngx_palloc(r->pool, u->conf->buffer_size);
- if (b->start == NULL) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- b->pos = b->start;
- b->last = b->start;
- b->end = b->start + u->conf->buffer_size;
- b->temporary = 1;
- b->tag = u->output.tag;
- }
- }
-
- for ( ;; ) {
-
- if (do_write) {
-
- size = b->last - b->pos;
-
- if (size && dst->write->ready) {
-
- n = dst->send(dst, b->pos, size);
-
- if (n == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (n > 0) {
- b->pos += n;
-
- if (b->pos == b->last) {
- b->pos = b->start;
- b->last = b->start;
- }
- }
- }
- }
-
- size = b->end - b->last;
-
- if (size && src->read->ready) {
-
- n = src->recv(src, b->last, size);
-
- if (n == NGX_AGAIN || n == 0) {
- break;
- }
-
- if (n > 0) {
- do_write = 1;
- b->last += n;
-
- continue;
- }
-
- if (n == NGX_ERROR) {
- src->read->eof = 1;
- }
- }
-
- break;
- }
-
- if ((upstream->read->eof && u->buffer.pos == u->buffer.last)
- || (downstream->read->eof && u->from_client.pos == u->from_client.last)
- || (downstream->read->eof && upstream->read->eof))
- {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream upgraded done");
- ngx_http_upstream_finalize_request(r, u, 0);
- return;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (ngx_handle_write_event(upstream->write, u->conf->send_lowat)
- != NGX_OK)
- {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (upstream->write->active && !upstream->write->ready) {
- ngx_add_timer(upstream->write, u->conf->send_timeout);
-
- } else if (upstream->write->timer_set) {
- ngx_del_timer(upstream->write);
- }
-
- if (ngx_handle_read_event(upstream->read, 0) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (upstream->read->active && !upstream->read->ready) {
- ngx_add_timer(upstream->read, u->conf->read_timeout);
-
- } else if (upstream->read->timer_set) {
- ngx_del_timer(upstream->read);
- }
-
- if (ngx_handle_write_event(downstream->write, clcf->send_lowat)
- != NGX_OK)
- {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (ngx_handle_read_event(downstream->read, 0) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (downstream->write->active && !downstream->write->ready) {
- ngx_add_timer(downstream->write, clcf->send_timeout);
-
- } else if (downstream->write->timer_set) {
- ngx_del_timer(downstream->write);
- }
-}
-
-
-static void
-ngx_http_upstream_process_non_buffered_downstream(ngx_http_request_t *r)
-{
- ngx_event_t *wev;
- ngx_connection_t *c;
- ngx_http_upstream_t *u;
-
- c = r->connection;
- u = r->upstream;
- wev = c->write;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream process non buffered downstream");
-
- c->log->action = "sending to client";
-
- if (wev->timedout) {
- c->timedout = 1;
- ngx_connection_error(c, NGX_ETIMEDOUT, "client timed out");
- ngx_http_upstream_finalize_request(r, u, NGX_HTTP_REQUEST_TIME_OUT);
- return;
- }
-
- ngx_http_upstream_process_non_buffered_request(r, 1);
-}
-
-
-static void
-ngx_http_upstream_process_non_buffered_upstream(ngx_http_request_t *r,
- ngx_http_upstream_t *u)
-{
- ngx_connection_t *c;
-
- c = u->peer.connection;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream process non buffered upstream");
-
- c->log->action = "reading upstream";
-
- if (c->read->timedout) {
- ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
- ngx_http_upstream_finalize_request(r, u, NGX_HTTP_GATEWAY_TIME_OUT);
- return;
- }
-
- ngx_http_upstream_process_non_buffered_request(r, 0);
-}
-
-
-static void
-ngx_http_upstream_process_non_buffered_request(ngx_http_request_t *r,
- ngx_uint_t do_write)
-{
- size_t size;
- ssize_t n;
- ngx_buf_t *b;
- ngx_int_t rc;
- ngx_connection_t *downstream, *upstream;
- ngx_http_upstream_t *u;
- ngx_http_core_loc_conf_t *clcf;
-
- u = r->upstream;
- downstream = r->connection;
- upstream = u->peer.connection;
-
- b = &u->buffer;
-
- do_write = do_write || u->length == 0;
-
- for ( ;; ) {
-
- if (do_write) {
-
- if (u->out_bufs || u->busy_bufs) {
- rc = ngx_http_output_filter(r, u->out_bufs);
-
- if (rc == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- ngx_chain_update_chains(r->pool, &u->free_bufs, &u->busy_bufs,
- &u->out_bufs, u->output.tag);
- }
-
- if (u->busy_bufs == NULL) {
-
- if (u->length == 0
- || (upstream->read->eof && u->length == -1))
- {
- ngx_http_upstream_finalize_request(r, u, 0);
- return;
- }
-
- if (upstream->read->eof) {
- ngx_log_error(NGX_LOG_ERR, upstream->log, 0,
- "upstream prematurely closed connection");
-
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_BAD_GATEWAY);
- return;
- }
-
- if (upstream->read->error) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_BAD_GATEWAY);
- return;
- }
-
- b->pos = b->start;
- b->last = b->start;
- }
- }
-
- size = b->end - b->last;
-
- if (size && upstream->read->ready) {
-
- n = upstream->recv(upstream, b->last, size);
-
- if (n == NGX_AGAIN) {
- break;
- }
-
- if (n > 0) {
- u->state->response_length += n;
-
- if (u->input_filter(u->input_filter_ctx, n) == NGX_ERROR) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
- }
-
- do_write = 1;
-
- continue;
- }
-
- break;
- }
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (downstream->data == r) {
- if (ngx_handle_write_event(downstream->write, clcf->send_lowat)
- != NGX_OK)
- {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
- }
-
- if (downstream->write->active && !downstream->write->ready) {
- ngx_add_timer(downstream->write, clcf->send_timeout);
-
- } else if (downstream->write->timer_set) {
- ngx_del_timer(downstream->write);
- }
-
- if (ngx_handle_read_event(upstream->read, 0) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- if (upstream->read->active && !upstream->read->ready) {
- ngx_add_timer(upstream->read, u->conf->read_timeout);
-
- } else if (upstream->read->timer_set) {
- ngx_del_timer(upstream->read);
- }
-}
-
-
-static ngx_int_t
-ngx_http_upstream_non_buffered_filter_init(void *data)
-{
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_non_buffered_filter(void *data, ssize_t bytes)
-{
- ngx_http_request_t *r = data;
-
- ngx_buf_t *b;
- ngx_chain_t *cl, **ll;
- ngx_http_upstream_t *u;
-
- u = r->upstream;
-
- for (cl = u->out_bufs, ll = &u->out_bufs; cl; cl = cl->next) {
- ll = &cl->next;
- }
-
- cl = ngx_chain_get_free_buf(r->pool, &u->free_bufs);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- *ll = cl;
-
- cl->buf->flush = 1;
- cl->buf->memory = 1;
-
- b = &u->buffer;
-
- cl->buf->pos = b->last;
- b->last += bytes;
- cl->buf->last = b->last;
- cl->buf->tag = u->output.tag;
-
- if (u->length == -1) {
- return NGX_OK;
- }
-
- u->length -= bytes;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_upstream_process_downstream(ngx_http_request_t *r)
-{
- ngx_event_t *wev;
- ngx_connection_t *c;
- ngx_event_pipe_t *p;
- ngx_http_upstream_t *u;
-
- c = r->connection;
- u = r->upstream;
- p = u->pipe;
- wev = c->write;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream process downstream");
-
- c->log->action = "sending to client";
-
- if (wev->timedout) {
-
- if (wev->delayed) {
-
- wev->timedout = 0;
- wev->delayed = 0;
-
- if (!wev->ready) {
- ngx_add_timer(wev, p->send_timeout);
-
- if (ngx_handle_write_event(wev, p->send_lowat) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- }
-
- return;
- }
-
- if (ngx_event_pipe(p, wev->write) == NGX_ABORT) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
-
- } else {
- p->downstream_error = 1;
- c->timedout = 1;
- ngx_connection_error(c, NGX_ETIMEDOUT, "client timed out");
- }
-
- } else {
-
- if (wev->delayed) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http downstream delayed");
-
- if (ngx_handle_write_event(wev, p->send_lowat) != NGX_OK) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- }
-
- return;
- }
-
- if (ngx_event_pipe(p, 1) == NGX_ABORT) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
- }
-
- ngx_http_upstream_process_request(r);
-}
-
-
-static void
-ngx_http_upstream_process_upstream(ngx_http_request_t *r,
- ngx_http_upstream_t *u)
-{
- ngx_connection_t *c;
-
- c = u->peer.connection;
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http upstream process upstream");
-
- c->log->action = "reading upstream";
-
- if (c->read->timedout) {
- u->pipe->upstream_error = 1;
- ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
-
- } else {
- if (ngx_event_pipe(u->pipe, 0) == NGX_ABORT) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- return;
- }
- }
-
- ngx_http_upstream_process_request(r);
-}
-
-
-static void
-ngx_http_upstream_process_request(ngx_http_request_t *r)
-{
- ngx_temp_file_t *tf;
- ngx_event_pipe_t *p;
- ngx_http_upstream_t *u;
-
- u = r->upstream;
- p = u->pipe;
-
- if (u->peer.connection) {
-
- if (u->store) {
-
- if (p->upstream_eof || p->upstream_done) {
-
- tf = p->temp_file;
-
- if (u->headers_in.status_n == NGX_HTTP_OK
- && (p->upstream_done || p->length == -1)
- && (u->headers_in.content_length_n == -1
- || u->headers_in.content_length_n == tf->offset))
- {
- ngx_http_upstream_store(r, u);
- }
- }
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (u->cacheable) {
-
- if (p->upstream_done) {
- ngx_http_file_cache_update(r, p->temp_file);
-
- } else if (p->upstream_eof) {
-
- tf = p->temp_file;
-
- if (p->length == -1
- && (u->headers_in.content_length_n == -1
- || u->headers_in.content_length_n
- == tf->offset - (off_t) r->cache->body_start))
- {
- ngx_http_file_cache_update(r, tf);
-
- } else {
- ngx_http_file_cache_free(r->cache, tf);
- }
-
- } else if (p->upstream_error) {
- ngx_http_file_cache_free(r->cache, p->temp_file);
- }
- }
-
-#endif
-
- if (p->upstream_done || p->upstream_eof || p->upstream_error) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http upstream exit: %p", p->out);
-
- if (p->upstream_done
- || (p->upstream_eof && p->length == -1))
- {
- ngx_http_upstream_finalize_request(r, u, 0);
- return;
- }
-
- if (p->upstream_eof) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream prematurely closed connection");
- }
-
- ngx_http_upstream_finalize_request(r, u, NGX_HTTP_BAD_GATEWAY);
- return;
- }
- }
-
- if (p->downstream_error) {
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http upstream downstream error");
-
- if (!u->cacheable && !u->store && u->peer.connection) {
- ngx_http_upstream_finalize_request(r, u, NGX_ERROR);
- }
- }
-}
-
-
-static void
-ngx_http_upstream_store(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- size_t root;
- time_t lm;
- ngx_str_t path;
- ngx_temp_file_t *tf;
- ngx_ext_rename_file_t ext;
-
- tf = u->pipe->temp_file;
-
- if (tf->file.fd == NGX_INVALID_FILE) {
-
- /* create file for empty 200 response */
-
- tf = ngx_pcalloc(r->pool, sizeof(ngx_temp_file_t));
- if (tf == NULL) {
- return;
- }
-
- tf->file.fd = NGX_INVALID_FILE;
- tf->file.log = r->connection->log;
- tf->path = u->conf->temp_path;
- tf->pool = r->pool;
- tf->persistent = 1;
-
- if (ngx_create_temp_file(&tf->file, tf->path, tf->pool,
- tf->persistent, tf->clean, tf->access)
- != NGX_OK)
- {
- return;
- }
-
- u->pipe->temp_file = tf;
- }
-
- ext.access = u->conf->store_access;
- ext.path_access = u->conf->store_access;
- ext.time = -1;
- ext.create_path = 1;
- ext.delete_file = 1;
- ext.log = r->connection->log;
-
- if (u->headers_in.last_modified) {
-
- lm = ngx_http_parse_time(u->headers_in.last_modified->value.data,
- u->headers_in.last_modified->value.len);
-
- if (lm != NGX_ERROR) {
- ext.time = lm;
- ext.fd = tf->file.fd;
- }
- }
-
- if (u->conf->store_lengths == NULL) {
-
- if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) {
- return;
- }
-
- } else {
- if (ngx_http_script_run(r, &path, u->conf->store_lengths->elts, 0,
- u->conf->store_values->elts)
- == NULL)
- {
- return;
- }
- }
-
- path.len--;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "upstream stores \"%s\" to \"%s\"",
- tf->file.name.data, path.data);
-
- (void) ngx_ext_rename_file(&tf->file.name, &path, &ext);
-
- u->store = 0;
-}
-
-
-static void
-ngx_http_upstream_dummy_handler(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http upstream dummy handler");
-}
-
-
-static void
-ngx_http_upstream_next(ngx_http_request_t *r, ngx_http_upstream_t *u,
- ngx_uint_t ft_type)
-{
- ngx_msec_t timeout;
- ngx_uint_t status, state;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http next upstream, %xi", ft_type);
-
- if (u->peer.sockaddr) {
-
- if (ft_type == NGX_HTTP_UPSTREAM_FT_HTTP_403
- || ft_type == NGX_HTTP_UPSTREAM_FT_HTTP_404)
- {
- state = NGX_PEER_NEXT;
-
- } else {
- state = NGX_PEER_FAILED;
- }
-
- u->peer.free(&u->peer, u->peer.data, state);
- u->peer.sockaddr = NULL;
- }
-
- if (ft_type == NGX_HTTP_UPSTREAM_FT_TIMEOUT) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, NGX_ETIMEDOUT,
- "upstream timed out");
- }
-
- if (u->peer.cached && ft_type == NGX_HTTP_UPSTREAM_FT_ERROR) {
- status = 0;
-
- /* TODO: inform balancer instead */
-
- u->peer.tries++;
-
- } else {
- switch (ft_type) {
-
- case NGX_HTTP_UPSTREAM_FT_TIMEOUT:
- status = NGX_HTTP_GATEWAY_TIME_OUT;
- break;
-
- case NGX_HTTP_UPSTREAM_FT_HTTP_500:
- status = NGX_HTTP_INTERNAL_SERVER_ERROR;
- break;
-
- case NGX_HTTP_UPSTREAM_FT_HTTP_403:
- status = NGX_HTTP_FORBIDDEN;
- break;
-
- case NGX_HTTP_UPSTREAM_FT_HTTP_404:
- status = NGX_HTTP_NOT_FOUND;
- break;
-
- /*
- * NGX_HTTP_UPSTREAM_FT_BUSY_LOCK and NGX_HTTP_UPSTREAM_FT_MAX_WAITING
- * never reach here
- */
-
- default:
- status = NGX_HTTP_BAD_GATEWAY;
- }
- }
-
- if (r->connection->error) {
- ngx_http_upstream_finalize_request(r, u,
- NGX_HTTP_CLIENT_CLOSED_REQUEST);
- return;
- }
-
- if (status) {
- u->state->status = status;
- timeout = u->conf->next_upstream_timeout;
-
- if (u->peer.tries == 0
- || !(u->conf->next_upstream & ft_type)
- || (timeout && ngx_current_msec - u->peer.start_time >= timeout))
- {
-#if (NGX_HTTP_CACHE)
-
- if (u->cache_status == NGX_HTTP_CACHE_EXPIRED
- && (u->conf->cache_use_stale & ft_type))
- {
- ngx_int_t rc;
-
- rc = u->reinit_request(r);
-
- if (rc == NGX_OK) {
- u->cache_status = NGX_HTTP_CACHE_STALE;
- rc = ngx_http_upstream_cache_send(r, u);
- }
-
- ngx_http_upstream_finalize_request(r, u, rc);
- return;
- }
-#endif
-
- ngx_http_upstream_finalize_request(r, u, status);
- return;
- }
- }
-
- if (u->peer.connection) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "close http upstream connection: %d",
- u->peer.connection->fd);
-#if (NGX_HTTP_SSL)
-
- if (u->peer.connection->ssl) {
- u->peer.connection->ssl->no_wait_shutdown = 1;
- u->peer.connection->ssl->no_send_shutdown = 1;
-
- (void) ngx_ssl_shutdown(u->peer.connection);
- }
-#endif
-
- if (u->peer.connection->pool) {
- ngx_destroy_pool(u->peer.connection->pool);
- }
-
- ngx_close_connection(u->peer.connection);
- u->peer.connection = NULL;
- }
-
- ngx_http_upstream_connect(r, u);
-}
-
-
-static void
-ngx_http_upstream_cleanup(void *data)
-{
- ngx_http_request_t *r = data;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "cleanup http upstream request: \"%V\"", &r->uri);
-
- ngx_http_upstream_finalize_request(r, r->upstream, NGX_DONE);
-}
-
-
-static void
-ngx_http_upstream_finalize_request(ngx_http_request_t *r,
- ngx_http_upstream_t *u, ngx_int_t rc)
-{
- ngx_uint_t flush;
- ngx_time_t *tp;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "finalize http upstream request: %i", rc);
-
- if (u->cleanup) {
- *u->cleanup = NULL;
- u->cleanup = NULL;
- }
-
- if (u->resolved && u->resolved->ctx) {
- ngx_resolve_name_done(u->resolved->ctx);
- u->resolved->ctx = NULL;
- }
-
- if (u->state && u->state->response_sec) {
- tp = ngx_timeofday();
- u->state->response_sec = tp->sec - u->state->response_sec;
- u->state->response_msec = tp->msec - u->state->response_msec;
-
- if (u->pipe && u->pipe->read_length) {
- u->state->response_length = u->pipe->read_length;
- }
- }
-
- u->finalize_request(r, rc);
-
- if (u->peer.free && u->peer.sockaddr) {
- u->peer.free(&u->peer, u->peer.data, 0);
- u->peer.sockaddr = NULL;
- }
-
- if (u->peer.connection) {
-
-#if (NGX_HTTP_SSL)
-
- /* TODO: do not shutdown persistent connection */
-
- if (u->peer.connection->ssl) {
-
- /*
- * We send the "close notify" shutdown alert to the upstream only
- * and do not wait its "close notify" shutdown alert.
- * It is acceptable according to the TLS standard.
- */
-
- u->peer.connection->ssl->no_wait_shutdown = 1;
-
- (void) ngx_ssl_shutdown(u->peer.connection);
- }
-#endif
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "close http upstream connection: %d",
- u->peer.connection->fd);
-
- if (u->peer.connection->pool) {
- ngx_destroy_pool(u->peer.connection->pool);
- }
-
- ngx_close_connection(u->peer.connection);
- }
-
- u->peer.connection = NULL;
-
- if (u->pipe && u->pipe->temp_file) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http upstream temp fd: %d",
- u->pipe->temp_file->file.fd);
- }
-
- if (u->store && u->pipe && u->pipe->temp_file
- && u->pipe->temp_file->file.fd != NGX_INVALID_FILE)
- {
- if (ngx_delete_file(u->pipe->temp_file->file.name.data)
- == NGX_FILE_ERROR)
- {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- ngx_delete_file_n " \"%s\" failed",
- u->pipe->temp_file->file.name.data);
- }
- }
-
-#if (NGX_HTTP_CACHE)
-
- if (r->cache) {
-
- if (u->cacheable) {
-
- if (rc == NGX_HTTP_BAD_GATEWAY || rc == NGX_HTTP_GATEWAY_TIME_OUT) {
- time_t valid;
-
- valid = ngx_http_file_cache_valid(u->conf->cache_valid, rc);
-
- if (valid) {
- r->cache->valid_sec = ngx_time() + valid;
- r->cache->error = rc;
- }
- }
- }
-
- ngx_http_file_cache_free(r->cache, u->pipe->temp_file);
- }
-
-#endif
-
- if (r->subrequest_in_memory
- && u->headers_in.status_n >= NGX_HTTP_SPECIAL_RESPONSE)
- {
- u->buffer.last = u->buffer.pos;
- }
-
- if (rc == NGX_DECLINED) {
- return;
- }
-
- r->connection->log->action = "sending to client";
-
- if (!u->header_sent
- || rc == NGX_HTTP_REQUEST_TIME_OUT
- || rc == NGX_HTTP_CLIENT_CLOSED_REQUEST)
- {
- ngx_http_finalize_request(r, rc);
- return;
- }
-
- flush = 0;
-
- if (rc >= NGX_HTTP_SPECIAL_RESPONSE) {
- rc = NGX_ERROR;
- flush = 1;
- }
-
- if (r->header_only) {
- ngx_http_finalize_request(r, rc);
- return;
- }
-
- if (rc == 0) {
- rc = ngx_http_send_special(r, NGX_HTTP_LAST);
-
- } else if (flush) {
- r->keepalive = 0;
- rc = ngx_http_send_special(r, NGX_HTTP_FLUSH);
- }
-
- ngx_http_finalize_request(r, rc);
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_header_line(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_table_elt_t **ph;
-
- ph = (ngx_table_elt_t **) ((char *) &r->upstream->headers_in + offset);
-
- if (*ph == NULL) {
- *ph = h;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_ignore_header_line(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_content_length(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset)
-{
- ngx_http_upstream_t *u;
-
- u = r->upstream;
-
- u->headers_in.content_length = h;
- u->headers_in.content_length_n = ngx_atoof(h->value.data, h->value.len);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_last_modified(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset)
-{
- ngx_http_upstream_t *u;
-
- u = r->upstream;
-
- u->headers_in.last_modified = h;
-
-#if (NGX_HTTP_CACHE)
-
- if (u->cacheable) {
- u->headers_in.last_modified_time = ngx_http_parse_time(h->value.data,
- h->value.len);
- }
-
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_set_cookie(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_array_t *pa;
- ngx_table_elt_t **ph;
- ngx_http_upstream_t *u;
-
- u = r->upstream;
- pa = &u->headers_in.cookies;
-
- if (pa->elts == NULL) {
- if (ngx_array_init(pa, r->pool, 1, sizeof(ngx_table_elt_t *)) != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
-
- ph = ngx_array_push(pa);
- if (ph == NULL) {
- return NGX_ERROR;
- }
-
- *ph = h;
-
-#if (NGX_HTTP_CACHE)
- if (!(u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_SET_COOKIE)) {
- u->cacheable = 0;
- }
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_cache_control(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset)
-{
- ngx_array_t *pa;
- ngx_table_elt_t **ph;
- ngx_http_upstream_t *u;
-
- u = r->upstream;
- pa = &u->headers_in.cache_control;
-
- if (pa->elts == NULL) {
- if (ngx_array_init(pa, r->pool, 2, sizeof(ngx_table_elt_t *)) != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
-
- ph = ngx_array_push(pa);
- if (ph == NULL) {
- return NGX_ERROR;
- }
-
- *ph = h;
-
-#if (NGX_HTTP_CACHE)
- {
- u_char *p, *last;
- ngx_int_t n;
-
- if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL) {
- return NGX_OK;
- }
-
- if (r->cache == NULL) {
- return NGX_OK;
- }
-
- if (r->cache->valid_sec != 0 && u->headers_in.x_accel_expires != NULL) {
- return NGX_OK;
- }
-
- p = h->value.data;
- last = p + h->value.len;
-
- if (ngx_strlcasestrn(p, last, (u_char *) "no-cache", 8 - 1) != NULL
- || ngx_strlcasestrn(p, last, (u_char *) "no-store", 8 - 1) != NULL
- || ngx_strlcasestrn(p, last, (u_char *) "private", 7 - 1) != NULL)
- {
- u->cacheable = 0;
- return NGX_OK;
- }
-
- p = ngx_strlcasestrn(p, last, (u_char *) "max-age=", 8 - 1);
-
- if (p == NULL) {
- return NGX_OK;
- }
-
- n = 0;
-
- for (p += 8; p < last; p++) {
- if (*p == ',' || *p == ';' || *p == ' ') {
- break;
- }
-
- if (*p >= '0' && *p <= '9') {
- n = n * 10 + *p - '0';
- continue;
- }
-
- u->cacheable = 0;
- return NGX_OK;
- }
-
- if (n == 0) {
- u->cacheable = 0;
- return NGX_OK;
- }
-
- r->cache->valid_sec = ngx_time() + n;
- }
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_expires(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_http_upstream_t *u;
-
- u = r->upstream;
- u->headers_in.expires = h;
-
-#if (NGX_HTTP_CACHE)
- {
- time_t expires;
-
- if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_EXPIRES) {
- return NGX_OK;
- }
-
- if (r->cache == NULL) {
- return NGX_OK;
- }
-
- if (r->cache->valid_sec != 0) {
- return NGX_OK;
- }
-
- expires = ngx_http_parse_time(h->value.data, h->value.len);
-
- if (expires == NGX_ERROR || expires < ngx_time()) {
- u->cacheable = 0;
- return NGX_OK;
- }
-
- r->cache->valid_sec = expires;
- }
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_accel_expires(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset)
-{
- ngx_http_upstream_t *u;
-
- u = r->upstream;
- u->headers_in.x_accel_expires = h;
-
-#if (NGX_HTTP_CACHE)
- {
- u_char *p;
- size_t len;
- ngx_int_t n;
-
- if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_XA_EXPIRES) {
- return NGX_OK;
- }
-
- if (r->cache == NULL) {
- return NGX_OK;
- }
-
- len = h->value.len;
- p = h->value.data;
-
- if (p[0] != '@') {
- n = ngx_atoi(p, len);
-
- switch (n) {
- case 0:
- u->cacheable = 0;
- /* fall through */
-
- case NGX_ERROR:
- return NGX_OK;
-
- default:
- r->cache->valid_sec = ngx_time() + n;
- return NGX_OK;
- }
- }
-
- p++;
- len--;
-
- n = ngx_atoi(p, len);
-
- if (n != NGX_ERROR) {
- r->cache->valid_sec = n;
- }
- }
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_limit_rate(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_int_t n;
- ngx_http_upstream_t *u;
-
- u = r->upstream;
- u->headers_in.x_accel_limit_rate = h;
-
- if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_XA_LIMIT_RATE) {
- return NGX_OK;
- }
-
- n = ngx_atoi(h->value.data, h->value.len);
-
- if (n != NGX_ERROR) {
- r->limit_rate = (size_t) n;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_buffering(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- u_char c0, c1, c2;
- ngx_http_upstream_t *u;
-
- u = r->upstream;
-
- if (u->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_XA_BUFFERING) {
- return NGX_OK;
- }
-
- if (u->conf->change_buffering) {
-
- if (h->value.len == 2) {
- c0 = ngx_tolower(h->value.data[0]);
- c1 = ngx_tolower(h->value.data[1]);
-
- if (c0 == 'n' && c1 == 'o') {
- u->buffering = 0;
- }
-
- } else if (h->value.len == 3) {
- c0 = ngx_tolower(h->value.data[0]);
- c1 = ngx_tolower(h->value.data[1]);
- c2 = ngx_tolower(h->value.data[2]);
-
- if (c0 == 'y' && c1 == 'e' && c2 == 's') {
- u->buffering = 1;
- }
- }
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_charset(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- if (r->upstream->conf->ignore_headers & NGX_HTTP_UPSTREAM_IGN_XA_CHARSET) {
- return NGX_OK;
- }
-
- r->headers_out.override_charset = &h->value;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_connection(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- r->upstream->headers_in.connection = h;
-
- if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len,
- (u_char *) "close", 5 - 1)
- != NULL)
- {
- r->upstream->headers_in.connection_close = 1;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_process_transfer_encoding(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset)
-{
- r->upstream->headers_in.transfer_encoding = h;
-
- if (ngx_strlcasestrn(h->value.data, h->value.data + h->value.len,
- (u_char *) "chunked", 7 - 1)
- != NULL)
- {
- r->upstream->headers_in.chunked = 1;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_copy_header_line(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_table_elt_t *ho, **ph;
-
- ho = ngx_list_push(&r->headers_out.headers);
- if (ho == NULL) {
- return NGX_ERROR;
- }
-
- *ho = *h;
-
- if (offset) {
- ph = (ngx_table_elt_t **) ((char *) &r->headers_out + offset);
- *ph = ho;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_copy_multi_header_lines(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset)
-{
- ngx_array_t *pa;
- ngx_table_elt_t *ho, **ph;
-
- pa = (ngx_array_t *) ((char *) &r->headers_out + offset);
-
- if (pa->elts == NULL) {
- if (ngx_array_init(pa, r->pool, 2, sizeof(ngx_table_elt_t *)) != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
-
- ph = ngx_array_push(pa);
- if (ph == NULL) {
- return NGX_ERROR;
- }
-
- ho = ngx_list_push(&r->headers_out.headers);
- if (ho == NULL) {
- return NGX_ERROR;
- }
-
- *ho = *h;
- *ph = ho;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_copy_content_type(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- u_char *p, *last;
-
- r->headers_out.content_type_len = h->value.len;
- r->headers_out.content_type = h->value;
- r->headers_out.content_type_lowcase = NULL;
-
- for (p = h->value.data; *p; p++) {
-
- if (*p != ';') {
- continue;
- }
-
- last = p;
-
- while (*++p == ' ') { /* void */ }
-
- if (*p == '\0') {
- return NGX_OK;
- }
-
- if (ngx_strncasecmp(p, (u_char *) "charset=", 8) != 0) {
- continue;
- }
-
- p += 8;
-
- r->headers_out.content_type_len = last - h->value.data;
-
- if (*p == '"') {
- p++;
- }
-
- last = h->value.data + h->value.len;
-
- if (*(last - 1) == '"') {
- last--;
- }
-
- r->headers_out.charset.len = last - p;
- r->headers_out.charset.data = p;
-
- return NGX_OK;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_copy_last_modified(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_table_elt_t *ho;
-
- ho = ngx_list_push(&r->headers_out.headers);
- if (ho == NULL) {
- return NGX_ERROR;
- }
-
- *ho = *h;
-
- r->headers_out.last_modified = ho;
-
-#if (NGX_HTTP_CACHE)
-
- if (r->upstream->cacheable) {
- r->headers_out.last_modified_time =
- r->upstream->headers_in.last_modified_time;
- }
-
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_rewrite_location(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_int_t rc;
- ngx_table_elt_t *ho;
-
- ho = ngx_list_push(&r->headers_out.headers);
- if (ho == NULL) {
- return NGX_ERROR;
- }
-
- *ho = *h;
-
- if (r->upstream->rewrite_redirect) {
- rc = r->upstream->rewrite_redirect(r, ho, 0);
-
- if (rc == NGX_DECLINED) {
- return NGX_OK;
- }
-
- if (rc == NGX_OK) {
- r->headers_out.location = ho;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "rewritten location: \"%V\"", &ho->value);
- }
-
- return rc;
- }
-
- if (ho->value.data[0] != '/') {
- r->headers_out.location = ho;
- }
-
- /*
- * we do not set r->headers_out.location here to avoid the handling
- * the local redirects without a host name by ngx_http_header_filter()
- */
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_rewrite_refresh(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- u_char *p;
- ngx_int_t rc;
- ngx_table_elt_t *ho;
-
- ho = ngx_list_push(&r->headers_out.headers);
- if (ho == NULL) {
- return NGX_ERROR;
- }
-
- *ho = *h;
-
- if (r->upstream->rewrite_redirect) {
-
- p = ngx_strcasestrn(ho->value.data, "url=", 4 - 1);
-
- if (p) {
- rc = r->upstream->rewrite_redirect(r, ho, p + 4 - ho->value.data);
-
- } else {
- return NGX_OK;
- }
-
- if (rc == NGX_DECLINED) {
- return NGX_OK;
- }
-
- if (rc == NGX_OK) {
- r->headers_out.refresh = ho;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "rewritten refresh: \"%V\"", &ho->value);
- }
-
- return rc;
- }
-
- r->headers_out.refresh = ho;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_rewrite_set_cookie(ngx_http_request_t *r, ngx_table_elt_t *h,
- ngx_uint_t offset)
-{
- ngx_int_t rc;
- ngx_table_elt_t *ho;
-
- ho = ngx_list_push(&r->headers_out.headers);
- if (ho == NULL) {
- return NGX_ERROR;
- }
-
- *ho = *h;
-
- if (r->upstream->rewrite_cookie) {
- rc = r->upstream->rewrite_cookie(r, ho);
-
- if (rc == NGX_DECLINED) {
- return NGX_OK;
- }
-
-#if (NGX_DEBUG)
- if (rc == NGX_OK) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "rewritten cookie: \"%V\"", &ho->value);
- }
-#endif
-
- return rc;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_copy_allow_ranges(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset)
-{
- ngx_table_elt_t *ho;
-
-#if (NGX_HTTP_CACHE)
-
- if (r->cached) {
- r->allow_ranges = 1;
- return NGX_OK;
- }
-
- if (r->upstream->cacheable) {
- r->allow_ranges = 1;
- r->single_range = 1;
- return NGX_OK;
- }
-
-#endif
-
- ho = ngx_list_push(&r->headers_out.headers);
- if (ho == NULL) {
- return NGX_ERROR;
- }
-
- *ho = *h;
-
- r->headers_out.accept_ranges = ho;
-
- return NGX_OK;
-}
-
-
-#if (NGX_HTTP_GZIP)
-
-static ngx_int_t
-ngx_http_upstream_copy_content_encoding(ngx_http_request_t *r,
- ngx_table_elt_t *h, ngx_uint_t offset)
-{
- ngx_table_elt_t *ho;
-
- ho = ngx_list_push(&r->headers_out.headers);
- if (ho == NULL) {
- return NGX_ERROR;
- }
-
- *ho = *h;
-
- r->headers_out.content_encoding = ho;
-
- return NGX_OK;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_upstream_add_variables(ngx_conf_t *cf)
-{
- ngx_http_variable_t *var, *v;
-
- for (v = ngx_http_upstream_vars; v->name.len; v++) {
- var = ngx_http_add_variable(cf, &v->name, v->flags);
- if (var == NULL) {
- return NGX_ERROR;
- }
-
- var->get_handler = v->get_handler;
- var->data = v->data;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_addr_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- size_t len;
- ngx_uint_t i;
- ngx_http_upstream_state_t *state;
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- len = 0;
- state = r->upstream_states->elts;
-
- for (i = 0; i < r->upstream_states->nelts; i++) {
- if (state[i].peer) {
- len += state[i].peer->len + 2;
-
- } else {
- len += 3;
- }
- }
-
- p = ngx_pnalloc(r->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->data = p;
-
- i = 0;
-
- for ( ;; ) {
- if (state[i].peer) {
- p = ngx_cpymem(p, state[i].peer->data, state[i].peer->len);
- }
-
- if (++i == r->upstream_states->nelts) {
- break;
- }
-
- if (state[i].peer) {
- *p++ = ',';
- *p++ = ' ';
-
- } else {
- *p++ = ' ';
- *p++ = ':';
- *p++ = ' ';
-
- if (++i == r->upstream_states->nelts) {
- break;
- }
-
- continue;
- }
- }
-
- v->len = p - v->data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_status_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- size_t len;
- ngx_uint_t i;
- ngx_http_upstream_state_t *state;
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- len = r->upstream_states->nelts * (3 + 2);
-
- p = ngx_pnalloc(r->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->data = p;
-
- i = 0;
- state = r->upstream_states->elts;
-
- for ( ;; ) {
- if (state[i].status) {
- p = ngx_sprintf(p, "%ui", state[i].status);
-
- } else {
- *p++ = '-';
- }
-
- if (++i == r->upstream_states->nelts) {
- break;
- }
-
- if (state[i].peer) {
- *p++ = ',';
- *p++ = ' ';
-
- } else {
- *p++ = ' ';
- *p++ = ':';
- *p++ = ' ';
-
- if (++i == r->upstream_states->nelts) {
- break;
- }
-
- continue;
- }
- }
-
- v->len = p - v->data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_response_time_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- size_t len;
- ngx_uint_t i;
- ngx_msec_int_t ms;
- ngx_http_upstream_state_t *state;
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- len = r->upstream_states->nelts * (NGX_TIME_T_LEN + 4 + 2);
-
- p = ngx_pnalloc(r->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->data = p;
-
- i = 0;
- state = r->upstream_states->elts;
-
- for ( ;; ) {
- if (state[i].status) {
- ms = (ngx_msec_int_t)
- (state[i].response_sec * 1000 + state[i].response_msec);
- ms = ngx_max(ms, 0);
- p = ngx_sprintf(p, "%T.%03M", (time_t) ms / 1000, ms % 1000);
-
- } else {
- *p++ = '-';
- }
-
- if (++i == r->upstream_states->nelts) {
- break;
- }
-
- if (state[i].peer) {
- *p++ = ',';
- *p++ = ' ';
-
- } else {
- *p++ = ' ';
- *p++ = ':';
- *p++ = ' ';
-
- if (++i == r->upstream_states->nelts) {
- break;
- }
-
- continue;
- }
- }
-
- v->len = p - v->data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_response_length_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- size_t len;
- ngx_uint_t i;
- ngx_http_upstream_state_t *state;
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- if (r->upstream_states == NULL || r->upstream_states->nelts == 0) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- len = r->upstream_states->nelts * (NGX_OFF_T_LEN + 2);
-
- p = ngx_pnalloc(r->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->data = p;
-
- i = 0;
- state = r->upstream_states->elts;
-
- for ( ;; ) {
- p = ngx_sprintf(p, "%O", state[i].response_length);
-
- if (++i == r->upstream_states->nelts) {
- break;
- }
-
- if (state[i].peer) {
- *p++ = ',';
- *p++ = ' ';
-
- } else {
- *p++ = ' ';
- *p++ = ':';
- *p++ = ' ';
-
- if (++i == r->upstream_states->nelts) {
- break;
- }
-
- continue;
- }
- }
-
- v->len = p - v->data;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_upstream_header_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- if (r->upstream == NULL) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- return ngx_http_variable_unknown_header(v, (ngx_str_t *) data,
- &r->upstream->headers_in.headers.part,
- sizeof("upstream_http_") - 1);
-}
-
-
-ngx_int_t
-ngx_http_upstream_cookie_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_str_t *name = (ngx_str_t *) data;
-
- ngx_str_t cookie, s;
-
- if (r->upstream == NULL) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- s.len = name->len - (sizeof("upstream_cookie_") - 1);
- s.data = name->data + sizeof("upstream_cookie_") - 1;
-
- if (ngx_http_parse_set_cookie_lines(&r->upstream->headers_in.cookies,
- &s, &cookie)
- == NGX_DECLINED)
- {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->len = cookie.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = cookie.data;
-
- return NGX_OK;
-}
-
-
-#if (NGX_HTTP_CACHE)
-
-ngx_int_t
-ngx_http_upstream_cache_status(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_uint_t n;
-
- if (r->upstream == NULL || r->upstream->cache_status == 0) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- n = r->upstream->cache_status - 1;
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->len = ngx_http_cache_status[n].len;
- v->data = ngx_http_cache_status[n].data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_cache_last_modified(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- if (r->upstream == NULL
- || !r->upstream->conf->cache_revalidate
- || r->upstream->cache_status != NGX_HTTP_CACHE_EXPIRED
- || r->cache->last_modified == -1)
- {
- v->not_found = 1;
- return NGX_OK;
- }
-
- p = ngx_pnalloc(r->pool, sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_http_time(p, r->cache->last_modified) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_upstream_cache_etag(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- if (r->upstream == NULL
- || !r->upstream->conf->cache_revalidate
- || r->upstream->cache_status != NGX_HTTP_CACHE_EXPIRED
- || r->cache->etag.len == 0)
- {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->len = r->cache->etag.len;
- v->data = r->cache->etag.data;
-
- return NGX_OK;
-}
-
-#endif
-
-
-static char *
-ngx_http_upstream(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)
-{
- char *rv;
- void *mconf;
- ngx_str_t *value;
- ngx_url_t u;
- ngx_uint_t m;
- ngx_conf_t pcf;
- ngx_http_module_t *module;
- ngx_http_conf_ctx_t *ctx, *http_ctx;
- ngx_http_upstream_srv_conf_t *uscf;
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- value = cf->args->elts;
- u.host = value[1];
- u.no_resolve = 1;
- u.no_port = 1;
-
- uscf = ngx_http_upstream_add(cf, &u, NGX_HTTP_UPSTREAM_CREATE
- |NGX_HTTP_UPSTREAM_WEIGHT
- |NGX_HTTP_UPSTREAM_MAX_FAILS
- |NGX_HTTP_UPSTREAM_FAIL_TIMEOUT
- |NGX_HTTP_UPSTREAM_DOWN
- |NGX_HTTP_UPSTREAM_BACKUP);
- if (uscf == NULL) {
- return NGX_CONF_ERROR;
- }
-
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- http_ctx = cf->ctx;
- ctx->main_conf = http_ctx->main_conf;
-
- /* the upstream{}'s srv_conf */
-
- ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
- if (ctx->srv_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->srv_conf[ngx_http_upstream_module.ctx_index] = uscf;
-
- uscf->srv_conf = ctx->srv_conf;
-
-
- /* the upstream{}'s loc_conf */
-
- ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);
- if (ctx->loc_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_HTTP_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
-
- if (module->create_srv_conf) {
- mconf = module->create_srv_conf(cf);
- if (mconf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->srv_conf[ngx_modules[m]->ctx_index] = mconf;
- }
-
- if (module->create_loc_conf) {
- mconf = module->create_loc_conf(cf);
- if (mconf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->loc_conf[ngx_modules[m]->ctx_index] = mconf;
- }
- }
-
- uscf->servers = ngx_array_create(cf->pool, 4,
- sizeof(ngx_http_upstream_server_t));
- if (uscf->servers == NULL) {
- return NGX_CONF_ERROR;
- }
-
-
- /* parse inside upstream{} */
-
- pcf = *cf;
- cf->ctx = ctx;
- cf->cmd_type = NGX_HTTP_UPS_CONF;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = pcf;
-
- if (rv != NGX_CONF_OK) {
- return rv;
- }
-
- if (uscf->servers->nelts == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "no servers are inside upstream");
- return NGX_CONF_ERROR;
- }
-
- return rv;
-}
-
-
-static char *
-ngx_http_upstream_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_http_upstream_srv_conf_t *uscf = conf;
-
- time_t fail_timeout;
- ngx_str_t *value, s;
- ngx_url_t u;
- ngx_int_t weight, max_fails;
- ngx_uint_t i;
- ngx_http_upstream_server_t *us;
-
- us = ngx_array_push(uscf->servers);
- if (us == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(us, sizeof(ngx_http_upstream_server_t));
-
- value = cf->args->elts;
-
- weight = 1;
- max_fails = 1;
- fail_timeout = 10;
-
- for (i = 2; i < cf->args->nelts; i++) {
-
- if (ngx_strncmp(value[i].data, "weight=", 7) == 0) {
-
- if (!(uscf->flags & NGX_HTTP_UPSTREAM_WEIGHT)) {
- goto not_supported;
- }
-
- weight = ngx_atoi(&value[i].data[7], value[i].len - 7);
-
- if (weight == NGX_ERROR || weight == 0) {
- goto invalid;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "max_fails=", 10) == 0) {
-
- if (!(uscf->flags & NGX_HTTP_UPSTREAM_MAX_FAILS)) {
- goto not_supported;
- }
-
- max_fails = ngx_atoi(&value[i].data[10], value[i].len - 10);
-
- if (max_fails == NGX_ERROR) {
- goto invalid;
- }
-
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "fail_timeout=", 13) == 0) {
-
- if (!(uscf->flags & NGX_HTTP_UPSTREAM_FAIL_TIMEOUT)) {
- goto not_supported;
- }
-
- s.len = value[i].len - 13;
- s.data = &value[i].data[13];
-
- fail_timeout = ngx_parse_time(&s, 1);
-
- if (fail_timeout == (time_t) NGX_ERROR) {
- goto invalid;
- }
-
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "backup") == 0) {
-
- if (!(uscf->flags & NGX_HTTP_UPSTREAM_BACKUP)) {
- goto not_supported;
- }
-
- us->backup = 1;
-
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "down") == 0) {
-
- if (!(uscf->flags & NGX_HTTP_UPSTREAM_DOWN)) {
- goto not_supported;
- }
-
- us->down = 1;
-
- continue;
- }
-
- goto invalid;
- }
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url = value[1];
- u.default_port = 80;
-
- if (ngx_parse_url(cf->pool, &u) != NGX_OK) {
- if (u.err) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%s in upstream \"%V\"", u.err, &u.url);
- }
-
- return NGX_CONF_ERROR;
- }
-
- us->name = u.url;
- us->addrs = u.addrs;
- us->naddrs = u.naddrs;
- us->weight = weight;
- us->max_fails = max_fails;
- us->fail_timeout = fail_timeout;
-
- return NGX_CONF_OK;
-
-invalid:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[i]);
-
- return NGX_CONF_ERROR;
-
-not_supported:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "balancing method does not support parameter \"%V\"",
- &value[i]);
-
- return NGX_CONF_ERROR;
-}
-
-
-ngx_http_upstream_srv_conf_t *
-ngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
-{
- ngx_uint_t i;
- ngx_http_upstream_server_t *us;
- ngx_http_upstream_srv_conf_t *uscf, **uscfp;
- ngx_http_upstream_main_conf_t *umcf;
-
- if (!(flags & NGX_HTTP_UPSTREAM_CREATE)) {
-
- if (ngx_parse_url(cf->pool, u) != NGX_OK) {
- if (u->err) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%s in upstream \"%V\"", u->err, &u->url);
- }
-
- return NULL;
- }
- }
-
- umcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_upstream_module);
-
- uscfp = umcf->upstreams.elts;
-
- for (i = 0; i < umcf->upstreams.nelts; i++) {
-
- if (uscfp[i]->host.len != u->host.len
- || ngx_strncasecmp(uscfp[i]->host.data, u->host.data, u->host.len)
- != 0)
- {
- continue;
- }
-
- if ((flags & NGX_HTTP_UPSTREAM_CREATE)
- && (uscfp[i]->flags & NGX_HTTP_UPSTREAM_CREATE))
- {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate upstream \"%V\"", &u->host);
- return NULL;
- }
-
- if ((uscfp[i]->flags & NGX_HTTP_UPSTREAM_CREATE) && !u->no_port) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "upstream \"%V\" may not have port %d",
- &u->host, u->port);
- return NULL;
- }
-
- if ((flags & NGX_HTTP_UPSTREAM_CREATE) && !uscfp[i]->no_port) {
- ngx_log_error(NGX_LOG_WARN, cf->log, 0,
- "upstream \"%V\" may not have port %d in %s:%ui",
- &u->host, uscfp[i]->port,
- uscfp[i]->file_name, uscfp[i]->line);
- return NULL;
- }
-
- if (uscfp[i]->port && u->port
- && uscfp[i]->port != u->port)
- {
- continue;
- }
-
- if (uscfp[i]->default_port && u->default_port
- && uscfp[i]->default_port != u->default_port)
- {
- continue;
- }
-
- if (flags & NGX_HTTP_UPSTREAM_CREATE) {
- uscfp[i]->flags = flags;
- }
-
- return uscfp[i];
- }
-
- uscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_srv_conf_t));
- if (uscf == NULL) {
- return NULL;
- }
-
- uscf->flags = flags;
- uscf->host = u->host;
- uscf->file_name = cf->conf_file->file.name.data;
- uscf->line = cf->conf_file->line;
- uscf->port = u->port;
- uscf->default_port = u->default_port;
- uscf->no_port = u->no_port;
-
- if (u->naddrs == 1) {
- uscf->servers = ngx_array_create(cf->pool, 1,
- sizeof(ngx_http_upstream_server_t));
- if (uscf->servers == NULL) {
- return NULL;
- }
-
- us = ngx_array_push(uscf->servers);
- if (us == NULL) {
- return NULL;
- }
-
- ngx_memzero(us, sizeof(ngx_http_upstream_server_t));
-
- us->addrs = u->addrs;
- us->naddrs = 1;
- }
-
- uscfp = ngx_array_push(&umcf->upstreams);
- if (uscfp == NULL) {
- return NULL;
- }
-
- *uscfp = uscf;
-
- return uscf;
-}
-
-
-char *
-ngx_http_upstream_bind_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf)
-{
- char *p = conf;
-
- ngx_int_t rc;
- ngx_str_t *value;
- ngx_http_complex_value_t cv;
- ngx_http_upstream_local_t **plocal, *local;
- ngx_http_compile_complex_value_t ccv;
-
- plocal = (ngx_http_upstream_local_t **) (p + cmd->offset);
-
- if (*plocal != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- *plocal = NULL;
- return NGX_CONF_OK;
- }
-
- ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
-
- ccv.cf = cf;
- ccv.value = &value[1];
- ccv.complex_value = &cv;
-
- if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- local = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_local_t));
- if (local == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *plocal = local;
-
- if (cv.lengths) {
- local->value = ngx_palloc(cf->pool, sizeof(ngx_http_complex_value_t));
- if (local->value == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *local->value = cv;
-
- return NGX_CONF_OK;
- }
-
- local->addr = ngx_palloc(cf->pool, sizeof(ngx_addr_t));
- if (local->addr == NULL) {
- return NGX_CONF_ERROR;
- }
-
- rc = ngx_parse_addr(cf->pool, local->addr, value[1].data, value[1].len);
-
- switch (rc) {
- case NGX_OK:
- local->addr->name = value[1];
- return NGX_CONF_OK;
-
- case NGX_DECLINED:
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid address \"%V\"", &value[1]);
- /* fall through */
-
- default:
- return NGX_CONF_ERROR;
- }
-}
-
-
-static ngx_addr_t *
-ngx_http_upstream_get_local(ngx_http_request_t *r,
- ngx_http_upstream_local_t *local)
-{
- ngx_int_t rc;
- ngx_str_t val;
- ngx_addr_t *addr;
-
- if (local == NULL) {
- return NULL;
- }
-
- if (local->value == NULL) {
- return local->addr;
- }
-
- if (ngx_http_complex_value(r, local->value, &val) != NGX_OK) {
- return NULL;
- }
-
- if (val.len == 0) {
- return NULL;
- }
-
- addr = ngx_palloc(r->pool, sizeof(ngx_addr_t));
- if (addr == NULL) {
- return NULL;
- }
-
- rc = ngx_parse_addr(r->pool, addr, val.data, val.len);
-
- switch (rc) {
- case NGX_OK:
- addr->name = val;
- return addr;
-
- case NGX_DECLINED:
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid local address \"%V\"", &val);
- /* fall through */
-
- default:
- return NULL;
- }
-}
-
-
-char *
-ngx_http_upstream_param_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf)
-{
- char *p = conf;
-
- ngx_str_t *value;
- ngx_array_t **a;
- ngx_http_upstream_param_t *param;
-
- a = (ngx_array_t **) (p + cmd->offset);
-
- if (*a == NULL) {
- *a = ngx_array_create(cf->pool, 4, sizeof(ngx_http_upstream_param_t));
- if (*a == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- param = ngx_array_push(*a);
- if (param == NULL) {
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- param->key = value[1];
- param->value = value[2];
- param->skip_empty = 0;
-
- if (cf->args->nelts == 4) {
- if (ngx_strcmp(value[3].data, "if_not_empty") != 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid parameter \"%V\"", &value[3]);
- return NGX_CONF_ERROR;
- }
-
- param->skip_empty = 1;
- }
-
- return NGX_CONF_OK;
-}
-
-
-ngx_int_t
-ngx_http_upstream_hide_headers_hash(ngx_conf_t *cf,
- ngx_http_upstream_conf_t *conf, ngx_http_upstream_conf_t *prev,
- ngx_str_t *default_hide_headers, ngx_hash_init_t *hash)
-{
- ngx_str_t *h;
- ngx_uint_t i, j;
- ngx_array_t hide_headers;
- ngx_hash_key_t *hk;
-
- if (conf->hide_headers == NGX_CONF_UNSET_PTR
- && conf->pass_headers == NGX_CONF_UNSET_PTR)
- {
- conf->hide_headers = prev->hide_headers;
- conf->pass_headers = prev->pass_headers;
-
- conf->hide_headers_hash = prev->hide_headers_hash;
-
- if (conf->hide_headers_hash.buckets
-#if (NGX_HTTP_CACHE)
- && ((conf->cache == NULL) == (prev->cache == NULL))
-#endif
- )
- {
- return NGX_OK;
- }
-
- } else {
- if (conf->hide_headers == NGX_CONF_UNSET_PTR) {
- conf->hide_headers = prev->hide_headers;
- }
-
- if (conf->pass_headers == NGX_CONF_UNSET_PTR) {
- conf->pass_headers = prev->pass_headers;
- }
- }
-
- if (ngx_array_init(&hide_headers, cf->temp_pool, 4, sizeof(ngx_hash_key_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- for (h = default_hide_headers; h->len; h++) {
- hk = ngx_array_push(&hide_headers);
- if (hk == NULL) {
- return NGX_ERROR;
- }
-
- hk->key = *h;
- hk->key_hash = ngx_hash_key_lc(h->data, h->len);
- hk->value = (void *) 1;
- }
-
- if (conf->hide_headers != NGX_CONF_UNSET_PTR) {
-
- h = conf->hide_headers->elts;
-
- for (i = 0; i < conf->hide_headers->nelts; i++) {
-
- hk = hide_headers.elts;
-
- for (j = 0; j < hide_headers.nelts; j++) {
- if (ngx_strcasecmp(h[i].data, hk[j].key.data) == 0) {
- goto exist;
- }
- }
-
- hk = ngx_array_push(&hide_headers);
- if (hk == NULL) {
- return NGX_ERROR;
- }
-
- hk->key = h[i];
- hk->key_hash = ngx_hash_key_lc(h[i].data, h[i].len);
- hk->value = (void *) 1;
-
- exist:
-
- continue;
- }
- }
-
- if (conf->pass_headers != NGX_CONF_UNSET_PTR) {
-
- h = conf->pass_headers->elts;
- hk = hide_headers.elts;
-
- for (i = 0; i < conf->pass_headers->nelts; i++) {
- for (j = 0; j < hide_headers.nelts; j++) {
-
- if (hk[j].key.data == NULL) {
- continue;
- }
-
- if (ngx_strcasecmp(h[i].data, hk[j].key.data) == 0) {
- hk[j].key.data = NULL;
- break;
- }
- }
- }
- }
-
- hash->hash = &conf->hide_headers_hash;
- hash->key = ngx_hash_key_lc;
- hash->pool = cf->pool;
- hash->temp_pool = NULL;
-
- return ngx_hash_init(hash, hide_headers.elts, hide_headers.nelts);
-}
-
-
-static void *
-ngx_http_upstream_create_main_conf(ngx_conf_t *cf)
-{
- ngx_http_upstream_main_conf_t *umcf;
-
- umcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_main_conf_t));
- if (umcf == NULL) {
- return NULL;
- }
-
- if (ngx_array_init(&umcf->upstreams, cf->pool, 4,
- sizeof(ngx_http_upstream_srv_conf_t *))
- != NGX_OK)
- {
- return NULL;
- }
-
- return umcf;
-}
-
-
-static char *
-ngx_http_upstream_init_main_conf(ngx_conf_t *cf, void *conf)
-{
- ngx_http_upstream_main_conf_t *umcf = conf;
-
- ngx_uint_t i;
- ngx_array_t headers_in;
- ngx_hash_key_t *hk;
- ngx_hash_init_t hash;
- ngx_http_upstream_init_pt init;
- ngx_http_upstream_header_t *header;
- ngx_http_upstream_srv_conf_t **uscfp;
-
- uscfp = umcf->upstreams.elts;
-
- for (i = 0; i < umcf->upstreams.nelts; i++) {
-
- init = uscfp[i]->peer.init_upstream ? uscfp[i]->peer.init_upstream:
- ngx_http_upstream_init_round_robin;
-
- if (init(cf, uscfp[i]) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
-
- /* upstream_headers_in_hash */
-
- if (ngx_array_init(&headers_in, cf->temp_pool, 32, sizeof(ngx_hash_key_t))
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- for (header = ngx_http_upstream_headers_in; header->name.len; header++) {
- hk = ngx_array_push(&headers_in);
- if (hk == NULL) {
- return NGX_CONF_ERROR;
- }
-
- hk->key = header->name;
- hk->key_hash = ngx_hash_key_lc(header->name.data, header->name.len);
- hk->value = header;
- }
-
- hash.hash = &umcf->headers_in_hash;
- hash.key = ngx_hash_key_lc;
- hash.max_size = 512;
- hash.bucket_size = ngx_align(64, ngx_cacheline_size);
- hash.name = "upstream_headers_in_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- if (ngx_hash_init(&hash, headers_in.elts, headers_in.nelts) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.h
deleted file mode 100644
index 2ee899d8332..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream.h
+++ /dev/null
@@ -1,398 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_UPSTREAM_H_INCLUDED_
-#define _NGX_HTTP_UPSTREAM_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_event_connect.h>
-#include <ngx_event_pipe.h>
-#include <ngx_http.h>
-
-
-#define NGX_HTTP_UPSTREAM_FT_ERROR 0x00000002
-#define NGX_HTTP_UPSTREAM_FT_TIMEOUT 0x00000004
-#define NGX_HTTP_UPSTREAM_FT_INVALID_HEADER 0x00000008
-#define NGX_HTTP_UPSTREAM_FT_HTTP_500 0x00000010
-#define NGX_HTTP_UPSTREAM_FT_HTTP_502 0x00000020
-#define NGX_HTTP_UPSTREAM_FT_HTTP_503 0x00000040
-#define NGX_HTTP_UPSTREAM_FT_HTTP_504 0x00000080
-#define NGX_HTTP_UPSTREAM_FT_HTTP_403 0x00000100
-#define NGX_HTTP_UPSTREAM_FT_HTTP_404 0x00000200
-#define NGX_HTTP_UPSTREAM_FT_UPDATING 0x00000400
-#define NGX_HTTP_UPSTREAM_FT_BUSY_LOCK 0x00000800
-#define NGX_HTTP_UPSTREAM_FT_MAX_WAITING 0x00001000
-#define NGX_HTTP_UPSTREAM_FT_NOLIVE 0x40000000
-#define NGX_HTTP_UPSTREAM_FT_OFF 0x80000000
-
-#define NGX_HTTP_UPSTREAM_FT_STATUS (NGX_HTTP_UPSTREAM_FT_HTTP_500 \
- |NGX_HTTP_UPSTREAM_FT_HTTP_502 \
- |NGX_HTTP_UPSTREAM_FT_HTTP_503 \
- |NGX_HTTP_UPSTREAM_FT_HTTP_504 \
- |NGX_HTTP_UPSTREAM_FT_HTTP_403 \
- |NGX_HTTP_UPSTREAM_FT_HTTP_404)
-
-#define NGX_HTTP_UPSTREAM_INVALID_HEADER 40
-
-
-#define NGX_HTTP_UPSTREAM_IGN_XA_REDIRECT 0x00000002
-#define NGX_HTTP_UPSTREAM_IGN_XA_EXPIRES 0x00000004
-#define NGX_HTTP_UPSTREAM_IGN_EXPIRES 0x00000008
-#define NGX_HTTP_UPSTREAM_IGN_CACHE_CONTROL 0x00000010
-#define NGX_HTTP_UPSTREAM_IGN_SET_COOKIE 0x00000020
-#define NGX_HTTP_UPSTREAM_IGN_XA_LIMIT_RATE 0x00000040
-#define NGX_HTTP_UPSTREAM_IGN_XA_BUFFERING 0x00000080
-#define NGX_HTTP_UPSTREAM_IGN_XA_CHARSET 0x00000100
-
-
-typedef struct {
- ngx_msec_t bl_time;
- ngx_uint_t bl_state;
-
- ngx_uint_t status;
- time_t response_sec;
- ngx_uint_t response_msec;
- off_t response_length;
-
- ngx_str_t *peer;
-} ngx_http_upstream_state_t;
-
-
-typedef struct {
- ngx_hash_t headers_in_hash;
- ngx_array_t upstreams;
- /* ngx_http_upstream_srv_conf_t */
-} ngx_http_upstream_main_conf_t;
-
-typedef struct ngx_http_upstream_srv_conf_s ngx_http_upstream_srv_conf_t;
-
-typedef ngx_int_t (*ngx_http_upstream_init_pt)(ngx_conf_t *cf,
- ngx_http_upstream_srv_conf_t *us);
-typedef ngx_int_t (*ngx_http_upstream_init_peer_pt)(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us);
-
-
-typedef struct {
- ngx_http_upstream_init_pt init_upstream;
- ngx_http_upstream_init_peer_pt init;
- void *data;
-} ngx_http_upstream_peer_t;
-
-
-typedef struct {
- ngx_str_t name;
- ngx_addr_t *addrs;
- ngx_uint_t naddrs;
- ngx_uint_t weight;
- ngx_uint_t max_fails;
- time_t fail_timeout;
-
- unsigned down:1;
- unsigned backup:1;
-} ngx_http_upstream_server_t;
-
-
-#define NGX_HTTP_UPSTREAM_CREATE 0x0001
-#define NGX_HTTP_UPSTREAM_WEIGHT 0x0002
-#define NGX_HTTP_UPSTREAM_MAX_FAILS 0x0004
-#define NGX_HTTP_UPSTREAM_FAIL_TIMEOUT 0x0008
-#define NGX_HTTP_UPSTREAM_DOWN 0x0010
-#define NGX_HTTP_UPSTREAM_BACKUP 0x0020
-
-
-struct ngx_http_upstream_srv_conf_s {
- ngx_http_upstream_peer_t peer;
- void **srv_conf;
-
- ngx_array_t *servers; /* ngx_http_upstream_server_t */
-
- ngx_uint_t flags;
- ngx_str_t host;
- u_char *file_name;
- ngx_uint_t line;
- in_port_t port;
- in_port_t default_port;
- ngx_uint_t no_port; /* unsigned no_port:1 */
-};
-
-
-typedef struct {
- ngx_addr_t *addr;
- ngx_http_complex_value_t *value;
-} ngx_http_upstream_local_t;
-
-
-typedef struct {
- ngx_http_upstream_srv_conf_t *upstream;
-
- ngx_msec_t connect_timeout;
- ngx_msec_t send_timeout;
- ngx_msec_t read_timeout;
- ngx_msec_t timeout;
- ngx_msec_t next_upstream_timeout;
-
- size_t send_lowat;
- size_t buffer_size;
-
- size_t busy_buffers_size;
- size_t max_temp_file_size;
- size_t temp_file_write_size;
-
- size_t busy_buffers_size_conf;
- size_t max_temp_file_size_conf;
- size_t temp_file_write_size_conf;
-
- ngx_bufs_t bufs;
-
- ngx_uint_t ignore_headers;
- ngx_uint_t next_upstream;
- ngx_uint_t store_access;
- ngx_uint_t next_upstream_tries;
- ngx_flag_t buffering;
- ngx_flag_t pass_request_headers;
- ngx_flag_t pass_request_body;
-
- ngx_flag_t ignore_client_abort;
- ngx_flag_t intercept_errors;
- ngx_flag_t cyclic_temp_file;
-
- ngx_path_t *temp_path;
-
- ngx_hash_t hide_headers_hash;
- ngx_array_t *hide_headers;
- ngx_array_t *pass_headers;
-
- ngx_http_upstream_local_t *local;
-
-#if (NGX_HTTP_CACHE)
- ngx_shm_zone_t *cache;
-
- ngx_uint_t cache_min_uses;
- ngx_uint_t cache_use_stale;
- ngx_uint_t cache_methods;
-
- ngx_flag_t cache_lock;
- ngx_msec_t cache_lock_timeout;
-
- ngx_flag_t cache_revalidate;
-
- ngx_array_t *cache_valid;
- ngx_array_t *cache_bypass;
- ngx_array_t *no_cache;
-#endif
-
- ngx_array_t *store_lengths;
- ngx_array_t *store_values;
-
- signed store:2;
- unsigned intercept_404:1;
- unsigned change_buffering:1;
-
-#if (NGX_HTTP_SSL)
- ngx_ssl_t *ssl;
- ngx_flag_t ssl_session_reuse;
-
- ngx_http_complex_value_t *ssl_name;
- ngx_flag_t ssl_server_name;
- ngx_flag_t ssl_verify;
-#endif
-
- ngx_str_t module;
-} ngx_http_upstream_conf_t;
-
-
-typedef struct {
- ngx_str_t name;
- ngx_http_header_handler_pt handler;
- ngx_uint_t offset;
- ngx_http_header_handler_pt copy_handler;
- ngx_uint_t conf;
- ngx_uint_t redirect; /* unsigned redirect:1; */
-} ngx_http_upstream_header_t;
-
-
-typedef struct {
- ngx_list_t headers;
-
- ngx_uint_t status_n;
- ngx_str_t status_line;
-
- ngx_table_elt_t *status;
- ngx_table_elt_t *date;
- ngx_table_elt_t *server;
- ngx_table_elt_t *connection;
-
- ngx_table_elt_t *expires;
- ngx_table_elt_t *etag;
- ngx_table_elt_t *x_accel_expires;
- ngx_table_elt_t *x_accel_redirect;
- ngx_table_elt_t *x_accel_limit_rate;
-
- ngx_table_elt_t *content_type;
- ngx_table_elt_t *content_length;
-
- ngx_table_elt_t *last_modified;
- ngx_table_elt_t *location;
- ngx_table_elt_t *accept_ranges;
- ngx_table_elt_t *www_authenticate;
- ngx_table_elt_t *transfer_encoding;
-
-#if (NGX_HTTP_GZIP)
- ngx_table_elt_t *content_encoding;
-#endif
-
- ngx_array_t cache_control;
- ngx_array_t cookies;
-
- off_t content_length_n;
- time_t last_modified_time;
-
- unsigned connection_close:1;
- unsigned chunked:1;
-} ngx_http_upstream_headers_in_t;
-
-
-typedef struct {
- ngx_str_t host;
- in_port_t port;
- ngx_uint_t no_port; /* unsigned no_port:1 */
-
- ngx_uint_t naddrs;
- ngx_addr_t *addrs;
-
- struct sockaddr *sockaddr;
- socklen_t socklen;
-
- ngx_resolver_ctx_t *ctx;
-} ngx_http_upstream_resolved_t;
-
-
-typedef void (*ngx_http_upstream_handler_pt)(ngx_http_request_t *r,
- ngx_http_upstream_t *u);
-
-
-struct ngx_http_upstream_s {
- ngx_http_upstream_handler_pt read_event_handler;
- ngx_http_upstream_handler_pt write_event_handler;
-
- ngx_peer_connection_t peer;
-
- ngx_event_pipe_t *pipe;
-
- ngx_chain_t *request_bufs;
-
- ngx_output_chain_ctx_t output;
- ngx_chain_writer_ctx_t writer;
-
- ngx_http_upstream_conf_t *conf;
-
- ngx_http_upstream_headers_in_t headers_in;
-
- ngx_http_upstream_resolved_t *resolved;
-
- ngx_buf_t from_client;
-
- ngx_buf_t buffer;
- off_t length;
-
- ngx_chain_t *out_bufs;
- ngx_chain_t *busy_bufs;
- ngx_chain_t *free_bufs;
-
- ngx_int_t (*input_filter_init)(void *data);
- ngx_int_t (*input_filter)(void *data, ssize_t bytes);
- void *input_filter_ctx;
-
-#if (NGX_HTTP_CACHE)
- ngx_int_t (*create_key)(ngx_http_request_t *r);
-#endif
- ngx_int_t (*create_request)(ngx_http_request_t *r);
- ngx_int_t (*reinit_request)(ngx_http_request_t *r);
- ngx_int_t (*process_header)(ngx_http_request_t *r);
- void (*abort_request)(ngx_http_request_t *r);
- void (*finalize_request)(ngx_http_request_t *r,
- ngx_int_t rc);
- ngx_int_t (*rewrite_redirect)(ngx_http_request_t *r,
- ngx_table_elt_t *h, size_t prefix);
- ngx_int_t (*rewrite_cookie)(ngx_http_request_t *r,
- ngx_table_elt_t *h);
-
- ngx_msec_t timeout;
-
- ngx_http_upstream_state_t *state;
-
- ngx_str_t method;
- ngx_str_t schema;
- ngx_str_t uri;
-
-#if (NGX_HTTP_SSL)
- ngx_str_t ssl_name;
-#endif
-
- ngx_http_cleanup_pt *cleanup;
-
- unsigned store:1;
- unsigned cacheable:1;
- unsigned accel:1;
- unsigned ssl:1;
-#if (NGX_HTTP_CACHE)
- unsigned cache_status:3;
-#endif
-
- unsigned buffering:1;
- unsigned keepalive:1;
- unsigned upgrade:1;
-
- unsigned request_sent:1;
- unsigned header_sent:1;
-};
-
-
-typedef struct {
- ngx_uint_t status;
- ngx_uint_t mask;
-} ngx_http_upstream_next_t;
-
-
-typedef struct {
- ngx_str_t key;
- ngx_str_t value;
- ngx_uint_t skip_empty;
-} ngx_http_upstream_param_t;
-
-
-ngx_int_t ngx_http_upstream_cookie_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-ngx_int_t ngx_http_upstream_header_variable(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-ngx_int_t ngx_http_upstream_create(ngx_http_request_t *r);
-void ngx_http_upstream_init(ngx_http_request_t *r);
-ngx_http_upstream_srv_conf_t *ngx_http_upstream_add(ngx_conf_t *cf,
- ngx_url_t *u, ngx_uint_t flags);
-char *ngx_http_upstream_bind_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-char *ngx_http_upstream_param_set_slot(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-ngx_int_t ngx_http_upstream_hide_headers_hash(ngx_conf_t *cf,
- ngx_http_upstream_conf_t *conf, ngx_http_upstream_conf_t *prev,
- ngx_str_t *default_hide_headers, ngx_hash_init_t *hash);
-
-
-#define ngx_http_conf_upstream_srv_conf(uscf, module) \
- uscf->srv_conf[module.ctx_index]
-
-
-extern ngx_module_t ngx_http_upstream_module;
-extern ngx_conf_bitmask_t ngx_http_upstream_cache_method_mask[];
-extern ngx_conf_bitmask_t ngx_http_upstream_ignore_headers_masks[];
-
-
-#endif /* _NGX_HTTP_UPSTREAM_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.c
deleted file mode 100644
index 2d0649b7f73..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.c
+++ /dev/null
@@ -1,696 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-#define ngx_http_upstream_tries(p) ((p)->number \
- + ((p)->next ? (p)->next->number : 0))
-
-
-static ngx_http_upstream_rr_peer_t *ngx_http_upstream_get_peer(
- ngx_http_upstream_rr_peer_data_t *rrp);
-
-#if (NGX_HTTP_SSL)
-
-static ngx_int_t ngx_http_upstream_empty_set_session(ngx_peer_connection_t *pc,
- void *data);
-static void ngx_http_upstream_empty_save_session(ngx_peer_connection_t *pc,
- void *data);
-
-#endif
-
-
-ngx_int_t
-ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
- ngx_http_upstream_srv_conf_t *us)
-{
- ngx_url_t u;
- ngx_uint_t i, j, n, w;
- ngx_http_upstream_server_t *server;
- ngx_http_upstream_rr_peer_t *peer;
- ngx_http_upstream_rr_peers_t *peers, *backup;
-
- us->peer.init = ngx_http_upstream_init_round_robin_peer;
-
- if (us->servers) {
- server = us->servers->elts;
-
- n = 0;
- w = 0;
-
- for (i = 0; i < us->servers->nelts; i++) {
- if (server[i].backup) {
- continue;
- }
-
- n += server[i].naddrs;
- w += server[i].naddrs * server[i].weight;
- }
-
- if (n == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no servers in upstream \"%V\" in %s:%ui",
- &us->host, us->file_name, us->line);
- return NGX_ERROR;
- }
-
- peers = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_rr_peers_t)
- + sizeof(ngx_http_upstream_rr_peer_t) * (n - 1));
- if (peers == NULL) {
- return NGX_ERROR;
- }
-
- peers->single = (n == 1);
- peers->number = n;
- peers->weighted = (w != n);
- peers->total_weight = w;
- peers->name = &us->host;
-
- n = 0;
- peer = peers->peer;
-
- for (i = 0; i < us->servers->nelts; i++) {
- if (server[i].backup) {
- continue;
- }
-
- for (j = 0; j < server[i].naddrs; j++) {
- peer[n].sockaddr = server[i].addrs[j].sockaddr;
- peer[n].socklen = server[i].addrs[j].socklen;
- peer[n].name = server[i].addrs[j].name;
- peer[n].weight = server[i].weight;
- peer[n].effective_weight = server[i].weight;
- peer[n].current_weight = 0;
- peer[n].max_fails = server[i].max_fails;
- peer[n].fail_timeout = server[i].fail_timeout;
- peer[n].down = server[i].down;
- peer[n].server = server[i].name;
- n++;
- }
- }
-
- us->peer.data = peers;
-
- /* backup servers */
-
- n = 0;
- w = 0;
-
- for (i = 0; i < us->servers->nelts; i++) {
- if (!server[i].backup) {
- continue;
- }
-
- n += server[i].naddrs;
- w += server[i].naddrs * server[i].weight;
- }
-
- if (n == 0) {
- return NGX_OK;
- }
-
- backup = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_rr_peers_t)
- + sizeof(ngx_http_upstream_rr_peer_t) * (n - 1));
- if (backup == NULL) {
- return NGX_ERROR;
- }
-
- peers->single = 0;
- backup->single = 0;
- backup->number = n;
- backup->weighted = (w != n);
- backup->total_weight = w;
- backup->name = &us->host;
-
- n = 0;
- peer = backup->peer;
-
- for (i = 0; i < us->servers->nelts; i++) {
- if (!server[i].backup) {
- continue;
- }
-
- for (j = 0; j < server[i].naddrs; j++) {
- peer[n].sockaddr = server[i].addrs[j].sockaddr;
- peer[n].socklen = server[i].addrs[j].socklen;
- peer[n].name = server[i].addrs[j].name;
- peer[n].weight = server[i].weight;
- peer[n].effective_weight = server[i].weight;
- peer[n].current_weight = 0;
- peer[n].max_fails = server[i].max_fails;
- peer[n].fail_timeout = server[i].fail_timeout;
- peer[n].down = server[i].down;
- peer[n].server = server[i].name;
- n++;
- }
- }
-
- peers->next = backup;
-
- return NGX_OK;
- }
-
-
- /* an upstream implicitly defined by proxy_pass, etc. */
-
- if (us->port == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no port in upstream \"%V\" in %s:%ui",
- &us->host, us->file_name, us->line);
- return NGX_ERROR;
- }
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.host = us->host;
- u.port = us->port;
-
- if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
- if (u.err) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "%s in upstream \"%V\" in %s:%ui",
- u.err, &us->host, us->file_name, us->line);
- }
-
- return NGX_ERROR;
- }
-
- n = u.naddrs;
-
- peers = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_rr_peers_t)
- + sizeof(ngx_http_upstream_rr_peer_t) * (n - 1));
- if (peers == NULL) {
- return NGX_ERROR;
- }
-
- peers->single = (n == 1);
- peers->number = n;
- peers->weighted = 0;
- peers->total_weight = n;
- peers->name = &us->host;
-
- peer = peers->peer;
-
- for (i = 0; i < u.naddrs; i++) {
- peer[i].sockaddr = u.addrs[i].sockaddr;
- peer[i].socklen = u.addrs[i].socklen;
- peer[i].name = u.addrs[i].name;
- peer[i].weight = 1;
- peer[i].effective_weight = 1;
- peer[i].current_weight = 0;
- peer[i].max_fails = 1;
- peer[i].fail_timeout = 10;
- }
-
- us->peer.data = peers;
-
- /* implicitly defined upstream has no backup servers */
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_upstream_init_round_robin_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us)
-{
- ngx_uint_t n;
- ngx_http_upstream_rr_peer_data_t *rrp;
-
- rrp = r->upstream->peer.data;
-
- if (rrp == NULL) {
- rrp = ngx_palloc(r->pool, sizeof(ngx_http_upstream_rr_peer_data_t));
- if (rrp == NULL) {
- return NGX_ERROR;
- }
-
- r->upstream->peer.data = rrp;
- }
-
- rrp->peers = us->peer.data;
- rrp->current = 0;
-
- n = rrp->peers->number;
-
- if (rrp->peers->next && rrp->peers->next->number > n) {
- n = rrp->peers->next->number;
- }
-
- if (n <= 8 * sizeof(uintptr_t)) {
- rrp->tried = &rrp->data;
- rrp->data = 0;
-
- } else {
- n = (n + (8 * sizeof(uintptr_t) - 1)) / (8 * sizeof(uintptr_t));
-
- rrp->tried = ngx_pcalloc(r->pool, n * sizeof(uintptr_t));
- if (rrp->tried == NULL) {
- return NGX_ERROR;
- }
- }
-
- r->upstream->peer.get = ngx_http_upstream_get_round_robin_peer;
- r->upstream->peer.free = ngx_http_upstream_free_round_robin_peer;
- r->upstream->peer.tries = ngx_http_upstream_tries(rrp->peers);
-#if (NGX_HTTP_SSL)
- r->upstream->peer.set_session =
- ngx_http_upstream_set_round_robin_peer_session;
- r->upstream->peer.save_session =
- ngx_http_upstream_save_round_robin_peer_session;
-#endif
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
- ngx_http_upstream_resolved_t *ur)
-{
- u_char *p;
- size_t len;
- socklen_t socklen;
- ngx_uint_t i, n;
- struct sockaddr *sockaddr;
- ngx_http_upstream_rr_peer_t *peer;
- ngx_http_upstream_rr_peers_t *peers;
- ngx_http_upstream_rr_peer_data_t *rrp;
-
- rrp = r->upstream->peer.data;
-
- if (rrp == NULL) {
- rrp = ngx_palloc(r->pool, sizeof(ngx_http_upstream_rr_peer_data_t));
- if (rrp == NULL) {
- return NGX_ERROR;
- }
-
- r->upstream->peer.data = rrp;
- }
-
- peers = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_rr_peers_t)
- + sizeof(ngx_http_upstream_rr_peer_t) * (ur->naddrs - 1));
- if (peers == NULL) {
- return NGX_ERROR;
- }
-
- peers->single = (ur->naddrs == 1);
- peers->number = ur->naddrs;
- peers->name = &ur->host;
-
- peer = peers->peer;
-
- if (ur->sockaddr) {
- peer[0].sockaddr = ur->sockaddr;
- peer[0].socklen = ur->socklen;
- peer[0].name = ur->host;
- peer[0].weight = 1;
- peer[0].effective_weight = 1;
- peer[0].current_weight = 0;
- peer[0].max_fails = 1;
- peer[0].fail_timeout = 10;
-
- } else {
-
- for (i = 0; i < ur->naddrs; i++) {
-
- socklen = ur->addrs[i].socklen;
-
- sockaddr = ngx_palloc(r->pool, socklen);
- if (sockaddr == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(sockaddr, ur->addrs[i].sockaddr, socklen);
-
- switch (sockaddr->sa_family) {
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- ((struct sockaddr_in6 *) sockaddr)->sin6_port = htons(ur->port);
- break;
-#endif
- default: /* AF_INET */
- ((struct sockaddr_in *) sockaddr)->sin_port = htons(ur->port);
- }
-
- p = ngx_pnalloc(r->pool, NGX_SOCKADDR_STRLEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- len = ngx_sock_ntop(sockaddr, socklen, p, NGX_SOCKADDR_STRLEN, 1);
-
- peer[i].sockaddr = sockaddr;
- peer[i].socklen = socklen;
- peer[i].name.len = len;
- peer[i].name.data = p;
- peer[i].weight = 1;
- peer[i].effective_weight = 1;
- peer[i].current_weight = 0;
- peer[i].max_fails = 1;
- peer[i].fail_timeout = 10;
- }
- }
-
- rrp->peers = peers;
- rrp->current = 0;
-
- if (rrp->peers->number <= 8 * sizeof(uintptr_t)) {
- rrp->tried = &rrp->data;
- rrp->data = 0;
-
- } else {
- n = (rrp->peers->number + (8 * sizeof(uintptr_t) - 1))
- / (8 * sizeof(uintptr_t));
-
- rrp->tried = ngx_pcalloc(r->pool, n * sizeof(uintptr_t));
- if (rrp->tried == NULL) {
- return NGX_ERROR;
- }
- }
-
- r->upstream->peer.get = ngx_http_upstream_get_round_robin_peer;
- r->upstream->peer.free = ngx_http_upstream_free_round_robin_peer;
- r->upstream->peer.tries = ngx_http_upstream_tries(rrp->peers);
-#if (NGX_HTTP_SSL)
- r->upstream->peer.set_session = ngx_http_upstream_empty_set_session;
- r->upstream->peer.save_session = ngx_http_upstream_empty_save_session;
-#endif
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data)
-{
- ngx_http_upstream_rr_peer_data_t *rrp = data;
-
- ngx_int_t rc;
- ngx_uint_t i, n;
- ngx_http_upstream_rr_peer_t *peer;
- ngx_http_upstream_rr_peers_t *peers;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get rr peer, try: %ui", pc->tries);
-
- pc->cached = 0;
- pc->connection = NULL;
-
- peers = rrp->peers;
-
- /* ngx_lock_mutex(peers->mutex); */
-
- if (peers->single) {
- peer = &peers->peer[0];
-
- if (peer->down) {
- goto failed;
- }
-
- } else {
-
- /* there are several peers */
-
- peer = ngx_http_upstream_get_peer(rrp);
-
- if (peer == NULL) {
- goto failed;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "get rr peer, current: %ui %i",
- rrp->current, peer->current_weight);
- }
-
- pc->sockaddr = peer->sockaddr;
- pc->socklen = peer->socklen;
- pc->name = &peer->name;
-
- /* ngx_unlock_mutex(peers->mutex); */
-
- return NGX_OK;
-
-failed:
-
- if (peers->next) {
-
- /* ngx_unlock_mutex(peers->mutex); */
-
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, pc->log, 0, "backup servers");
-
- rrp->peers = peers->next;
-
- n = (rrp->peers->number + (8 * sizeof(uintptr_t) - 1))
- / (8 * sizeof(uintptr_t));
-
- for (i = 0; i < n; i++) {
- rrp->tried[i] = 0;
- }
-
- rc = ngx_http_upstream_get_round_robin_peer(pc, rrp);
-
- if (rc != NGX_BUSY) {
- return rc;
- }
-
- /* ngx_lock_mutex(peers->mutex); */
- }
-
- /* all peers failed, mark them as live for quick recovery */
-
- for (i = 0; i < peers->number; i++) {
- peers->peer[i].fails = 0;
- }
-
- /* ngx_unlock_mutex(peers->mutex); */
-
- pc->name = peers->name;
-
- return NGX_BUSY;
-}
-
-
-static ngx_http_upstream_rr_peer_t *
-ngx_http_upstream_get_peer(ngx_http_upstream_rr_peer_data_t *rrp)
-{
- time_t now;
- uintptr_t m;
- ngx_int_t total;
- ngx_uint_t i, n;
- ngx_http_upstream_rr_peer_t *peer, *best;
-
- now = ngx_time();
-
- best = NULL;
- total = 0;
-
- for (i = 0; i < rrp->peers->number; i++) {
-
- n = i / (8 * sizeof(uintptr_t));
- m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t));
-
- if (rrp->tried[n] & m) {
- continue;
- }
-
- peer = &rrp->peers->peer[i];
-
- if (peer->down) {
- continue;
- }
-
- if (peer->max_fails
- && peer->fails >= peer->max_fails
- && now - peer->checked <= peer->fail_timeout)
- {
- continue;
- }
-
- peer->current_weight += peer->effective_weight;
- total += peer->effective_weight;
-
- if (peer->effective_weight < peer->weight) {
- peer->effective_weight++;
- }
-
- if (best == NULL || peer->current_weight > best->current_weight) {
- best = peer;
- }
- }
-
- if (best == NULL) {
- return NULL;
- }
-
- i = best - &rrp->peers->peer[0];
-
- rrp->current = i;
-
- n = i / (8 * sizeof(uintptr_t));
- m = (uintptr_t) 1 << i % (8 * sizeof(uintptr_t));
-
- rrp->tried[n] |= m;
-
- best->current_weight -= total;
-
- if (now - best->checked > best->fail_timeout) {
- best->checked = now;
- }
-
- return best;
-}
-
-
-void
-ngx_http_upstream_free_round_robin_peer(ngx_peer_connection_t *pc, void *data,
- ngx_uint_t state)
-{
- ngx_http_upstream_rr_peer_data_t *rrp = data;
-
- time_t now;
- ngx_http_upstream_rr_peer_t *peer;
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "free rr peer %ui %ui", pc->tries, state);
-
- /* TODO: NGX_PEER_KEEPALIVE */
-
- if (rrp->peers->single) {
- pc->tries = 0;
- return;
- }
-
- peer = &rrp->peers->peer[rrp->current];
-
- if (state & NGX_PEER_FAILED) {
- now = ngx_time();
-
- /* ngx_lock_mutex(rrp->peers->mutex); */
-
- peer->fails++;
- peer->accessed = now;
- peer->checked = now;
-
- if (peer->max_fails) {
- peer->effective_weight -= peer->weight / peer->max_fails;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "free rr peer failed: %ui %i",
- rrp->current, peer->effective_weight);
-
- if (peer->effective_weight < 0) {
- peer->effective_weight = 0;
- }
-
- /* ngx_unlock_mutex(rrp->peers->mutex); */
-
- } else {
-
- /* mark peer live if check passed */
-
- if (peer->accessed < peer->checked) {
- peer->fails = 0;
- }
- }
-
- if (pc->tries) {
- pc->tries--;
- }
-
- /* ngx_unlock_mutex(rrp->peers->mutex); */
-}
-
-
-#if (NGX_HTTP_SSL)
-
-ngx_int_t
-ngx_http_upstream_set_round_robin_peer_session(ngx_peer_connection_t *pc,
- void *data)
-{
- ngx_http_upstream_rr_peer_data_t *rrp = data;
-
- ngx_int_t rc;
- ngx_ssl_session_t *ssl_session;
- ngx_http_upstream_rr_peer_t *peer;
-
- peer = &rrp->peers->peer[rrp->current];
-
- /* TODO: threads only mutex */
- /* ngx_lock_mutex(rrp->peers->mutex); */
-
- ssl_session = peer->ssl_session;
-
- rc = ngx_ssl_set_session(pc->connection, ssl_session);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "set session: %p", ssl_session);
-
- /* ngx_unlock_mutex(rrp->peers->mutex); */
-
- return rc;
-}
-
-
-void
-ngx_http_upstream_save_round_robin_peer_session(ngx_peer_connection_t *pc,
- void *data)
-{
- ngx_http_upstream_rr_peer_data_t *rrp = data;
-
- ngx_ssl_session_t *old_ssl_session, *ssl_session;
- ngx_http_upstream_rr_peer_t *peer;
-
- ssl_session = ngx_ssl_get_session(pc->connection);
-
- if (ssl_session == NULL) {
- return;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "save session: %p", ssl_session);
-
- peer = &rrp->peers->peer[rrp->current];
-
- /* TODO: threads only mutex */
- /* ngx_lock_mutex(rrp->peers->mutex); */
-
- old_ssl_session = peer->ssl_session;
- peer->ssl_session = ssl_session;
-
- /* ngx_unlock_mutex(rrp->peers->mutex); */
-
- if (old_ssl_session) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0,
- "old session: %p", old_ssl_session);
-
- /* TODO: may block */
-
- ngx_ssl_free_session(old_ssl_session);
- }
-}
-
-
-static ngx_int_t
-ngx_http_upstream_empty_set_session(ngx_peer_connection_t *pc, void *data)
-{
- return NGX_OK;
-}
-
-
-static void
-ngx_http_upstream_empty_save_session(ngx_peer_connection_t *pc, void *data)
-{
- return;
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.h
deleted file mode 100644
index 9db82a63c0d..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_upstream_round_robin.h
+++ /dev/null
@@ -1,90 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_UPSTREAM_ROUND_ROBIN_H_INCLUDED_
-#define _NGX_HTTP_UPSTREAM_ROUND_ROBIN_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef struct {
- struct sockaddr *sockaddr;
- socklen_t socklen;
- ngx_str_t name;
- ngx_str_t server;
-
- ngx_int_t current_weight;
- ngx_int_t effective_weight;
- ngx_int_t weight;
-
- ngx_uint_t fails;
- time_t accessed;
- time_t checked;
-
- ngx_uint_t max_fails;
- time_t fail_timeout;
-
- ngx_uint_t down; /* unsigned down:1; */
-
-#if (NGX_HTTP_SSL)
- ngx_ssl_session_t *ssl_session; /* local to a process */
-#endif
-} ngx_http_upstream_rr_peer_t;
-
-
-typedef struct ngx_http_upstream_rr_peers_s ngx_http_upstream_rr_peers_t;
-
-struct ngx_http_upstream_rr_peers_s {
- ngx_uint_t number;
-
- /* ngx_mutex_t *mutex; */
-
- ngx_uint_t total_weight;
-
- unsigned single:1;
- unsigned weighted:1;
-
- ngx_str_t *name;
-
- ngx_http_upstream_rr_peers_t *next;
-
- ngx_http_upstream_rr_peer_t peer[1];
-};
-
-
-typedef struct {
- ngx_http_upstream_rr_peers_t *peers;
- ngx_uint_t current;
- uintptr_t *tried;
- uintptr_t data;
-} ngx_http_upstream_rr_peer_data_t;
-
-
-ngx_int_t ngx_http_upstream_init_round_robin(ngx_conf_t *cf,
- ngx_http_upstream_srv_conf_t *us);
-ngx_int_t ngx_http_upstream_init_round_robin_peer(ngx_http_request_t *r,
- ngx_http_upstream_srv_conf_t *us);
-ngx_int_t ngx_http_upstream_create_round_robin_peer(ngx_http_request_t *r,
- ngx_http_upstream_resolved_t *ur);
-ngx_int_t ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc,
- void *data);
-void ngx_http_upstream_free_round_robin_peer(ngx_peer_connection_t *pc,
- void *data, ngx_uint_t state);
-
-#if (NGX_HTTP_SSL)
-ngx_int_t
- ngx_http_upstream_set_round_robin_peer_session(ngx_peer_connection_t *pc,
- void *data);
-void ngx_http_upstream_save_round_robin_peer_session(ngx_peer_connection_t *pc,
- void *data);
-#endif
-
-
-#endif /* _NGX_HTTP_UPSTREAM_ROUND_ROBIN_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.c
deleted file mode 100644
index 738f2237ac7..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.c
+++ /dev/null
@@ -1,2616 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-#include <nginx.h>
-
-
-static ngx_int_t ngx_http_variable_request(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-#if 0
-static void ngx_http_variable_request_set(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-#endif
-static ngx_int_t ngx_http_variable_request_get_size(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static void ngx_http_variable_request_set_size(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_header(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-static ngx_int_t ngx_http_variable_cookies(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_headers(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_headers_internal(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data, u_char sep);
-
-static ngx_int_t ngx_http_variable_unknown_header_in(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_unknown_header_out(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_request_line(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_cookie(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_argument(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-#if (NGX_HAVE_TCP_INFO)
-static ngx_int_t ngx_http_variable_tcpinfo(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-#endif
-
-static ngx_int_t ngx_http_variable_content_length(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_host(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_binary_remote_addr(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_remote_addr(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_remote_port(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_proxy_protocol_addr(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_server_addr(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_server_port(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_scheme(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_https(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static void ngx_http_variable_set_args(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_is_args(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_document_root(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_realpath_root(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_request_filename(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_server_name(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_request_method(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_remote_user(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_bytes_sent(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_body_bytes_sent(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_pipe(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_request_completion(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_request_body(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_request_body_file(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_request_length(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_request_time(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_status(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-static ngx_int_t ngx_http_variable_sent_content_type(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_sent_content_length(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_sent_location(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_sent_last_modified(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_sent_connection(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_sent_keep_alive(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_sent_transfer_encoding(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-static ngx_int_t ngx_http_variable_connection(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_connection_requests(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-static ngx_int_t ngx_http_variable_nginx_version(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_hostname(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_pid(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_msec(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_time_iso8601(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-static ngx_int_t ngx_http_variable_time_local(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-/*
- * TODO:
- * Apache CGI: AUTH_TYPE, PATH_INFO (null), PATH_TRANSLATED
- * REMOTE_HOST (null), REMOTE_IDENT (null),
- * SERVER_SOFTWARE
- *
- * Apache SSI: DOCUMENT_NAME, LAST_MODIFIED, USER_NAME (file owner)
- */
-
-/*
- * the $http_host, $http_user_agent, $http_referer, and $http_via
- * variables may be handled by generic
- * ngx_http_variable_unknown_header_in(), but for performance reasons
- * they are handled using dedicated entries
- */
-
-static ngx_http_variable_t ngx_http_core_variables[] = {
-
- { ngx_string("http_host"), NULL, ngx_http_variable_header,
- offsetof(ngx_http_request_t, headers_in.host), 0, 0 },
-
- { ngx_string("http_user_agent"), NULL, ngx_http_variable_header,
- offsetof(ngx_http_request_t, headers_in.user_agent), 0, 0 },
-
- { ngx_string("http_referer"), NULL, ngx_http_variable_header,
- offsetof(ngx_http_request_t, headers_in.referer), 0, 0 },
-
-#if (NGX_HTTP_GZIP)
- { ngx_string("http_via"), NULL, ngx_http_variable_header,
- offsetof(ngx_http_request_t, headers_in.via), 0, 0 },
-#endif
-
-#if (NGX_HTTP_X_FORWARDED_FOR)
- { ngx_string("http_x_forwarded_for"), NULL, ngx_http_variable_headers,
- offsetof(ngx_http_request_t, headers_in.x_forwarded_for), 0, 0 },
-#endif
-
- { ngx_string("http_cookie"), NULL, ngx_http_variable_cookies,
- offsetof(ngx_http_request_t, headers_in.cookies), 0, 0 },
-
- { ngx_string("content_length"), NULL, ngx_http_variable_content_length,
- 0, 0, 0 },
-
- { ngx_string("content_type"), NULL, ngx_http_variable_header,
- offsetof(ngx_http_request_t, headers_in.content_type), 0, 0 },
-
- { ngx_string("host"), NULL, ngx_http_variable_host, 0, 0, 0 },
-
- { ngx_string("binary_remote_addr"), NULL,
- ngx_http_variable_binary_remote_addr, 0, 0, 0 },
-
- { ngx_string("remote_addr"), NULL, ngx_http_variable_remote_addr, 0, 0, 0 },
-
- { ngx_string("remote_port"), NULL, ngx_http_variable_remote_port, 0, 0, 0 },
-
- { ngx_string("proxy_protocol_addr"), NULL,
- ngx_http_variable_proxy_protocol_addr, 0, 0, 0 },
-
- { ngx_string("server_addr"), NULL, ngx_http_variable_server_addr, 0, 0, 0 },
-
- { ngx_string("server_port"), NULL, ngx_http_variable_server_port, 0, 0, 0 },
-
- { ngx_string("server_protocol"), NULL, ngx_http_variable_request,
- offsetof(ngx_http_request_t, http_protocol), 0, 0 },
-
- { ngx_string("scheme"), NULL, ngx_http_variable_scheme, 0, 0, 0 },
-
- { ngx_string("https"), NULL, ngx_http_variable_https, 0, 0, 0 },
-
- { ngx_string("request_uri"), NULL, ngx_http_variable_request,
- offsetof(ngx_http_request_t, unparsed_uri), 0, 0 },
-
- { ngx_string("uri"), NULL, ngx_http_variable_request,
- offsetof(ngx_http_request_t, uri),
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("document_uri"), NULL, ngx_http_variable_request,
- offsetof(ngx_http_request_t, uri),
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("request"), NULL, ngx_http_variable_request_line, 0, 0, 0 },
-
- { ngx_string("document_root"), NULL,
- ngx_http_variable_document_root, 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("realpath_root"), NULL,
- ngx_http_variable_realpath_root, 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("query_string"), NULL, ngx_http_variable_request,
- offsetof(ngx_http_request_t, args),
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("args"),
- ngx_http_variable_set_args,
- ngx_http_variable_request,
- offsetof(ngx_http_request_t, args),
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("is_args"), NULL, ngx_http_variable_is_args,
- 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("request_filename"), NULL,
- ngx_http_variable_request_filename, 0,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("server_name"), NULL, ngx_http_variable_server_name, 0, 0, 0 },
-
- { ngx_string("request_method"), NULL,
- ngx_http_variable_request_method, 0,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("remote_user"), NULL, ngx_http_variable_remote_user, 0, 0, 0 },
-
- { ngx_string("bytes_sent"), NULL, ngx_http_variable_bytes_sent,
- 0, 0, 0 },
-
- { ngx_string("body_bytes_sent"), NULL, ngx_http_variable_body_bytes_sent,
- 0, 0, 0 },
-
- { ngx_string("pipe"), NULL, ngx_http_variable_pipe,
- 0, 0, 0 },
-
- { ngx_string("request_completion"), NULL,
- ngx_http_variable_request_completion,
- 0, 0, 0 },
-
- { ngx_string("request_body"), NULL,
- ngx_http_variable_request_body,
- 0, 0, 0 },
-
- { ngx_string("request_body_file"), NULL,
- ngx_http_variable_request_body_file,
- 0, 0, 0 },
-
- { ngx_string("request_length"), NULL, ngx_http_variable_request_length,
- 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("request_time"), NULL, ngx_http_variable_request_time,
- 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("status"), NULL,
- ngx_http_variable_status, 0,
- NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("sent_http_content_type"), NULL,
- ngx_http_variable_sent_content_type, 0, 0, 0 },
-
- { ngx_string("sent_http_content_length"), NULL,
- ngx_http_variable_sent_content_length, 0, 0, 0 },
-
- { ngx_string("sent_http_location"), NULL,
- ngx_http_variable_sent_location, 0, 0, 0 },
-
- { ngx_string("sent_http_last_modified"), NULL,
- ngx_http_variable_sent_last_modified, 0, 0, 0 },
-
- { ngx_string("sent_http_connection"), NULL,
- ngx_http_variable_sent_connection, 0, 0, 0 },
-
- { ngx_string("sent_http_keep_alive"), NULL,
- ngx_http_variable_sent_keep_alive, 0, 0, 0 },
-
- { ngx_string("sent_http_transfer_encoding"), NULL,
- ngx_http_variable_sent_transfer_encoding, 0, 0, 0 },
-
- { ngx_string("sent_http_cache_control"), NULL, ngx_http_variable_headers,
- offsetof(ngx_http_request_t, headers_out.cache_control), 0, 0 },
-
- { ngx_string("limit_rate"), ngx_http_variable_request_set_size,
- ngx_http_variable_request_get_size,
- offsetof(ngx_http_request_t, limit_rate),
- NGX_HTTP_VAR_CHANGEABLE|NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("connection"), NULL,
- ngx_http_variable_connection, 0, 0, 0 },
-
- { ngx_string("connection_requests"), NULL,
- ngx_http_variable_connection_requests, 0, 0, 0 },
-
- { ngx_string("nginx_version"), NULL, ngx_http_variable_nginx_version,
- 0, 0, 0 },
-
- { ngx_string("hostname"), NULL, ngx_http_variable_hostname,
- 0, 0, 0 },
-
- { ngx_string("pid"), NULL, ngx_http_variable_pid,
- 0, 0, 0 },
-
- { ngx_string("msec"), NULL, ngx_http_variable_msec,
- 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("time_iso8601"), NULL, ngx_http_variable_time_iso8601,
- 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("time_local"), NULL, ngx_http_variable_time_local,
- 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
-#if (NGX_HAVE_TCP_INFO)
- { ngx_string("tcpinfo_rtt"), NULL, ngx_http_variable_tcpinfo,
- 0, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("tcpinfo_rttvar"), NULL, ngx_http_variable_tcpinfo,
- 1, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("tcpinfo_snd_cwnd"), NULL, ngx_http_variable_tcpinfo,
- 2, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-
- { ngx_string("tcpinfo_rcv_space"), NULL, ngx_http_variable_tcpinfo,
- 3, NGX_HTTP_VAR_NOCACHEABLE, 0 },
-#endif
-
- { ngx_null_string, NULL, NULL, 0, 0, 0 }
-};
-
-
-ngx_http_variable_value_t ngx_http_variable_null_value =
- ngx_http_variable("");
-ngx_http_variable_value_t ngx_http_variable_true_value =
- ngx_http_variable("1");
-
-
-ngx_http_variable_t *
-ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name, ngx_uint_t flags)
-{
- ngx_int_t rc;
- ngx_uint_t i;
- ngx_hash_key_t *key;
- ngx_http_variable_t *v;
- ngx_http_core_main_conf_t *cmcf;
-
- if (name->len == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"$\"");
- return NULL;
- }
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- key = cmcf->variables_keys->keys.elts;
- for (i = 0; i < cmcf->variables_keys->keys.nelts; i++) {
- if (name->len != key[i].key.len
- || ngx_strncasecmp(name->data, key[i].key.data, name->len) != 0)
- {
- continue;
- }
-
- v = key[i].value;
-
- if (!(v->flags & NGX_HTTP_VAR_CHANGEABLE)) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the duplicate \"%V\" variable", name);
- return NULL;
- }
-
- return v;
- }
-
- v = ngx_palloc(cf->pool, sizeof(ngx_http_variable_t));
- if (v == NULL) {
- return NULL;
- }
-
- v->name.len = name->len;
- v->name.data = ngx_pnalloc(cf->pool, name->len);
- if (v->name.data == NULL) {
- return NULL;
- }
-
- ngx_strlow(v->name.data, name->data, name->len);
-
- v->set_handler = NULL;
- v->get_handler = NULL;
- v->data = 0;
- v->flags = flags;
- v->index = 0;
-
- rc = ngx_hash_add_key(cmcf->variables_keys, &v->name, v, 0);
-
- if (rc == NGX_ERROR) {
- return NULL;
- }
-
- if (rc == NGX_BUSY) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "conflicting variable name \"%V\"", name);
- return NULL;
- }
-
- return v;
-}
-
-
-ngx_int_t
-ngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name)
-{
- ngx_uint_t i;
- ngx_http_variable_t *v;
- ngx_http_core_main_conf_t *cmcf;
-
- if (name->len == 0) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid variable name \"$\"");
- return NGX_ERROR;
- }
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- v = cmcf->variables.elts;
-
- if (v == NULL) {
- if (ngx_array_init(&cmcf->variables, cf->pool, 4,
- sizeof(ngx_http_variable_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- } else {
- for (i = 0; i < cmcf->variables.nelts; i++) {
- if (name->len != v[i].name.len
- || ngx_strncasecmp(name->data, v[i].name.data, name->len) != 0)
- {
- continue;
- }
-
- return i;
- }
- }
-
- v = ngx_array_push(&cmcf->variables);
- if (v == NULL) {
- return NGX_ERROR;
- }
-
- v->name.len = name->len;
- v->name.data = ngx_pnalloc(cf->pool, name->len);
- if (v->name.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_strlow(v->name.data, name->data, name->len);
-
- v->set_handler = NULL;
- v->get_handler = NULL;
- v->data = 0;
- v->flags = 0;
- v->index = cmcf->variables.nelts - 1;
-
- return v->index;
-}
-
-
-ngx_http_variable_value_t *
-ngx_http_get_indexed_variable(ngx_http_request_t *r, ngx_uint_t index)
-{
- ngx_http_variable_t *v;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- if (cmcf->variables.nelts <= index) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "unknown variable index: %ui", index);
- return NULL;
- }
-
- if (r->variables[index].not_found || r->variables[index].valid) {
- return &r->variables[index];
- }
-
- v = cmcf->variables.elts;
-
- if (v[index].get_handler(r, &r->variables[index], v[index].data)
- == NGX_OK)
- {
- if (v[index].flags & NGX_HTTP_VAR_NOCACHEABLE) {
- r->variables[index].no_cacheable = 1;
- }
-
- return &r->variables[index];
- }
-
- r->variables[index].valid = 0;
- r->variables[index].not_found = 1;
-
- return NULL;
-}
-
-
-ngx_http_variable_value_t *
-ngx_http_get_flushed_variable(ngx_http_request_t *r, ngx_uint_t index)
-{
- ngx_http_variable_value_t *v;
-
- v = &r->variables[index];
-
- if (v->valid || v->not_found) {
- if (!v->no_cacheable) {
- return v;
- }
-
- v->valid = 0;
- v->not_found = 0;
- }
-
- return ngx_http_get_indexed_variable(r, index);
-}
-
-
-ngx_http_variable_value_t *
-ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key)
-{
- ngx_http_variable_t *v;
- ngx_http_variable_value_t *vv;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- v = ngx_hash_find(&cmcf->variables_hash, key, name->data, name->len);
-
- if (v) {
- if (v->flags & NGX_HTTP_VAR_INDEXED) {
- return ngx_http_get_flushed_variable(r, v->index);
-
- } else {
-
- vv = ngx_palloc(r->pool, sizeof(ngx_http_variable_value_t));
-
- if (vv && v->get_handler(r, vv, v->data) == NGX_OK) {
- return vv;
- }
-
- return NULL;
- }
- }
-
- vv = ngx_palloc(r->pool, sizeof(ngx_http_variable_value_t));
- if (vv == NULL) {
- return NULL;
- }
-
- if (ngx_strncmp(name->data, "http_", 5) == 0) {
-
- if (ngx_http_variable_unknown_header_in(r, vv, (uintptr_t) name)
- == NGX_OK)
- {
- return vv;
- }
-
- return NULL;
- }
-
- if (ngx_strncmp(name->data, "sent_http_", 10) == 0) {
-
- if (ngx_http_variable_unknown_header_out(r, vv, (uintptr_t) name)
- == NGX_OK)
- {
- return vv;
- }
-
- return NULL;
- }
-
- if (ngx_strncmp(name->data, "upstream_http_", 14) == 0) {
-
- if (ngx_http_upstream_header_variable(r, vv, (uintptr_t) name)
- == NGX_OK)
- {
- return vv;
- }
-
- return NULL;
- }
-
- if (ngx_strncmp(name->data, "cookie_", 7) == 0) {
-
- if (ngx_http_variable_cookie(r, vv, (uintptr_t) name) == NGX_OK) {
- return vv;
- }
-
- return NULL;
- }
-
- if (ngx_strncmp(name->data, "upstream_cookie_", 16) == 0) {
-
- if (ngx_http_upstream_cookie_variable(r, vv, (uintptr_t) name)
- == NGX_OK)
- {
- return vv;
- }
-
- return NULL;
- }
-
- if (ngx_strncmp(name->data, "arg_", 4) == 0) {
-
- if (ngx_http_variable_argument(r, vv, (uintptr_t) name) == NGX_OK) {
- return vv;
- }
-
- return NULL;
- }
-
- vv->not_found = 1;
-
- return vv;
-}
-
-
-static ngx_int_t
-ngx_http_variable_request(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_str_t *s;
-
- s = (ngx_str_t *) ((char *) r + data);
-
- if (s->data) {
- v->len = s->len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = s->data;
-
- } else {
- v->not_found = 1;
- }
-
- return NGX_OK;
-}
-
-
-#if 0
-
-static void
-ngx_http_variable_request_set(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_str_t *s;
-
- s = (ngx_str_t *) ((char *) r + data);
-
- s->len = v->len;
- s->data = v->data;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_variable_request_get_size(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- size_t *sp;
-
- sp = (size_t *) ((char *) r + data);
-
- v->data = ngx_pnalloc(r->pool, NGX_SIZE_T_LEN);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(v->data, "%uz", *sp) - v->data;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_variable_request_set_size(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ssize_t s, *sp;
- ngx_str_t val;
-
- val.len = v->len;
- val.data = v->data;
-
- s = ngx_parse_size(&val);
-
- if (s == NGX_ERROR) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "invalid size \"%V\"", &val);
- return;
- }
-
- sp = (ssize_t *) ((char *) r + data);
-
- *sp = s;
-
- return;
-}
-
-
-static ngx_int_t
-ngx_http_variable_header(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_table_elt_t *h;
-
- h = *(ngx_table_elt_t **) ((char *) r + data);
-
- if (h) {
- v->len = h->value.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = h->value.data;
-
- } else {
- v->not_found = 1;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_cookies(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- return ngx_http_variable_headers_internal(r, v, data, ';');
-}
-
-
-static ngx_int_t
-ngx_http_variable_headers(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- return ngx_http_variable_headers_internal(r, v, data, ',');
-}
-
-
-static ngx_int_t
-ngx_http_variable_headers_internal(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data, u_char sep)
-{
- size_t len;
- u_char *p, *end;
- ngx_uint_t i, n;
- ngx_array_t *a;
- ngx_table_elt_t **h;
-
- a = (ngx_array_t *) ((char *) r + data);
-
- n = a->nelts;
- h = a->elts;
-
- len = 0;
-
- for (i = 0; i < n; i++) {
-
- if (h[i]->hash == 0) {
- continue;
- }
-
- len += h[i]->value.len + 2;
- }
-
- if (len == 0) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- len -= 2;
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- if (n == 1) {
- v->len = (*h)->value.len;
- v->data = (*h)->value.data;
-
- return NGX_OK;
- }
-
- p = ngx_pnalloc(r->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = len;
- v->data = p;
-
- end = p + len;
-
- for (i = 0; /* void */ ; i++) {
-
- if (h[i]->hash == 0) {
- continue;
- }
-
- p = ngx_copy(p, h[i]->value.data, h[i]->value.len);
-
- if (p == end) {
- break;
- }
-
- *p++ = sep; *p++ = ' ';
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_unknown_header_in(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- return ngx_http_variable_unknown_header(v, (ngx_str_t *) data,
- &r->headers_in.headers.part,
- sizeof("http_") - 1);
-}
-
-
-static ngx_int_t
-ngx_http_variable_unknown_header_out(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- return ngx_http_variable_unknown_header(v, (ngx_str_t *) data,
- &r->headers_out.headers.part,
- sizeof("sent_http_") - 1);
-}
-
-
-ngx_int_t
-ngx_http_variable_unknown_header(ngx_http_variable_value_t *v, ngx_str_t *var,
- ngx_list_part_t *part, size_t prefix)
-{
- u_char ch;
- ngx_uint_t i, n;
- ngx_table_elt_t *header;
-
- header = part->elts;
-
- for (i = 0; /* void */ ; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
-
- part = part->next;
- header = part->elts;
- i = 0;
- }
-
- if (header[i].hash == 0) {
- continue;
- }
-
- for (n = 0; n + prefix < var->len && n < header[i].key.len; n++) {
- ch = header[i].key.data[n];
-
- if (ch >= 'A' && ch <= 'Z') {
- ch |= 0x20;
-
- } else if (ch == '-') {
- ch = '_';
- }
-
- if (var->data[n + prefix] != ch) {
- break;
- }
- }
-
- if (n + prefix == var->len && n == header[i].key.len) {
- v->len = header[i].value.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = header[i].value.data;
-
- return NGX_OK;
- }
- }
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_request_line(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p, *s;
-
- s = r->request_line.data;
-
- if (s == NULL) {
- s = r->request_start;
-
- if (s == NULL) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- for (p = s; p < r->header_in->last; p++) {
- if (*p == CR || *p == LF) {
- break;
- }
- }
-
- r->request_line.len = p - s;
- r->request_line.data = s;
- }
-
- v->len = r->request_line.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = s;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_cookie(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_str_t *name = (ngx_str_t *) data;
-
- ngx_str_t cookie, s;
-
- s.len = name->len - (sizeof("cookie_") - 1);
- s.data = name->data + sizeof("cookie_") - 1;
-
- if (ngx_http_parse_multi_header_lines(&r->headers_in.cookies, &s, &cookie)
- == NGX_DECLINED)
- {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->len = cookie.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = cookie.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_argument(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_str_t *name = (ngx_str_t *) data;
-
- u_char *arg;
- size_t len;
- ngx_str_t value;
-
- len = name->len - (sizeof("arg_") - 1);
- arg = name->data + sizeof("arg_") - 1;
-
- if (ngx_http_arg(r, arg, len, &value) != NGX_OK) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->data = value.data;
- v->len = value.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
-}
-
-
-#if (NGX_HAVE_TCP_INFO)
-
-static ngx_int_t
-ngx_http_variable_tcpinfo(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- struct tcp_info ti;
- socklen_t len;
- uint32_t value;
-
- len = sizeof(struct tcp_info);
- if (getsockopt(r->connection->fd, IPPROTO_TCP, TCP_INFO, &ti, &len) == -1) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- v->data = ngx_pnalloc(r->pool, NGX_INT32_LEN);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- switch (data) {
- case 0:
- value = ti.tcpi_rtt;
- break;
-
- case 1:
- value = ti.tcpi_rttvar;
- break;
-
- case 2:
- value = ti.tcpi_snd_cwnd;
- break;
-
- case 3:
- value = ti.tcpi_rcv_space;
- break;
-
- /* suppress warning */
- default:
- value = 0;
- break;
- }
-
- v->len = ngx_sprintf(v->data, "%uD", value) - v->data;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_http_variable_content_length(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- if (r->headers_in.content_length) {
- v->len = r->headers_in.content_length->value.len;
- v->data = r->headers_in.content_length->value.data;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- } else if (r->headers_in.content_length_n >= 0) {
- p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(p, "%O", r->headers_in.content_length_n) - p;
- v->data = p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- } else {
- v->not_found = 1;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_host(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- ngx_http_core_srv_conf_t *cscf;
-
- if (r->headers_in.server.len) {
- v->len = r->headers_in.server.len;
- v->data = r->headers_in.server.data;
-
- } else {
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- v->len = cscf->server_name.len;
- v->data = cscf->server_name.data;
- }
-
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_binary_remote_addr(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- struct sockaddr_in *sin;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
-
- switch (r->connection->sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) r->connection->sockaddr;
-
- v->len = sizeof(struct in6_addr);
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = sin6->sin6_addr.s6_addr;
-
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) r->connection->sockaddr;
-
- v->len = sizeof(in_addr_t);
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) &sin->sin_addr;
-
- break;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_remote_addr(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- v->len = r->connection->addr_text.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = r->connection->addr_text.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_remote_port(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_uint_t port;
- struct sockaddr_in *sin;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
-
- v->len = 0;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- v->data = ngx_pnalloc(r->pool, sizeof("65535") - 1);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- switch (r->connection->sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) r->connection->sockaddr;
- port = ntohs(sin6->sin6_port);
- break;
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- port = 0;
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) r->connection->sockaddr;
- port = ntohs(sin->sin_port);
- break;
- }
-
- if (port > 0 && port < 65536) {
- v->len = ngx_sprintf(v->data, "%ui", port) - v->data;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_proxy_protocol_addr(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- v->len = r->connection->proxy_protocol_addr.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = r->connection->proxy_protocol_addr.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_server_addr(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_str_t s;
- u_char addr[NGX_SOCKADDR_STRLEN];
-
- s.len = NGX_SOCKADDR_STRLEN;
- s.data = addr;
-
- if (ngx_connection_local_sockaddr(r->connection, &s, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- s.data = ngx_pnalloc(r->pool, s.len);
- if (s.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s.data, addr, s.len);
-
- v->len = s.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = s.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_server_port(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_uint_t port;
- struct sockaddr_in *sin;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
-
- v->len = 0;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- if (ngx_connection_local_sockaddr(r->connection, NULL, 0) != NGX_OK) {
- return NGX_ERROR;
- }
-
- v->data = ngx_pnalloc(r->pool, sizeof("65535") - 1);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- switch (r->connection->local_sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) r->connection->local_sockaddr;
- port = ntohs(sin6->sin6_port);
- break;
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- port = 0;
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) r->connection->local_sockaddr;
- port = ntohs(sin->sin_port);
- break;
- }
-
- if (port > 0 && port < 65536) {
- v->len = ngx_sprintf(v->data, "%ui", port) - v->data;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_scheme(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
-#if (NGX_HTTP_SSL)
-
- if (r->connection->ssl) {
- v->len = sizeof("https") - 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) "https";
-
- return NGX_OK;
- }
-
-#endif
-
- v->len = sizeof("http") - 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) "http";
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_https(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
-#if (NGX_HTTP_SSL)
-
- if (r->connection->ssl) {
- v->len = sizeof("on") - 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) "on";
-
- return NGX_OK;
- }
-
-#endif
-
- *v = ngx_http_variable_null_value;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_http_variable_set_args(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- r->args.len = v->len;
- r->args.data = v->data;
- r->valid_unparsed_uri = 0;
-}
-
-
-static ngx_int_t
-ngx_http_variable_is_args(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- if (r->args.len == 0) {
- v->len = 0;
- v->data = NULL;
- return NGX_OK;
- }
-
- v->len = 1;
- v->data = (u_char *) "?";
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_document_root(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_str_t path;
- ngx_http_core_loc_conf_t *clcf;
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->root_lengths == NULL) {
- v->len = clcf->root.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = clcf->root.data;
-
- } else {
- if (ngx_http_script_run(r, &path, clcf->root_lengths->elts, 0,
- clcf->root_values->elts)
- == NULL)
- {
- return NGX_ERROR;
- }
-
- if (ngx_get_full_name(r->pool, (ngx_str_t *) &ngx_cycle->prefix, &path)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- v->len = path.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = path.data;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_realpath_root(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *real;
- size_t len;
- ngx_str_t path;
- ngx_http_core_loc_conf_t *clcf;
-#if (NGX_HAVE_MAX_PATH)
- u_char buffer[NGX_MAX_PATH];
-#endif
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->root_lengths == NULL) {
- path = clcf->root;
-
- } else {
- if (ngx_http_script_run(r, &path, clcf->root_lengths->elts, 1,
- clcf->root_values->elts)
- == NULL)
- {
- return NGX_ERROR;
- }
-
- path.data[path.len - 1] = '\0';
-
- if (ngx_get_full_name(r->pool, (ngx_str_t *) &ngx_cycle->prefix, &path)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
- }
-
-#if (NGX_HAVE_MAX_PATH)
- real = buffer;
-#else
- real = NULL;
-#endif
-
- real = ngx_realpath(path.data, real);
-
- if (real == NULL) {
- ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
- ngx_realpath_n " \"%s\" failed", path.data);
- return NGX_ERROR;
- }
-
- len = ngx_strlen(real);
-
- v->data = ngx_pnalloc(r->pool, len);
- if (v->data == NULL) {
-#if !(NGX_HAVE_MAX_PATH)
- ngx_free(real);
-#endif
- return NGX_ERROR;
- }
-
- v->len = len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- ngx_memcpy(v->data, real, len);
-
-#if !(NGX_HAVE_MAX_PATH)
- ngx_free(real);
-#endif
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_request_filename(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- size_t root;
- ngx_str_t path;
-
- if (ngx_http_map_uri_to_path(r, &path, &root, 0) == NULL) {
- return NGX_ERROR;
- }
-
- /* ngx_http_map_uri_to_path() allocates memory for terminating '\0' */
-
- v->len = path.len - 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = path.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_server_name(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_http_core_srv_conf_t *cscf;
-
- cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
-
- v->len = cscf->server_name.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = cscf->server_name.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_request_method(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- if (r->main->method_name.data) {
- v->len = r->main->method_name.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = r->main->method_name.data;
-
- } else {
- v->not_found = 1;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_remote_user(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_int_t rc;
-
- rc = ngx_http_auth_basic_user(r);
-
- if (rc == NGX_DECLINED) {
- v->not_found = 1;
- return NGX_OK;
- }
-
- if (rc == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- v->len = r->headers_in.user.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = r->headers_in.user.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_bytes_sent(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(p, "%O", r->connection->sent) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_body_bytes_sent(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- off_t sent;
- u_char *p;
-
- sent = r->connection->sent - r->header_size;
-
- if (sent < 0) {
- sent = 0;
- }
-
- p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(p, "%O", sent) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_pipe(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- v->data = (u_char *) (r->pipeline ? "p" : ".");
- v->len = 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_status(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_uint_t status;
-
- v->data = ngx_pnalloc(r->pool, NGX_INT_T_LEN);
- if (v->data == NULL) {
- return NGX_ERROR;
- }
-
- if (r->err_status) {
- status = r->err_status;
-
- } else if (r->headers_out.status) {
- status = r->headers_out.status;
-
- } else if (r->http_version == NGX_HTTP_VERSION_9) {
- status = 9;
-
- } else {
- status = 0;
- }
-
- v->len = ngx_sprintf(v->data, "%03ui", status) - v->data;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_sent_content_type(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- if (r->headers_out.content_type.len) {
- v->len = r->headers_out.content_type.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = r->headers_out.content_type.data;
-
- } else {
- v->not_found = 1;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_sent_content_length(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- if (r->headers_out.content_length) {
- v->len = r->headers_out.content_length->value.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = r->headers_out.content_length->value.data;
-
- return NGX_OK;
- }
-
- if (r->headers_out.content_length_n >= 0) {
- p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(p, "%O", r->headers_out.content_length_n) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
- }
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_sent_location(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- ngx_str_t name;
-
- if (r->headers_out.location) {
- v->len = r->headers_out.location->value.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = r->headers_out.location->value.data;
-
- return NGX_OK;
- }
-
- ngx_str_set(&name, "sent_http_location");
-
- return ngx_http_variable_unknown_header(v, &name,
- &r->headers_out.headers.part,
- sizeof("sent_http_") - 1);
-}
-
-
-static ngx_int_t
-ngx_http_variable_sent_last_modified(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- if (r->headers_out.last_modified) {
- v->len = r->headers_out.last_modified->value.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = r->headers_out.last_modified->value.data;
-
- return NGX_OK;
- }
-
- if (r->headers_out.last_modified_time >= 0) {
- p = ngx_pnalloc(r->pool, sizeof("Mon, 28 Sep 1970 06:00:00 GMT") - 1);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_http_time(p, r->headers_out.last_modified_time) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
- }
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_sent_connection(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- size_t len;
- char *p;
-
- if (r->headers_out.status == NGX_HTTP_SWITCHING_PROTOCOLS) {
- len = sizeof("upgrade") - 1;
- p = "upgrade";
-
- } else if (r->keepalive) {
- len = sizeof("keep-alive") - 1;
- p = "keep-alive";
-
- } else {
- len = sizeof("close") - 1;
- p = "close";
- }
-
- v->len = len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_sent_keep_alive(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- ngx_http_core_loc_conf_t *clcf;
-
- if (r->keepalive) {
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- if (clcf->keepalive_header) {
-
- p = ngx_pnalloc(r->pool, sizeof("timeout=") - 1 + NGX_TIME_T_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(p, "timeout=%T", clcf->keepalive_header) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
- }
- }
-
- v->not_found = 1;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_sent_transfer_encoding(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- if (r->chunked) {
- v->len = sizeof("chunked") - 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) "chunked";
-
- } else {
- v->not_found = 1;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_request_completion(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- if (r->request_complete) {
- v->len = 2;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) "OK";
-
- return NGX_OK;
- }
-
- v->len = 0;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) "";
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_request_body(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- size_t len;
- ngx_buf_t *buf;
- ngx_chain_t *cl;
-
- if (r->request_body == NULL
- || r->request_body->bufs == NULL
- || r->request_body->temp_file)
- {
- v->not_found = 1;
-
- return NGX_OK;
- }
-
- cl = r->request_body->bufs;
- buf = cl->buf;
-
- if (cl->next == NULL) {
- v->len = buf->last - buf->pos;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = buf->pos;
-
- return NGX_OK;
- }
-
- len = buf->last - buf->pos;
- cl = cl->next;
-
- for ( /* void */ ; cl; cl = cl->next) {
- buf = cl->buf;
- len += buf->last - buf->pos;
- }
-
- p = ngx_pnalloc(r->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->data = p;
- cl = r->request_body->bufs;
-
- for ( /* void */ ; cl; cl = cl->next) {
- buf = cl->buf;
- p = ngx_cpymem(p, buf->pos, buf->last - buf->pos);
- }
-
- v->len = len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_request_body_file(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- if (r->request_body == NULL || r->request_body->temp_file == NULL) {
- v->not_found = 1;
-
- return NGX_OK;
- }
-
- v->len = r->request_body->temp_file->file.name.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = r->request_body->temp_file->file.name.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_request_length(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(p, "%O", r->request_length) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_request_time(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- ngx_time_t *tp;
- ngx_msec_int_t ms;
-
- p = ngx_pnalloc(r->pool, NGX_TIME_T_LEN + 4);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- tp = ngx_timeofday();
-
- ms = (ngx_msec_int_t)
- ((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec));
- ms = ngx_max(ms, 0);
-
- v->len = ngx_sprintf(p, "%T.%03M", (time_t) ms / 1000, ms % 1000) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_connection(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- p = ngx_pnalloc(r->pool, NGX_ATOMIC_T_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(p, "%uA", r->connection->number) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_connection_requests(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- p = ngx_pnalloc(r->pool, NGX_INT_T_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(p, "%ui", r->connection->requests) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_nginx_version(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- v->len = sizeof(NGINX_VERSION) - 1;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) NGINX_VERSION;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_hostname(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- v->len = ngx_cycle->hostname.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = ngx_cycle->hostname.data;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_pid(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- p = ngx_pnalloc(r->pool, NGX_INT64_LEN);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- v->len = ngx_sprintf(p, "%P", ngx_pid) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_msec(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
- ngx_time_t *tp;
-
- p = ngx_pnalloc(r->pool, NGX_TIME_T_LEN + 4);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- tp = ngx_timeofday();
-
- v->len = ngx_sprintf(p, "%T.%03M", tp->sec, tp->msec) - p;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_time_iso8601(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- p = ngx_pnalloc(r->pool, ngx_cached_http_log_iso8601.len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(p, ngx_cached_http_log_iso8601.data,
- ngx_cached_http_log_iso8601.len);
-
- v->len = ngx_cached_http_log_iso8601.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_variable_time_local(ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data)
-{
- u_char *p;
-
- p = ngx_pnalloc(r->pool, ngx_cached_http_log_time.len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(p, ngx_cached_http_log_time.data, ngx_cached_http_log_time.len);
-
- v->len = ngx_cached_http_log_time.len;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = p;
-
- return NGX_OK;
-}
-
-
-void *
-ngx_http_map_find(ngx_http_request_t *r, ngx_http_map_t *map, ngx_str_t *match)
-{
- void *value;
- u_char *low;
- size_t len;
- ngx_uint_t key;
-
- len = match->len;
-
- if (len) {
- low = ngx_pnalloc(r->pool, len);
- if (low == NULL) {
- return NULL;
- }
-
- } else {
- low = NULL;
- }
-
- key = ngx_hash_strlow(low, match->data, len);
-
- value = ngx_hash_find_combined(&map->hash, key, low, len);
- if (value) {
- return value;
- }
-
-#if (NGX_PCRE)
-
- if (len && map->nregex) {
- ngx_int_t n;
- ngx_uint_t i;
- ngx_http_map_regex_t *reg;
-
- reg = map->regex;
-
- for (i = 0; i < map->nregex; i++) {
-
- n = ngx_http_regex_exec(r, reg[i].regex, match);
-
- if (n == NGX_OK) {
- return reg[i].value;
- }
-
- if (n == NGX_DECLINED) {
- continue;
- }
-
- /* NGX_ERROR */
-
- return NULL;
- }
- }
-
-#endif
-
- return NULL;
-}
-
-
-#if (NGX_PCRE)
-
-static ngx_int_t
-ngx_http_variable_not_found(ngx_http_request_t *r, ngx_http_variable_value_t *v,
- uintptr_t data)
-{
- v->not_found = 1;
- return NGX_OK;
-}
-
-
-ngx_http_regex_t *
-ngx_http_regex_compile(ngx_conf_t *cf, ngx_regex_compile_t *rc)
-{
- u_char *p;
- size_t size;
- ngx_str_t name;
- ngx_uint_t i, n;
- ngx_http_variable_t *v;
- ngx_http_regex_t *re;
- ngx_http_regex_variable_t *rv;
- ngx_http_core_main_conf_t *cmcf;
-
- rc->pool = cf->pool;
-
- if (ngx_regex_compile(rc) != NGX_OK) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "%V", &rc->err);
- return NULL;
- }
-
- re = ngx_pcalloc(cf->pool, sizeof(ngx_http_regex_t));
- if (re == NULL) {
- return NULL;
- }
-
- re->regex = rc->regex;
- re->ncaptures = rc->captures;
- re->name = rc->pattern;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
- cmcf->ncaptures = ngx_max(cmcf->ncaptures, re->ncaptures);
-
- n = (ngx_uint_t) rc->named_captures;
-
- if (n == 0) {
- return re;
- }
-
- rv = ngx_palloc(rc->pool, n * sizeof(ngx_http_regex_variable_t));
- if (rv == NULL) {
- return NULL;
- }
-
- re->variables = rv;
- re->nvariables = n;
-
- size = rc->name_size;
- p = rc->names;
-
- for (i = 0; i < n; i++) {
- rv[i].capture = 2 * ((p[0] << 8) + p[1]);
-
- name.data = &p[2];
- name.len = ngx_strlen(name.data);
-
- v = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
- if (v == NULL) {
- return NULL;
- }
-
- rv[i].index = ngx_http_get_variable_index(cf, &name);
- if (rv[i].index == NGX_ERROR) {
- return NULL;
- }
-
- v->get_handler = ngx_http_variable_not_found;
-
- p += size;
- }
-
- return re;
-}
-
-
-ngx_int_t
-ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re, ngx_str_t *s)
-{
- ngx_int_t rc, index;
- ngx_uint_t i, n, len;
- ngx_http_variable_value_t *vv;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);
-
- if (re->ncaptures) {
- len = cmcf->ncaptures;
-
- if (r->captures == NULL) {
- r->captures = ngx_palloc(r->pool, len * sizeof(int));
- if (r->captures == NULL) {
- return NGX_ERROR;
- }
- }
-
- } else {
- len = 0;
- }
-
- rc = ngx_regex_exec(re->regex, s, r->captures, len);
-
- if (rc == NGX_REGEX_NO_MATCHED) {
- return NGX_DECLINED;
- }
-
- if (rc < 0) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- ngx_regex_exec_n " failed: %i on \"%V\" using \"%V\"",
- rc, s, &re->name);
- return NGX_ERROR;
- }
-
- for (i = 0; i < re->nvariables; i++) {
-
- n = re->variables[i].capture;
- index = re->variables[i].index;
- vv = &r->variables[index];
-
- vv->len = r->captures[n + 1] - r->captures[n];
- vv->valid = 1;
- vv->no_cacheable = 0;
- vv->not_found = 0;
- vv->data = &s->data[r->captures[n]];
-
-#if (NGX_DEBUG)
- {
- ngx_http_variable_t *v;
-
- v = cmcf->variables.elts;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "http regex set $%V to \"%*s\"",
- &v[index].name, vv->len, vv->data);
- }
-#endif
- }
-
- r->ncaptures = rc * 2;
- r->captures_data = s->data;
-
- return NGX_OK;
-}
-
-#endif
-
-
-ngx_int_t
-ngx_http_variables_add_core_vars(ngx_conf_t *cf)
-{
- ngx_int_t rc;
- ngx_http_variable_t *cv, *v;
- ngx_http_core_main_conf_t *cmcf;
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- cmcf->variables_keys = ngx_pcalloc(cf->temp_pool,
- sizeof(ngx_hash_keys_arrays_t));
- if (cmcf->variables_keys == NULL) {
- return NGX_ERROR;
- }
-
- cmcf->variables_keys->pool = cf->pool;
- cmcf->variables_keys->temp_pool = cf->pool;
-
- if (ngx_hash_keys_array_init(cmcf->variables_keys, NGX_HASH_SMALL)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- for (cv = ngx_http_core_variables; cv->name.len; cv++) {
- v = ngx_palloc(cf->pool, sizeof(ngx_http_variable_t));
- if (v == NULL) {
- return NGX_ERROR;
- }
-
- *v = *cv;
-
- rc = ngx_hash_add_key(cmcf->variables_keys, &v->name, v,
- NGX_HASH_READONLY_KEY);
-
- if (rc == NGX_OK) {
- continue;
- }
-
- if (rc == NGX_BUSY) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "conflicting variable name \"%V\"", &v->name);
- }
-
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_http_variables_init_vars(ngx_conf_t *cf)
-{
- ngx_uint_t i, n;
- ngx_hash_key_t *key;
- ngx_hash_init_t hash;
- ngx_http_variable_t *v, *av;
- ngx_http_core_main_conf_t *cmcf;
-
- /* set the handlers for the indexed http variables */
-
- cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);
-
- v = cmcf->variables.elts;
- key = cmcf->variables_keys->keys.elts;
-
- for (i = 0; i < cmcf->variables.nelts; i++) {
-
- for (n = 0; n < cmcf->variables_keys->keys.nelts; n++) {
-
- av = key[n].value;
-
- if (v[i].name.len == key[n].key.len
- && ngx_strncmp(v[i].name.data, key[n].key.data, v[i].name.len)
- == 0)
- {
- v[i].get_handler = av->get_handler;
- v[i].data = av->data;
-
- av->flags |= NGX_HTTP_VAR_INDEXED;
- v[i].flags = av->flags;
-
- av->index = i;
-
- if (av->get_handler == NULL) {
- break;
- }
-
- goto next;
- }
- }
-
- if (ngx_strncmp(v[i].name.data, "http_", 5) == 0) {
- v[i].get_handler = ngx_http_variable_unknown_header_in;
- v[i].data = (uintptr_t) &v[i].name;
-
- continue;
- }
-
- if (ngx_strncmp(v[i].name.data, "sent_http_", 10) == 0) {
- v[i].get_handler = ngx_http_variable_unknown_header_out;
- v[i].data = (uintptr_t) &v[i].name;
-
- continue;
- }
-
- if (ngx_strncmp(v[i].name.data, "upstream_http_", 14) == 0) {
- v[i].get_handler = ngx_http_upstream_header_variable;
- v[i].data = (uintptr_t) &v[i].name;
- v[i].flags = NGX_HTTP_VAR_NOCACHEABLE;
-
- continue;
- }
-
- if (ngx_strncmp(v[i].name.data, "cookie_", 7) == 0) {
- v[i].get_handler = ngx_http_variable_cookie;
- v[i].data = (uintptr_t) &v[i].name;
-
- continue;
- }
-
- if (ngx_strncmp(v[i].name.data, "upstream_cookie_", 16) == 0) {
- v[i].get_handler = ngx_http_upstream_cookie_variable;
- v[i].data = (uintptr_t) &v[i].name;
- v[i].flags = NGX_HTTP_VAR_NOCACHEABLE;
-
- continue;
- }
-
- if (ngx_strncmp(v[i].name.data, "arg_", 4) == 0) {
- v[i].get_handler = ngx_http_variable_argument;
- v[i].data = (uintptr_t) &v[i].name;
- v[i].flags = NGX_HTTP_VAR_NOCACHEABLE;
-
- continue;
- }
-
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "unknown \"%V\" variable", &v[i].name);
-
- return NGX_ERROR;
-
- next:
- continue;
- }
-
-
- for (n = 0; n < cmcf->variables_keys->keys.nelts; n++) {
- av = key[n].value;
-
- if (av->flags & NGX_HTTP_VAR_NOHASH) {
- key[n].key.data = NULL;
- }
- }
-
-
- hash.hash = &cmcf->variables_hash;
- hash.key = ngx_hash_key;
- hash.max_size = cmcf->variables_hash_max_size;
- hash.bucket_size = cmcf->variables_hash_bucket_size;
- hash.name = "variables_hash";
- hash.pool = cf->pool;
- hash.temp_pool = NULL;
-
- if (ngx_hash_init(&hash, cmcf->variables_keys->keys.elts,
- cmcf->variables_keys->keys.nelts)
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
- cmcf->variables_keys = NULL;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.h
deleted file mode 100644
index 829fab31e64..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_variables.h
+++ /dev/null
@@ -1,112 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_HTTP_VARIABLES_H_INCLUDED_
-#define _NGX_HTTP_VARIABLES_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-typedef ngx_variable_value_t ngx_http_variable_value_t;
-
-#define ngx_http_variable(v) { sizeof(v) - 1, 1, 0, 0, 0, (u_char *) v }
-
-typedef struct ngx_http_variable_s ngx_http_variable_t;
-
-typedef void (*ngx_http_set_variable_pt) (ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-typedef ngx_int_t (*ngx_http_get_variable_pt) (ngx_http_request_t *r,
- ngx_http_variable_value_t *v, uintptr_t data);
-
-
-#define NGX_HTTP_VAR_CHANGEABLE 1
-#define NGX_HTTP_VAR_NOCACHEABLE 2
-#define NGX_HTTP_VAR_INDEXED 4
-#define NGX_HTTP_VAR_NOHASH 8
-
-
-struct ngx_http_variable_s {
- ngx_str_t name; /* must be first to build the hash */
- ngx_http_set_variable_pt set_handler;
- ngx_http_get_variable_pt get_handler;
- uintptr_t data;
- ngx_uint_t flags;
- ngx_uint_t index;
-};
-
-
-ngx_http_variable_t *ngx_http_add_variable(ngx_conf_t *cf, ngx_str_t *name,
- ngx_uint_t flags);
-ngx_int_t ngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name);
-ngx_http_variable_value_t *ngx_http_get_indexed_variable(ngx_http_request_t *r,
- ngx_uint_t index);
-ngx_http_variable_value_t *ngx_http_get_flushed_variable(ngx_http_request_t *r,
- ngx_uint_t index);
-
-ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r,
- ngx_str_t *name, ngx_uint_t key);
-
-ngx_int_t ngx_http_variable_unknown_header(ngx_http_variable_value_t *v,
- ngx_str_t *var, ngx_list_part_t *part, size_t prefix);
-
-
-#if (NGX_PCRE)
-
-typedef struct {
- ngx_uint_t capture;
- ngx_int_t index;
-} ngx_http_regex_variable_t;
-
-
-typedef struct {
- ngx_regex_t *regex;
- ngx_uint_t ncaptures;
- ngx_http_regex_variable_t *variables;
- ngx_uint_t nvariables;
- ngx_str_t name;
-} ngx_http_regex_t;
-
-
-typedef struct {
- ngx_http_regex_t *regex;
- void *value;
-} ngx_http_map_regex_t;
-
-
-ngx_http_regex_t *ngx_http_regex_compile(ngx_conf_t *cf,
- ngx_regex_compile_t *rc);
-ngx_int_t ngx_http_regex_exec(ngx_http_request_t *r, ngx_http_regex_t *re,
- ngx_str_t *s);
-
-#endif
-
-
-typedef struct {
- ngx_hash_combined_t hash;
-#if (NGX_PCRE)
- ngx_http_map_regex_t *regex;
- ngx_uint_t nregex;
-#endif
-} ngx_http_map_t;
-
-
-void *ngx_http_map_find(ngx_http_request_t *r, ngx_http_map_t *map,
- ngx_str_t *match);
-
-
-ngx_int_t ngx_http_variables_add_core_vars(ngx_conf_t *cf);
-ngx_int_t ngx_http_variables_init_vars(ngx_conf_t *cf);
-
-
-extern ngx_http_variable_value_t ngx_http_variable_null_value;
-extern ngx_http_variable_value_t ngx_http_variable_true_value;
-
-
-#endif /* _NGX_HTTP_VARIABLES_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_write_filter_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_write_filter_module.c
deleted file mode 100644
index 83cb1fa1e98..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/http/ngx_http_write_filter_module.c
+++ /dev/null
@@ -1,318 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_http.h>
-
-
-static ngx_int_t ngx_http_write_filter_init(ngx_conf_t *cf);
-
-
-static ngx_http_module_t ngx_http_write_filter_module_ctx = {
- NULL, /* preconfiguration */
- ngx_http_write_filter_init, /* postconfiguration */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- NULL, /* create server configuration */
- NULL, /* merge server configuration */
-
- NULL, /* create location configuration */
- NULL, /* merge location configuration */
-};
-
-
-ngx_module_t ngx_http_write_filter_module = {
- NGX_MODULE_V1,
- &ngx_http_write_filter_module_ctx, /* module context */
- NULL, /* module directives */
- NGX_HTTP_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-ngx_int_t
-ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in)
-{
- off_t size, sent, nsent, limit;
- ngx_uint_t last, flush;
- ngx_msec_t delay;
- ngx_chain_t *cl, *ln, **ll, *chain;
- ngx_connection_t *c;
- ngx_http_core_loc_conf_t *clcf;
-
- c = r->connection;
-
- if (c->error) {
- return NGX_ERROR;
- }
-
- size = 0;
- flush = 0;
- last = 0;
- ll = &r->out;
-
- /* find the size, the flush point and the last link of the saved chain */
-
- for (cl = r->out; cl; cl = cl->next) {
- ll = &cl->next;
-
- ngx_log_debug7(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "write old buf t:%d f:%d %p, pos %p, size: %z "
- "file: %O, size: %z",
- cl->buf->temporary, cl->buf->in_file,
- cl->buf->start, cl->buf->pos,
- cl->buf->last - cl->buf->pos,
- cl->buf->file_pos,
- cl->buf->file_last - cl->buf->file_pos);
-
-#if 1
- if (ngx_buf_size(cl->buf) == 0 && !ngx_buf_special(cl->buf)) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "zero size buf in writer "
- "t:%d r:%d f:%d %p %p-%p %p %O-%O",
- cl->buf->temporary,
- cl->buf->recycled,
- cl->buf->in_file,
- cl->buf->start,
- cl->buf->pos,
- cl->buf->last,
- cl->buf->file,
- cl->buf->file_pos,
- cl->buf->file_last);
-
- ngx_debug_point();
- return NGX_ERROR;
- }
-#endif
-
- size += ngx_buf_size(cl->buf);
-
- if (cl->buf->flush || cl->buf->recycled) {
- flush = 1;
- }
-
- if (cl->buf->last_buf) {
- last = 1;
- }
- }
-
- /* add the new chain to the existent one */
-
- for (ln = in; ln; ln = ln->next) {
- cl = ngx_alloc_chain_link(r->pool);
- if (cl == NULL) {
- return NGX_ERROR;
- }
-
- cl->buf = ln->buf;
- *ll = cl;
- ll = &cl->next;
-
- ngx_log_debug7(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "write new buf t:%d f:%d %p, pos %p, size: %z "
- "file: %O, size: %z",
- cl->buf->temporary, cl->buf->in_file,
- cl->buf->start, cl->buf->pos,
- cl->buf->last - cl->buf->pos,
- cl->buf->file_pos,
- cl->buf->file_last - cl->buf->file_pos);
-
-#if 1
- if (ngx_buf_size(cl->buf) == 0 && !ngx_buf_special(cl->buf)) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "zero size buf in writer "
- "t:%d r:%d f:%d %p %p-%p %p %O-%O",
- cl->buf->temporary,
- cl->buf->recycled,
- cl->buf->in_file,
- cl->buf->start,
- cl->buf->pos,
- cl->buf->last,
- cl->buf->file,
- cl->buf->file_pos,
- cl->buf->file_last);
-
- ngx_debug_point();
- return NGX_ERROR;
- }
-#endif
-
- size += ngx_buf_size(cl->buf);
-
- if (cl->buf->flush || cl->buf->recycled) {
- flush = 1;
- }
-
- if (cl->buf->last_buf) {
- last = 1;
- }
- }
-
- *ll = NULL;
-
- ngx_log_debug3(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http write filter: l:%d f:%d s:%O", last, flush, size);
-
- clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
-
- /*
- * avoid the output if there are no last buf, no flush point,
- * there are the incoming bufs and the size of all bufs
- * is smaller than "postpone_output" directive
- */
-
- if (!last && !flush && in && size < (off_t) clcf->postpone_output) {
- return NGX_OK;
- }
-
- if (c->write->delayed) {
- c->buffered |= NGX_HTTP_WRITE_BUFFERED;
- return NGX_AGAIN;
- }
-
- if (size == 0
- && !(c->buffered & NGX_LOWLEVEL_BUFFERED)
- && !(last && c->need_last_buf))
- {
- if (last || flush) {
- for (cl = r->out; cl; /* void */) {
- ln = cl;
- cl = cl->next;
- ngx_free_chain(r->pool, ln);
- }
-
- r->out = NULL;
- c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;
-
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "the http output chain is empty");
-
- ngx_debug_point();
-
- return NGX_ERROR;
- }
-
- if (r->limit_rate) {
- if (r->limit_rate_after == 0) {
- r->limit_rate_after = clcf->limit_rate_after;
- }
-
- limit = (off_t) r->limit_rate * (ngx_time() - r->start_sec + 1)
- - (c->sent - r->limit_rate_after);
-
- if (limit <= 0) {
- c->write->delayed = 1;
- ngx_add_timer(c->write,
- (ngx_msec_t) (- limit * 1000 / r->limit_rate + 1));
-
- c->buffered |= NGX_HTTP_WRITE_BUFFERED;
-
- return NGX_AGAIN;
- }
-
- if (clcf->sendfile_max_chunk
- && (off_t) clcf->sendfile_max_chunk < limit)
- {
- limit = clcf->sendfile_max_chunk;
- }
-
- } else {
- limit = clcf->sendfile_max_chunk;
- }
-
- sent = c->sent;
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http write filter limit %O", limit);
-
- chain = c->send_chain(c, r->out, limit);
-
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
- "http write filter %p", chain);
-
- if (chain == NGX_CHAIN_ERROR) {
- c->error = 1;
- return NGX_ERROR;
- }
-
- if (r->limit_rate) {
-
- nsent = c->sent;
-
- if (r->limit_rate_after) {
-
- sent -= r->limit_rate_after;
- if (sent < 0) {
- sent = 0;
- }
-
- nsent -= r->limit_rate_after;
- if (nsent < 0) {
- nsent = 0;
- }
- }
-
- delay = (ngx_msec_t) ((nsent - sent) * 1000 / r->limit_rate);
-
- if (delay > 0) {
- limit = 0;
- c->write->delayed = 1;
- ngx_add_timer(c->write, delay);
- }
- }
-
- if (limit
- && c->write->ready
- && c->sent - sent >= limit - (off_t) (2 * ngx_pagesize))
- {
- c->write->delayed = 1;
- ngx_add_timer(c->write, 1);
- }
-
- for (cl = r->out; cl && cl != chain; /* void */) {
- ln = cl;
- cl = cl->next;
- ngx_free_chain(r->pool, ln);
- }
-
- r->out = chain;
-
- if (chain) {
- c->buffered |= NGX_HTTP_WRITE_BUFFERED;
- return NGX_AGAIN;
- }
-
- c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;
-
- if ((c->buffered & NGX_LOWLEVEL_BUFFERED) && r->postponed == NULL) {
- return NGX_AGAIN;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_http_write_filter_init(ngx_conf_t *cf)
-{
- ngx_http_top_body_filter = ngx_http_write_filter;
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.c
deleted file mode 100644
index 5a7cb6bf67e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.c
+++ /dev/null
@@ -1,567 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-
-
-static char *ngx_mail_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static ngx_int_t ngx_mail_add_ports(ngx_conf_t *cf, ngx_array_t *ports,
- ngx_mail_listen_t *listen);
-static char *ngx_mail_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports);
-static ngx_int_t ngx_mail_add_addrs(ngx_conf_t *cf, ngx_mail_port_t *mport,
- ngx_mail_conf_addr_t *addr);
-#if (NGX_HAVE_INET6)
-static ngx_int_t ngx_mail_add_addrs6(ngx_conf_t *cf, ngx_mail_port_t *mport,
- ngx_mail_conf_addr_t *addr);
-#endif
-static ngx_int_t ngx_mail_cmp_conf_addrs(const void *one, const void *two);
-
-
-ngx_uint_t ngx_mail_max_module;
-
-
-static ngx_command_t ngx_mail_commands[] = {
-
- { ngx_string("mail"),
- NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
- ngx_mail_block,
- 0,
- 0,
- NULL },
-
- { ngx_string("imap"),
- NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
- ngx_mail_block,
- 0,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_core_module_t ngx_mail_module_ctx = {
- ngx_string("mail"),
- NULL,
- NULL
-};
-
-
-ngx_module_t ngx_mail_module = {
- NGX_MODULE_V1,
- &ngx_mail_module_ctx, /* module context */
- ngx_mail_commands, /* module directives */
- NGX_CORE_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static char *
-ngx_mail_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *rv;
- ngx_uint_t i, m, mi, s;
- ngx_conf_t pcf;
- ngx_array_t ports;
- ngx_mail_listen_t *listen;
- ngx_mail_module_t *module;
- ngx_mail_conf_ctx_t *ctx;
- ngx_mail_core_srv_conf_t **cscfp;
- ngx_mail_core_main_conf_t *cmcf;
-
- if (cmd->name.data[0] == 'i') {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "the \"imap\" directive is deprecated, "
- "use the \"mail\" directive instead");
- }
-
- /* the main mail context */
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_mail_conf_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *(ngx_mail_conf_ctx_t **) conf = ctx;
-
- /* count the number of the http modules and set up their indices */
-
- ngx_mail_max_module = 0;
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
- continue;
- }
-
- ngx_modules[m]->ctx_index = ngx_mail_max_module++;
- }
-
-
- /* the mail main_conf context, it is the same in the all mail contexts */
-
- ctx->main_conf = ngx_pcalloc(cf->pool,
- sizeof(void *) * ngx_mail_max_module);
- if (ctx->main_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
-
- /*
- * the mail null srv_conf context, it is used to merge
- * the server{}s' srv_conf's
- */
-
- ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_mail_max_module);
- if (ctx->srv_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
-
- /*
- * create the main_conf's and the null srv_conf's of the all mail modules
- */
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
- mi = ngx_modules[m]->ctx_index;
-
- if (module->create_main_conf) {
- ctx->main_conf[mi] = module->create_main_conf(cf);
- if (ctx->main_conf[mi] == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- if (module->create_srv_conf) {
- ctx->srv_conf[mi] = module->create_srv_conf(cf);
- if (ctx->srv_conf[mi] == NULL) {
- return NGX_CONF_ERROR;
- }
- }
- }
-
-
- /* parse inside the mail{} block */
-
- pcf = *cf;
- cf->ctx = ctx;
-
- cf->module_type = NGX_MAIL_MODULE;
- cf->cmd_type = NGX_MAIL_MAIN_CONF;
- rv = ngx_conf_parse(cf, NULL);
-
- if (rv != NGX_CONF_OK) {
- *cf = pcf;
- return rv;
- }
-
-
- /* init mail{} main_conf's, merge the server{}s' srv_conf's */
-
- cmcf = ctx->main_conf[ngx_mail_core_module.ctx_index];
- cscfp = cmcf->servers.elts;
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
- mi = ngx_modules[m]->ctx_index;
-
- /* init mail{} main_conf's */
-
- cf->ctx = ctx;
-
- if (module->init_main_conf) {
- rv = module->init_main_conf(cf, ctx->main_conf[mi]);
- if (rv != NGX_CONF_OK) {
- *cf = pcf;
- return rv;
- }
- }
-
- for (s = 0; s < cmcf->servers.nelts; s++) {
-
- /* merge the server{}s' srv_conf's */
-
- cf->ctx = cscfp[s]->ctx;
-
- if (module->merge_srv_conf) {
- rv = module->merge_srv_conf(cf,
- ctx->srv_conf[mi],
- cscfp[s]->ctx->srv_conf[mi]);
- if (rv != NGX_CONF_OK) {
- *cf = pcf;
- return rv;
- }
- }
- }
- }
-
- *cf = pcf;
-
-
- if (ngx_array_init(&ports, cf->temp_pool, 4, sizeof(ngx_mail_conf_port_t))
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- listen = cmcf->listen.elts;
-
- for (i = 0; i < cmcf->listen.nelts; i++) {
- if (ngx_mail_add_ports(cf, &ports, &listen[i]) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- }
-
- return ngx_mail_optimize_servers(cf, &ports);
-}
-
-
-static ngx_int_t
-ngx_mail_add_ports(ngx_conf_t *cf, ngx_array_t *ports,
- ngx_mail_listen_t *listen)
-{
- in_port_t p;
- ngx_uint_t i;
- struct sockaddr *sa;
- struct sockaddr_in *sin;
- ngx_mail_conf_port_t *port;
- ngx_mail_conf_addr_t *addr;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
-
- sa = (struct sockaddr *) &listen->sockaddr;
-
- switch (sa->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) sa;
- p = sin6->sin6_port;
- break;
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- p = 0;
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) sa;
- p = sin->sin_port;
- break;
- }
-
- port = ports->elts;
- for (i = 0; i < ports->nelts; i++) {
- if (p == port[i].port && sa->sa_family == port[i].family) {
-
- /* a port is already in the port list */
-
- port = &port[i];
- goto found;
- }
- }
-
- /* add a port to the port list */
-
- port = ngx_array_push(ports);
- if (port == NULL) {
- return NGX_ERROR;
- }
-
- port->family = sa->sa_family;
- port->port = p;
-
- if (ngx_array_init(&port->addrs, cf->temp_pool, 2,
- sizeof(ngx_mail_conf_addr_t))
- != NGX_OK)
- {
- return NGX_ERROR;
- }
-
-found:
-
- addr = ngx_array_push(&port->addrs);
- if (addr == NULL) {
- return NGX_ERROR;
- }
-
- addr->sockaddr = (struct sockaddr *) &listen->sockaddr;
- addr->socklen = listen->socklen;
- addr->ctx = listen->ctx;
- addr->bind = listen->bind;
- addr->wildcard = listen->wildcard;
- addr->so_keepalive = listen->so_keepalive;
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- addr->tcp_keepidle = listen->tcp_keepidle;
- addr->tcp_keepintvl = listen->tcp_keepintvl;
- addr->tcp_keepcnt = listen->tcp_keepcnt;
-#endif
-#if (NGX_MAIL_SSL)
- addr->ssl = listen->ssl;
-#endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- addr->ipv6only = listen->ipv6only;
-#endif
-
- return NGX_OK;
-}
-
-
-static char *
-ngx_mail_optimize_servers(ngx_conf_t *cf, ngx_array_t *ports)
-{
- ngx_uint_t i, p, last, bind_wildcard;
- ngx_listening_t *ls;
- ngx_mail_port_t *mport;
- ngx_mail_conf_port_t *port;
- ngx_mail_conf_addr_t *addr;
-
- port = ports->elts;
- for (p = 0; p < ports->nelts; p++) {
-
- ngx_sort(port[p].addrs.elts, (size_t) port[p].addrs.nelts,
- sizeof(ngx_mail_conf_addr_t), ngx_mail_cmp_conf_addrs);
-
- addr = port[p].addrs.elts;
- last = port[p].addrs.nelts;
-
- /*
- * if there is the binding to the "*:port" then we need to bind()
- * to the "*:port" only and ignore the other bindings
- */
-
- if (addr[last - 1].wildcard) {
- addr[last - 1].bind = 1;
- bind_wildcard = 1;
-
- } else {
- bind_wildcard = 0;
- }
-
- i = 0;
-
- while (i < last) {
-
- if (bind_wildcard && !addr[i].bind) {
- i++;
- continue;
- }
-
- ls = ngx_create_listening(cf, addr[i].sockaddr, addr[i].socklen);
- if (ls == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ls->addr_ntop = 1;
- ls->handler = ngx_mail_init_connection;
- ls->pool_size = 256;
-
- /* TODO: error_log directive */
- ls->logp = &cf->cycle->new_log;
- ls->log.data = &ls->addr_text;
- ls->log.handler = ngx_accept_log_error;
-
- ls->keepalive = addr[i].so_keepalive;
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- ls->keepidle = addr[i].tcp_keepidle;
- ls->keepintvl = addr[i].tcp_keepintvl;
- ls->keepcnt = addr[i].tcp_keepcnt;
-#endif
-
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- ls->ipv6only = addr[i].ipv6only;
-#endif
-
- mport = ngx_palloc(cf->pool, sizeof(ngx_mail_port_t));
- if (mport == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ls->servers = mport;
-
- if (i == last - 1) {
- mport->naddrs = last;
-
- } else {
- mport->naddrs = 1;
- i = 0;
- }
-
- switch (ls->sockaddr->sa_family) {
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- if (ngx_mail_add_addrs6(cf, mport, addr) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- break;
-#endif
- default: /* AF_INET */
- if (ngx_mail_add_addrs(cf, mport, addr) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
- break;
- }
-
- addr++;
- last--;
- }
- }
-
- return NGX_CONF_OK;
-}
-
-
-static ngx_int_t
-ngx_mail_add_addrs(ngx_conf_t *cf, ngx_mail_port_t *mport,
- ngx_mail_conf_addr_t *addr)
-{
- u_char *p;
- size_t len;
- ngx_uint_t i;
- ngx_mail_in_addr_t *addrs;
- struct sockaddr_in *sin;
- u_char buf[NGX_SOCKADDR_STRLEN];
-
- mport->addrs = ngx_pcalloc(cf->pool,
- mport->naddrs * sizeof(ngx_mail_in_addr_t));
- if (mport->addrs == NULL) {
- return NGX_ERROR;
- }
-
- addrs = mport->addrs;
-
- for (i = 0; i < mport->naddrs; i++) {
-
- sin = (struct sockaddr_in *) addr[i].sockaddr;
- addrs[i].addr = sin->sin_addr.s_addr;
-
- addrs[i].conf.ctx = addr[i].ctx;
-#if (NGX_MAIL_SSL)
- addrs[i].conf.ssl = addr[i].ssl;
-#endif
-
- len = ngx_sock_ntop(addr[i].sockaddr, addr[i].socklen, buf,
- NGX_SOCKADDR_STRLEN, 1);
-
- p = ngx_pnalloc(cf->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(p, buf, len);
-
- addrs[i].conf.addr_text.len = len;
- addrs[i].conf.addr_text.data = p;
- }
-
- return NGX_OK;
-}
-
-
-#if (NGX_HAVE_INET6)
-
-static ngx_int_t
-ngx_mail_add_addrs6(ngx_conf_t *cf, ngx_mail_port_t *mport,
- ngx_mail_conf_addr_t *addr)
-{
- u_char *p;
- size_t len;
- ngx_uint_t i;
- ngx_mail_in6_addr_t *addrs6;
- struct sockaddr_in6 *sin6;
- u_char buf[NGX_SOCKADDR_STRLEN];
-
- mport->addrs = ngx_pcalloc(cf->pool,
- mport->naddrs * sizeof(ngx_mail_in6_addr_t));
- if (mport->addrs == NULL) {
- return NGX_ERROR;
- }
-
- addrs6 = mport->addrs;
-
- for (i = 0; i < mport->naddrs; i++) {
-
- sin6 = (struct sockaddr_in6 *) addr[i].sockaddr;
- addrs6[i].addr6 = sin6->sin6_addr;
-
- addrs6[i].conf.ctx = addr[i].ctx;
-#if (NGX_MAIL_SSL)
- addrs6[i].conf.ssl = addr[i].ssl;
-#endif
-
- len = ngx_sock_ntop(addr[i].sockaddr, addr[i].socklen, buf,
- NGX_SOCKADDR_STRLEN, 1);
-
- p = ngx_pnalloc(cf->pool, len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(p, buf, len);
-
- addrs6[i].conf.addr_text.len = len;
- addrs6[i].conf.addr_text.data = p;
- }
-
- return NGX_OK;
-}
-
-#endif
-
-
-static ngx_int_t
-ngx_mail_cmp_conf_addrs(const void *one, const void *two)
-{
- ngx_mail_conf_addr_t *first, *second;
-
- first = (ngx_mail_conf_addr_t *) one;
- second = (ngx_mail_conf_addr_t *) two;
-
- if (first->wildcard) {
- /* a wildcard must be the last resort, shift it to the end */
- return 1;
- }
-
- if (second->wildcard) {
- /* a wildcard must be the last resort, shift it to the end */
- return -1;
- }
-
- if (first->bind && !second->bind) {
- /* shift explicit bind()ed addresses to the start */
- return -1;
- }
-
- if (!first->bind && second->bind) {
- /* shift explicit bind()ed addresses to the start */
- return 1;
- }
-
- /* do not sort by default */
-
- return 0;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.h
deleted file mode 100644
index dc39f1e1375..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail.h
+++ /dev/null
@@ -1,421 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_MAIL_H_INCLUDED_
-#define _NGX_MAIL_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_event_connect.h>
-
-#if (NGX_MAIL_SSL)
-#include <ngx_mail_ssl_module.h>
-#endif
-
-
-
-typedef struct {
- void **main_conf;
- void **srv_conf;
-} ngx_mail_conf_ctx_t;
-
-
-typedef struct {
- u_char sockaddr[NGX_SOCKADDRLEN];
- socklen_t socklen;
-
- /* server ctx */
- ngx_mail_conf_ctx_t *ctx;
-
- unsigned bind:1;
- unsigned wildcard:1;
-#if (NGX_MAIL_SSL)
- unsigned ssl:1;
-#endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- unsigned ipv6only:1;
-#endif
- unsigned so_keepalive:2;
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- int tcp_keepidle;
- int tcp_keepintvl;
- int tcp_keepcnt;
-#endif
-} ngx_mail_listen_t;
-
-
-typedef struct {
- ngx_mail_conf_ctx_t *ctx;
- ngx_str_t addr_text;
-#if (NGX_MAIL_SSL)
- ngx_uint_t ssl; /* unsigned ssl:1; */
-#endif
-} ngx_mail_addr_conf_t;
-
-typedef struct {
- in_addr_t addr;
- ngx_mail_addr_conf_t conf;
-} ngx_mail_in_addr_t;
-
-
-#if (NGX_HAVE_INET6)
-
-typedef struct {
- struct in6_addr addr6;
- ngx_mail_addr_conf_t conf;
-} ngx_mail_in6_addr_t;
-
-#endif
-
-
-typedef struct {
- /* ngx_mail_in_addr_t or ngx_mail_in6_addr_t */
- void *addrs;
- ngx_uint_t naddrs;
-} ngx_mail_port_t;
-
-
-typedef struct {
- int family;
- in_port_t port;
- ngx_array_t addrs; /* array of ngx_mail_conf_addr_t */
-} ngx_mail_conf_port_t;
-
-
-typedef struct {
- struct sockaddr *sockaddr;
- socklen_t socklen;
-
- ngx_mail_conf_ctx_t *ctx;
-
- unsigned bind:1;
- unsigned wildcard:1;
-#if (NGX_MAIL_SSL)
- unsigned ssl:1;
-#endif
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- unsigned ipv6only:1;
-#endif
- unsigned so_keepalive:2;
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- int tcp_keepidle;
- int tcp_keepintvl;
- int tcp_keepcnt;
-#endif
-} ngx_mail_conf_addr_t;
-
-
-typedef struct {
- ngx_array_t servers; /* ngx_mail_core_srv_conf_t */
- ngx_array_t listen; /* ngx_mail_listen_t */
-} ngx_mail_core_main_conf_t;
-
-
-#define NGX_MAIL_POP3_PROTOCOL 0
-#define NGX_MAIL_IMAP_PROTOCOL 1
-#define NGX_MAIL_SMTP_PROTOCOL 2
-
-
-typedef struct ngx_mail_protocol_s ngx_mail_protocol_t;
-
-
-typedef struct {
- ngx_mail_protocol_t *protocol;
-
- ngx_msec_t timeout;
- ngx_msec_t resolver_timeout;
-
- ngx_flag_t so_keepalive;
-
- ngx_str_t server_name;
-
- u_char *file_name;
- ngx_int_t line;
-
- ngx_resolver_t *resolver;
-
- /* server ctx */
- ngx_mail_conf_ctx_t *ctx;
-} ngx_mail_core_srv_conf_t;
-
-
-typedef enum {
- ngx_pop3_start = 0,
- ngx_pop3_user,
- ngx_pop3_passwd,
- ngx_pop3_auth_login_username,
- ngx_pop3_auth_login_password,
- ngx_pop3_auth_plain,
- ngx_pop3_auth_cram_md5
-} ngx_pop3_state_e;
-
-
-typedef enum {
- ngx_imap_start = 0,
- ngx_imap_auth_login_username,
- ngx_imap_auth_login_password,
- ngx_imap_auth_plain,
- ngx_imap_auth_cram_md5,
- ngx_imap_login,
- ngx_imap_user,
- ngx_imap_passwd
-} ngx_imap_state_e;
-
-
-typedef enum {
- ngx_smtp_start = 0,
- ngx_smtp_auth_login_username,
- ngx_smtp_auth_login_password,
- ngx_smtp_auth_plain,
- ngx_smtp_auth_cram_md5,
- ngx_smtp_helo,
- ngx_smtp_helo_xclient,
- ngx_smtp_helo_from,
- ngx_smtp_xclient,
- ngx_smtp_xclient_from,
- ngx_smtp_xclient_helo,
- ngx_smtp_from,
- ngx_smtp_to
-} ngx_smtp_state_e;
-
-
-typedef struct {
- ngx_peer_connection_t upstream;
- ngx_buf_t *buffer;
-} ngx_mail_proxy_ctx_t;
-
-
-typedef struct {
- uint32_t signature; /* "MAIL" */
-
- ngx_connection_t *connection;
-
- ngx_str_t out;
- ngx_buf_t *buffer;
-
- void **ctx;
- void **main_conf;
- void **srv_conf;
-
- ngx_resolver_ctx_t *resolver_ctx;
-
- ngx_mail_proxy_ctx_t *proxy;
-
- ngx_uint_t mail_state;
-
- unsigned protocol:3;
- unsigned blocked:1;
- unsigned quit:1;
- unsigned quoted:1;
- unsigned backslash:1;
- unsigned no_sync_literal:1;
- unsigned starttls:1;
- unsigned esmtp:1;
- unsigned auth_method:3;
- unsigned auth_wait:1;
-
- ngx_str_t login;
- ngx_str_t passwd;
-
- ngx_str_t salt;
- ngx_str_t tag;
- ngx_str_t tagged_line;
- ngx_str_t text;
-
- ngx_str_t *addr_text;
- ngx_str_t host;
- ngx_str_t smtp_helo;
- ngx_str_t smtp_from;
- ngx_str_t smtp_to;
-
- ngx_str_t cmd;
-
- ngx_uint_t command;
- ngx_array_t args;
-
- ngx_uint_t login_attempt;
-
- /* used to parse POP3/IMAP/SMTP command */
-
- ngx_uint_t state;
- u_char *cmd_start;
- u_char *arg_start;
- u_char *arg_end;
- ngx_uint_t literal_len;
-} ngx_mail_session_t;
-
-
-typedef struct {
- ngx_str_t *client;
- ngx_mail_session_t *session;
-} ngx_mail_log_ctx_t;
-
-
-#define NGX_POP3_USER 1
-#define NGX_POP3_PASS 2
-#define NGX_POP3_CAPA 3
-#define NGX_POP3_QUIT 4
-#define NGX_POP3_NOOP 5
-#define NGX_POP3_STLS 6
-#define NGX_POP3_APOP 7
-#define NGX_POP3_AUTH 8
-#define NGX_POP3_STAT 9
-#define NGX_POP3_LIST 10
-#define NGX_POP3_RETR 11
-#define NGX_POP3_DELE 12
-#define NGX_POP3_RSET 13
-#define NGX_POP3_TOP 14
-#define NGX_POP3_UIDL 15
-
-
-#define NGX_IMAP_LOGIN 1
-#define NGX_IMAP_LOGOUT 2
-#define NGX_IMAP_CAPABILITY 3
-#define NGX_IMAP_NOOP 4
-#define NGX_IMAP_STARTTLS 5
-
-#define NGX_IMAP_NEXT 6
-
-#define NGX_IMAP_AUTHENTICATE 7
-
-
-#define NGX_SMTP_HELO 1
-#define NGX_SMTP_EHLO 2
-#define NGX_SMTP_AUTH 3
-#define NGX_SMTP_QUIT 4
-#define NGX_SMTP_NOOP 5
-#define NGX_SMTP_MAIL 6
-#define NGX_SMTP_RSET 7
-#define NGX_SMTP_RCPT 8
-#define NGX_SMTP_DATA 9
-#define NGX_SMTP_VRFY 10
-#define NGX_SMTP_EXPN 11
-#define NGX_SMTP_HELP 12
-#define NGX_SMTP_STARTTLS 13
-
-
-#define NGX_MAIL_AUTH_PLAIN 0
-#define NGX_MAIL_AUTH_LOGIN 1
-#define NGX_MAIL_AUTH_LOGIN_USERNAME 2
-#define NGX_MAIL_AUTH_APOP 3
-#define NGX_MAIL_AUTH_CRAM_MD5 4
-#define NGX_MAIL_AUTH_NONE 5
-
-
-#define NGX_MAIL_AUTH_PLAIN_ENABLED 0x0002
-#define NGX_MAIL_AUTH_LOGIN_ENABLED 0x0004
-#define NGX_MAIL_AUTH_APOP_ENABLED 0x0008
-#define NGX_MAIL_AUTH_CRAM_MD5_ENABLED 0x0010
-#define NGX_MAIL_AUTH_NONE_ENABLED 0x0020
-
-
-#define NGX_MAIL_PARSE_INVALID_COMMAND 20
-
-
-typedef void (*ngx_mail_init_session_pt)(ngx_mail_session_t *s,
- ngx_connection_t *c);
-typedef void (*ngx_mail_init_protocol_pt)(ngx_event_t *rev);
-typedef void (*ngx_mail_auth_state_pt)(ngx_event_t *rev);
-typedef ngx_int_t (*ngx_mail_parse_command_pt)(ngx_mail_session_t *s);
-
-
-struct ngx_mail_protocol_s {
- ngx_str_t name;
- in_port_t port[4];
- ngx_uint_t type;
-
- ngx_mail_init_session_pt init_session;
- ngx_mail_init_protocol_pt init_protocol;
- ngx_mail_parse_command_pt parse_command;
- ngx_mail_auth_state_pt auth_state;
-
- ngx_str_t internal_server_error;
-};
-
-
-typedef struct {
- ngx_mail_protocol_t *protocol;
-
- void *(*create_main_conf)(ngx_conf_t *cf);
- char *(*init_main_conf)(ngx_conf_t *cf, void *conf);
-
- void *(*create_srv_conf)(ngx_conf_t *cf);
- char *(*merge_srv_conf)(ngx_conf_t *cf, void *prev,
- void *conf);
-} ngx_mail_module_t;
-
-
-#define NGX_MAIL_MODULE 0x4C49414D /* "MAIL" */
-
-#define NGX_MAIL_MAIN_CONF 0x02000000
-#define NGX_MAIL_SRV_CONF 0x04000000
-
-
-#define NGX_MAIL_MAIN_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, main_conf)
-#define NGX_MAIL_SRV_CONF_OFFSET offsetof(ngx_mail_conf_ctx_t, srv_conf)
-
-
-#define ngx_mail_get_module_ctx(s, module) (s)->ctx[module.ctx_index]
-#define ngx_mail_set_ctx(s, c, module) s->ctx[module.ctx_index] = c;
-#define ngx_mail_delete_ctx(s, module) s->ctx[module.ctx_index] = NULL;
-
-
-#define ngx_mail_get_module_main_conf(s, module) \
- (s)->main_conf[module.ctx_index]
-#define ngx_mail_get_module_srv_conf(s, module) (s)->srv_conf[module.ctx_index]
-
-#define ngx_mail_conf_get_module_main_conf(cf, module) \
- ((ngx_mail_conf_ctx_t *) cf->ctx)->main_conf[module.ctx_index]
-#define ngx_mail_conf_get_module_srv_conf(cf, module) \
- ((ngx_mail_conf_ctx_t *) cf->ctx)->srv_conf[module.ctx_index]
-
-
-#if (NGX_MAIL_SSL)
-void ngx_mail_starttls_handler(ngx_event_t *rev);
-ngx_int_t ngx_mail_starttls_only(ngx_mail_session_t *s, ngx_connection_t *c);
-#endif
-
-
-void ngx_mail_init_connection(ngx_connection_t *c);
-
-ngx_int_t ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c,
- ngx_mail_core_srv_conf_t *cscf);
-ngx_int_t ngx_mail_auth_plain(ngx_mail_session_t *s, ngx_connection_t *c,
- ngx_uint_t n);
-ngx_int_t ngx_mail_auth_login_username(ngx_mail_session_t *s,
- ngx_connection_t *c, ngx_uint_t n);
-ngx_int_t ngx_mail_auth_login_password(ngx_mail_session_t *s,
- ngx_connection_t *c);
-ngx_int_t ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s,
- ngx_connection_t *c, char *prefix, size_t len);
-ngx_int_t ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c);
-ngx_int_t ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c);
-
-void ngx_mail_send(ngx_event_t *wev);
-ngx_int_t ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c);
-void ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c);
-void ngx_mail_close_connection(ngx_connection_t *c);
-void ngx_mail_session_internal_server_error(ngx_mail_session_t *s);
-u_char *ngx_mail_log_error(ngx_log_t *log, u_char *buf, size_t len);
-
-
-char *ngx_mail_capabilities(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-
-
-/* STUB */
-void ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer);
-void ngx_mail_auth_http_init(ngx_mail_session_t *s);
-/**/
-
-
-extern ngx_uint_t ngx_mail_max_module;
-extern ngx_module_t ngx_mail_core_module;
-
-
-#endif /* _NGX_MAIL_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_auth_http_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_auth_http_module.c
deleted file mode 100644
index eb7531c80a3..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_auth_http_module.c
+++ /dev/null
@@ -1,1461 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_event_connect.h>
-#include <ngx_mail.h>
-
-
-typedef struct {
- ngx_addr_t *peer;
-
- ngx_msec_t timeout;
-
- ngx_str_t host_header;
- ngx_str_t uri;
- ngx_str_t header;
-
- ngx_array_t *headers;
-
- u_char *file;
- ngx_uint_t line;
-} ngx_mail_auth_http_conf_t;
-
-
-typedef struct ngx_mail_auth_http_ctx_s ngx_mail_auth_http_ctx_t;
-
-typedef void (*ngx_mail_auth_http_handler_pt)(ngx_mail_session_t *s,
- ngx_mail_auth_http_ctx_t *ctx);
-
-struct ngx_mail_auth_http_ctx_s {
- ngx_buf_t *request;
- ngx_buf_t *response;
- ngx_peer_connection_t peer;
-
- ngx_mail_auth_http_handler_pt handler;
-
- ngx_uint_t state;
-
- u_char *header_name_start;
- u_char *header_name_end;
- u_char *header_start;
- u_char *header_end;
-
- ngx_str_t addr;
- ngx_str_t port;
- ngx_str_t err;
- ngx_str_t errmsg;
- ngx_str_t errcode;
-
- time_t sleep;
-
- ngx_pool_t *pool;
-};
-
-
-static void ngx_mail_auth_http_write_handler(ngx_event_t *wev);
-static void ngx_mail_auth_http_read_handler(ngx_event_t *rev);
-static void ngx_mail_auth_http_ignore_status_line(ngx_mail_session_t *s,
- ngx_mail_auth_http_ctx_t *ctx);
-static void ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
- ngx_mail_auth_http_ctx_t *ctx);
-static void ngx_mail_auth_sleep_handler(ngx_event_t *rev);
-static ngx_int_t ngx_mail_auth_http_parse_header_line(ngx_mail_session_t *s,
- ngx_mail_auth_http_ctx_t *ctx);
-static void ngx_mail_auth_http_block_read(ngx_event_t *rev);
-static void ngx_mail_auth_http_dummy_handler(ngx_event_t *ev);
-static ngx_buf_t *ngx_mail_auth_http_create_request(ngx_mail_session_t *s,
- ngx_pool_t *pool, ngx_mail_auth_http_conf_t *ahcf);
-static ngx_int_t ngx_mail_auth_http_escape(ngx_pool_t *pool, ngx_str_t *text,
- ngx_str_t *escaped);
-
-static void *ngx_mail_auth_http_create_conf(ngx_conf_t *cf);
-static char *ngx_mail_auth_http_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_mail_auth_http(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
-static char *ngx_mail_auth_http_header(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_command_t ngx_mail_auth_http_commands[] = {
-
- { ngx_string("auth_http"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_mail_auth_http,
- NGX_MAIL_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("auth_http_timeout"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_auth_http_conf_t, timeout),
- NULL },
-
- { ngx_string("auth_http_header"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE2,
- ngx_mail_auth_http_header,
- NGX_MAIL_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_mail_module_t ngx_mail_auth_http_module_ctx = {
- NULL, /* protocol */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_mail_auth_http_create_conf, /* create server configuration */
- ngx_mail_auth_http_merge_conf /* merge server configuration */
-};
-
-
-ngx_module_t ngx_mail_auth_http_module = {
- NGX_MODULE_V1,
- &ngx_mail_auth_http_module_ctx, /* module context */
- ngx_mail_auth_http_commands, /* module directives */
- NGX_MAIL_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_mail_auth_http_method[] = {
- ngx_string("plain"),
- ngx_string("plain"),
- ngx_string("plain"),
- ngx_string("apop"),
- ngx_string("cram-md5"),
- ngx_string("none")
-};
-
-static ngx_str_t ngx_mail_smtp_errcode = ngx_string("535 5.7.0");
-
-
-void
-ngx_mail_auth_http_init(ngx_mail_session_t *s)
-{
- ngx_int_t rc;
- ngx_pool_t *pool;
- ngx_mail_auth_http_ctx_t *ctx;
- ngx_mail_auth_http_conf_t *ahcf;
-
- s->connection->log->action = "in http auth state";
-
- pool = ngx_create_pool(2048, s->connection->log);
- if (pool == NULL) {
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- ctx = ngx_pcalloc(pool, sizeof(ngx_mail_auth_http_ctx_t));
- if (ctx == NULL) {
- ngx_destroy_pool(pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- ctx->pool = pool;
-
- ahcf = ngx_mail_get_module_srv_conf(s, ngx_mail_auth_http_module);
-
- ctx->request = ngx_mail_auth_http_create_request(s, pool, ahcf);
- if (ctx->request == NULL) {
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- ngx_mail_set_ctx(s, ctx, ngx_mail_auth_http_module);
-
- ctx->peer.sockaddr = ahcf->peer->sockaddr;
- ctx->peer.socklen = ahcf->peer->socklen;
- ctx->peer.name = &ahcf->peer->name;
- ctx->peer.get = ngx_event_get_peer;
- ctx->peer.log = s->connection->log;
- ctx->peer.log_error = NGX_ERROR_ERR;
-
- rc = ngx_event_connect_peer(&ctx->peer);
-
- if (rc == NGX_ERROR || rc == NGX_BUSY || rc == NGX_DECLINED) {
- if (ctx->peer.connection) {
- ngx_close_connection(ctx->peer.connection);
- }
-
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- ctx->peer.connection->data = s;
- ctx->peer.connection->pool = s->connection->pool;
-
- s->connection->read->handler = ngx_mail_auth_http_block_read;
- ctx->peer.connection->read->handler = ngx_mail_auth_http_read_handler;
- ctx->peer.connection->write->handler = ngx_mail_auth_http_write_handler;
-
- ctx->handler = ngx_mail_auth_http_ignore_status_line;
-
- ngx_add_timer(ctx->peer.connection->read, ahcf->timeout);
- ngx_add_timer(ctx->peer.connection->write, ahcf->timeout);
-
- if (rc == NGX_OK) {
- ngx_mail_auth_http_write_handler(ctx->peer.connection->write);
- return;
- }
-}
-
-
-static void
-ngx_mail_auth_http_write_handler(ngx_event_t *wev)
-{
- ssize_t n, size;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_auth_http_ctx_t *ctx;
- ngx_mail_auth_http_conf_t *ahcf;
-
- c = wev->data;
- s = c->data;
-
- ctx = ngx_mail_get_module_ctx(s, ngx_mail_auth_http_module);
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, wev->log, 0,
- "mail auth http write handler");
-
- if (wev->timedout) {
- ngx_log_error(NGX_LOG_ERR, wev->log, NGX_ETIMEDOUT,
- "auth http server %V timed out", ctx->peer.name);
- ngx_close_connection(c);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- size = ctx->request->last - ctx->request->pos;
-
- n = ngx_send(c, ctx->request->pos, size);
-
- if (n == NGX_ERROR) {
- ngx_close_connection(c);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- if (n > 0) {
- ctx->request->pos += n;
-
- if (n == size) {
- wev->handler = ngx_mail_auth_http_dummy_handler;
-
- if (wev->timer_set) {
- ngx_del_timer(wev);
- }
-
- if (ngx_handle_write_event(wev, 0) != NGX_OK) {
- ngx_close_connection(c);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- }
-
- return;
- }
- }
-
- if (!wev->timer_set) {
- ahcf = ngx_mail_get_module_srv_conf(s, ngx_mail_auth_http_module);
- ngx_add_timer(wev, ahcf->timeout);
- }
-}
-
-
-static void
-ngx_mail_auth_http_read_handler(ngx_event_t *rev)
-{
- ssize_t n, size;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_auth_http_ctx_t *ctx;
-
- c = rev->data;
- s = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail auth http read handler");
-
- ctx = ngx_mail_get_module_ctx(s, ngx_mail_auth_http_module);
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_ERR, rev->log, NGX_ETIMEDOUT,
- "auth http server %V timed out", ctx->peer.name);
- ngx_close_connection(c);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- if (ctx->response == NULL) {
- ctx->response = ngx_create_temp_buf(ctx->pool, 1024);
- if (ctx->response == NULL) {
- ngx_close_connection(c);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
- }
-
- size = ctx->response->end - ctx->response->last;
-
- n = ngx_recv(c, ctx->response->pos, size);
-
- if (n > 0) {
- ctx->response->last += n;
-
- ctx->handler(s, ctx);
- return;
- }
-
- if (n == NGX_AGAIN) {
- return;
- }
-
- ngx_close_connection(c);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
-}
-
-
-static void
-ngx_mail_auth_http_ignore_status_line(ngx_mail_session_t *s,
- ngx_mail_auth_http_ctx_t *ctx)
-{
- u_char *p, ch;
- enum {
- sw_start = 0,
- sw_H,
- sw_HT,
- sw_HTT,
- sw_HTTP,
- sw_skip,
- sw_almost_done
- } state;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
- "mail auth http process status line");
-
- state = ctx->state;
-
- for (p = ctx->response->pos; p < ctx->response->last; p++) {
- ch = *p;
-
- switch (state) {
-
- /* "HTTP/" */
- case sw_start:
- if (ch == 'H') {
- state = sw_H;
- break;
- }
- goto next;
-
- case sw_H:
- if (ch == 'T') {
- state = sw_HT;
- break;
- }
- goto next;
-
- case sw_HT:
- if (ch == 'T') {
- state = sw_HTT;
- break;
- }
- goto next;
-
- case sw_HTT:
- if (ch == 'P') {
- state = sw_HTTP;
- break;
- }
- goto next;
-
- case sw_HTTP:
- if (ch == '/') {
- state = sw_skip;
- break;
- }
- goto next;
-
- /* any text until end of line */
- case sw_skip:
- switch (ch) {
- case CR:
- state = sw_almost_done;
-
- break;
- case LF:
- goto done;
- }
- break;
-
- /* end of status line */
- case sw_almost_done:
- if (ch == LF) {
- goto done;
- }
-
- ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
- "auth http server &V sent invalid response",
- ctx->peer.name);
- ngx_close_connection(ctx->peer.connection);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
- }
-
- ctx->response->pos = p;
- ctx->state = state;
-
- return;
-
-next:
-
- p = ctx->response->start - 1;
-
-done:
-
- ctx->response->pos = p + 1;
- ctx->state = 0;
- ctx->handler = ngx_mail_auth_http_process_headers;
- ctx->handler(s, ctx);
-}
-
-
-static void
-ngx_mail_auth_http_process_headers(ngx_mail_session_t *s,
- ngx_mail_auth_http_ctx_t *ctx)
-{
- u_char *p;
- time_t timer;
- size_t len, size;
- ngx_int_t rc, port, n;
- ngx_addr_t *peer;
- struct sockaddr_in *sin;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
- "mail auth http process headers");
-
- for ( ;; ) {
- rc = ngx_mail_auth_http_parse_header_line(s, ctx);
-
- if (rc == NGX_OK) {
-
-#if (NGX_DEBUG)
- {
- ngx_str_t key, value;
-
- key.len = ctx->header_name_end - ctx->header_name_start;
- key.data = ctx->header_name_start;
- value.len = ctx->header_end - ctx->header_start;
- value.data = ctx->header_start;
-
- ngx_log_debug2(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
- "mail auth http header: \"%V: %V\"",
- &key, &value);
- }
-#endif
-
- len = ctx->header_name_end - ctx->header_name_start;
-
- if (len == sizeof("Auth-Status") - 1
- && ngx_strncasecmp(ctx->header_name_start,
- (u_char *) "Auth-Status",
- sizeof("Auth-Status") - 1)
- == 0)
- {
- len = ctx->header_end - ctx->header_start;
-
- if (len == 2
- && ctx->header_start[0] == 'O'
- && ctx->header_start[1] == 'K')
- {
- continue;
- }
-
- if (len == 4
- && ctx->header_start[0] == 'W'
- && ctx->header_start[1] == 'A'
- && ctx->header_start[2] == 'I'
- && ctx->header_start[3] == 'T')
- {
- s->auth_wait = 1;
- continue;
- }
-
- ctx->errmsg.len = len;
- ctx->errmsg.data = ctx->header_start;
-
- switch (s->protocol) {
-
- case NGX_MAIL_POP3_PROTOCOL:
- size = sizeof("-ERR ") - 1 + len + sizeof(CRLF) - 1;
- break;
-
- case NGX_MAIL_IMAP_PROTOCOL:
- size = s->tag.len + sizeof("NO ") - 1 + len
- + sizeof(CRLF) - 1;
- break;
-
- default: /* NGX_MAIL_SMTP_PROTOCOL */
- ctx->err = ctx->errmsg;
- continue;
- }
-
- p = ngx_pnalloc(s->connection->pool, size);
- if (p == NULL) {
- ngx_close_connection(ctx->peer.connection);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- ctx->err.data = p;
-
- switch (s->protocol) {
-
- case NGX_MAIL_POP3_PROTOCOL:
- *p++ = '-'; *p++ = 'E'; *p++ = 'R'; *p++ = 'R'; *p++ = ' ';
- break;
-
- case NGX_MAIL_IMAP_PROTOCOL:
- p = ngx_cpymem(p, s->tag.data, s->tag.len);
- *p++ = 'N'; *p++ = 'O'; *p++ = ' ';
- break;
-
- default: /* NGX_MAIL_SMTP_PROTOCOL */
- break;
- }
-
- p = ngx_cpymem(p, ctx->header_start, len);
- *p++ = CR; *p++ = LF;
-
- ctx->err.len = p - ctx->err.data;
-
- continue;
- }
-
- if (len == sizeof("Auth-Server") - 1
- && ngx_strncasecmp(ctx->header_name_start,
- (u_char *) "Auth-Server",
- sizeof("Auth-Server") - 1)
- == 0)
- {
- ctx->addr.len = ctx->header_end - ctx->header_start;
- ctx->addr.data = ctx->header_start;
-
- continue;
- }
-
- if (len == sizeof("Auth-Port") - 1
- && ngx_strncasecmp(ctx->header_name_start,
- (u_char *) "Auth-Port",
- sizeof("Auth-Port") - 1)
- == 0)
- {
- ctx->port.len = ctx->header_end - ctx->header_start;
- ctx->port.data = ctx->header_start;
-
- continue;
- }
-
- if (len == sizeof("Auth-User") - 1
- && ngx_strncasecmp(ctx->header_name_start,
- (u_char *) "Auth-User",
- sizeof("Auth-User") - 1)
- == 0)
- {
- s->login.len = ctx->header_end - ctx->header_start;
-
- s->login.data = ngx_pnalloc(s->connection->pool, s->login.len);
- if (s->login.data == NULL) {
- ngx_close_connection(ctx->peer.connection);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- ngx_memcpy(s->login.data, ctx->header_start, s->login.len);
-
- continue;
- }
-
- if (len == sizeof("Auth-Pass") - 1
- && ngx_strncasecmp(ctx->header_name_start,
- (u_char *) "Auth-Pass",
- sizeof("Auth-Pass") - 1)
- == 0)
- {
- s->passwd.len = ctx->header_end - ctx->header_start;
-
- s->passwd.data = ngx_pnalloc(s->connection->pool,
- s->passwd.len);
- if (s->passwd.data == NULL) {
- ngx_close_connection(ctx->peer.connection);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- ngx_memcpy(s->passwd.data, ctx->header_start, s->passwd.len);
-
- continue;
- }
-
- if (len == sizeof("Auth-Wait") - 1
- && ngx_strncasecmp(ctx->header_name_start,
- (u_char *) "Auth-Wait",
- sizeof("Auth-Wait") - 1)
- == 0)
- {
- n = ngx_atoi(ctx->header_start,
- ctx->header_end - ctx->header_start);
-
- if (n != NGX_ERROR) {
- ctx->sleep = n;
- }
-
- continue;
- }
-
- if (len == sizeof("Auth-Error-Code") - 1
- && ngx_strncasecmp(ctx->header_name_start,
- (u_char *) "Auth-Error-Code",
- sizeof("Auth-Error-Code") - 1)
- == 0)
- {
- ctx->errcode.len = ctx->header_end - ctx->header_start;
-
- ctx->errcode.data = ngx_pnalloc(s->connection->pool,
- ctx->errcode.len);
- if (ctx->errcode.data == NULL) {
- ngx_close_connection(ctx->peer.connection);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- ngx_memcpy(ctx->errcode.data, ctx->header_start,
- ctx->errcode.len);
-
- continue;
- }
-
- /* ignore other headers */
-
- continue;
- }
-
- if (rc == NGX_DONE) {
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
- "mail auth http header done");
-
- ngx_close_connection(ctx->peer.connection);
-
- if (ctx->err.len) {
-
- ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
- "client login failed: \"%V\"", &ctx->errmsg);
-
- if (s->protocol == NGX_MAIL_SMTP_PROTOCOL) {
-
- if (ctx->errcode.len == 0) {
- ctx->errcode = ngx_mail_smtp_errcode;
- }
-
- ctx->err.len = ctx->errcode.len + ctx->errmsg.len
- + sizeof(" " CRLF) - 1;
-
- p = ngx_pnalloc(s->connection->pool, ctx->err.len);
- if (p == NULL) {
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- ctx->err.data = p;
-
- p = ngx_cpymem(p, ctx->errcode.data, ctx->errcode.len);
- *p++ = ' ';
- p = ngx_cpymem(p, ctx->errmsg.data, ctx->errmsg.len);
- *p++ = CR; *p = LF;
- }
-
- s->out = ctx->err;
- timer = ctx->sleep;
-
- ngx_destroy_pool(ctx->pool);
-
- if (timer == 0) {
- s->quit = 1;
- ngx_mail_send(s->connection->write);
- return;
- }
-
- ngx_add_timer(s->connection->read, (ngx_msec_t) (timer * 1000));
-
- s->connection->read->handler = ngx_mail_auth_sleep_handler;
-
- return;
- }
-
- if (s->auth_wait) {
- timer = ctx->sleep;
-
- ngx_destroy_pool(ctx->pool);
-
- if (timer == 0) {
- ngx_mail_auth_http_init(s);
- return;
- }
-
- ngx_add_timer(s->connection->read, (ngx_msec_t) (timer * 1000));
-
- s->connection->read->handler = ngx_mail_auth_sleep_handler;
-
- return;
- }
-
- if (ctx->addr.len == 0 || ctx->port.len == 0) {
- ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
- "auth http server %V did not send server or port",
- ctx->peer.name);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- if (s->passwd.data == NULL
- && s->protocol != NGX_MAIL_SMTP_PROTOCOL)
- {
- ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
- "auth http server %V did not send password",
- ctx->peer.name);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- peer = ngx_pcalloc(s->connection->pool, sizeof(ngx_addr_t));
- if (peer == NULL) {
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- rc = ngx_parse_addr(s->connection->pool, peer,
- ctx->addr.data, ctx->addr.len);
-
- switch (rc) {
- case NGX_OK:
- break;
-
- case NGX_DECLINED:
- ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
- "auth http server %V sent invalid server "
- "address:\"%V\"",
- ctx->peer.name, &ctx->addr);
- /* fall through */
-
- default:
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- port = ngx_atoi(ctx->port.data, ctx->port.len);
- if (port == NGX_ERROR || port < 1 || port > 65535) {
- ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
- "auth http server %V sent invalid server "
- "port:\"%V\"",
- ctx->peer.name, &ctx->port);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- switch (peer->sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) peer->sockaddr;
- sin6->sin6_port = htons((in_port_t) port);
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) peer->sockaddr;
- sin->sin_port = htons((in_port_t) port);
- break;
- }
-
- len = ctx->addr.len + 1 + ctx->port.len;
-
- peer->name.len = len;
-
- peer->name.data = ngx_pnalloc(s->connection->pool, len);
- if (peer->name.data == NULL) {
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- len = ctx->addr.len;
-
- ngx_memcpy(peer->name.data, ctx->addr.data, len);
-
- peer->name.data[len++] = ':';
-
- ngx_memcpy(peer->name.data + len, ctx->port.data, ctx->port.len);
-
- ngx_destroy_pool(ctx->pool);
- ngx_mail_proxy_init(s, peer);
-
- return;
- }
-
- if (rc == NGX_AGAIN ) {
- return;
- }
-
- /* rc == NGX_ERROR */
-
- ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
- "auth http server %V sent invalid header in response",
- ctx->peer.name);
- ngx_close_connection(ctx->peer.connection);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
-
- return;
- }
-}
-
-
-static void
-ngx_mail_auth_sleep_handler(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_core_srv_conf_t *cscf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail auth sleep handler");
-
- c = rev->data;
- s = c->data;
-
- if (rev->timedout) {
-
- rev->timedout = 0;
-
- if (s->auth_wait) {
- s->auth_wait = 0;
- ngx_mail_auth_http_init(s);
- return;
- }
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- rev->handler = cscf->protocol->auth_state;
-
- s->mail_state = 0;
- s->auth_method = NGX_MAIL_AUTH_PLAIN;
-
- c->log->action = "in auth state";
-
- ngx_mail_send(c->write);
-
- if (c->destroyed) {
- return;
- }
-
- ngx_add_timer(rev, cscf->timeout);
-
- if (rev->ready) {
- rev->handler(rev);
- return;
- }
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_mail_close_connection(c);
- }
-
- return;
- }
-
- if (rev->active) {
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- ngx_mail_close_connection(c);
- }
- }
-}
-
-
-static ngx_int_t
-ngx_mail_auth_http_parse_header_line(ngx_mail_session_t *s,
- ngx_mail_auth_http_ctx_t *ctx)
-{
- u_char c, ch, *p;
- enum {
- sw_start = 0,
- sw_name,
- sw_space_before_value,
- sw_value,
- sw_space_after_value,
- sw_almost_done,
- sw_header_almost_done
- } state;
-
- state = ctx->state;
-
- for (p = ctx->response->pos; p < ctx->response->last; p++) {
- ch = *p;
-
- switch (state) {
-
- /* first char */
- case sw_start:
-
- switch (ch) {
- case CR:
- ctx->header_end = p;
- state = sw_header_almost_done;
- break;
- case LF:
- ctx->header_end = p;
- goto header_done;
- default:
- state = sw_name;
- ctx->header_name_start = p;
-
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'z') {
- break;
- }
-
- if (ch >= '0' && ch <= '9') {
- break;
- }
-
- return NGX_ERROR;
- }
- break;
-
- /* header name */
- case sw_name:
- c = (u_char) (ch | 0x20);
- if (c >= 'a' && c <= 'z') {
- break;
- }
-
- if (ch == ':') {
- ctx->header_name_end = p;
- state = sw_space_before_value;
- break;
- }
-
- if (ch == '-') {
- break;
- }
-
- if (ch >= '0' && ch <= '9') {
- break;
- }
-
- if (ch == CR) {
- ctx->header_name_end = p;
- ctx->header_start = p;
- ctx->header_end = p;
- state = sw_almost_done;
- break;
- }
-
- if (ch == LF) {
- ctx->header_name_end = p;
- ctx->header_start = p;
- ctx->header_end = p;
- goto done;
- }
-
- return NGX_ERROR;
-
- /* space* before header value */
- case sw_space_before_value:
- switch (ch) {
- case ' ':
- break;
- case CR:
- ctx->header_start = p;
- ctx->header_end = p;
- state = sw_almost_done;
- break;
- case LF:
- ctx->header_start = p;
- ctx->header_end = p;
- goto done;
- default:
- ctx->header_start = p;
- state = sw_value;
- break;
- }
- break;
-
- /* header value */
- case sw_value:
- switch (ch) {
- case ' ':
- ctx->header_end = p;
- state = sw_space_after_value;
- break;
- case CR:
- ctx->header_end = p;
- state = sw_almost_done;
- break;
- case LF:
- ctx->header_end = p;
- goto done;
- }
- break;
-
- /* space* before end of header line */
- case sw_space_after_value:
- switch (ch) {
- case ' ':
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- default:
- state = sw_value;
- break;
- }
- break;
-
- /* end of header line */
- case sw_almost_done:
- switch (ch) {
- case LF:
- goto done;
- default:
- return NGX_ERROR;
- }
-
- /* end of header */
- case sw_header_almost_done:
- switch (ch) {
- case LF:
- goto header_done;
- default:
- return NGX_ERROR;
- }
- }
- }
-
- ctx->response->pos = p;
- ctx->state = state;
-
- return NGX_AGAIN;
-
-done:
-
- ctx->response->pos = p + 1;
- ctx->state = sw_start;
-
- return NGX_OK;
-
-header_done:
-
- ctx->response->pos = p + 1;
- ctx->state = sw_start;
-
- return NGX_DONE;
-}
-
-
-static void
-ngx_mail_auth_http_block_read(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_auth_http_ctx_t *ctx;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail auth http block read");
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- c = rev->data;
- s = c->data;
-
- ctx = ngx_mail_get_module_ctx(s, ngx_mail_auth_http_module);
-
- ngx_close_connection(ctx->peer.connection);
- ngx_destroy_pool(ctx->pool);
- ngx_mail_session_internal_server_error(s);
- }
-}
-
-
-static void
-ngx_mail_auth_http_dummy_handler(ngx_event_t *ev)
-{
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, ev->log, 0,
- "mail auth http dummy handler");
-}
-
-
-static ngx_buf_t *
-ngx_mail_auth_http_create_request(ngx_mail_session_t *s, ngx_pool_t *pool,
- ngx_mail_auth_http_conf_t *ahcf)
-{
- size_t len;
- ngx_buf_t *b;
- ngx_str_t login, passwd;
- ngx_mail_core_srv_conf_t *cscf;
-
- if (ngx_mail_auth_http_escape(pool, &s->login, &login) != NGX_OK) {
- return NULL;
- }
-
- if (ngx_mail_auth_http_escape(pool, &s->passwd, &passwd) != NGX_OK) {
- return NULL;
- }
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- len = sizeof("GET ") - 1 + ahcf->uri.len + sizeof(" HTTP/1.0" CRLF) - 1
- + sizeof("Host: ") - 1 + ahcf->host_header.len + sizeof(CRLF) - 1
- + sizeof("Auth-Method: ") - 1
- + ngx_mail_auth_http_method[s->auth_method].len
- + sizeof(CRLF) - 1
- + sizeof("Auth-User: ") - 1 + login.len + sizeof(CRLF) - 1
- + sizeof("Auth-Pass: ") - 1 + passwd.len + sizeof(CRLF) - 1
- + sizeof("Auth-Salt: ") - 1 + s->salt.len
- + sizeof("Auth-Protocol: ") - 1 + cscf->protocol->name.len
- + sizeof(CRLF) - 1
- + sizeof("Auth-Login-Attempt: ") - 1 + NGX_INT_T_LEN
- + sizeof(CRLF) - 1
- + sizeof("Client-IP: ") - 1 + s->connection->addr_text.len
- + sizeof(CRLF) - 1
- + sizeof("Client-Host: ") - 1 + s->host.len + sizeof(CRLF) - 1
- + sizeof("Auth-SMTP-Helo: ") - 1 + s->smtp_helo.len
- + sizeof("Auth-SMTP-From: ") - 1 + s->smtp_from.len
- + sizeof("Auth-SMTP-To: ") - 1 + s->smtp_to.len
- + ahcf->header.len
- + sizeof(CRLF) - 1;
-
- b = ngx_create_temp_buf(pool, len);
- if (b == NULL) {
- return NULL;
- }
-
- b->last = ngx_cpymem(b->last, "GET ", sizeof("GET ") - 1);
- b->last = ngx_copy(b->last, ahcf->uri.data, ahcf->uri.len);
- b->last = ngx_cpymem(b->last, " HTTP/1.0" CRLF,
- sizeof(" HTTP/1.0" CRLF) - 1);
-
- b->last = ngx_cpymem(b->last, "Host: ", sizeof("Host: ") - 1);
- b->last = ngx_copy(b->last, ahcf->host_header.data,
- ahcf->host_header.len);
- *b->last++ = CR; *b->last++ = LF;
-
- b->last = ngx_cpymem(b->last, "Auth-Method: ",
- sizeof("Auth-Method: ") - 1);
- b->last = ngx_cpymem(b->last,
- ngx_mail_auth_http_method[s->auth_method].data,
- ngx_mail_auth_http_method[s->auth_method].len);
- *b->last++ = CR; *b->last++ = LF;
-
- b->last = ngx_cpymem(b->last, "Auth-User: ", sizeof("Auth-User: ") - 1);
- b->last = ngx_copy(b->last, login.data, login.len);
- *b->last++ = CR; *b->last++ = LF;
-
- b->last = ngx_cpymem(b->last, "Auth-Pass: ", sizeof("Auth-Pass: ") - 1);
- b->last = ngx_copy(b->last, passwd.data, passwd.len);
- *b->last++ = CR; *b->last++ = LF;
-
- if (s->auth_method != NGX_MAIL_AUTH_PLAIN && s->salt.len) {
- b->last = ngx_cpymem(b->last, "Auth-Salt: ", sizeof("Auth-Salt: ") - 1);
- b->last = ngx_copy(b->last, s->salt.data, s->salt.len);
-
- s->passwd.data = NULL;
- }
-
- b->last = ngx_cpymem(b->last, "Auth-Protocol: ",
- sizeof("Auth-Protocol: ") - 1);
- b->last = ngx_cpymem(b->last, cscf->protocol->name.data,
- cscf->protocol->name.len);
- *b->last++ = CR; *b->last++ = LF;
-
- b->last = ngx_sprintf(b->last, "Auth-Login-Attempt: %ui" CRLF,
- s->login_attempt);
-
- b->last = ngx_cpymem(b->last, "Client-IP: ", sizeof("Client-IP: ") - 1);
- b->last = ngx_copy(b->last, s->connection->addr_text.data,
- s->connection->addr_text.len);
- *b->last++ = CR; *b->last++ = LF;
-
- if (s->host.len) {
- b->last = ngx_cpymem(b->last, "Client-Host: ",
- sizeof("Client-Host: ") - 1);
- b->last = ngx_copy(b->last, s->host.data, s->host.len);
- *b->last++ = CR; *b->last++ = LF;
- }
-
- if (s->auth_method == NGX_MAIL_AUTH_NONE) {
-
- /* HELO, MAIL FROM, and RCPT TO can't contain CRLF, no need to escape */
-
- b->last = ngx_cpymem(b->last, "Auth-SMTP-Helo: ",
- sizeof("Auth-SMTP-Helo: ") - 1);
- b->last = ngx_copy(b->last, s->smtp_helo.data, s->smtp_helo.len);
- *b->last++ = CR; *b->last++ = LF;
-
- b->last = ngx_cpymem(b->last, "Auth-SMTP-From: ",
- sizeof("Auth-SMTP-From: ") - 1);
- b->last = ngx_copy(b->last, s->smtp_from.data, s->smtp_from.len);
- *b->last++ = CR; *b->last++ = LF;
-
- b->last = ngx_cpymem(b->last, "Auth-SMTP-To: ",
- sizeof("Auth-SMTP-To: ") - 1);
- b->last = ngx_copy(b->last, s->smtp_to.data, s->smtp_to.len);
- *b->last++ = CR; *b->last++ = LF;
-
- }
-
- if (ahcf->header.len) {
- b->last = ngx_copy(b->last, ahcf->header.data, ahcf->header.len);
- }
-
- /* add "\r\n" at the header end */
- *b->last++ = CR; *b->last++ = LF;
-
-#if (NGX_DEBUG_MAIL_PASSWD)
- {
- ngx_str_t l;
-
- l.len = b->last - b->pos;
- l.data = b->pos;
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
- "mail auth http header:%N\"%V\"", &l);
- }
-#endif
-
- return b;
-}
-
-
-static ngx_int_t
-ngx_mail_auth_http_escape(ngx_pool_t *pool, ngx_str_t *text, ngx_str_t *escaped)
-{
- u_char *p;
- uintptr_t n;
-
- n = ngx_escape_uri(NULL, text->data, text->len, NGX_ESCAPE_MAIL_AUTH);
-
- if (n == 0) {
- *escaped = *text;
- return NGX_OK;
- }
-
- escaped->len = text->len + n * 2;
-
- p = ngx_pnalloc(pool, escaped->len);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- (void) ngx_escape_uri(p, text->data, text->len, NGX_ESCAPE_MAIL_AUTH);
-
- escaped->data = p;
-
- return NGX_OK;
-}
-
-
-static void *
-ngx_mail_auth_http_create_conf(ngx_conf_t *cf)
-{
- ngx_mail_auth_http_conf_t *ahcf;
-
- ahcf = ngx_pcalloc(cf->pool, sizeof(ngx_mail_auth_http_conf_t));
- if (ahcf == NULL) {
- return NULL;
- }
-
- ahcf->timeout = NGX_CONF_UNSET_MSEC;
-
- ahcf->file = cf->conf_file->file.name.data;
- ahcf->line = cf->conf_file->line;
-
- return ahcf;
-}
-
-
-static char *
-ngx_mail_auth_http_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_mail_auth_http_conf_t *prev = parent;
- ngx_mail_auth_http_conf_t *conf = child;
-
- u_char *p;
- size_t len;
- ngx_uint_t i;
- ngx_table_elt_t *header;
-
- if (conf->peer == NULL) {
- conf->peer = prev->peer;
- conf->host_header = prev->host_header;
- conf->uri = prev->uri;
-
- if (conf->peer == NULL) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no \"auth_http\" is defined for server in %s:%ui",
- conf->file, conf->line);
-
- return NGX_CONF_ERROR;
- }
- }
-
- ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000);
-
- if (conf->headers == NULL) {
- conf->headers = prev->headers;
- conf->header = prev->header;
- }
-
- if (conf->headers && conf->header.len == 0) {
- len = 0;
- header = conf->headers->elts;
- for (i = 0; i < conf->headers->nelts; i++) {
- len += header[i].key.len + 2 + header[i].value.len + 2;
- }
-
- p = ngx_pnalloc(cf->pool, len);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->header.len = len;
- conf->header.data = p;
-
- for (i = 0; i < conf->headers->nelts; i++) {
- p = ngx_cpymem(p, header[i].key.data, header[i].key.len);
- *p++ = ':'; *p++ = ' ';
- p = ngx_cpymem(p, header[i].value.data, header[i].value.len);
- *p++ = CR; *p++ = LF;
- }
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_mail_auth_http(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_mail_auth_http_conf_t *ahcf = conf;
-
- ngx_str_t *value;
- ngx_url_t u;
-
- value = cf->args->elts;
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url = value[1];
- u.default_port = 80;
- u.uri_part = 1;
-
- if (ngx_strncmp(u.url.data, "http://", 7) == 0) {
- u.url.len -= 7;
- u.url.data += 7;
- }
-
- if (ngx_parse_url(cf->pool, &u) != NGX_OK) {
- if (u.err) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%s in auth_http \"%V\"", u.err, &u.url);
- }
-
- return NGX_CONF_ERROR;
- }
-
- ahcf->peer = u.addrs;
-
- if (u.family != AF_UNIX) {
- ahcf->host_header = u.host;
-
- } else {
- ngx_str_set(&ahcf->host_header, "localhost");
- }
-
- ahcf->uri = u.uri;
-
- if (ahcf->uri.len == 0) {
- ngx_str_set(&ahcf->uri, "/");
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_mail_auth_http_header(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_mail_auth_http_conf_t *ahcf = conf;
-
- ngx_str_t *value;
- ngx_table_elt_t *header;
-
- if (ahcf->headers == NULL) {
- ahcf->headers = ngx_array_create(cf->pool, 1, sizeof(ngx_table_elt_t));
- if (ahcf->headers == NULL) {
- return NGX_CONF_ERROR;
- }
- }
-
- header = ngx_array_push(ahcf->headers);
- if (header == NULL) {
- return NGX_CONF_ERROR;
- }
-
- value = cf->args->elts;
-
- header->key = value[1];
- header->value = value[2];
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_core_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_core_module.c
deleted file mode 100644
index a5388c8470e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_core_module.c
+++ /dev/null
@@ -1,653 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-
-
-static void *ngx_mail_core_create_main_conf(ngx_conf_t *cf);
-static void *ngx_mail_core_create_srv_conf(ngx_conf_t *cf);
-static char *ngx_mail_core_merge_srv_conf(ngx_conf_t *cf, void *parent,
- void *child);
-static char *ngx_mail_core_server(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_mail_core_protocol(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_mail_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_conf_deprecated_t ngx_conf_deprecated_so_keepalive = {
- ngx_conf_deprecated, "so_keepalive",
- "so_keepalive\" parameter of the \"listen"
-};
-
-
-static ngx_command_t ngx_mail_core_commands[] = {
-
- { ngx_string("server"),
- NGX_MAIL_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS,
- ngx_mail_core_server,
- 0,
- 0,
- NULL },
-
- { ngx_string("listen"),
- NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
- ngx_mail_core_listen,
- NGX_MAIL_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("protocol"),
- NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_mail_core_protocol,
- NGX_MAIL_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("so_keepalive"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_core_srv_conf_t, so_keepalive),
- &ngx_conf_deprecated_so_keepalive },
-
- { ngx_string("timeout"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_core_srv_conf_t, timeout),
- NULL },
-
- { ngx_string("server_name"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_core_srv_conf_t, server_name),
- NULL },
-
- { ngx_string("resolver"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
- ngx_mail_core_resolver,
- NGX_MAIL_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("resolver_timeout"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_core_srv_conf_t, resolver_timeout),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_mail_module_t ngx_mail_core_module_ctx = {
- NULL, /* protocol */
-
- ngx_mail_core_create_main_conf, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_mail_core_create_srv_conf, /* create server configuration */
- ngx_mail_core_merge_srv_conf /* merge server configuration */
-};
-
-
-ngx_module_t ngx_mail_core_module = {
- NGX_MODULE_V1,
- &ngx_mail_core_module_ctx, /* module context */
- ngx_mail_core_commands, /* module directives */
- NGX_MAIL_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static void *
-ngx_mail_core_create_main_conf(ngx_conf_t *cf)
-{
- ngx_mail_core_main_conf_t *cmcf;
-
- cmcf = ngx_pcalloc(cf->pool, sizeof(ngx_mail_core_main_conf_t));
- if (cmcf == NULL) {
- return NULL;
- }
-
- if (ngx_array_init(&cmcf->servers, cf->pool, 4,
- sizeof(ngx_mail_core_srv_conf_t *))
- != NGX_OK)
- {
- return NULL;
- }
-
- if (ngx_array_init(&cmcf->listen, cf->pool, 4, sizeof(ngx_mail_listen_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- return cmcf;
-}
-
-
-static void *
-ngx_mail_core_create_srv_conf(ngx_conf_t *cf)
-{
- ngx_mail_core_srv_conf_t *cscf;
-
- cscf = ngx_pcalloc(cf->pool, sizeof(ngx_mail_core_srv_conf_t));
- if (cscf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * cscf->protocol = NULL;
- */
-
- cscf->timeout = NGX_CONF_UNSET_MSEC;
- cscf->resolver_timeout = NGX_CONF_UNSET_MSEC;
- cscf->so_keepalive = NGX_CONF_UNSET;
-
- cscf->resolver = NGX_CONF_UNSET_PTR;
-
- cscf->file_name = cf->conf_file->file.name.data;
- cscf->line = cf->conf_file->line;
-
- return cscf;
-}
-
-
-static char *
-ngx_mail_core_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_mail_core_srv_conf_t *prev = parent;
- ngx_mail_core_srv_conf_t *conf = child;
-
- ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 60000);
- ngx_conf_merge_msec_value(conf->resolver_timeout, prev->resolver_timeout,
- 30000);
-
- ngx_conf_merge_value(conf->so_keepalive, prev->so_keepalive, 0);
-
-
- ngx_conf_merge_str_value(conf->server_name, prev->server_name, "");
-
- if (conf->server_name.len == 0) {
- conf->server_name = cf->cycle->hostname;
- }
-
- if (conf->protocol == NULL) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "unknown mail protocol for server in %s:%ui",
- conf->file_name, conf->line);
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_ptr_value(conf->resolver, prev->resolver, NULL);
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_mail_core_server(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *rv;
- void *mconf;
- ngx_uint_t m;
- ngx_conf_t pcf;
- ngx_mail_module_t *module;
- ngx_mail_conf_ctx_t *ctx, *mail_ctx;
- ngx_mail_core_srv_conf_t *cscf, **cscfp;
- ngx_mail_core_main_conf_t *cmcf;
-
- ctx = ngx_pcalloc(cf->pool, sizeof(ngx_mail_conf_ctx_t));
- if (ctx == NULL) {
- return NGX_CONF_ERROR;
- }
-
- mail_ctx = cf->ctx;
- ctx->main_conf = mail_ctx->main_conf;
-
- /* the server{}'s srv_conf */
-
- ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_mail_max_module);
- if (ctx->srv_conf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
-
- if (module->create_srv_conf) {
- mconf = module->create_srv_conf(cf);
- if (mconf == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ctx->srv_conf[ngx_modules[m]->ctx_index] = mconf;
- }
- }
-
- /* the server configuration context */
-
- cscf = ctx->srv_conf[ngx_mail_core_module.ctx_index];
- cscf->ctx = ctx;
-
- cmcf = ctx->main_conf[ngx_mail_core_module.ctx_index];
-
- cscfp = ngx_array_push(&cmcf->servers);
- if (cscfp == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *cscfp = cscf;
-
-
- /* parse inside server{} */
-
- pcf = *cf;
- cf->ctx = ctx;
- cf->cmd_type = NGX_MAIL_SRV_CONF;
-
- rv = ngx_conf_parse(cf, NULL);
-
- *cf = pcf;
-
- return rv;
-}
-
-
-static char *
-ngx_mail_core_listen(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_mail_core_srv_conf_t *cscf = conf;
-
- size_t len, off;
- in_port_t port;
- ngx_str_t *value;
- ngx_url_t u;
- ngx_uint_t i, m;
- struct sockaddr *sa;
- ngx_mail_listen_t *ls;
- ngx_mail_module_t *module;
- struct sockaddr_in *sin;
- ngx_mail_core_main_conf_t *cmcf;
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
-#endif
-
- value = cf->args->elts;
-
- ngx_memzero(&u, sizeof(ngx_url_t));
-
- u.url = value[1];
- u.listen = 1;
-
- if (ngx_parse_url(cf->pool, &u) != NGX_OK) {
- if (u.err) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "%s in \"%V\" of the \"listen\" directive",
- u.err, &u.url);
- }
-
- return NGX_CONF_ERROR;
- }
-
- cmcf = ngx_mail_conf_get_module_main_conf(cf, ngx_mail_core_module);
-
- ls = cmcf->listen.elts;
-
- for (i = 0; i < cmcf->listen.nelts; i++) {
-
- sa = (struct sockaddr *) ls[i].sockaddr;
-
- if (sa->sa_family != u.family) {
- continue;
- }
-
- switch (sa->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- off = offsetof(struct sockaddr_in6, sin6_addr);
- len = 16;
- sin6 = (struct sockaddr_in6 *) sa;
- port = sin6->sin6_port;
- break;
-#endif
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- case AF_UNIX:
- off = offsetof(struct sockaddr_un, sun_path);
- len = sizeof(((struct sockaddr_un *) sa)->sun_path);
- port = 0;
- break;
-#endif
-
- default: /* AF_INET */
- off = offsetof(struct sockaddr_in, sin_addr);
- len = 4;
- sin = (struct sockaddr_in *) sa;
- port = sin->sin_port;
- break;
- }
-
- if (ngx_memcmp(ls[i].sockaddr + off, u.sockaddr + off, len) != 0) {
- continue;
- }
-
- if (port != u.port) {
- continue;
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "duplicate \"%V\" address and port pair", &u.url);
- return NGX_CONF_ERROR;
- }
-
- ls = ngx_array_push(&cmcf->listen);
- if (ls == NULL) {
- return NGX_CONF_ERROR;
- }
-
- ngx_memzero(ls, sizeof(ngx_mail_listen_t));
-
- ngx_memcpy(ls->sockaddr, u.sockaddr, u.socklen);
-
- ls->socklen = u.socklen;
- ls->wildcard = u.wildcard;
- ls->ctx = cf->ctx;
-
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- ls->ipv6only = 1;
-#endif
-
- if (cscf->protocol == NULL) {
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
-
- if (module->protocol == NULL) {
- continue;
- }
-
- for (i = 0; module->protocol->port[i]; i++) {
- if (module->protocol->port[i] == u.port) {
- cscf->protocol = module->protocol;
- break;
- }
- }
- }
- }
-
- for (i = 2; i < cf->args->nelts; i++) {
-
- if (ngx_strcmp(value[i].data, "bind") == 0) {
- ls->bind = 1;
- continue;
- }
-
- if (ngx_strncmp(value[i].data, "ipv6only=o", 10) == 0) {
-#if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
- struct sockaddr *sa;
- u_char buf[NGX_SOCKADDR_STRLEN];
-
- sa = (struct sockaddr *) ls->sockaddr;
-
- if (sa->sa_family == AF_INET6) {
-
- if (ngx_strcmp(&value[i].data[10], "n") == 0) {
- ls->ipv6only = 1;
-
- } else if (ngx_strcmp(&value[i].data[10], "ff") == 0) {
- ls->ipv6only = 0;
-
- } else {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid ipv6only flags \"%s\"",
- &value[i].data[9]);
- return NGX_CONF_ERROR;
- }
-
- ls->bind = 1;
-
- } else {
- len = ngx_sock_ntop(sa, ls->socklen, buf,
- NGX_SOCKADDR_STRLEN, 1);
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "ipv6only is not supported "
- "on addr \"%*s\", ignored", len, buf);
- }
-
- continue;
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "bind ipv6only is not supported "
- "on this platform");
- return NGX_CONF_ERROR;
-#endif
- }
-
- if (ngx_strcmp(value[i].data, "ssl") == 0) {
-#if (NGX_MAIL_SSL)
- ls->ssl = 1;
- continue;
-#else
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the \"ssl\" parameter requires "
- "ngx_mail_ssl_module");
- return NGX_CONF_ERROR;
-#endif
- }
-
- if (ngx_strncmp(value[i].data, "so_keepalive=", 13) == 0) {
-
- if (ngx_strcmp(&value[i].data[13], "on") == 0) {
- ls->so_keepalive = 1;
-
- } else if (ngx_strcmp(&value[i].data[13], "off") == 0) {
- ls->so_keepalive = 2;
-
- } else {
-
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- u_char *p, *end;
- ngx_str_t s;
-
- end = value[i].data + value[i].len;
- s.data = value[i].data + 13;
-
- p = ngx_strlchr(s.data, end, ':');
- if (p == NULL) {
- p = end;
- }
-
- if (p > s.data) {
- s.len = p - s.data;
-
- ls->tcp_keepidle = ngx_parse_time(&s, 1);
- if (ls->tcp_keepidle == (time_t) NGX_ERROR) {
- goto invalid_so_keepalive;
- }
- }
-
- s.data = (p < end) ? (p + 1) : end;
-
- p = ngx_strlchr(s.data, end, ':');
- if (p == NULL) {
- p = end;
- }
-
- if (p > s.data) {
- s.len = p - s.data;
-
- ls->tcp_keepintvl = ngx_parse_time(&s, 1);
- if (ls->tcp_keepintvl == (time_t) NGX_ERROR) {
- goto invalid_so_keepalive;
- }
- }
-
- s.data = (p < end) ? (p + 1) : end;
-
- if (s.data < end) {
- s.len = end - s.data;
-
- ls->tcp_keepcnt = ngx_atoi(s.data, s.len);
- if (ls->tcp_keepcnt == NGX_ERROR) {
- goto invalid_so_keepalive;
- }
- }
-
- if (ls->tcp_keepidle == 0 && ls->tcp_keepintvl == 0
- && ls->tcp_keepcnt == 0)
- {
- goto invalid_so_keepalive;
- }
-
- ls->so_keepalive = 1;
-
-#else
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the \"so_keepalive\" parameter accepts "
- "only \"on\" or \"off\" on this platform");
- return NGX_CONF_ERROR;
-
-#endif
- }
-
- ls->bind = 1;
-
- continue;
-
-#if (NGX_HAVE_KEEPALIVE_TUNABLE)
- invalid_so_keepalive:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid so_keepalive value: \"%s\"",
- &value[i].data[13]);
- return NGX_CONF_ERROR;
-#endif
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "the invalid \"%V\" parameter", &value[i]);
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_mail_core_protocol(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_mail_core_srv_conf_t *cscf = conf;
-
- ngx_str_t *value;
- ngx_uint_t m;
- ngx_mail_module_t *module;
-
- value = cf->args->elts;
-
- for (m = 0; ngx_modules[m]; m++) {
- if (ngx_modules[m]->type != NGX_MAIL_MODULE) {
- continue;
- }
-
- module = ngx_modules[m]->ctx;
-
- if (module->protocol
- && ngx_strcmp(module->protocol->name.data, value[1].data) == 0)
- {
- cscf->protocol = module->protocol;
-
- return NGX_CONF_OK;
- }
- }
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "unknown protocol \"%V\"", &value[1]);
- return NGX_CONF_ERROR;
-}
-
-
-static char *
-ngx_mail_core_resolver(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_mail_core_srv_conf_t *cscf = conf;
-
- ngx_str_t *value;
-
- value = cf->args->elts;
-
- if (cscf->resolver != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- if (ngx_strcmp(value[1].data, "off") == 0) {
- cscf->resolver = NULL;
- return NGX_CONF_OK;
- }
-
- cscf->resolver = ngx_resolver_create(cf, &value[1], cf->args->nelts - 1);
- if (cscf->resolver == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-char *
-ngx_mail_capabilities(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- char *p = conf;
-
- ngx_str_t *c, *value;
- ngx_uint_t i;
- ngx_array_t *a;
-
- a = (ngx_array_t *) (p + cmd->offset);
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
- c = ngx_array_push(a);
- if (c == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *c = value[i];
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_handler.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_handler.c
deleted file mode 100644
index 57b69b564d7..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_handler.c
+++ /dev/null
@@ -1,790 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-
-
-static void ngx_mail_init_session(ngx_connection_t *c);
-
-#if (NGX_MAIL_SSL)
-static void ngx_mail_ssl_init_connection(ngx_ssl_t *ssl, ngx_connection_t *c);
-static void ngx_mail_ssl_handshake_handler(ngx_connection_t *c);
-#endif
-
-
-void
-ngx_mail_init_connection(ngx_connection_t *c)
-{
- size_t len;
- ngx_uint_t i;
- ngx_mail_port_t *port;
- struct sockaddr *sa;
- struct sockaddr_in *sin;
- ngx_mail_log_ctx_t *ctx;
- ngx_mail_in_addr_t *addr;
- ngx_mail_session_t *s;
- ngx_mail_addr_conf_t *addr_conf;
- u_char text[NGX_SOCKADDR_STRLEN];
-#if (NGX_HAVE_INET6)
- struct sockaddr_in6 *sin6;
- ngx_mail_in6_addr_t *addr6;
-#endif
-
-
- /* find the server configuration for the address:port */
-
- port = c->listening->servers;
-
- if (port->naddrs > 1) {
-
- /*
- * There are several addresses on this port and one of them
- * is the "*:port" wildcard so getsockname() is needed to determine
- * the server address.
- *
- * AcceptEx() already gave this address.
- */
-
- if (ngx_connection_local_sockaddr(c, NULL, 0) != NGX_OK) {
- ngx_mail_close_connection(c);
- return;
- }
-
- sa = c->local_sockaddr;
-
- switch (sa->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- sin6 = (struct sockaddr_in6 *) sa;
-
- addr6 = port->addrs;
-
- /* the last address is "*" */
-
- for (i = 0; i < port->naddrs - 1; i++) {
- if (ngx_memcmp(&addr6[i].addr6, &sin6->sin6_addr, 16) == 0) {
- break;
- }
- }
-
- addr_conf = &addr6[i].conf;
-
- break;
-#endif
-
- default: /* AF_INET */
- sin = (struct sockaddr_in *) sa;
-
- addr = port->addrs;
-
- /* the last address is "*" */
-
- for (i = 0; i < port->naddrs - 1; i++) {
- if (addr[i].addr == sin->sin_addr.s_addr) {
- break;
- }
- }
-
- addr_conf = &addr[i].conf;
-
- break;
- }
-
- } else {
- switch (c->local_sockaddr->sa_family) {
-
-#if (NGX_HAVE_INET6)
- case AF_INET6:
- addr6 = port->addrs;
- addr_conf = &addr6[0].conf;
- break;
-#endif
-
- default: /* AF_INET */
- addr = port->addrs;
- addr_conf = &addr[0].conf;
- break;
- }
- }
-
- s = ngx_pcalloc(c->pool, sizeof(ngx_mail_session_t));
- if (s == NULL) {
- ngx_mail_close_connection(c);
- return;
- }
-
- s->signature = NGX_MAIL_MODULE;
-
- s->main_conf = addr_conf->ctx->main_conf;
- s->srv_conf = addr_conf->ctx->srv_conf;
-
- s->addr_text = &addr_conf->addr_text;
-
- c->data = s;
- s->connection = c;
-
- len = ngx_sock_ntop(c->sockaddr, c->socklen, text, NGX_SOCKADDR_STRLEN, 1);
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0, "*%uA client %*s connected to %V",
- c->number, len, text, s->addr_text);
-
- ctx = ngx_palloc(c->pool, sizeof(ngx_mail_log_ctx_t));
- if (ctx == NULL) {
- ngx_mail_close_connection(c);
- return;
- }
-
- ctx->client = &c->addr_text;
- ctx->session = s;
-
- c->log->connection = c->number;
- c->log->handler = ngx_mail_log_error;
- c->log->data = ctx;
- c->log->action = "sending client greeting line";
-
- c->log_error = NGX_ERROR_INFO;
-
-#if (NGX_MAIL_SSL)
- {
- ngx_mail_ssl_conf_t *sslcf;
-
- sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
-
- if (sslcf->enable) {
- c->log->action = "SSL handshaking";
-
- ngx_mail_ssl_init_connection(&sslcf->ssl, c);
- return;
- }
-
- if (addr_conf->ssl) {
-
- c->log->action = "SSL handshaking";
-
- if (sslcf->ssl.ctx == NULL) {
- ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "no \"ssl_certificate\" is defined "
- "in server listening on SSL port");
- ngx_mail_close_connection(c);
- return;
- }
-
- ngx_mail_ssl_init_connection(&sslcf->ssl, c);
- return;
- }
-
- }
-#endif
-
- ngx_mail_init_session(c);
-}
-
-
-#if (NGX_MAIL_SSL)
-
-void
-ngx_mail_starttls_handler(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_ssl_conf_t *sslcf;
-
- c = rev->data;
- s = c->data;
- s->starttls = 1;
-
- c->log->action = "in starttls state";
-
- sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
-
- ngx_mail_ssl_init_connection(&sslcf->ssl, c);
-}
-
-
-static void
-ngx_mail_ssl_init_connection(ngx_ssl_t *ssl, ngx_connection_t *c)
-{
- ngx_mail_session_t *s;
- ngx_mail_core_srv_conf_t *cscf;
-
- if (ngx_ssl_create_connection(ssl, c, 0) == NGX_ERROR) {
- ngx_mail_close_connection(c);
- return;
- }
-
- if (ngx_ssl_handshake(c) == NGX_AGAIN) {
-
- s = c->data;
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- ngx_add_timer(c->read, cscf->timeout);
-
- c->ssl->handler = ngx_mail_ssl_handshake_handler;
-
- return;
- }
-
- ngx_mail_ssl_handshake_handler(c);
-}
-
-
-static void
-ngx_mail_ssl_handshake_handler(ngx_connection_t *c)
-{
- ngx_mail_session_t *s;
- ngx_mail_core_srv_conf_t *cscf;
-
- if (c->ssl->handshaked) {
-
- s = c->data;
-
- if (s->starttls) {
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- c->read->handler = cscf->protocol->init_protocol;
- c->write->handler = ngx_mail_send;
-
- cscf->protocol->init_protocol(c->read);
-
- return;
- }
-
- c->read->ready = 0;
-
- ngx_mail_init_session(c);
- return;
- }
-
- ngx_mail_close_connection(c);
-}
-
-#endif
-
-
-static void
-ngx_mail_init_session(ngx_connection_t *c)
-{
- ngx_mail_session_t *s;
- ngx_mail_core_srv_conf_t *cscf;
-
- s = c->data;
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- s->protocol = cscf->protocol->type;
-
- s->ctx = ngx_pcalloc(c->pool, sizeof(void *) * ngx_mail_max_module);
- if (s->ctx == NULL) {
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- c->write->handler = ngx_mail_send;
-
- cscf->protocol->init_session(s, c);
-}
-
-
-ngx_int_t
-ngx_mail_salt(ngx_mail_session_t *s, ngx_connection_t *c,
- ngx_mail_core_srv_conf_t *cscf)
-{
- s->salt.data = ngx_pnalloc(c->pool,
- sizeof(" <18446744073709551616.@>" CRLF) - 1
- + NGX_TIME_T_LEN
- + cscf->server_name.len);
- if (s->salt.data == NULL) {
- return NGX_ERROR;
- }
-
- s->salt.len = ngx_sprintf(s->salt.data, "<%ul.%T@%V>" CRLF,
- ngx_random(), ngx_time(), &cscf->server_name)
- - s->salt.data;
-
- return NGX_OK;
-}
-
-
-#if (NGX_MAIL_SSL)
-
-ngx_int_t
-ngx_mail_starttls_only(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_mail_ssl_conf_t *sslcf;
-
- if (c->ssl) {
- return 0;
- }
-
- sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
-
- if (sslcf->starttls == NGX_MAIL_STARTTLS_ONLY) {
- return 1;
- }
-
- return 0;
-}
-
-#endif
-
-
-ngx_int_t
-ngx_mail_auth_plain(ngx_mail_session_t *s, ngx_connection_t *c, ngx_uint_t n)
-{
- u_char *p, *last;
- ngx_str_t *arg, plain;
-
- arg = s->args.elts;
-
-#if (NGX_DEBUG_MAIL_PASSWD)
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "mail auth plain: \"%V\"", &arg[n]);
-#endif
-
- plain.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[n].len));
- if (plain.data == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_decode_base64(&plain, &arg[n]) != NGX_OK) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid base64 encoding in AUTH PLAIN command");
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- p = plain.data;
- last = p + plain.len;
-
- while (p < last && *p++) { /* void */ }
-
- if (p == last) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid login in AUTH PLAIN command");
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- s->login.data = p;
-
- while (p < last && *p) { p++; }
-
- if (p == last) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid password in AUTH PLAIN command");
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- s->login.len = p++ - s->login.data;
-
- s->passwd.len = last - p;
- s->passwd.data = p;
-
-#if (NGX_DEBUG_MAIL_PASSWD)
- ngx_log_debug2(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "mail auth plain: \"%V\" \"%V\"", &s->login, &s->passwd);
-#endif
-
- return NGX_DONE;
-}
-
-
-ngx_int_t
-ngx_mail_auth_login_username(ngx_mail_session_t *s, ngx_connection_t *c,
- ngx_uint_t n)
-{
- ngx_str_t *arg;
-
- arg = s->args.elts;
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "mail auth login username: \"%V\"", &arg[n]);
-
- s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[n].len));
- if (s->login.data == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_decode_base64(&s->login, &arg[n]) != NGX_OK) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid base64 encoding in AUTH LOGIN command");
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "mail auth login username: \"%V\"", &s->login);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_mail_auth_login_password(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_t *arg;
-
- arg = s->args.elts;
-
-#if (NGX_DEBUG_MAIL_PASSWD)
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "mail auth login password: \"%V\"", &arg[0]);
-#endif
-
- s->passwd.data = ngx_pnalloc(c->pool,
- ngx_base64_decoded_length(arg[0].len));
- if (s->passwd.data == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_decode_base64(&s->passwd, &arg[0]) != NGX_OK) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid base64 encoding in AUTH LOGIN command");
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
-#if (NGX_DEBUG_MAIL_PASSWD)
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "mail auth login password: \"%V\"", &s->passwd);
-#endif
-
- return NGX_DONE;
-}
-
-
-ngx_int_t
-ngx_mail_auth_cram_md5_salt(ngx_mail_session_t *s, ngx_connection_t *c,
- char *prefix, size_t len)
-{
- u_char *p;
- ngx_str_t salt;
- ngx_uint_t n;
-
- p = ngx_pnalloc(c->pool, len + ngx_base64_encoded_length(s->salt.len) + 2);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- salt.data = ngx_cpymem(p, prefix, len);
- s->salt.len -= 2;
-
- ngx_encode_base64(&salt, &s->salt);
-
- s->salt.len += 2;
- n = len + salt.len;
- p[n++] = CR; p[n++] = LF;
-
- s->out.len = n;
- s->out.data = p;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_mail_auth_cram_md5(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- u_char *p, *last;
- ngx_str_t *arg;
-
- arg = s->args.elts;
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "mail auth cram-md5: \"%V\"", &arg[0]);
-
- s->login.data = ngx_pnalloc(c->pool, ngx_base64_decoded_length(arg[0].len));
- if (s->login.data == NULL) {
- return NGX_ERROR;
- }
-
- if (ngx_decode_base64(&s->login, &arg[0]) != NGX_OK) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid base64 encoding in AUTH CRAM-MD5 command");
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- p = s->login.data;
- last = p + s->login.len;
-
- while (p < last) {
- if (*p++ == ' ') {
- s->login.len = p - s->login.data - 1;
- s->passwd.len = last - p;
- s->passwd.data = p;
- break;
- }
- }
-
- if (s->passwd.len != 32) {
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid CRAM-MD5 hash in AUTH CRAM-MD5 command");
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "mail auth cram-md5: \"%V\" \"%V\"", &s->login, &s->passwd);
-
- s->auth_method = NGX_MAIL_AUTH_CRAM_MD5;
-
- return NGX_DONE;
-}
-
-
-void
-ngx_mail_send(ngx_event_t *wev)
-{
- ngx_int_t n;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_core_srv_conf_t *cscf;
-
- c = wev->data;
- s = c->data;
-
- if (wev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- c->timedout = 1;
- ngx_mail_close_connection(c);
- return;
- }
-
- if (s->out.len == 0) {
- if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
- ngx_mail_close_connection(c);
- }
-
- return;
- }
-
- n = c->send(c, s->out.data, s->out.len);
-
- if (n > 0) {
- s->out.data += n;
- s->out.len -= n;
-
- if (s->out.len != 0) {
- goto again;
- }
-
- if (wev->timer_set) {
- ngx_del_timer(wev);
- }
-
- if (s->quit) {
- ngx_mail_close_connection(c);
- return;
- }
-
- if (s->blocked) {
- c->read->handler(c->read);
- }
-
- return;
- }
-
- if (n == NGX_ERROR) {
- ngx_mail_close_connection(c);
- return;
- }
-
- /* n == NGX_AGAIN */
-
-again:
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- ngx_add_timer(c->write, cscf->timeout);
-
- if (ngx_handle_write_event(c->write, 0) != NGX_OK) {
- ngx_mail_close_connection(c);
- return;
- }
-}
-
-
-ngx_int_t
-ngx_mail_read_command(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ssize_t n;
- ngx_int_t rc;
- ngx_str_t l;
- ngx_mail_core_srv_conf_t *cscf;
-
- n = c->recv(c, s->buffer->last, s->buffer->end - s->buffer->last);
-
- if (n == NGX_ERROR || n == 0) {
- ngx_mail_close_connection(c);
- return NGX_ERROR;
- }
-
- if (n > 0) {
- s->buffer->last += n;
- }
-
- if (n == NGX_AGAIN) {
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- ngx_mail_session_internal_server_error(s);
- return NGX_ERROR;
- }
-
- if (s->buffer->pos == s->buffer->last) {
- return NGX_AGAIN;
- }
- }
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- rc = cscf->protocol->parse_command(s);
-
- if (rc == NGX_AGAIN) {
-
- if (s->buffer->last < s->buffer->end) {
- return rc;
- }
-
- l.len = s->buffer->last - s->buffer->start;
- l.data = s->buffer->start;
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent too long command \"%V\"", &l);
-
- s->quit = 1;
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- if (rc == NGX_IMAP_NEXT || rc == NGX_MAIL_PARSE_INVALID_COMMAND) {
- return rc;
- }
-
- if (rc == NGX_ERROR) {
- ngx_mail_close_connection(c);
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-void
-ngx_mail_auth(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- s->args.nelts = 0;
-
- if (s->buffer->pos == s->buffer->last) {
- s->buffer->pos = s->buffer->start;
- s->buffer->last = s->buffer->start;
- }
-
- s->state = 0;
-
- if (c->read->timer_set) {
- ngx_del_timer(c->read);
- }
-
- s->login_attempt++;
-
- ngx_mail_auth_http_init(s);
-}
-
-
-void
-ngx_mail_session_internal_server_error(ngx_mail_session_t *s)
-{
- ngx_mail_core_srv_conf_t *cscf;
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- s->out = cscf->protocol->internal_server_error;
- s->quit = 1;
-
- ngx_mail_send(s->connection->write);
-}
-
-
-void
-ngx_mail_close_connection(ngx_connection_t *c)
-{
- ngx_pool_t *pool;
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "close mail connection: %d", c->fd);
-
-#if (NGX_MAIL_SSL)
-
- if (c->ssl) {
- if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
- c->ssl->handler = ngx_mail_close_connection;
- return;
- }
- }
-
-#endif
-
-#if (NGX_STAT_STUB)
- (void) ngx_atomic_fetch_add(ngx_stat_active, -1);
-#endif
-
- c->destroyed = 1;
-
- pool = c->pool;
-
- ngx_close_connection(c);
-
- ngx_destroy_pool(pool);
-}
-
-
-u_char *
-ngx_mail_log_error(ngx_log_t *log, u_char *buf, size_t len)
-{
- u_char *p;
- ngx_mail_session_t *s;
- ngx_mail_log_ctx_t *ctx;
-
- if (log->action) {
- p = ngx_snprintf(buf, len, " while %s", log->action);
- len -= p - buf;
- buf = p;
- }
-
- ctx = log->data;
-
- p = ngx_snprintf(buf, len, ", client: %V", ctx->client);
- len -= p - buf;
- buf = p;
-
- s = ctx->session;
-
- if (s == NULL) {
- return p;
- }
-
- p = ngx_snprintf(buf, len, "%s, server: %V",
- s->starttls ? " using starttls" : "",
- s->addr_text);
- len -= p - buf;
- buf = p;
-
- if (s->login.len == 0) {
- return p;
- }
-
- p = ngx_snprintf(buf, len, ", login: \"%V\"", &s->login);
- len -= p - buf;
- buf = p;
-
- if (s->proxy == NULL) {
- return p;
- }
-
- p = ngx_snprintf(buf, len, ", upstream: %V", s->proxy->upstream.name);
-
- return p;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_handler.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_handler.c
deleted file mode 100644
index 57e2fb77daa..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_handler.c
+++ /dev/null
@@ -1,457 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-#include <ngx_mail_imap_module.h>
-
-
-static ngx_int_t ngx_mail_imap_login(ngx_mail_session_t *s,
- ngx_connection_t *c);
-static ngx_int_t ngx_mail_imap_authenticate(ngx_mail_session_t *s,
- ngx_connection_t *c);
-static ngx_int_t ngx_mail_imap_capability(ngx_mail_session_t *s,
- ngx_connection_t *c);
-static ngx_int_t ngx_mail_imap_starttls(ngx_mail_session_t *s,
- ngx_connection_t *c);
-
-
-static u_char imap_greeting[] = "* OK IMAP4 ready" CRLF;
-static u_char imap_star[] = "* ";
-static u_char imap_ok[] = "OK completed" CRLF;
-static u_char imap_next[] = "+ OK" CRLF;
-static u_char imap_plain_next[] = "+ " CRLF;
-static u_char imap_username[] = "+ VXNlcm5hbWU6" CRLF;
-static u_char imap_password[] = "+ UGFzc3dvcmQ6" CRLF;
-static u_char imap_bye[] = "* BYE" CRLF;
-static u_char imap_invalid_command[] = "BAD invalid command" CRLF;
-
-
-void
-ngx_mail_imap_init_session(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_mail_core_srv_conf_t *cscf;
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- ngx_str_set(&s->out, imap_greeting);
-
- c->read->handler = ngx_mail_imap_init_protocol;
-
- ngx_add_timer(c->read, cscf->timeout);
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- ngx_mail_close_connection(c);
- }
-
- ngx_mail_send(c->write);
-}
-
-
-void
-ngx_mail_imap_init_protocol(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_imap_srv_conf_t *iscf;
-
- c = rev->data;
-
- c->log->action = "in auth state";
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- c->timedout = 1;
- ngx_mail_close_connection(c);
- return;
- }
-
- s = c->data;
-
- if (s->buffer == NULL) {
- if (ngx_array_init(&s->args, c->pool, 2, sizeof(ngx_str_t))
- == NGX_ERROR)
- {
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module);
-
- s->buffer = ngx_create_temp_buf(c->pool, iscf->client_buffer_size);
- if (s->buffer == NULL) {
- ngx_mail_session_internal_server_error(s);
- return;
- }
- }
-
- s->mail_state = ngx_imap_start;
- c->read->handler = ngx_mail_imap_auth_state;
-
- ngx_mail_imap_auth_state(rev);
-}
-
-
-void
-ngx_mail_imap_auth_state(ngx_event_t *rev)
-{
- u_char *p, *dst, *src, *end;
- ngx_str_t *arg;
- ngx_int_t rc;
- ngx_uint_t tag, i;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
-
- c = rev->data;
- s = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, c->log, 0, "imap auth state");
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- c->timedout = 1;
- ngx_mail_close_connection(c);
- return;
- }
-
- if (s->out.len) {
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, c->log, 0, "imap send handler busy");
- s->blocked = 1;
- return;
- }
-
- s->blocked = 0;
-
- rc = ngx_mail_read_command(s, c);
-
- if (rc == NGX_AGAIN || rc == NGX_ERROR) {
- return;
- }
-
- tag = 1;
- s->text.len = 0;
- ngx_str_set(&s->out, imap_ok);
-
- if (rc == NGX_OK) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0, "imap auth command: %i",
- s->command);
-
- if (s->backslash) {
-
- arg = s->args.elts;
-
- for (i = 0; i < s->args.nelts; i++) {
- dst = arg[i].data;
- end = dst + arg[i].len;
-
- for (src = dst; src < end; dst++) {
- *dst = *src;
- if (*src++ == '\\') {
- *dst = *src++;
- }
- }
-
- arg[i].len = dst - arg[i].data;
- }
-
- s->backslash = 0;
- }
-
- switch (s->mail_state) {
-
- case ngx_imap_start:
-
- switch (s->command) {
-
- case NGX_IMAP_LOGIN:
- rc = ngx_mail_imap_login(s, c);
- break;
-
- case NGX_IMAP_AUTHENTICATE:
- rc = ngx_mail_imap_authenticate(s, c);
- tag = (rc != NGX_OK);
- break;
-
- case NGX_IMAP_CAPABILITY:
- rc = ngx_mail_imap_capability(s, c);
- break;
-
- case NGX_IMAP_LOGOUT:
- s->quit = 1;
- ngx_str_set(&s->text, imap_bye);
- break;
-
- case NGX_IMAP_NOOP:
- break;
-
- case NGX_IMAP_STARTTLS:
- rc = ngx_mail_imap_starttls(s, c);
- break;
-
- default:
- rc = NGX_MAIL_PARSE_INVALID_COMMAND;
- break;
- }
-
- break;
-
- case ngx_imap_auth_login_username:
- rc = ngx_mail_auth_login_username(s, c, 0);
-
- tag = 0;
- ngx_str_set(&s->out, imap_password);
- s->mail_state = ngx_imap_auth_login_password;
-
- break;
-
- case ngx_imap_auth_login_password:
- rc = ngx_mail_auth_login_password(s, c);
- break;
-
- case ngx_imap_auth_plain:
- rc = ngx_mail_auth_plain(s, c, 0);
- break;
-
- case ngx_imap_auth_cram_md5:
- rc = ngx_mail_auth_cram_md5(s, c);
- break;
- }
-
- } else if (rc == NGX_IMAP_NEXT) {
- tag = 0;
- ngx_str_set(&s->out, imap_next);
- }
-
- switch (rc) {
-
- case NGX_DONE:
- ngx_mail_auth(s, c);
- return;
-
- case NGX_ERROR:
- ngx_mail_session_internal_server_error(s);
- return;
-
- case NGX_MAIL_PARSE_INVALID_COMMAND:
- s->state = 0;
- ngx_str_set(&s->out, imap_invalid_command);
- s->mail_state = ngx_imap_start;
- break;
- }
-
- if (tag) {
- if (s->tag.len == 0) {
- ngx_str_set(&s->tag, imap_star);
- }
-
- if (s->tagged_line.len < s->tag.len + s->text.len + s->out.len) {
- s->tagged_line.len = s->tag.len + s->text.len + s->out.len;
- s->tagged_line.data = ngx_pnalloc(c->pool, s->tagged_line.len);
- if (s->tagged_line.data == NULL) {
- ngx_mail_close_connection(c);
- return;
- }
- }
-
- p = s->tagged_line.data;
-
- if (s->text.len) {
- p = ngx_cpymem(p, s->text.data, s->text.len);
- }
-
- p = ngx_cpymem(p, s->tag.data, s->tag.len);
- ngx_memcpy(p, s->out.data, s->out.len);
-
- s->out.len = s->text.len + s->tag.len + s->out.len;
- s->out.data = s->tagged_line.data;
- }
-
- if (rc != NGX_IMAP_NEXT) {
- s->args.nelts = 0;
-
- if (s->state) {
- /* preserve tag */
- s->arg_start = s->buffer->start + s->tag.len;
- s->buffer->pos = s->arg_start;
- s->buffer->last = s->arg_start;
-
- } else {
- s->buffer->pos = s->buffer->start;
- s->buffer->last = s->buffer->start;
- s->tag.len = 0;
- }
- }
-
- ngx_mail_send(c->write);
-}
-
-
-static ngx_int_t
-ngx_mail_imap_login(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_t *arg;
-
-#if (NGX_MAIL_SSL)
- if (ngx_mail_starttls_only(s, c)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-#endif
-
- arg = s->args.elts;
-
- if (s->args.nelts != 2 || arg[0].len == 0) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- s->login.len = arg[0].len;
- s->login.data = ngx_pnalloc(c->pool, s->login.len);
- if (s->login.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->login.data, arg[0].data, s->login.len);
-
- s->passwd.len = arg[1].len;
- s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len);
- if (s->passwd.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->passwd.data, arg[1].data, s->passwd.len);
-
-#if (NGX_DEBUG_MAIL_PASSWD)
- ngx_log_debug2(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "imap login:\"%V\" passwd:\"%V\"",
- &s->login, &s->passwd);
-#else
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "imap login:\"%V\"", &s->login);
-#endif
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_mail_imap_authenticate(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_int_t rc;
- ngx_mail_core_srv_conf_t *cscf;
- ngx_mail_imap_srv_conf_t *iscf;
-
-#if (NGX_MAIL_SSL)
- if (ngx_mail_starttls_only(s, c)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-#endif
-
- rc = ngx_mail_auth_parse(s, c);
-
- switch (rc) {
-
- case NGX_MAIL_AUTH_LOGIN:
-
- ngx_str_set(&s->out, imap_username);
- s->mail_state = ngx_imap_auth_login_username;
-
- return NGX_OK;
-
- case NGX_MAIL_AUTH_LOGIN_USERNAME:
-
- ngx_str_set(&s->out, imap_password);
- s->mail_state = ngx_imap_auth_login_password;
-
- return ngx_mail_auth_login_username(s, c, 1);
-
- case NGX_MAIL_AUTH_PLAIN:
-
- ngx_str_set(&s->out, imap_plain_next);
- s->mail_state = ngx_imap_auth_plain;
-
- return NGX_OK;
-
- case NGX_MAIL_AUTH_CRAM_MD5:
-
- iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module);
-
- if (!(iscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- if (s->salt.data == NULL) {
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- if (ngx_mail_salt(s, c, cscf) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- if (ngx_mail_auth_cram_md5_salt(s, c, "+ ", 2) == NGX_OK) {
- s->mail_state = ngx_imap_auth_cram_md5;
- return NGX_OK;
- }
-
- return NGX_ERROR;
- }
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_mail_imap_capability(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_mail_imap_srv_conf_t *iscf;
-
- iscf = ngx_mail_get_module_srv_conf(s, ngx_mail_imap_module);
-
-#if (NGX_MAIL_SSL)
-
- if (c->ssl == NULL) {
- ngx_mail_ssl_conf_t *sslcf;
-
- sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
-
- if (sslcf->starttls == NGX_MAIL_STARTTLS_ON) {
- s->text = iscf->starttls_capability;
- return NGX_OK;
- }
-
- if (sslcf->starttls == NGX_MAIL_STARTTLS_ONLY) {
- s->text = iscf->starttls_only_capability;
- return NGX_OK;
- }
- }
-#endif
-
- s->text = iscf->capability;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_mail_imap_starttls(ngx_mail_session_t *s, ngx_connection_t *c)
-{
-#if (NGX_MAIL_SSL)
- ngx_mail_ssl_conf_t *sslcf;
-
- if (c->ssl == NULL) {
- sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
- if (sslcf->starttls) {
- c->read->handler = ngx_mail_starttls_handler;
- return NGX_OK;
- }
- }
-
-#endif
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.c
deleted file mode 100644
index dc80b4fb4c1..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.c
+++ /dev/null
@@ -1,253 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-#include <ngx_mail_imap_module.h>
-
-
-static void *ngx_mail_imap_create_srv_conf(ngx_conf_t *cf);
-static char *ngx_mail_imap_merge_srv_conf(ngx_conf_t *cf, void *parent,
- void *child);
-
-
-static ngx_str_t ngx_mail_imap_default_capabilities[] = {
- ngx_string("IMAP4"),
- ngx_string("IMAP4rev1"),
- ngx_string("UIDPLUS"),
- ngx_null_string
-};
-
-
-static ngx_conf_bitmask_t ngx_mail_imap_auth_methods[] = {
- { ngx_string("plain"), NGX_MAIL_AUTH_PLAIN_ENABLED },
- { ngx_string("login"), NGX_MAIL_AUTH_LOGIN_ENABLED },
- { ngx_string("cram-md5"), NGX_MAIL_AUTH_CRAM_MD5_ENABLED },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_str_t ngx_mail_imap_auth_methods_names[] = {
- ngx_string("AUTH=PLAIN"),
- ngx_string("AUTH=LOGIN"),
- ngx_null_string, /* APOP */
- ngx_string("AUTH=CRAM-MD5"),
- ngx_null_string /* NONE */
-};
-
-
-static ngx_mail_protocol_t ngx_mail_imap_protocol = {
- ngx_string("imap"),
- { 143, 993, 0, 0 },
- NGX_MAIL_IMAP_PROTOCOL,
-
- ngx_mail_imap_init_session,
- ngx_mail_imap_init_protocol,
- ngx_mail_imap_parse_command,
- ngx_mail_imap_auth_state,
-
- ngx_string("* BAD internal server error" CRLF)
-};
-
-
-static ngx_command_t ngx_mail_imap_commands[] = {
-
- { ngx_string("imap_client_buffer"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_imap_srv_conf_t, client_buffer_size),
- NULL },
-
- { ngx_string("imap_capabilities"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
- ngx_mail_capabilities,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_imap_srv_conf_t, capabilities),
- NULL },
-
- { ngx_string("imap_auth"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_imap_srv_conf_t, auth_methods),
- &ngx_mail_imap_auth_methods },
-
- ngx_null_command
-};
-
-
-static ngx_mail_module_t ngx_mail_imap_module_ctx = {
- &ngx_mail_imap_protocol, /* protocol */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_mail_imap_create_srv_conf, /* create server configuration */
- ngx_mail_imap_merge_srv_conf /* merge server configuration */
-};
-
-
-ngx_module_t ngx_mail_imap_module = {
- NGX_MODULE_V1,
- &ngx_mail_imap_module_ctx, /* module context */
- ngx_mail_imap_commands, /* module directives */
- NGX_MAIL_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static void *
-ngx_mail_imap_create_srv_conf(ngx_conf_t *cf)
-{
- ngx_mail_imap_srv_conf_t *iscf;
-
- iscf = ngx_pcalloc(cf->pool, sizeof(ngx_mail_imap_srv_conf_t));
- if (iscf == NULL) {
- return NULL;
- }
-
- iscf->client_buffer_size = NGX_CONF_UNSET_SIZE;
-
- if (ngx_array_init(&iscf->capabilities, cf->pool, 4, sizeof(ngx_str_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- return iscf;
-}
-
-
-static char *
-ngx_mail_imap_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_mail_imap_srv_conf_t *prev = parent;
- ngx_mail_imap_srv_conf_t *conf = child;
-
- u_char *p, *auth;
- size_t size;
- ngx_str_t *c, *d;
- ngx_uint_t i, m;
-
- ngx_conf_merge_size_value(conf->client_buffer_size,
- prev->client_buffer_size,
- (size_t) ngx_pagesize);
-
- ngx_conf_merge_bitmask_value(conf->auth_methods,
- prev->auth_methods,
- (NGX_CONF_BITMASK_SET
- |NGX_MAIL_AUTH_PLAIN_ENABLED));
-
-
- if (conf->capabilities.nelts == 0) {
- conf->capabilities = prev->capabilities;
- }
-
- if (conf->capabilities.nelts == 0) {
-
- for (d = ngx_mail_imap_default_capabilities; d->len; d++) {
- c = ngx_array_push(&conf->capabilities);
- if (c == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *c = *d;
- }
- }
-
- size = sizeof("* CAPABILITY" CRLF) - 1;
-
- c = conf->capabilities.elts;
- for (i = 0; i < conf->capabilities.nelts; i++) {
- size += 1 + c[i].len;
- }
-
- for (m = NGX_MAIL_AUTH_PLAIN_ENABLED, i = 0;
- m <= NGX_MAIL_AUTH_CRAM_MD5_ENABLED;
- m <<= 1, i++)
- {
- if (m & conf->auth_methods) {
- size += 1 + ngx_mail_imap_auth_methods_names[i].len;
- }
- }
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->capability.len = size;
- conf->capability.data = p;
-
- p = ngx_cpymem(p, "* CAPABILITY", sizeof("* CAPABILITY") - 1);
-
- for (i = 0; i < conf->capabilities.nelts; i++) {
- *p++ = ' ';
- p = ngx_cpymem(p, c[i].data, c[i].len);
- }
-
- auth = p;
-
- for (m = NGX_MAIL_AUTH_PLAIN_ENABLED, i = 0;
- m <= NGX_MAIL_AUTH_CRAM_MD5_ENABLED;
- m <<= 1, i++)
- {
- if (m & conf->auth_methods) {
- *p++ = ' ';
- p = ngx_cpymem(p, ngx_mail_imap_auth_methods_names[i].data,
- ngx_mail_imap_auth_methods_names[i].len);
- }
- }
-
- *p++ = CR; *p = LF;
-
-
- size += sizeof(" STARTTLS") - 1;
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->starttls_capability.len = size;
- conf->starttls_capability.data = p;
-
- p = ngx_cpymem(p, conf->capability.data,
- conf->capability.len - (sizeof(CRLF) - 1));
- p = ngx_cpymem(p, " STARTTLS", sizeof(" STARTTLS") - 1);
- *p++ = CR; *p = LF;
-
-
- size = (auth - conf->capability.data) + sizeof(CRLF) - 1
- + sizeof(" STARTTLS LOGINDISABLED") - 1;
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->starttls_only_capability.len = size;
- conf->starttls_only_capability.data = p;
-
- p = ngx_cpymem(p, conf->capability.data,
- auth - conf->capability.data);
- p = ngx_cpymem(p, " STARTTLS LOGINDISABLED",
- sizeof(" STARTTLS LOGINDISABLED") - 1);
- *p++ = CR; *p = LF;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.h
deleted file mode 100644
index 131b44597f8..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_imap_module.h
+++ /dev/null
@@ -1,39 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_MAIL_IMAP_MODULE_H_INCLUDED_
-#define _NGX_MAIL_IMAP_MODULE_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_mail.h>
-
-
-typedef struct {
- size_t client_buffer_size;
-
- ngx_str_t capability;
- ngx_str_t starttls_capability;
- ngx_str_t starttls_only_capability;
-
- ngx_uint_t auth_methods;
-
- ngx_array_t capabilities;
-} ngx_mail_imap_srv_conf_t;
-
-
-void ngx_mail_imap_init_session(ngx_mail_session_t *s, ngx_connection_t *c);
-void ngx_mail_imap_init_protocol(ngx_event_t *rev);
-void ngx_mail_imap_auth_state(ngx_event_t *rev);
-ngx_int_t ngx_mail_imap_parse_command(ngx_mail_session_t *s);
-
-
-extern ngx_module_t ngx_mail_imap_module;
-
-
-#endif /* _NGX_MAIL_IMAP_MODULE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_parse.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_parse.c
deleted file mode 100644
index b158f5a0fba..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_parse.c
+++ /dev/null
@@ -1,918 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-#include <ngx_mail_pop3_module.h>
-#include <ngx_mail_imap_module.h>
-#include <ngx_mail_smtp_module.h>
-
-
-ngx_int_t
-ngx_mail_pop3_parse_command(ngx_mail_session_t *s)
-{
- u_char ch, *p, *c, c0, c1, c2, c3;
- ngx_str_t *arg;
- enum {
- sw_start = 0,
- sw_spaces_before_argument,
- sw_argument,
- sw_almost_done
- } state;
-
- state = s->state;
-
- for (p = s->buffer->pos; p < s->buffer->last; p++) {
- ch = *p;
-
- switch (state) {
-
- /* POP3 command */
- case sw_start:
- if (ch == ' ' || ch == CR || ch == LF) {
- c = s->buffer->start;
-
- if (p - c == 4) {
-
- c0 = ngx_toupper(c[0]);
- c1 = ngx_toupper(c[1]);
- c2 = ngx_toupper(c[2]);
- c3 = ngx_toupper(c[3]);
-
- if (c0 == 'U' && c1 == 'S' && c2 == 'E' && c3 == 'R')
- {
- s->command = NGX_POP3_USER;
-
- } else if (c0 == 'P' && c1 == 'A' && c2 == 'S' && c3 == 'S')
- {
- s->command = NGX_POP3_PASS;
-
- } else if (c0 == 'A' && c1 == 'P' && c2 == 'O' && c3 == 'P')
- {
- s->command = NGX_POP3_APOP;
-
- } else if (c0 == 'Q' && c1 == 'U' && c2 == 'I' && c3 == 'T')
- {
- s->command = NGX_POP3_QUIT;
-
- } else if (c0 == 'C' && c1 == 'A' && c2 == 'P' && c3 == 'A')
- {
- s->command = NGX_POP3_CAPA;
-
- } else if (c0 == 'A' && c1 == 'U' && c2 == 'T' && c3 == 'H')
- {
- s->command = NGX_POP3_AUTH;
-
- } else if (c0 == 'N' && c1 == 'O' && c2 == 'O' && c3 == 'P')
- {
- s->command = NGX_POP3_NOOP;
-#if (NGX_MAIL_SSL)
- } else if (c0 == 'S' && c1 == 'T' && c2 == 'L' && c3 == 'S')
- {
- s->command = NGX_POP3_STLS;
-#endif
- } else {
- goto invalid;
- }
-
- } else {
- goto invalid;
- }
-
- switch (ch) {
- case ' ':
- state = sw_spaces_before_argument;
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- }
- break;
- }
-
- if ((ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z')) {
- goto invalid;
- }
-
- break;
-
- case sw_spaces_before_argument:
- switch (ch) {
- case ' ':
- break;
- case CR:
- state = sw_almost_done;
- s->arg_end = p;
- break;
- case LF:
- s->arg_end = p;
- goto done;
- default:
- if (s->args.nelts <= 2) {
- state = sw_argument;
- s->arg_start = p;
- break;
- }
- goto invalid;
- }
- break;
-
- case sw_argument:
- switch (ch) {
-
- case ' ':
-
- /*
- * the space should be considered as part of the at username
- * or password, but not of argument in other commands
- */
-
- if (s->command == NGX_POP3_USER
- || s->command == NGX_POP3_PASS)
- {
- break;
- }
-
- /* fall through */
-
- case CR:
- case LF:
- arg = ngx_array_push(&s->args);
- if (arg == NULL) {
- return NGX_ERROR;
- }
- arg->len = p - s->arg_start;
- arg->data = s->arg_start;
- s->arg_start = NULL;
-
- switch (ch) {
- case ' ':
- state = sw_spaces_before_argument;
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- }
- break;
-
- default:
- break;
- }
- break;
-
- case sw_almost_done:
- switch (ch) {
- case LF:
- goto done;
- default:
- goto invalid;
- }
- }
- }
-
- s->buffer->pos = p;
- s->state = state;
-
- return NGX_AGAIN;
-
-done:
-
- s->buffer->pos = p + 1;
-
- if (s->arg_start) {
- arg = ngx_array_push(&s->args);
- if (arg == NULL) {
- return NGX_ERROR;
- }
- arg->len = s->arg_end - s->arg_start;
- arg->data = s->arg_start;
- s->arg_start = NULL;
- }
-
- s->state = (s->command != NGX_POP3_AUTH) ? sw_start : sw_argument;
-
- return NGX_OK;
-
-invalid:
-
- s->state = sw_start;
- s->arg_start = NULL;
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
-}
-
-
-ngx_int_t
-ngx_mail_imap_parse_command(ngx_mail_session_t *s)
-{
- u_char ch, *p, *c;
- ngx_str_t *arg;
- enum {
- sw_start = 0,
- sw_spaces_before_command,
- sw_command,
- sw_spaces_before_argument,
- sw_argument,
- sw_backslash,
- sw_literal,
- sw_no_sync_literal_argument,
- sw_start_literal_argument,
- sw_literal_argument,
- sw_end_literal_argument,
- sw_almost_done
- } state;
-
- state = s->state;
-
- for (p = s->buffer->pos; p < s->buffer->last; p++) {
- ch = *p;
-
- switch (state) {
-
- /* IMAP tag */
- case sw_start:
- switch (ch) {
- case ' ':
- s->tag.len = p - s->buffer->start + 1;
- s->tag.data = s->buffer->start;
- state = sw_spaces_before_command;
- break;
- case CR:
- s->state = sw_start;
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- case LF:
- s->state = sw_start;
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
- break;
-
- case sw_spaces_before_command:
- switch (ch) {
- case ' ':
- break;
- case CR:
- s->state = sw_start;
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- case LF:
- s->state = sw_start;
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- default:
- s->cmd_start = p;
- state = sw_command;
- break;
- }
- break;
-
- case sw_command:
- if (ch == ' ' || ch == CR || ch == LF) {
-
- c = s->cmd_start;
-
- switch (p - c) {
-
- case 4:
- if ((c[0] == 'N' || c[0] == 'n')
- && (c[1] == 'O'|| c[1] == 'o')
- && (c[2] == 'O'|| c[2] == 'o')
- && (c[3] == 'P'|| c[3] == 'p'))
- {
- s->command = NGX_IMAP_NOOP;
-
- } else {
- goto invalid;
- }
- break;
-
- case 5:
- if ((c[0] == 'L'|| c[0] == 'l')
- && (c[1] == 'O'|| c[1] == 'o')
- && (c[2] == 'G'|| c[2] == 'g')
- && (c[3] == 'I'|| c[3] == 'i')
- && (c[4] == 'N'|| c[4] == 'n'))
- {
- s->command = NGX_IMAP_LOGIN;
-
- } else {
- goto invalid;
- }
- break;
-
- case 6:
- if ((c[0] == 'L'|| c[0] == 'l')
- && (c[1] == 'O'|| c[1] == 'o')
- && (c[2] == 'G'|| c[2] == 'g')
- && (c[3] == 'O'|| c[3] == 'o')
- && (c[4] == 'U'|| c[4] == 'u')
- && (c[5] == 'T'|| c[5] == 't'))
- {
- s->command = NGX_IMAP_LOGOUT;
-
- } else {
- goto invalid;
- }
- break;
-
-#if (NGX_MAIL_SSL)
- case 8:
- if ((c[0] == 'S'|| c[0] == 's')
- && (c[1] == 'T'|| c[1] == 't')
- && (c[2] == 'A'|| c[2] == 'a')
- && (c[3] == 'R'|| c[3] == 'r')
- && (c[4] == 'T'|| c[4] == 't')
- && (c[5] == 'T'|| c[5] == 't')
- && (c[6] == 'L'|| c[6] == 'l')
- && (c[7] == 'S'|| c[7] == 's'))
- {
- s->command = NGX_IMAP_STARTTLS;
-
- } else {
- goto invalid;
- }
- break;
-#endif
-
- case 10:
- if ((c[0] == 'C'|| c[0] == 'c')
- && (c[1] == 'A'|| c[1] == 'a')
- && (c[2] == 'P'|| c[2] == 'p')
- && (c[3] == 'A'|| c[3] == 'a')
- && (c[4] == 'B'|| c[4] == 'b')
- && (c[5] == 'I'|| c[5] == 'i')
- && (c[6] == 'L'|| c[6] == 'l')
- && (c[7] == 'I'|| c[7] == 'i')
- && (c[8] == 'T'|| c[8] == 't')
- && (c[9] == 'Y'|| c[9] == 'y'))
- {
- s->command = NGX_IMAP_CAPABILITY;
-
- } else {
- goto invalid;
- }
- break;
-
- case 12:
- if ((c[0] == 'A'|| c[0] == 'a')
- && (c[1] == 'U'|| c[1] == 'u')
- && (c[2] == 'T'|| c[2] == 't')
- && (c[3] == 'H'|| c[3] == 'h')
- && (c[4] == 'E'|| c[4] == 'e')
- && (c[5] == 'N'|| c[5] == 'n')
- && (c[6] == 'T'|| c[6] == 't')
- && (c[7] == 'I'|| c[7] == 'i')
- && (c[8] == 'C'|| c[8] == 'c')
- && (c[9] == 'A'|| c[9] == 'a')
- && (c[10] == 'T'|| c[10] == 't')
- && (c[11] == 'E'|| c[11] == 'e'))
- {
- s->command = NGX_IMAP_AUTHENTICATE;
-
- } else {
- goto invalid;
- }
- break;
-
- default:
- goto invalid;
- }
-
- switch (ch) {
- case ' ':
- state = sw_spaces_before_argument;
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- }
- break;
- }
-
- if ((ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z')) {
- goto invalid;
- }
-
- break;
-
- case sw_spaces_before_argument:
- switch (ch) {
- case ' ':
- break;
- case CR:
- state = sw_almost_done;
- s->arg_end = p;
- break;
- case LF:
- s->arg_end = p;
- goto done;
- case '"':
- if (s->args.nelts <= 2) {
- s->quoted = 1;
- s->arg_start = p + 1;
- state = sw_argument;
- break;
- }
- goto invalid;
- case '{':
- if (s->args.nelts <= 2) {
- state = sw_literal;
- break;
- }
- goto invalid;
- default:
- if (s->args.nelts <= 2) {
- s->arg_start = p;
- state = sw_argument;
- break;
- }
- goto invalid;
- }
- break;
-
- case sw_argument:
- if (ch == ' ' && s->quoted) {
- break;
- }
-
- switch (ch) {
- case '"':
- if (!s->quoted) {
- break;
- }
- s->quoted = 0;
- /* fall through */
- case ' ':
- case CR:
- case LF:
- arg = ngx_array_push(&s->args);
- if (arg == NULL) {
- return NGX_ERROR;
- }
- arg->len = p - s->arg_start;
- arg->data = s->arg_start;
- s->arg_start = NULL;
-
- switch (ch) {
- case '"':
- case ' ':
- state = sw_spaces_before_argument;
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- }
- break;
- case '\\':
- if (s->quoted) {
- s->backslash = 1;
- state = sw_backslash;
- }
- break;
- }
- break;
-
- case sw_backslash:
- switch (ch) {
- case CR:
- case LF:
- goto invalid;
- default:
- state = sw_argument;
- }
- break;
-
- case sw_literal:
- if (ch >= '0' && ch <= '9') {
- s->literal_len = s->literal_len * 10 + (ch - '0');
- break;
- }
- if (ch == '}') {
- state = sw_start_literal_argument;
- break;
- }
- if (ch == '+') {
- state = sw_no_sync_literal_argument;
- break;
- }
- goto invalid;
-
- case sw_no_sync_literal_argument:
- if (ch == '}') {
- s->no_sync_literal = 1;
- state = sw_start_literal_argument;
- break;
- }
- goto invalid;
-
- case sw_start_literal_argument:
- switch (ch) {
- case CR:
- break;
- case LF:
- s->buffer->pos = p + 1;
- s->arg_start = p + 1;
- if (s->no_sync_literal == 0) {
- s->state = sw_literal_argument;
- return NGX_IMAP_NEXT;
- }
- state = sw_literal_argument;
- s->no_sync_literal = 0;
- break;
- default:
- goto invalid;
- }
- break;
-
- case sw_literal_argument:
- if (s->literal_len && --s->literal_len) {
- break;
- }
-
- arg = ngx_array_push(&s->args);
- if (arg == NULL) {
- return NGX_ERROR;
- }
- arg->len = p + 1 - s->arg_start;
- arg->data = s->arg_start;
- s->arg_start = NULL;
- state = sw_end_literal_argument;
-
- break;
-
- case sw_end_literal_argument:
- switch (ch) {
- case '{':
- if (s->args.nelts <= 2) {
- state = sw_literal;
- break;
- }
- goto invalid;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- default:
- state = sw_spaces_before_argument;
- break;
- }
- break;
-
- case sw_almost_done:
- switch (ch) {
- case LF:
- goto done;
- default:
- goto invalid;
- }
- }
- }
-
- s->buffer->pos = p;
- s->state = state;
-
- return NGX_AGAIN;
-
-done:
-
- s->buffer->pos = p + 1;
-
- if (s->arg_start) {
- arg = ngx_array_push(&s->args);
- if (arg == NULL) {
- return NGX_ERROR;
- }
- arg->len = s->arg_end - s->arg_start;
- arg->data = s->arg_start;
-
- s->arg_start = NULL;
- s->cmd_start = NULL;
- s->quoted = 0;
- s->no_sync_literal = 0;
- s->literal_len = 0;
- }
-
- s->state = (s->command != NGX_IMAP_AUTHENTICATE) ? sw_start : sw_argument;
-
- return NGX_OK;
-
-invalid:
-
- s->state = sw_start;
- s->quoted = 0;
- s->no_sync_literal = 0;
- s->literal_len = 0;
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
-}
-
-
-ngx_int_t
-ngx_mail_smtp_parse_command(ngx_mail_session_t *s)
-{
- u_char ch, *p, *c, c0, c1, c2, c3;
- ngx_str_t *arg;
- enum {
- sw_start = 0,
- sw_command,
- sw_invalid,
- sw_spaces_before_argument,
- sw_argument,
- sw_almost_done
- } state;
-
- state = s->state;
-
- for (p = s->buffer->pos; p < s->buffer->last; p++) {
- ch = *p;
-
- switch (state) {
-
- /* SMTP command */
- case sw_start:
- s->cmd_start = p;
- state = sw_command;
-
- /* fall through */
-
- case sw_command:
- if (ch == ' ' || ch == CR || ch == LF) {
- c = s->cmd_start;
-
- if (p - c == 4) {
-
- c0 = ngx_toupper(c[0]);
- c1 = ngx_toupper(c[1]);
- c2 = ngx_toupper(c[2]);
- c3 = ngx_toupper(c[3]);
-
- if (c0 == 'H' && c1 == 'E' && c2 == 'L' && c3 == 'O')
- {
- s->command = NGX_SMTP_HELO;
-
- } else if (c0 == 'E' && c1 == 'H' && c2 == 'L' && c3 == 'O')
- {
- s->command = NGX_SMTP_EHLO;
-
- } else if (c0 == 'Q' && c1 == 'U' && c2 == 'I' && c3 == 'T')
- {
- s->command = NGX_SMTP_QUIT;
-
- } else if (c0 == 'A' && c1 == 'U' && c2 == 'T' && c3 == 'H')
- {
- s->command = NGX_SMTP_AUTH;
-
- } else if (c0 == 'N' && c1 == 'O' && c2 == 'O' && c3 == 'P')
- {
- s->command = NGX_SMTP_NOOP;
-
- } else if (c0 == 'M' && c1 == 'A' && c2 == 'I' && c3 == 'L')
- {
- s->command = NGX_SMTP_MAIL;
-
- } else if (c0 == 'R' && c1 == 'S' && c2 == 'E' && c3 == 'T')
- {
- s->command = NGX_SMTP_RSET;
-
- } else if (c0 == 'R' && c1 == 'C' && c2 == 'P' && c3 == 'T')
- {
- s->command = NGX_SMTP_RCPT;
-
- } else if (c0 == 'V' && c1 == 'R' && c2 == 'F' && c3 == 'Y')
- {
- s->command = NGX_SMTP_VRFY;
-
- } else if (c0 == 'E' && c1 == 'X' && c2 == 'P' && c3 == 'N')
- {
- s->command = NGX_SMTP_EXPN;
-
- } else if (c0 == 'H' && c1 == 'E' && c2 == 'L' && c3 == 'P')
- {
- s->command = NGX_SMTP_HELP;
-
- } else {
- goto invalid;
- }
-#if (NGX_MAIL_SSL)
- } else if (p - c == 8) {
-
- if ((c[0] == 'S'|| c[0] == 's')
- && (c[1] == 'T'|| c[1] == 't')
- && (c[2] == 'A'|| c[2] == 'a')
- && (c[3] == 'R'|| c[3] == 'r')
- && (c[4] == 'T'|| c[4] == 't')
- && (c[5] == 'T'|| c[5] == 't')
- && (c[6] == 'L'|| c[6] == 'l')
- && (c[7] == 'S'|| c[7] == 's'))
- {
- s->command = NGX_SMTP_STARTTLS;
-
- } else {
- goto invalid;
- }
-#endif
- } else {
- goto invalid;
- }
-
- s->cmd.data = s->cmd_start;
- s->cmd.len = p - s->cmd_start;
-
- switch (ch) {
- case ' ':
- state = sw_spaces_before_argument;
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- }
- break;
- }
-
- if ((ch < 'A' || ch > 'Z') && (ch < 'a' || ch > 'z')) {
- goto invalid;
- }
-
- break;
-
- case sw_invalid:
- goto invalid;
-
- case sw_spaces_before_argument:
- switch (ch) {
- case ' ':
- break;
- case CR:
- state = sw_almost_done;
- s->arg_end = p;
- break;
- case LF:
- s->arg_end = p;
- goto done;
- default:
- if (s->args.nelts <= 10) {
- state = sw_argument;
- s->arg_start = p;
- break;
- }
- goto invalid;
- }
- break;
-
- case sw_argument:
- switch (ch) {
- case ' ':
- case CR:
- case LF:
- arg = ngx_array_push(&s->args);
- if (arg == NULL) {
- return NGX_ERROR;
- }
- arg->len = p - s->arg_start;
- arg->data = s->arg_start;
- s->arg_start = NULL;
-
- switch (ch) {
- case ' ':
- state = sw_spaces_before_argument;
- break;
- case CR:
- state = sw_almost_done;
- break;
- case LF:
- goto done;
- }
- break;
-
- default:
- break;
- }
- break;
-
- case sw_almost_done:
- switch (ch) {
- case LF:
- goto done;
- default:
- goto invalid;
- }
- }
- }
-
- s->buffer->pos = p;
- s->state = state;
-
- return NGX_AGAIN;
-
-done:
-
- s->buffer->pos = p + 1;
-
- if (s->arg_start) {
- arg = ngx_array_push(&s->args);
- if (arg == NULL) {
- return NGX_ERROR;
- }
- arg->len = s->arg_end - s->arg_start;
- arg->data = s->arg_start;
- s->arg_start = NULL;
- }
-
- s->state = (s->command != NGX_SMTP_AUTH) ? sw_start : sw_argument;
-
- return NGX_OK;
-
-invalid:
-
- s->state = sw_invalid;
- s->arg_start = NULL;
-
- /* skip invalid command till LF */
-
- for (p = s->buffer->pos; p < s->buffer->last; p++) {
- if (*p == LF) {
- s->state = sw_start;
- p++;
- break;
- }
- }
-
- s->buffer->pos = p;
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
-}
-
-
-ngx_int_t
-ngx_mail_auth_parse(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_t *arg;
-
-#if (NGX_MAIL_SSL)
- if (ngx_mail_starttls_only(s, c)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-#endif
-
- if (s->args.nelts == 0) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- arg = s->args.elts;
-
- if (arg[0].len == 5) {
-
- if (ngx_strncasecmp(arg[0].data, (u_char *) "LOGIN", 5) == 0) {
-
- if (s->args.nelts == 1) {
- return NGX_MAIL_AUTH_LOGIN;
- }
-
- if (s->args.nelts == 2) {
- return NGX_MAIL_AUTH_LOGIN_USERNAME;
- }
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- if (ngx_strncasecmp(arg[0].data, (u_char *) "PLAIN", 5) == 0) {
-
- if (s->args.nelts == 1) {
- return NGX_MAIL_AUTH_PLAIN;
- }
-
- if (s->args.nelts == 2) {
- return ngx_mail_auth_plain(s, c, 1);
- }
- }
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- if (arg[0].len == 8) {
-
- if (s->args.nelts != 1) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- if (ngx_strncasecmp(arg[0].data, (u_char *) "CRAM-MD5", 8) == 0) {
- return NGX_MAIL_AUTH_CRAM_MD5;
- }
- }
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_handler.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_handler.c
deleted file mode 100644
index 51bc257a595..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_handler.c
+++ /dev/null
@@ -1,500 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-#include <ngx_mail_pop3_module.h>
-
-
-static ngx_int_t ngx_mail_pop3_user(ngx_mail_session_t *s, ngx_connection_t *c);
-static ngx_int_t ngx_mail_pop3_pass(ngx_mail_session_t *s, ngx_connection_t *c);
-static ngx_int_t ngx_mail_pop3_capa(ngx_mail_session_t *s, ngx_connection_t *c,
- ngx_int_t stls);
-static ngx_int_t ngx_mail_pop3_stls(ngx_mail_session_t *s, ngx_connection_t *c);
-static ngx_int_t ngx_mail_pop3_apop(ngx_mail_session_t *s, ngx_connection_t *c);
-static ngx_int_t ngx_mail_pop3_auth(ngx_mail_session_t *s, ngx_connection_t *c);
-
-
-static u_char pop3_greeting[] = "+OK POP3 ready" CRLF;
-static u_char pop3_ok[] = "+OK" CRLF;
-static u_char pop3_next[] = "+ " CRLF;
-static u_char pop3_username[] = "+ VXNlcm5hbWU6" CRLF;
-static u_char pop3_password[] = "+ UGFzc3dvcmQ6" CRLF;
-static u_char pop3_invalid_command[] = "-ERR invalid command" CRLF;
-
-
-void
-ngx_mail_pop3_init_session(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- u_char *p;
- ngx_mail_core_srv_conf_t *cscf;
- ngx_mail_pop3_srv_conf_t *pscf;
-
- pscf = ngx_mail_get_module_srv_conf(s, ngx_mail_pop3_module);
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- if (pscf->auth_methods
- & (NGX_MAIL_AUTH_APOP_ENABLED|NGX_MAIL_AUTH_CRAM_MD5_ENABLED))
- {
- if (ngx_mail_salt(s, c, cscf) != NGX_OK) {
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- s->out.data = ngx_pnalloc(c->pool, sizeof(pop3_greeting) + s->salt.len);
- if (s->out.data == NULL) {
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- p = ngx_cpymem(s->out.data, pop3_greeting, sizeof(pop3_greeting) - 3);
- *p++ = ' ';
- p = ngx_cpymem(p, s->salt.data, s->salt.len);
-
- s->out.len = p - s->out.data;
-
- } else {
- ngx_str_set(&s->out, pop3_greeting);
- }
-
- c->read->handler = ngx_mail_pop3_init_protocol;
-
- ngx_add_timer(c->read, cscf->timeout);
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- ngx_mail_close_connection(c);
- }
-
- ngx_mail_send(c->write);
-}
-
-
-void
-ngx_mail_pop3_init_protocol(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
-
- c = rev->data;
-
- c->log->action = "in auth state";
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- c->timedout = 1;
- ngx_mail_close_connection(c);
- return;
- }
-
- s = c->data;
-
- if (s->buffer == NULL) {
- if (ngx_array_init(&s->args, c->pool, 2, sizeof(ngx_str_t))
- == NGX_ERROR)
- {
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- s->buffer = ngx_create_temp_buf(c->pool, 128);
- if (s->buffer == NULL) {
- ngx_mail_session_internal_server_error(s);
- return;
- }
- }
-
- s->mail_state = ngx_pop3_start;
- c->read->handler = ngx_mail_pop3_auth_state;
-
- ngx_mail_pop3_auth_state(rev);
-}
-
-
-void
-ngx_mail_pop3_auth_state(ngx_event_t *rev)
-{
- ngx_int_t rc;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
-
- c = rev->data;
- s = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, c->log, 0, "pop3 auth state");
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- c->timedout = 1;
- ngx_mail_close_connection(c);
- return;
- }
-
- if (s->out.len) {
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, c->log, 0, "pop3 send handler busy");
- s->blocked = 1;
- return;
- }
-
- s->blocked = 0;
-
- rc = ngx_mail_read_command(s, c);
-
- if (rc == NGX_AGAIN || rc == NGX_ERROR) {
- return;
- }
-
- ngx_str_set(&s->out, pop3_ok);
-
- if (rc == NGX_OK) {
- switch (s->mail_state) {
-
- case ngx_pop3_start:
-
- switch (s->command) {
-
- case NGX_POP3_USER:
- rc = ngx_mail_pop3_user(s, c);
- break;
-
- case NGX_POP3_CAPA:
- rc = ngx_mail_pop3_capa(s, c, 1);
- break;
-
- case NGX_POP3_APOP:
- rc = ngx_mail_pop3_apop(s, c);
- break;
-
- case NGX_POP3_AUTH:
- rc = ngx_mail_pop3_auth(s, c);
- break;
-
- case NGX_POP3_QUIT:
- s->quit = 1;
- break;
-
- case NGX_POP3_NOOP:
- break;
-
- case NGX_POP3_STLS:
- rc = ngx_mail_pop3_stls(s, c);
- break;
-
- default:
- rc = NGX_MAIL_PARSE_INVALID_COMMAND;
- break;
- }
-
- break;
-
- case ngx_pop3_user:
-
- switch (s->command) {
-
- case NGX_POP3_PASS:
- rc = ngx_mail_pop3_pass(s, c);
- break;
-
- case NGX_POP3_CAPA:
- rc = ngx_mail_pop3_capa(s, c, 0);
- break;
-
- case NGX_POP3_QUIT:
- s->quit = 1;
- break;
-
- case NGX_POP3_NOOP:
- break;
-
- default:
- rc = NGX_MAIL_PARSE_INVALID_COMMAND;
- break;
- }
-
- break;
-
- /* suppress warnings */
- case ngx_pop3_passwd:
- break;
-
- case ngx_pop3_auth_login_username:
- rc = ngx_mail_auth_login_username(s, c, 0);
-
- ngx_str_set(&s->out, pop3_password);
- s->mail_state = ngx_pop3_auth_login_password;
- break;
-
- case ngx_pop3_auth_login_password:
- rc = ngx_mail_auth_login_password(s, c);
- break;
-
- case ngx_pop3_auth_plain:
- rc = ngx_mail_auth_plain(s, c, 0);
- break;
-
- case ngx_pop3_auth_cram_md5:
- rc = ngx_mail_auth_cram_md5(s, c);
- break;
- }
- }
-
- switch (rc) {
-
- case NGX_DONE:
- ngx_mail_auth(s, c);
- return;
-
- case NGX_ERROR:
- ngx_mail_session_internal_server_error(s);
- return;
-
- case NGX_MAIL_PARSE_INVALID_COMMAND:
- s->mail_state = ngx_pop3_start;
- s->state = 0;
-
- ngx_str_set(&s->out, pop3_invalid_command);
-
- /* fall through */
-
- case NGX_OK:
-
- s->args.nelts = 0;
- s->buffer->pos = s->buffer->start;
- s->buffer->last = s->buffer->start;
-
- if (s->state) {
- s->arg_start = s->buffer->start;
- }
-
- ngx_mail_send(c->write);
- }
-}
-
-static ngx_int_t
-ngx_mail_pop3_user(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_t *arg;
-
-#if (NGX_MAIL_SSL)
- if (ngx_mail_starttls_only(s, c)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-#endif
-
- if (s->args.nelts != 1) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- arg = s->args.elts;
- s->login.len = arg[0].len;
- s->login.data = ngx_pnalloc(c->pool, s->login.len);
- if (s->login.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->login.data, arg[0].data, s->login.len);
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "pop3 login: \"%V\"", &s->login);
-
- s->mail_state = ngx_pop3_user;
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_mail_pop3_pass(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_t *arg;
-
- if (s->args.nelts != 1) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- arg = s->args.elts;
- s->passwd.len = arg[0].len;
- s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len);
- if (s->passwd.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->passwd.data, arg[0].data, s->passwd.len);
-
-#if (NGX_DEBUG_MAIL_PASSWD)
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "pop3 passwd: \"%V\"", &s->passwd);
-#endif
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_mail_pop3_capa(ngx_mail_session_t *s, ngx_connection_t *c, ngx_int_t stls)
-{
- ngx_mail_pop3_srv_conf_t *pscf;
-
- pscf = ngx_mail_get_module_srv_conf(s, ngx_mail_pop3_module);
-
-#if (NGX_MAIL_SSL)
-
- if (stls && c->ssl == NULL) {
- ngx_mail_ssl_conf_t *sslcf;
-
- sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
-
- if (sslcf->starttls == NGX_MAIL_STARTTLS_ON) {
- s->out = pscf->starttls_capability;
- return NGX_OK;
- }
-
- if (sslcf->starttls == NGX_MAIL_STARTTLS_ONLY) {
- s->out = pscf->starttls_only_capability;
- return NGX_OK;
- }
- }
-
-#endif
-
- s->out = pscf->capability;
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_mail_pop3_stls(ngx_mail_session_t *s, ngx_connection_t *c)
-{
-#if (NGX_MAIL_SSL)
- ngx_mail_ssl_conf_t *sslcf;
-
- if (c->ssl == NULL) {
- sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
- if (sslcf->starttls) {
- c->read->handler = ngx_mail_starttls_handler;
- return NGX_OK;
- }
- }
-
-#endif
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
-}
-
-
-static ngx_int_t
-ngx_mail_pop3_apop(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_t *arg;
- ngx_mail_pop3_srv_conf_t *pscf;
-
-#if (NGX_MAIL_SSL)
- if (ngx_mail_starttls_only(s, c)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-#endif
-
- if (s->args.nelts != 2) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- pscf = ngx_mail_get_module_srv_conf(s, ngx_mail_pop3_module);
-
- if (!(pscf->auth_methods & NGX_MAIL_AUTH_APOP_ENABLED)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- arg = s->args.elts;
-
- s->login.len = arg[0].len;
- s->login.data = ngx_pnalloc(c->pool, s->login.len);
- if (s->login.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->login.data, arg[0].data, s->login.len);
-
- s->passwd.len = arg[1].len;
- s->passwd.data = ngx_pnalloc(c->pool, s->passwd.len);
- if (s->passwd.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->passwd.data, arg[1].data, s->passwd.len);
-
- ngx_log_debug2(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "pop3 apop: \"%V\" \"%V\"", &s->login, &s->passwd);
-
- s->auth_method = NGX_MAIL_AUTH_APOP;
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_mail_pop3_auth(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_int_t rc;
- ngx_mail_pop3_srv_conf_t *pscf;
-
-#if (NGX_MAIL_SSL)
- if (ngx_mail_starttls_only(s, c)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-#endif
-
- pscf = ngx_mail_get_module_srv_conf(s, ngx_mail_pop3_module);
-
- if (s->args.nelts == 0) {
- s->out = pscf->auth_capability;
- s->state = 0;
-
- return NGX_OK;
- }
-
- rc = ngx_mail_auth_parse(s, c);
-
- switch (rc) {
-
- case NGX_MAIL_AUTH_LOGIN:
-
- ngx_str_set(&s->out, pop3_username);
- s->mail_state = ngx_pop3_auth_login_username;
-
- return NGX_OK;
-
- case NGX_MAIL_AUTH_LOGIN_USERNAME:
-
- ngx_str_set(&s->out, pop3_password);
- s->mail_state = ngx_pop3_auth_login_password;
-
- return ngx_mail_auth_login_username(s, c, 1);
-
- case NGX_MAIL_AUTH_PLAIN:
-
- ngx_str_set(&s->out, pop3_next);
- s->mail_state = ngx_pop3_auth_plain;
-
- return NGX_OK;
-
- case NGX_MAIL_AUTH_CRAM_MD5:
-
- if (!(pscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- if (ngx_mail_auth_cram_md5_salt(s, c, "+ ", 2) == NGX_OK) {
- s->mail_state = ngx_pop3_auth_cram_md5;
- return NGX_OK;
- }
-
- return NGX_ERROR;
- }
-
- return rc;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.c
deleted file mode 100644
index b59747290e2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.c
+++ /dev/null
@@ -1,264 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-#include <ngx_mail_pop3_module.h>
-
-
-static void *ngx_mail_pop3_create_srv_conf(ngx_conf_t *cf);
-static char *ngx_mail_pop3_merge_srv_conf(ngx_conf_t *cf, void *parent,
- void *child);
-
-
-static ngx_str_t ngx_mail_pop3_default_capabilities[] = {
- ngx_string("TOP"),
- ngx_string("USER"),
- ngx_string("UIDL"),
- ngx_null_string
-};
-
-
-static ngx_conf_bitmask_t ngx_mail_pop3_auth_methods[] = {
- { ngx_string("plain"), NGX_MAIL_AUTH_PLAIN_ENABLED },
- { ngx_string("apop"), NGX_MAIL_AUTH_APOP_ENABLED },
- { ngx_string("cram-md5"), NGX_MAIL_AUTH_CRAM_MD5_ENABLED },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_str_t ngx_mail_pop3_auth_plain_capability =
- ngx_string("+OK methods supported:" CRLF
- "LOGIN" CRLF
- "PLAIN" CRLF
- "." CRLF);
-
-
-static ngx_str_t ngx_mail_pop3_auth_cram_md5_capability =
- ngx_string("+OK methods supported:" CRLF
- "LOGIN" CRLF
- "PLAIN" CRLF
- "CRAM-MD5" CRLF
- "." CRLF);
-
-
-static ngx_mail_protocol_t ngx_mail_pop3_protocol = {
- ngx_string("pop3"),
- { 110, 995, 0, 0 },
- NGX_MAIL_POP3_PROTOCOL,
-
- ngx_mail_pop3_init_session,
- ngx_mail_pop3_init_protocol,
- ngx_mail_pop3_parse_command,
- ngx_mail_pop3_auth_state,
-
- ngx_string("-ERR internal server error" CRLF)
-};
-
-
-static ngx_command_t ngx_mail_pop3_commands[] = {
-
- { ngx_string("pop3_capabilities"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
- ngx_mail_capabilities,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_pop3_srv_conf_t, capabilities),
- NULL },
-
- { ngx_string("pop3_auth"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_pop3_srv_conf_t, auth_methods),
- &ngx_mail_pop3_auth_methods },
-
- ngx_null_command
-};
-
-
-static ngx_mail_module_t ngx_mail_pop3_module_ctx = {
- &ngx_mail_pop3_protocol, /* protocol */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_mail_pop3_create_srv_conf, /* create server configuration */
- ngx_mail_pop3_merge_srv_conf /* merge server configuration */
-};
-
-
-ngx_module_t ngx_mail_pop3_module = {
- NGX_MODULE_V1,
- &ngx_mail_pop3_module_ctx, /* module context */
- ngx_mail_pop3_commands, /* module directives */
- NGX_MAIL_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static void *
-ngx_mail_pop3_create_srv_conf(ngx_conf_t *cf)
-{
- ngx_mail_pop3_srv_conf_t *pscf;
-
- pscf = ngx_pcalloc(cf->pool, sizeof(ngx_mail_pop3_srv_conf_t));
- if (pscf == NULL) {
- return NULL;
- }
-
- if (ngx_array_init(&pscf->capabilities, cf->pool, 4, sizeof(ngx_str_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- return pscf;
-}
-
-
-static char *
-ngx_mail_pop3_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_mail_pop3_srv_conf_t *prev = parent;
- ngx_mail_pop3_srv_conf_t *conf = child;
-
- u_char *p;
- size_t size, stls_only_size;
- ngx_str_t *c, *d;
- ngx_uint_t i;
-
- ngx_conf_merge_bitmask_value(conf->auth_methods,
- prev->auth_methods,
- (NGX_CONF_BITMASK_SET
- |NGX_MAIL_AUTH_PLAIN_ENABLED));
-
- if (conf->capabilities.nelts == 0) {
- conf->capabilities = prev->capabilities;
- }
-
- if (conf->capabilities.nelts == 0) {
-
- for (d = ngx_mail_pop3_default_capabilities; d->len; d++) {
- c = ngx_array_push(&conf->capabilities);
- if (c == NULL) {
- return NGX_CONF_ERROR;
- }
-
- *c = *d;
- }
- }
-
- size = sizeof("+OK Capability list follows" CRLF) - 1
- + sizeof("." CRLF) - 1;
-
- stls_only_size = size + sizeof("STLS" CRLF) - 1;
-
- c = conf->capabilities.elts;
- for (i = 0; i < conf->capabilities.nelts; i++) {
- size += c[i].len + sizeof(CRLF) - 1;
-
- if (ngx_strcasecmp(c[i].data, (u_char *) "USER") == 0) {
- continue;
- }
-
- stls_only_size += c[i].len + sizeof(CRLF) - 1;
- }
-
- if (conf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED) {
- size += sizeof("SASL LOGIN PLAIN CRAM-MD5" CRLF) - 1;
-
- } else {
- size += sizeof("SASL LOGIN PLAIN" CRLF) - 1;
- }
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->capability.len = size;
- conf->capability.data = p;
-
- p = ngx_cpymem(p, "+OK Capability list follows" CRLF,
- sizeof("+OK Capability list follows" CRLF) - 1);
-
- for (i = 0; i < conf->capabilities.nelts; i++) {
- p = ngx_cpymem(p, c[i].data, c[i].len);
- *p++ = CR; *p++ = LF;
- }
-
- if (conf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED) {
- p = ngx_cpymem(p, "SASL LOGIN PLAIN CRAM-MD5" CRLF,
- sizeof("SASL LOGIN PLAIN CRAM-MD5" CRLF) - 1);
-
- } else {
- p = ngx_cpymem(p, "SASL LOGIN PLAIN" CRLF,
- sizeof("SASL LOGIN PLAIN" CRLF) - 1);
- }
-
- *p++ = '.'; *p++ = CR; *p = LF;
-
-
- size += sizeof("STLS" CRLF) - 1;
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->starttls_capability.len = size;
- conf->starttls_capability.data = p;
-
- p = ngx_cpymem(p, conf->capability.data,
- conf->capability.len - (sizeof("." CRLF) - 1));
-
- p = ngx_cpymem(p, "STLS" CRLF, sizeof("STLS" CRLF) - 1);
- *p++ = '.'; *p++ = CR; *p = LF;
-
-
- if (conf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED) {
- conf->auth_capability = ngx_mail_pop3_auth_cram_md5_capability;
-
- } else {
- conf->auth_capability = ngx_mail_pop3_auth_plain_capability;
- }
-
-
- p = ngx_pnalloc(cf->pool, stls_only_size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->starttls_only_capability.len = stls_only_size;
- conf->starttls_only_capability.data = p;
-
- p = ngx_cpymem(p, "+OK Capability list follows" CRLF,
- sizeof("+OK Capability list follows" CRLF) - 1);
-
- for (i = 0; i < conf->capabilities.nelts; i++) {
- if (ngx_strcasecmp(c[i].data, (u_char *) "USER") == 0) {
- continue;
- }
-
- p = ngx_cpymem(p, c[i].data, c[i].len);
- *p++ = CR; *p++ = LF;
- }
-
- p = ngx_cpymem(p, "STLS" CRLF, sizeof("STLS" CRLF) - 1);
- *p++ = '.'; *p++ = CR; *p = LF;
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.h
deleted file mode 100644
index 86947a77251..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_pop3_module.h
+++ /dev/null
@@ -1,38 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_MAIL_POP3_MODULE_H_INCLUDED_
-#define _NGX_MAIL_POP3_MODULE_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_mail.h>
-
-
-typedef struct {
- ngx_str_t capability;
- ngx_str_t starttls_capability;
- ngx_str_t starttls_only_capability;
- ngx_str_t auth_capability;
-
- ngx_uint_t auth_methods;
-
- ngx_array_t capabilities;
-} ngx_mail_pop3_srv_conf_t;
-
-
-void ngx_mail_pop3_init_session(ngx_mail_session_t *s, ngx_connection_t *c);
-void ngx_mail_pop3_init_protocol(ngx_event_t *rev);
-void ngx_mail_pop3_auth_state(ngx_event_t *rev);
-ngx_int_t ngx_mail_pop3_parse_command(ngx_mail_session_t *s);
-
-
-extern ngx_module_t ngx_mail_pop3_module;
-
-
-#endif /* _NGX_MAIL_POP3_MODULE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_proxy_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_proxy_module.c
deleted file mode 100644
index 41cbcf6e312..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_proxy_module.c
+++ /dev/null
@@ -1,1136 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_event_connect.h>
-#include <ngx_mail.h>
-
-
-typedef struct {
- ngx_flag_t enable;
- ngx_flag_t pass_error_message;
- ngx_flag_t xclient;
- size_t buffer_size;
- ngx_msec_t timeout;
-} ngx_mail_proxy_conf_t;
-
-
-static void ngx_mail_proxy_block_read(ngx_event_t *rev);
-static void ngx_mail_proxy_pop3_handler(ngx_event_t *rev);
-static void ngx_mail_proxy_imap_handler(ngx_event_t *rev);
-static void ngx_mail_proxy_smtp_handler(ngx_event_t *rev);
-static void ngx_mail_proxy_dummy_handler(ngx_event_t *ev);
-static ngx_int_t ngx_mail_proxy_read_response(ngx_mail_session_t *s,
- ngx_uint_t state);
-static void ngx_mail_proxy_handler(ngx_event_t *ev);
-static void ngx_mail_proxy_upstream_error(ngx_mail_session_t *s);
-static void ngx_mail_proxy_internal_server_error(ngx_mail_session_t *s);
-static void ngx_mail_proxy_close_session(ngx_mail_session_t *s);
-static void *ngx_mail_proxy_create_conf(ngx_conf_t *cf);
-static char *ngx_mail_proxy_merge_conf(ngx_conf_t *cf, void *parent,
- void *child);
-
-
-static ngx_command_t ngx_mail_proxy_commands[] = {
-
- { ngx_string("proxy"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_proxy_conf_t, enable),
- NULL },
-
- { ngx_string("proxy_buffer"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_proxy_conf_t, buffer_size),
- NULL },
-
- { ngx_string("proxy_timeout"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_proxy_conf_t, timeout),
- NULL },
-
- { ngx_string("proxy_pass_error_message"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_proxy_conf_t, pass_error_message),
- NULL },
-
- { ngx_string("xclient"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_proxy_conf_t, xclient),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_mail_module_t ngx_mail_proxy_module_ctx = {
- NULL, /* protocol */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_mail_proxy_create_conf, /* create server configuration */
- ngx_mail_proxy_merge_conf /* merge server configuration */
-};
-
-
-ngx_module_t ngx_mail_proxy_module = {
- NGX_MODULE_V1,
- &ngx_mail_proxy_module_ctx, /* module context */
- ngx_mail_proxy_commands, /* module directives */
- NGX_MAIL_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static u_char smtp_auth_ok[] = "235 2.0.0 OK" CRLF;
-
-
-void
-ngx_mail_proxy_init(ngx_mail_session_t *s, ngx_addr_t *peer)
-{
- int keepalive;
- ngx_int_t rc;
- ngx_mail_proxy_ctx_t *p;
- ngx_mail_proxy_conf_t *pcf;
- ngx_mail_core_srv_conf_t *cscf;
-
- s->connection->log->action = "connecting to upstream";
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- if (cscf->so_keepalive) {
- keepalive = 1;
-
- if (setsockopt(s->connection->fd, SOL_SOCKET, SO_KEEPALIVE,
- (const void *) &keepalive, sizeof(int))
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, s->connection->log, ngx_socket_errno,
- "setsockopt(SO_KEEPALIVE) failed");
- }
- }
-
- p = ngx_pcalloc(s->connection->pool, sizeof(ngx_mail_proxy_ctx_t));
- if (p == NULL) {
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- s->proxy = p;
-
- p->upstream.sockaddr = peer->sockaddr;
- p->upstream.socklen = peer->socklen;
- p->upstream.name = &peer->name;
- p->upstream.get = ngx_event_get_peer;
- p->upstream.log = s->connection->log;
- p->upstream.log_error = NGX_ERROR_ERR;
-
- rc = ngx_event_connect_peer(&p->upstream);
-
- if (rc == NGX_ERROR || rc == NGX_BUSY || rc == NGX_DECLINED) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- ngx_add_timer(p->upstream.connection->read, cscf->timeout);
-
- p->upstream.connection->data = s;
- p->upstream.connection->pool = s->connection->pool;
-
- s->connection->read->handler = ngx_mail_proxy_block_read;
- p->upstream.connection->write->handler = ngx_mail_proxy_dummy_handler;
-
- pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module);
-
- s->proxy->buffer = ngx_create_temp_buf(s->connection->pool,
- pcf->buffer_size);
- if (s->proxy->buffer == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- s->out.len = 0;
-
- switch (s->protocol) {
-
- case NGX_MAIL_POP3_PROTOCOL:
- p->upstream.connection->read->handler = ngx_mail_proxy_pop3_handler;
- s->mail_state = ngx_pop3_start;
- break;
-
- case NGX_MAIL_IMAP_PROTOCOL:
- p->upstream.connection->read->handler = ngx_mail_proxy_imap_handler;
- s->mail_state = ngx_imap_start;
- break;
-
- default: /* NGX_MAIL_SMTP_PROTOCOL */
- p->upstream.connection->read->handler = ngx_mail_proxy_smtp_handler;
- s->mail_state = ngx_smtp_start;
- break;
- }
-}
-
-
-static void
-ngx_mail_proxy_block_read(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy block read");
-
- if (ngx_handle_read_event(rev, 0) != NGX_OK) {
- c = rev->data;
- s = c->data;
-
- ngx_mail_proxy_close_session(s);
- }
-}
-
-
-static void
-ngx_mail_proxy_pop3_handler(ngx_event_t *rev)
-{
- u_char *p;
- ngx_int_t rc;
- ngx_str_t line;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_proxy_conf_t *pcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail proxy pop3 auth handler");
-
- c = rev->data;
- s = c->data;
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
- "upstream timed out");
- c->timedout = 1;
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- rc = ngx_mail_proxy_read_response(s, 0);
-
- if (rc == NGX_AGAIN) {
- return;
- }
-
- if (rc == NGX_ERROR) {
- ngx_mail_proxy_upstream_error(s);
- return;
- }
-
- switch (s->mail_state) {
-
- case ngx_pop3_start:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send user");
-
- s->connection->log->action = "sending user name to upstream";
-
- line.len = sizeof("USER ") - 1 + s->login.len + 2;
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- p = ngx_cpymem(line.data, "USER ", sizeof("USER ") - 1);
- p = ngx_cpymem(p, s->login.data, s->login.len);
- *p++ = CR; *p = LF;
-
- s->mail_state = ngx_pop3_user;
- break;
-
- case ngx_pop3_user:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send pass");
-
- s->connection->log->action = "sending password to upstream";
-
- line.len = sizeof("PASS ") - 1 + s->passwd.len + 2;
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- p = ngx_cpymem(line.data, "PASS ", sizeof("PASS ") - 1);
- p = ngx_cpymem(p, s->passwd.data, s->passwd.len);
- *p++ = CR; *p = LF;
-
- s->mail_state = ngx_pop3_passwd;
- break;
-
- case ngx_pop3_passwd:
- s->connection->read->handler = ngx_mail_proxy_handler;
- s->connection->write->handler = ngx_mail_proxy_handler;
- rev->handler = ngx_mail_proxy_handler;
- c->write->handler = ngx_mail_proxy_handler;
-
- pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module);
- ngx_add_timer(s->connection->read, pcf->timeout);
- ngx_del_timer(c->read);
-
- c->log->action = NULL;
- ngx_log_error(NGX_LOG_INFO, c->log, 0, "client logged in");
-
- ngx_mail_proxy_handler(s->connection->write);
-
- return;
-
- default:
-#if (NGX_SUPPRESS_WARN)
- ngx_str_null(&line);
-#endif
- break;
- }
-
- if (c->send(c, line.data, line.len) < (ssize_t) line.len) {
- /*
- * we treat the incomplete sending as NGX_ERROR
- * because it is very strange here
- */
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- s->proxy->buffer->pos = s->proxy->buffer->start;
- s->proxy->buffer->last = s->proxy->buffer->start;
-}
-
-
-static void
-ngx_mail_proxy_imap_handler(ngx_event_t *rev)
-{
- u_char *p;
- ngx_int_t rc;
- ngx_str_t line;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_proxy_conf_t *pcf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail proxy imap auth handler");
-
- c = rev->data;
- s = c->data;
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
- "upstream timed out");
- c->timedout = 1;
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- rc = ngx_mail_proxy_read_response(s, s->mail_state);
-
- if (rc == NGX_AGAIN) {
- return;
- }
-
- if (rc == NGX_ERROR) {
- ngx_mail_proxy_upstream_error(s);
- return;
- }
-
- switch (s->mail_state) {
-
- case ngx_imap_start:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail proxy send login");
-
- s->connection->log->action = "sending LOGIN command to upstream";
-
- line.len = s->tag.len + sizeof("LOGIN ") - 1
- + 1 + NGX_SIZE_T_LEN + 1 + 2;
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- line.len = ngx_sprintf(line.data, "%VLOGIN {%uz}" CRLF,
- &s->tag, s->login.len)
- - line.data;
-
- s->mail_state = ngx_imap_login;
- break;
-
- case ngx_imap_login:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send user");
-
- s->connection->log->action = "sending user name to upstream";
-
- line.len = s->login.len + 1 + 1 + NGX_SIZE_T_LEN + 1 + 2;
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- line.len = ngx_sprintf(line.data, "%V {%uz}" CRLF,
- &s->login, s->passwd.len)
- - line.data;
-
- s->mail_state = ngx_imap_user;
- break;
-
- case ngx_imap_user:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail proxy send passwd");
-
- s->connection->log->action = "sending password to upstream";
-
- line.len = s->passwd.len + 2;
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- p = ngx_cpymem(line.data, s->passwd.data, s->passwd.len);
- *p++ = CR; *p = LF;
-
- s->mail_state = ngx_imap_passwd;
- break;
-
- case ngx_imap_passwd:
- s->connection->read->handler = ngx_mail_proxy_handler;
- s->connection->write->handler = ngx_mail_proxy_handler;
- rev->handler = ngx_mail_proxy_handler;
- c->write->handler = ngx_mail_proxy_handler;
-
- pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module);
- ngx_add_timer(s->connection->read, pcf->timeout);
- ngx_del_timer(c->read);
-
- c->log->action = NULL;
- ngx_log_error(NGX_LOG_INFO, c->log, 0, "client logged in");
-
- ngx_mail_proxy_handler(s->connection->write);
-
- return;
-
- default:
-#if (NGX_SUPPRESS_WARN)
- ngx_str_null(&line);
-#endif
- break;
- }
-
- if (c->send(c, line.data, line.len) < (ssize_t) line.len) {
- /*
- * we treat the incomplete sending as NGX_ERROR
- * because it is very strange here
- */
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- s->proxy->buffer->pos = s->proxy->buffer->start;
- s->proxy->buffer->last = s->proxy->buffer->start;
-}
-
-
-static void
-ngx_mail_proxy_smtp_handler(ngx_event_t *rev)
-{
- u_char *p;
- ngx_int_t rc;
- ngx_str_t line;
- ngx_buf_t *b;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_proxy_conf_t *pcf;
- ngx_mail_core_srv_conf_t *cscf;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail proxy smtp auth handler");
-
- c = rev->data;
- s = c->data;
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
- "upstream timed out");
- c->timedout = 1;
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- rc = ngx_mail_proxy_read_response(s, s->mail_state);
-
- if (rc == NGX_AGAIN) {
- return;
- }
-
- if (rc == NGX_ERROR) {
- ngx_mail_proxy_upstream_error(s);
- return;
- }
-
- switch (s->mail_state) {
-
- case ngx_smtp_start:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0, "mail proxy send ehlo");
-
- s->connection->log->action = "sending HELO/EHLO to upstream";
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- line.len = sizeof("HELO ") - 1 + cscf->server_name.len + 2;
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module);
-
- p = ngx_cpymem(line.data,
- ((s->esmtp || pcf->xclient) ? "EHLO " : "HELO "),
- sizeof("HELO ") - 1);
-
- p = ngx_cpymem(p, cscf->server_name.data, cscf->server_name.len);
- *p++ = CR; *p = LF;
-
- if (pcf->xclient) {
- s->mail_state = ngx_smtp_helo_xclient;
-
- } else if (s->auth_method == NGX_MAIL_AUTH_NONE) {
- s->mail_state = ngx_smtp_helo_from;
-
- } else {
- s->mail_state = ngx_smtp_helo;
- }
-
- break;
-
- case ngx_smtp_helo_xclient:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail proxy send xclient");
-
- s->connection->log->action = "sending XCLIENT to upstream";
-
- line.len = sizeof("XCLIENT ADDR= LOGIN= NAME="
- CRLF) - 1
- + s->connection->addr_text.len + s->login.len + s->host.len;
-
-#if (NGX_HAVE_INET6)
- if (s->connection->sockaddr->sa_family == AF_INET6) {
- line.len += sizeof("IPV6:") - 1;
- }
-#endif
-
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- p = ngx_cpymem(line.data, "XCLIENT ADDR=", sizeof("XCLIENT ADDR=") - 1);
-
-#if (NGX_HAVE_INET6)
- if (s->connection->sockaddr->sa_family == AF_INET6) {
- p = ngx_cpymem(p, "IPV6:", sizeof("IPV6:") - 1);
- }
-#endif
-
- p = ngx_copy(p, s->connection->addr_text.data,
- s->connection->addr_text.len);
-
- if (s->login.len) {
- p = ngx_cpymem(p, " LOGIN=", sizeof(" LOGIN=") - 1);
- p = ngx_copy(p, s->login.data, s->login.len);
- }
-
- p = ngx_cpymem(p, " NAME=", sizeof(" NAME=") - 1);
- p = ngx_copy(p, s->host.data, s->host.len);
-
- *p++ = CR; *p++ = LF;
-
- line.len = p - line.data;
-
- if (s->smtp_helo.len) {
- s->mail_state = ngx_smtp_xclient_helo;
-
- } else if (s->auth_method == NGX_MAIL_AUTH_NONE) {
- s->mail_state = ngx_smtp_xclient_from;
-
- } else {
- s->mail_state = ngx_smtp_xclient;
- }
-
- break;
-
- case ngx_smtp_xclient_helo:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail proxy send client ehlo");
-
- s->connection->log->action = "sending client HELO/EHLO to upstream";
-
- line.len = sizeof("HELO " CRLF) - 1 + s->smtp_helo.len;
-
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- line.len = ngx_sprintf(line.data,
- ((s->esmtp) ? "EHLO %V" CRLF : "HELO %V" CRLF),
- &s->smtp_helo)
- - line.data;
-
- s->mail_state = (s->auth_method == NGX_MAIL_AUTH_NONE) ?
- ngx_smtp_helo_from : ngx_smtp_helo;
-
- break;
-
- case ngx_smtp_helo_from:
- case ngx_smtp_xclient_from:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail proxy send mail from");
-
- s->connection->log->action = "sending MAIL FROM to upstream";
-
- line.len = s->smtp_from.len + sizeof(CRLF) - 1;
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- p = ngx_cpymem(line.data, s->smtp_from.data, s->smtp_from.len);
- *p++ = CR; *p = LF;
-
- s->mail_state = ngx_smtp_from;
-
- break;
-
- case ngx_smtp_from:
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, rev->log, 0,
- "mail proxy send rcpt to");
-
- s->connection->log->action = "sending RCPT TO to upstream";
-
- line.len = s->smtp_to.len + sizeof(CRLF) - 1;
- line.data = ngx_pnalloc(c->pool, line.len);
- if (line.data == NULL) {
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- p = ngx_cpymem(line.data, s->smtp_to.data, s->smtp_to.len);
- *p++ = CR; *p = LF;
-
- s->mail_state = ngx_smtp_to;
-
- break;
-
- case ngx_smtp_helo:
- case ngx_smtp_xclient:
- case ngx_smtp_to:
-
- b = s->proxy->buffer;
-
- if (s->auth_method == NGX_MAIL_AUTH_NONE) {
- b->pos = b->start;
-
- } else {
- ngx_memcpy(b->start, smtp_auth_ok, sizeof(smtp_auth_ok) - 1);
- b->last = b->start + sizeof(smtp_auth_ok) - 1;
- }
-
- s->connection->read->handler = ngx_mail_proxy_handler;
- s->connection->write->handler = ngx_mail_proxy_handler;
- rev->handler = ngx_mail_proxy_handler;
- c->write->handler = ngx_mail_proxy_handler;
-
- pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module);
- ngx_add_timer(s->connection->read, pcf->timeout);
- ngx_del_timer(c->read);
-
- c->log->action = NULL;
- ngx_log_error(NGX_LOG_INFO, c->log, 0, "client logged in");
-
- if (s->buffer->pos == s->buffer->last) {
- ngx_mail_proxy_handler(s->connection->write);
-
- } else {
- ngx_mail_proxy_handler(c->write);
- }
-
- return;
-
- default:
-#if (NGX_SUPPRESS_WARN)
- ngx_str_null(&line);
-#endif
- break;
- }
-
- if (c->send(c, line.data, line.len) < (ssize_t) line.len) {
- /*
- * we treat the incomplete sending as NGX_ERROR
- * because it is very strange here
- */
- ngx_mail_proxy_internal_server_error(s);
- return;
- }
-
- s->proxy->buffer->pos = s->proxy->buffer->start;
- s->proxy->buffer->last = s->proxy->buffer->start;
-}
-
-
-static void
-ngx_mail_proxy_dummy_handler(ngx_event_t *wev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, wev->log, 0, "mail proxy dummy handler");
-
- if (ngx_handle_write_event(wev, 0) != NGX_OK) {
- c = wev->data;
- s = c->data;
-
- ngx_mail_proxy_close_session(s);
- }
-}
-
-
-static ngx_int_t
-ngx_mail_proxy_read_response(ngx_mail_session_t *s, ngx_uint_t state)
-{
- u_char *p, *m;
- ssize_t n;
- ngx_buf_t *b;
- ngx_mail_proxy_conf_t *pcf;
-
- s->connection->log->action = "reading response from upstream";
-
- b = s->proxy->buffer;
-
- n = s->proxy->upstream.connection->recv(s->proxy->upstream.connection,
- b->last, b->end - b->last);
-
- if (n == NGX_ERROR || n == 0) {
- return NGX_ERROR;
- }
-
- if (n == NGX_AGAIN) {
- return NGX_AGAIN;
- }
-
- b->last += n;
-
- if (b->last - b->pos < 4) {
- return NGX_AGAIN;
- }
-
- if (*(b->last - 2) != CR || *(b->last - 1) != LF) {
- if (b->last == b->end) {
- *(b->last - 1) = '\0';
- ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
- "upstream sent too long response line: \"%s\"",
- b->pos);
- return NGX_ERROR;
- }
-
- return NGX_AGAIN;
- }
-
- p = b->pos;
-
- switch (s->protocol) {
-
- case NGX_MAIL_POP3_PROTOCOL:
- if (p[0] == '+' && p[1] == 'O' && p[2] == 'K') {
- return NGX_OK;
- }
- break;
-
- case NGX_MAIL_IMAP_PROTOCOL:
- switch (state) {
-
- case ngx_imap_start:
- if (p[0] == '*' && p[1] == ' ' && p[2] == 'O' && p[3] == 'K') {
- return NGX_OK;
- }
- break;
-
- case ngx_imap_login:
- case ngx_imap_user:
- if (p[0] == '+') {
- return NGX_OK;
- }
- break;
-
- case ngx_imap_passwd:
- if (ngx_strncmp(p, s->tag.data, s->tag.len) == 0) {
- p += s->tag.len;
- if (p[0] == 'O' && p[1] == 'K') {
- return NGX_OK;
- }
- }
- break;
- }
-
- break;
-
- default: /* NGX_MAIL_SMTP_PROTOCOL */
-
- if (p[3] == '-') {
- /* multiline reply, check if we got last line */
-
- m = b->last - (sizeof(CRLF "200" CRLF) - 1);
-
- while (m > p) {
- if (m[0] == CR && m[1] == LF) {
- break;
- }
-
- m--;
- }
-
- if (m <= p || m[5] == '-') {
- return NGX_AGAIN;
- }
- }
-
- switch (state) {
-
- case ngx_smtp_start:
- if (p[0] == '2' && p[1] == '2' && p[2] == '0') {
- return NGX_OK;
- }
- break;
-
- case ngx_smtp_helo:
- case ngx_smtp_helo_xclient:
- case ngx_smtp_helo_from:
- case ngx_smtp_from:
- if (p[0] == '2' && p[1] == '5' && p[2] == '0') {
- return NGX_OK;
- }
- break;
-
- case ngx_smtp_xclient:
- case ngx_smtp_xclient_from:
- case ngx_smtp_xclient_helo:
- if (p[0] == '2' && (p[1] == '2' || p[1] == '5') && p[2] == '0') {
- return NGX_OK;
- }
- break;
-
- case ngx_smtp_to:
- return NGX_OK;
- }
-
- break;
- }
-
- pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module);
-
- if (pcf->pass_error_message == 0) {
- *(b->last - 2) = '\0';
- ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
- "upstream sent invalid response: \"%s\"", p);
- return NGX_ERROR;
- }
-
- s->out.len = b->last - p - 2;
- s->out.data = p;
-
- ngx_log_error(NGX_LOG_INFO, s->connection->log, 0,
- "upstream sent invalid response: \"%V\"", &s->out);
-
- s->out.len = b->last - b->pos;
- s->out.data = b->pos;
-
- return NGX_ERROR;
-}
-
-
-static void
-ngx_mail_proxy_handler(ngx_event_t *ev)
-{
- char *action, *recv_action, *send_action;
- size_t size;
- ssize_t n;
- ngx_buf_t *b;
- ngx_uint_t do_write;
- ngx_connection_t *c, *src, *dst;
- ngx_mail_session_t *s;
- ngx_mail_proxy_conf_t *pcf;
-
- c = ev->data;
- s = c->data;
-
- if (ev->timedout) {
- c->log->action = "proxying";
-
- if (c == s->connection) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
- "client timed out");
- c->timedout = 1;
-
- } else {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
- "upstream timed out");
- }
-
- ngx_mail_proxy_close_session(s);
- return;
- }
-
- if (c == s->connection) {
- if (ev->write) {
- recv_action = "proxying and reading from upstream";
- send_action = "proxying and sending to client";
- src = s->proxy->upstream.connection;
- dst = c;
- b = s->proxy->buffer;
-
- } else {
- recv_action = "proxying and reading from client";
- send_action = "proxying and sending to upstream";
- src = c;
- dst = s->proxy->upstream.connection;
- b = s->buffer;
- }
-
- } else {
- if (ev->write) {
- recv_action = "proxying and reading from client";
- send_action = "proxying and sending to upstream";
- src = s->connection;
- dst = c;
- b = s->buffer;
-
- } else {
- recv_action = "proxying and reading from upstream";
- send_action = "proxying and sending to client";
- src = c;
- dst = s->connection;
- b = s->proxy->buffer;
- }
- }
-
- do_write = ev->write ? 1 : 0;
-
- ngx_log_debug3(NGX_LOG_DEBUG_MAIL, ev->log, 0,
- "mail proxy handler: %d, #%d > #%d",
- do_write, src->fd, dst->fd);
-
- for ( ;; ) {
-
- if (do_write) {
-
- size = b->last - b->pos;
-
- if (size && dst->write->ready) {
- c->log->action = send_action;
-
- n = dst->send(dst, b->pos, size);
-
- if (n == NGX_ERROR) {
- ngx_mail_proxy_close_session(s);
- return;
- }
-
- if (n > 0) {
- b->pos += n;
-
- if (b->pos == b->last) {
- b->pos = b->start;
- b->last = b->start;
- }
- }
- }
- }
-
- size = b->end - b->last;
-
- if (size && src->read->ready) {
- c->log->action = recv_action;
-
- n = src->recv(src, b->last, size);
-
- if (n == NGX_AGAIN || n == 0) {
- break;
- }
-
- if (n > 0) {
- do_write = 1;
- b->last += n;
-
- continue;
- }
-
- if (n == NGX_ERROR) {
- src->read->eof = 1;
- }
- }
-
- break;
- }
-
- c->log->action = "proxying";
-
- if ((s->connection->read->eof && s->buffer->pos == s->buffer->last)
- || (s->proxy->upstream.connection->read->eof
- && s->proxy->buffer->pos == s->proxy->buffer->last)
- || (s->connection->read->eof
- && s->proxy->upstream.connection->read->eof))
- {
- action = c->log->action;
- c->log->action = NULL;
- ngx_log_error(NGX_LOG_INFO, c->log, 0, "proxied session done");
- c->log->action = action;
-
- ngx_mail_proxy_close_session(s);
- return;
- }
-
- if (ngx_handle_write_event(dst->write, 0) != NGX_OK) {
- ngx_mail_proxy_close_session(s);
- return;
- }
-
- if (ngx_handle_read_event(dst->read, 0) != NGX_OK) {
- ngx_mail_proxy_close_session(s);
- return;
- }
-
- if (ngx_handle_write_event(src->write, 0) != NGX_OK) {
- ngx_mail_proxy_close_session(s);
- return;
- }
-
- if (ngx_handle_read_event(src->read, 0) != NGX_OK) {
- ngx_mail_proxy_close_session(s);
- return;
- }
-
- if (c == s->connection) {
- pcf = ngx_mail_get_module_srv_conf(s, ngx_mail_proxy_module);
- ngx_add_timer(c->read, pcf->timeout);
- }
-}
-
-
-static void
-ngx_mail_proxy_upstream_error(ngx_mail_session_t *s)
-{
- if (s->proxy->upstream.connection) {
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
- "close mail proxy connection: %d",
- s->proxy->upstream.connection->fd);
-
- ngx_close_connection(s->proxy->upstream.connection);
- }
-
- if (s->out.len == 0) {
- ngx_mail_session_internal_server_error(s);
- return;
- }
-
- s->quit = 1;
- ngx_mail_send(s->connection->write);
-}
-
-
-static void
-ngx_mail_proxy_internal_server_error(ngx_mail_session_t *s)
-{
- if (s->proxy->upstream.connection) {
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
- "close mail proxy connection: %d",
- s->proxy->upstream.connection->fd);
-
- ngx_close_connection(s->proxy->upstream.connection);
- }
-
- ngx_mail_session_internal_server_error(s);
-}
-
-
-static void
-ngx_mail_proxy_close_session(ngx_mail_session_t *s)
-{
- if (s->proxy->upstream.connection) {
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, s->connection->log, 0,
- "close mail proxy connection: %d",
- s->proxy->upstream.connection->fd);
-
- ngx_close_connection(s->proxy->upstream.connection);
- }
-
- ngx_mail_close_connection(s->connection);
-}
-
-
-static void *
-ngx_mail_proxy_create_conf(ngx_conf_t *cf)
-{
- ngx_mail_proxy_conf_t *pcf;
-
- pcf = ngx_pcalloc(cf->pool, sizeof(ngx_mail_proxy_conf_t));
- if (pcf == NULL) {
- return NULL;
- }
-
- pcf->enable = NGX_CONF_UNSET;
- pcf->pass_error_message = NGX_CONF_UNSET;
- pcf->xclient = NGX_CONF_UNSET;
- pcf->buffer_size = NGX_CONF_UNSET_SIZE;
- pcf->timeout = NGX_CONF_UNSET_MSEC;
-
- return pcf;
-}
-
-
-static char *
-ngx_mail_proxy_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_mail_proxy_conf_t *prev = parent;
- ngx_mail_proxy_conf_t *conf = child;
-
- ngx_conf_merge_value(conf->enable, prev->enable, 0);
- ngx_conf_merge_value(conf->pass_error_message, prev->pass_error_message, 0);
- ngx_conf_merge_value(conf->xclient, prev->xclient, 1);
- ngx_conf_merge_size_value(conf->buffer_size, prev->buffer_size,
- (size_t) ngx_pagesize);
- ngx_conf_merge_msec_value(conf->timeout, prev->timeout, 24 * 60 * 60000);
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_handler.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_handler.c
deleted file mode 100644
index 46d703e2ce9..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_handler.c
+++ /dev/null
@@ -1,857 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-#include <ngx_mail_smtp_module.h>
-
-
-static void ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx);
-static void ngx_mail_smtp_resolve_name(ngx_event_t *rev);
-static void ngx_mail_smtp_resolve_name_handler(ngx_resolver_ctx_t *ctx);
-static void ngx_mail_smtp_greeting(ngx_mail_session_t *s, ngx_connection_t *c);
-static void ngx_mail_smtp_invalid_pipelining(ngx_event_t *rev);
-static ngx_int_t ngx_mail_smtp_create_buffer(ngx_mail_session_t *s,
- ngx_connection_t *c);
-
-static ngx_int_t ngx_mail_smtp_helo(ngx_mail_session_t *s, ngx_connection_t *c);
-static ngx_int_t ngx_mail_smtp_auth(ngx_mail_session_t *s, ngx_connection_t *c);
-static ngx_int_t ngx_mail_smtp_mail(ngx_mail_session_t *s, ngx_connection_t *c);
-static ngx_int_t ngx_mail_smtp_starttls(ngx_mail_session_t *s,
- ngx_connection_t *c);
-static ngx_int_t ngx_mail_smtp_rset(ngx_mail_session_t *s, ngx_connection_t *c);
-static ngx_int_t ngx_mail_smtp_rcpt(ngx_mail_session_t *s, ngx_connection_t *c);
-
-static ngx_int_t ngx_mail_smtp_discard_command(ngx_mail_session_t *s,
- ngx_connection_t *c, char *err);
-static void ngx_mail_smtp_log_rejected_command(ngx_mail_session_t *s,
- ngx_connection_t *c, char *err);
-
-
-static u_char smtp_ok[] = "250 2.0.0 OK" CRLF;
-static u_char smtp_bye[] = "221 2.0.0 Bye" CRLF;
-static u_char smtp_starttls[] = "220 2.0.0 Start TLS" CRLF;
-static u_char smtp_next[] = "334 " CRLF;
-static u_char smtp_username[] = "334 VXNlcm5hbWU6" CRLF;
-static u_char smtp_password[] = "334 UGFzc3dvcmQ6" CRLF;
-static u_char smtp_invalid_command[] = "500 5.5.1 Invalid command" CRLF;
-static u_char smtp_invalid_pipelining[] =
- "503 5.5.0 Improper use of SMTP command pipelining" CRLF;
-static u_char smtp_invalid_argument[] = "501 5.5.4 Invalid argument" CRLF;
-static u_char smtp_auth_required[] = "530 5.7.1 Authentication required" CRLF;
-static u_char smtp_bad_sequence[] = "503 5.5.1 Bad sequence of commands" CRLF;
-
-
-static ngx_str_t smtp_unavailable = ngx_string("[UNAVAILABLE]");
-static ngx_str_t smtp_tempunavail = ngx_string("[TEMPUNAVAIL]");
-
-
-void
-ngx_mail_smtp_init_session(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_resolver_ctx_t *ctx;
- ngx_mail_core_srv_conf_t *cscf;
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- if (cscf->resolver == NULL) {
- s->host = smtp_unavailable;
- ngx_mail_smtp_greeting(s, c);
- return;
- }
-
-#if (NGX_HAVE_UNIX_DOMAIN)
- if (c->sockaddr->sa_family == AF_UNIX) {
- s->host = smtp_tempunavail;
- ngx_mail_smtp_greeting(s, c);
- return;
- }
-#endif
-
- c->log->action = "in resolving client address";
-
- ctx = ngx_resolve_start(cscf->resolver, NULL);
- if (ctx == NULL) {
- ngx_mail_close_connection(c);
- return;
- }
-
- ctx->addr.sockaddr = c->sockaddr;
- ctx->addr.socklen = c->socklen;
- ctx->handler = ngx_mail_smtp_resolve_addr_handler;
- ctx->data = s;
- ctx->timeout = cscf->resolver_timeout;
-
- if (ngx_resolve_addr(ctx) != NGX_OK) {
- ngx_mail_close_connection(c);
- }
-}
-
-
-static void
-ngx_mail_smtp_resolve_addr_handler(ngx_resolver_ctx_t *ctx)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
-
- s = ctx->data;
- c = s->connection;
-
- if (ctx->state) {
- ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "%V could not be resolved (%i: %s)",
- &c->addr_text, ctx->state,
- ngx_resolver_strerror(ctx->state));
-
- if (ctx->state == NGX_RESOLVE_NXDOMAIN) {
- s->host = smtp_unavailable;
-
- } else {
- s->host = smtp_tempunavail;
- }
-
- ngx_resolve_addr_done(ctx);
-
- ngx_mail_smtp_greeting(s, s->connection);
-
- return;
- }
-
- c->log->action = "in resolving client hostname";
-
- s->host.data = ngx_pstrdup(c->pool, &ctx->name);
- if (s->host.data == NULL) {
- ngx_resolve_addr_done(ctx);
- ngx_mail_close_connection(c);
- return;
- }
-
- s->host.len = ctx->name.len;
-
- ngx_resolve_addr_done(ctx);
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "address resolved: %V", &s->host);
-
- c->read->handler = ngx_mail_smtp_resolve_name;
-
- ngx_post_event(c->read, &ngx_posted_events);
-}
-
-
-static void
-ngx_mail_smtp_resolve_name(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_resolver_ctx_t *ctx;
- ngx_mail_core_srv_conf_t *cscf;
-
- c = rev->data;
- s = c->data;
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- ctx = ngx_resolve_start(cscf->resolver, NULL);
- if (ctx == NULL) {
- ngx_mail_close_connection(c);
- return;
- }
-
- ctx->name = s->host;
- ctx->handler = ngx_mail_smtp_resolve_name_handler;
- ctx->data = s;
- ctx->timeout = cscf->resolver_timeout;
-
- if (ngx_resolve_name(ctx) != NGX_OK) {
- ngx_mail_close_connection(c);
- }
-}
-
-
-static void
-ngx_mail_smtp_resolve_name_handler(ngx_resolver_ctx_t *ctx)
-{
- ngx_uint_t i;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
-
- s = ctx->data;
- c = s->connection;
-
- if (ctx->state) {
- ngx_log_error(NGX_LOG_ERR, c->log, 0,
- "\"%V\" could not be resolved (%i: %s)",
- &ctx->name, ctx->state,
- ngx_resolver_strerror(ctx->state));
-
- if (ctx->state == NGX_RESOLVE_NXDOMAIN) {
- s->host = smtp_unavailable;
-
- } else {
- s->host = smtp_tempunavail;
- }
-
- } else {
-
-#if (NGX_DEBUG)
- {
- u_char text[NGX_SOCKADDR_STRLEN];
- ngx_str_t addr;
-
- addr.data = text;
-
- for (i = 0; i < ctx->naddrs; i++) {
- addr.len = ngx_sock_ntop(ctx->addrs[i].sockaddr,
- ctx->addrs[i].socklen,
- text, NGX_SOCKADDR_STRLEN, 0);
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "name was resolved to %V", &addr);
- }
- }
-#endif
-
- for (i = 0; i < ctx->naddrs; i++) {
- if (ngx_cmp_sockaddr(ctx->addrs[i].sockaddr, ctx->addrs[i].socklen,
- c->sockaddr, c->socklen, 0)
- == NGX_OK)
- {
- goto found;
- }
- }
-
- s->host = smtp_unavailable;
- }
-
-found:
-
- ngx_resolve_name_done(ctx);
-
- ngx_mail_smtp_greeting(s, c);
-}
-
-
-static void
-ngx_mail_smtp_greeting(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_msec_t timeout;
- ngx_mail_core_srv_conf_t *cscf;
- ngx_mail_smtp_srv_conf_t *sscf;
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "smtp greeting for \"%V\"", &s->host);
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
- sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
-
- timeout = sscf->greeting_delay ? sscf->greeting_delay : cscf->timeout;
- ngx_add_timer(c->read, timeout);
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- ngx_mail_close_connection(c);
- }
-
- if (sscf->greeting_delay) {
- c->read->handler = ngx_mail_smtp_invalid_pipelining;
- return;
- }
-
- c->read->handler = ngx_mail_smtp_init_protocol;
-
- s->out = sscf->greeting;
-
- ngx_mail_send(c->write);
-}
-
-
-static void
-ngx_mail_smtp_invalid_pipelining(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
- ngx_mail_core_srv_conf_t *cscf;
- ngx_mail_smtp_srv_conf_t *sscf;
-
- c = rev->data;
- s = c->data;
-
- c->log->action = "in delay pipelining state";
-
- if (rev->timedout) {
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, c->log, 0, "delay greeting");
-
- rev->timedout = 0;
-
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- c->read->handler = ngx_mail_smtp_init_protocol;
-
- ngx_add_timer(c->read, cscf->timeout);
-
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- ngx_mail_close_connection(c);
- return;
- }
-
- sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
-
- s->out = sscf->greeting;
-
- } else {
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, c->log, 0, "invalid pipelining");
-
- if (s->buffer == NULL) {
- if (ngx_mail_smtp_create_buffer(s, c) != NGX_OK) {
- return;
- }
- }
-
- if (ngx_mail_smtp_discard_command(s, c,
- "client was rejected before greeting: \"%V\"")
- != NGX_OK)
- {
- return;
- }
-
- ngx_str_set(&s->out, smtp_invalid_pipelining);
- s->quit = 1;
- }
-
- ngx_mail_send(c->write);
-}
-
-
-void
-ngx_mail_smtp_init_protocol(ngx_event_t *rev)
-{
- ngx_connection_t *c;
- ngx_mail_session_t *s;
-
- c = rev->data;
-
- c->log->action = "in auth state";
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- c->timedout = 1;
- ngx_mail_close_connection(c);
- return;
- }
-
- s = c->data;
-
- if (s->buffer == NULL) {
- if (ngx_mail_smtp_create_buffer(s, c) != NGX_OK) {
- return;
- }
- }
-
- s->mail_state = ngx_smtp_start;
- c->read->handler = ngx_mail_smtp_auth_state;
-
- ngx_mail_smtp_auth_state(rev);
-}
-
-
-static ngx_int_t
-ngx_mail_smtp_create_buffer(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_mail_smtp_srv_conf_t *sscf;
-
- if (ngx_array_init(&s->args, c->pool, 2, sizeof(ngx_str_t)) == NGX_ERROR) {
- ngx_mail_session_internal_server_error(s);
- return NGX_ERROR;
- }
-
- sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
-
- s->buffer = ngx_create_temp_buf(c->pool, sscf->client_buffer_size);
- if (s->buffer == NULL) {
- ngx_mail_session_internal_server_error(s);
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-void
-ngx_mail_smtp_auth_state(ngx_event_t *rev)
-{
- ngx_int_t rc;
- ngx_connection_t *c;
- ngx_mail_session_t *s;
-
- c = rev->data;
- s = c->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, c->log, 0, "smtp auth state");
-
- if (rev->timedout) {
- ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");
- c->timedout = 1;
- ngx_mail_close_connection(c);
- return;
- }
-
- if (s->out.len) {
- ngx_log_debug0(NGX_LOG_DEBUG_MAIL, c->log, 0, "smtp send handler busy");
- s->blocked = 1;
- return;
- }
-
- s->blocked = 0;
-
- rc = ngx_mail_read_command(s, c);
-
- if (rc == NGX_AGAIN || rc == NGX_ERROR) {
- return;
- }
-
- ngx_str_set(&s->out, smtp_ok);
-
- if (rc == NGX_OK) {
- switch (s->mail_state) {
-
- case ngx_smtp_start:
-
- switch (s->command) {
-
- case NGX_SMTP_HELO:
- case NGX_SMTP_EHLO:
- rc = ngx_mail_smtp_helo(s, c);
- break;
-
- case NGX_SMTP_AUTH:
- rc = ngx_mail_smtp_auth(s, c);
- break;
-
- case NGX_SMTP_QUIT:
- s->quit = 1;
- ngx_str_set(&s->out, smtp_bye);
- break;
-
- case NGX_SMTP_MAIL:
- rc = ngx_mail_smtp_mail(s, c);
- break;
-
- case NGX_SMTP_RCPT:
- rc = ngx_mail_smtp_rcpt(s, c);
- break;
-
- case NGX_SMTP_RSET:
- rc = ngx_mail_smtp_rset(s, c);
- break;
-
- case NGX_SMTP_NOOP:
- break;
-
- case NGX_SMTP_STARTTLS:
- rc = ngx_mail_smtp_starttls(s, c);
- ngx_str_set(&s->out, smtp_starttls);
- break;
-
- default:
- rc = NGX_MAIL_PARSE_INVALID_COMMAND;
- break;
- }
-
- break;
-
- case ngx_smtp_auth_login_username:
- rc = ngx_mail_auth_login_username(s, c, 0);
-
- ngx_str_set(&s->out, smtp_password);
- s->mail_state = ngx_smtp_auth_login_password;
- break;
-
- case ngx_smtp_auth_login_password:
- rc = ngx_mail_auth_login_password(s, c);
- break;
-
- case ngx_smtp_auth_plain:
- rc = ngx_mail_auth_plain(s, c, 0);
- break;
-
- case ngx_smtp_auth_cram_md5:
- rc = ngx_mail_auth_cram_md5(s, c);
- break;
- }
- }
-
- if (s->buffer->pos < s->buffer->last) {
- s->blocked = 1;
- }
-
- switch (rc) {
-
- case NGX_DONE:
- ngx_mail_auth(s, c);
- return;
-
- case NGX_ERROR:
- ngx_mail_session_internal_server_error(s);
- return;
-
- case NGX_MAIL_PARSE_INVALID_COMMAND:
- s->mail_state = ngx_smtp_start;
- s->state = 0;
- ngx_str_set(&s->out, smtp_invalid_command);
-
- /* fall through */
-
- case NGX_OK:
- s->args.nelts = 0;
-
- if (s->buffer->pos == s->buffer->last) {
- s->buffer->pos = s->buffer->start;
- s->buffer->last = s->buffer->start;
- }
-
- if (s->state) {
- s->arg_start = s->buffer->pos;
- }
-
- ngx_mail_send(c->write);
- }
-}
-
-
-static ngx_int_t
-ngx_mail_smtp_helo(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_t *arg;
- ngx_mail_smtp_srv_conf_t *sscf;
-
- if (s->args.nelts != 1) {
- ngx_str_set(&s->out, smtp_invalid_argument);
- s->state = 0;
- return NGX_OK;
- }
-
- arg = s->args.elts;
-
- s->smtp_helo.len = arg[0].len;
-
- s->smtp_helo.data = ngx_pnalloc(c->pool, arg[0].len);
- if (s->smtp_helo.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->smtp_helo.data, arg[0].data, arg[0].len);
-
- ngx_str_null(&s->smtp_from);
- ngx_str_null(&s->smtp_to);
-
- sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
-
- if (s->command == NGX_SMTP_HELO) {
- s->out = sscf->server_name;
-
- } else {
- s->esmtp = 1;
-
-#if (NGX_MAIL_SSL)
-
- if (c->ssl == NULL) {
- ngx_mail_ssl_conf_t *sslcf;
-
- sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
-
- if (sslcf->starttls == NGX_MAIL_STARTTLS_ON) {
- s->out = sscf->starttls_capability;
- return NGX_OK;
- }
-
- if (sslcf->starttls == NGX_MAIL_STARTTLS_ONLY) {
- s->out = sscf->starttls_only_capability;
- return NGX_OK;
- }
- }
-#endif
-
- s->out = sscf->capability;
- }
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_mail_smtp_auth(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_int_t rc;
- ngx_mail_core_srv_conf_t *cscf;
- ngx_mail_smtp_srv_conf_t *sscf;
-
-#if (NGX_MAIL_SSL)
- if (ngx_mail_starttls_only(s, c)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-#endif
-
- if (s->args.nelts == 0) {
- ngx_str_set(&s->out, smtp_invalid_argument);
- s->state = 0;
- return NGX_OK;
- }
-
- rc = ngx_mail_auth_parse(s, c);
-
- switch (rc) {
-
- case NGX_MAIL_AUTH_LOGIN:
-
- ngx_str_set(&s->out, smtp_username);
- s->mail_state = ngx_smtp_auth_login_username;
-
- return NGX_OK;
-
- case NGX_MAIL_AUTH_LOGIN_USERNAME:
-
- ngx_str_set(&s->out, smtp_password);
- s->mail_state = ngx_smtp_auth_login_password;
-
- return ngx_mail_auth_login_username(s, c, 1);
-
- case NGX_MAIL_AUTH_PLAIN:
-
- ngx_str_set(&s->out, smtp_next);
- s->mail_state = ngx_smtp_auth_plain;
-
- return NGX_OK;
-
- case NGX_MAIL_AUTH_CRAM_MD5:
-
- sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
-
- if (!(sscf->auth_methods & NGX_MAIL_AUTH_CRAM_MD5_ENABLED)) {
- return NGX_MAIL_PARSE_INVALID_COMMAND;
- }
-
- if (s->salt.data == NULL) {
- cscf = ngx_mail_get_module_srv_conf(s, ngx_mail_core_module);
-
- if (ngx_mail_salt(s, c, cscf) != NGX_OK) {
- return NGX_ERROR;
- }
- }
-
- if (ngx_mail_auth_cram_md5_salt(s, c, "334 ", 4) == NGX_OK) {
- s->mail_state = ngx_smtp_auth_cram_md5;
- return NGX_OK;
- }
-
- return NGX_ERROR;
- }
-
- return rc;
-}
-
-
-static ngx_int_t
-ngx_mail_smtp_mail(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_t *arg, cmd;
- ngx_mail_smtp_srv_conf_t *sscf;
-
- sscf = ngx_mail_get_module_srv_conf(s, ngx_mail_smtp_module);
-
- if (!(sscf->auth_methods & NGX_MAIL_AUTH_NONE_ENABLED)) {
- ngx_mail_smtp_log_rejected_command(s, c, "client was rejected: \"%V\"");
- ngx_str_set(&s->out, smtp_auth_required);
- return NGX_OK;
- }
-
- /* auth none */
-
- if (s->smtp_from.len) {
- ngx_str_set(&s->out, smtp_bad_sequence);
- return NGX_OK;
- }
-
- if (s->args.nelts == 0) {
- ngx_str_set(&s->out, smtp_invalid_argument);
- return NGX_OK;
- }
-
- arg = s->args.elts;
- arg += s->args.nelts - 1;
-
- cmd.len = arg->data + arg->len - s->cmd.data;
- cmd.data = s->cmd.data;
-
- s->smtp_from.len = cmd.len;
-
- s->smtp_from.data = ngx_pnalloc(c->pool, cmd.len);
- if (s->smtp_from.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->smtp_from.data, cmd.data, cmd.len);
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "smtp mail from:\"%V\"", &s->smtp_from);
-
- ngx_str_set(&s->out, smtp_ok);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_mail_smtp_rcpt(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_t *arg, cmd;
-
- if (s->smtp_from.len == 0) {
- ngx_str_set(&s->out, smtp_bad_sequence);
- return NGX_OK;
- }
-
- if (s->args.nelts == 0) {
- ngx_str_set(&s->out, smtp_invalid_argument);
- return NGX_OK;
- }
-
- arg = s->args.elts;
- arg += s->args.nelts - 1;
-
- cmd.len = arg->data + arg->len - s->cmd.data;
- cmd.data = s->cmd.data;
-
- s->smtp_to.len = cmd.len;
-
- s->smtp_to.data = ngx_pnalloc(c->pool, cmd.len);
- if (s->smtp_to.data == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(s->smtp_to.data, cmd.data, cmd.len);
-
- ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
- "smtp rcpt to:\"%V\"", &s->smtp_to);
-
- s->auth_method = NGX_MAIL_AUTH_NONE;
-
- return NGX_DONE;
-}
-
-
-static ngx_int_t
-ngx_mail_smtp_rset(ngx_mail_session_t *s, ngx_connection_t *c)
-{
- ngx_str_null(&s->smtp_from);
- ngx_str_null(&s->smtp_to);
- ngx_str_set(&s->out, smtp_ok);
-
- return NGX_OK;
-}
-
-
-static ngx_int_t
-ngx_mail_smtp_starttls(ngx_mail_session_t *s, ngx_connection_t *c)
-{
-#if (NGX_MAIL_SSL)
- ngx_mail_ssl_conf_t *sslcf;
-
- if (c->ssl == NULL) {
- sslcf = ngx_mail_get_module_srv_conf(s, ngx_mail_ssl_module);
- if (sslcf->starttls) {
-
- /*
- * RFC3207 requires us to discard any knowledge
- * obtained from client before STARTTLS.
- */
-
- ngx_str_null(&s->smtp_helo);
- ngx_str_null(&s->smtp_from);
- ngx_str_null(&s->smtp_to);
-
- s->buffer->pos = s->buffer->start;
- s->buffer->last = s->buffer->start;
-
- c->read->handler = ngx_mail_starttls_handler;
- return NGX_OK;
- }
- }
-
-#endif
-
- return NGX_MAIL_PARSE_INVALID_COMMAND;
-}
-
-
-static ngx_int_t
-ngx_mail_smtp_discard_command(ngx_mail_session_t *s, ngx_connection_t *c,
- char *err)
-{
- ssize_t n;
-
- n = c->recv(c, s->buffer->last, s->buffer->end - s->buffer->last);
-
- if (n == NGX_ERROR || n == 0) {
- ngx_mail_close_connection(c);
- return NGX_ERROR;
- }
-
- if (n > 0) {
- s->buffer->last += n;
- }
-
- if (n == NGX_AGAIN) {
- if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
- ngx_mail_session_internal_server_error(s);
- return NGX_ERROR;
- }
-
- return NGX_AGAIN;
- }
-
- ngx_mail_smtp_log_rejected_command(s, c, err);
-
- s->buffer->pos = s->buffer->start;
- s->buffer->last = s->buffer->start;
-
- return NGX_OK;
-}
-
-
-static void
-ngx_mail_smtp_log_rejected_command(ngx_mail_session_t *s, ngx_connection_t *c,
- char *err)
-{
- u_char ch;
- ngx_str_t cmd;
- ngx_uint_t i;
-
- if (c->log->log_level < NGX_LOG_INFO) {
- return;
- }
-
- cmd.len = s->buffer->last - s->buffer->start;
- cmd.data = s->buffer->start;
-
- for (i = 0; i < cmd.len; i++) {
- ch = cmd.data[i];
-
- if (ch != CR && ch != LF) {
- continue;
- }
-
- cmd.data[i] = '_';
- }
-
- cmd.len = i;
-
- ngx_log_error(NGX_LOG_INFO, c->log, 0, err, &cmd);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.c
deleted file mode 100644
index 02bbf1fb9d8..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.c
+++ /dev/null
@@ -1,307 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_mail.h>
-#include <ngx_mail_smtp_module.h>
-
-
-static void *ngx_mail_smtp_create_srv_conf(ngx_conf_t *cf);
-static char *ngx_mail_smtp_merge_srv_conf(ngx_conf_t *cf, void *parent,
- void *child);
-
-
-static ngx_conf_bitmask_t ngx_mail_smtp_auth_methods[] = {
- { ngx_string("plain"), NGX_MAIL_AUTH_PLAIN_ENABLED },
- { ngx_string("login"), NGX_MAIL_AUTH_LOGIN_ENABLED },
- { ngx_string("cram-md5"), NGX_MAIL_AUTH_CRAM_MD5_ENABLED },
- { ngx_string("none"), NGX_MAIL_AUTH_NONE_ENABLED },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_str_t ngx_mail_smtp_auth_methods_names[] = {
- ngx_string("PLAIN"),
- ngx_string("LOGIN"),
- ngx_null_string, /* APOP */
- ngx_string("CRAM-MD5"),
- ngx_null_string /* NONE */
-};
-
-
-static ngx_mail_protocol_t ngx_mail_smtp_protocol = {
- ngx_string("smtp"),
- { 25, 465, 587, 0 },
- NGX_MAIL_SMTP_PROTOCOL,
-
- ngx_mail_smtp_init_session,
- ngx_mail_smtp_init_protocol,
- ngx_mail_smtp_parse_command,
- ngx_mail_smtp_auth_state,
-
- ngx_string("451 4.3.2 Internal server error" CRLF)
-};
-
-
-static ngx_command_t ngx_mail_smtp_commands[] = {
-
- { ngx_string("smtp_client_buffer"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_size_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_smtp_srv_conf_t, client_buffer_size),
- NULL },
-
- { ngx_string("smtp_greeting_delay"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_smtp_srv_conf_t, greeting_delay),
- NULL },
-
- { ngx_string("smtp_capabilities"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
- ngx_mail_capabilities,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_smtp_srv_conf_t, capabilities),
- NULL },
-
- { ngx_string("smtp_auth"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_smtp_srv_conf_t, auth_methods),
- &ngx_mail_smtp_auth_methods },
-
- ngx_null_command
-};
-
-
-static ngx_mail_module_t ngx_mail_smtp_module_ctx = {
- &ngx_mail_smtp_protocol, /* protocol */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_mail_smtp_create_srv_conf, /* create server configuration */
- ngx_mail_smtp_merge_srv_conf /* merge server configuration */
-};
-
-
-ngx_module_t ngx_mail_smtp_module = {
- NGX_MODULE_V1,
- &ngx_mail_smtp_module_ctx, /* module context */
- ngx_mail_smtp_commands, /* module directives */
- NGX_MAIL_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static void *
-ngx_mail_smtp_create_srv_conf(ngx_conf_t *cf)
-{
- ngx_mail_smtp_srv_conf_t *sscf;
-
- sscf = ngx_pcalloc(cf->pool, sizeof(ngx_mail_smtp_srv_conf_t));
- if (sscf == NULL) {
- return NULL;
- }
-
- sscf->client_buffer_size = NGX_CONF_UNSET_SIZE;
- sscf->greeting_delay = NGX_CONF_UNSET_MSEC;
-
- if (ngx_array_init(&sscf->capabilities, cf->pool, 4, sizeof(ngx_str_t))
- != NGX_OK)
- {
- return NULL;
- }
-
- return sscf;
-}
-
-
-static char *
-ngx_mail_smtp_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_mail_smtp_srv_conf_t *prev = parent;
- ngx_mail_smtp_srv_conf_t *conf = child;
-
- u_char *p, *auth, *last;
- size_t size;
- ngx_str_t *c;
- ngx_uint_t i, m, auth_enabled;
- ngx_mail_core_srv_conf_t *cscf;
-
- ngx_conf_merge_size_value(conf->client_buffer_size,
- prev->client_buffer_size,
- (size_t) ngx_pagesize);
-
- ngx_conf_merge_msec_value(conf->greeting_delay,
- prev->greeting_delay, 0);
-
- ngx_conf_merge_bitmask_value(conf->auth_methods,
- prev->auth_methods,
- (NGX_CONF_BITMASK_SET
- |NGX_MAIL_AUTH_PLAIN_ENABLED
- |NGX_MAIL_AUTH_LOGIN_ENABLED));
-
-
- cscf = ngx_mail_conf_get_module_srv_conf(cf, ngx_mail_core_module);
-
- size = sizeof("220 ESMTP ready" CRLF) - 1 + cscf->server_name.len;
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->greeting.len = size;
- conf->greeting.data = p;
-
- *p++ = '2'; *p++ = '2'; *p++ = '0'; *p++ = ' ';
- p = ngx_cpymem(p, cscf->server_name.data, cscf->server_name.len);
- ngx_memcpy(p, " ESMTP ready" CRLF, sizeof(" ESMTP ready" CRLF) - 1);
-
-
- size = sizeof("250 " CRLF) - 1 + cscf->server_name.len;
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->server_name.len = size;
- conf->server_name.data = p;
-
- *p++ = '2'; *p++ = '5'; *p++ = '0'; *p++ = ' ';
- p = ngx_cpymem(p, cscf->server_name.data, cscf->server_name.len);
- *p++ = CR; *p = LF;
-
-
- if (conf->capabilities.nelts == 0) {
- conf->capabilities = prev->capabilities;
- }
-
- size = sizeof("250-") - 1 + cscf->server_name.len + sizeof(CRLF) - 1;
-
- c = conf->capabilities.elts;
- for (i = 0; i < conf->capabilities.nelts; i++) {
- size += sizeof("250 ") - 1 + c[i].len + sizeof(CRLF) - 1;
- }
-
- auth_enabled = 0;
-
- for (m = NGX_MAIL_AUTH_PLAIN_ENABLED, i = 0;
- m <= NGX_MAIL_AUTH_CRAM_MD5_ENABLED;
- m <<= 1, i++)
- {
- if (m & conf->auth_methods) {
- size += 1 + ngx_mail_smtp_auth_methods_names[i].len;
- auth_enabled = 1;
- }
- }
-
- if (auth_enabled) {
- size += sizeof("250 AUTH") - 1 + sizeof(CRLF) - 1;
- }
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->capability.len = size;
- conf->capability.data = p;
-
- last = p;
-
- *p++ = '2'; *p++ = '5'; *p++ = '0'; *p++ = '-';
- p = ngx_cpymem(p, cscf->server_name.data, cscf->server_name.len);
- *p++ = CR; *p++ = LF;
-
- for (i = 0; i < conf->capabilities.nelts; i++) {
- last = p;
- *p++ = '2'; *p++ = '5'; *p++ = '0'; *p++ = '-';
- p = ngx_cpymem(p, c[i].data, c[i].len);
- *p++ = CR; *p++ = LF;
- }
-
- auth = p;
-
- if (auth_enabled) {
- last = p;
-
- *p++ = '2'; *p++ = '5'; *p++ = '0'; *p++ = ' ';
- *p++ = 'A'; *p++ = 'U'; *p++ = 'T'; *p++ = 'H';
-
- for (m = NGX_MAIL_AUTH_PLAIN_ENABLED, i = 0;
- m <= NGX_MAIL_AUTH_CRAM_MD5_ENABLED;
- m <<= 1, i++)
- {
- if (m & conf->auth_methods) {
- *p++ = ' ';
- p = ngx_cpymem(p, ngx_mail_smtp_auth_methods_names[i].data,
- ngx_mail_smtp_auth_methods_names[i].len);
- }
- }
-
- *p++ = CR; *p = LF;
-
- } else {
- last[3] = ' ';
- }
-
- size += sizeof("250 STARTTLS" CRLF) - 1;
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->starttls_capability.len = size;
- conf->starttls_capability.data = p;
-
- p = ngx_cpymem(p, conf->capability.data, conf->capability.len);
-
- p = ngx_cpymem(p, "250 STARTTLS" CRLF, sizeof("250 STARTTLS" CRLF) - 1);
-
- p = conf->starttls_capability.data
- + (last - conf->capability.data) + 3;
- *p = '-';
-
- size = (auth - conf->capability.data)
- + sizeof("250 STARTTLS" CRLF) - 1;
-
- p = ngx_pnalloc(cf->pool, size);
- if (p == NULL) {
- return NGX_CONF_ERROR;
- }
-
- conf->starttls_only_capability.len = size;
- conf->starttls_only_capability.data = p;
-
- p = ngx_cpymem(p, conf->capability.data, auth - conf->capability.data);
-
- ngx_memcpy(p, "250 STARTTLS" CRLF, sizeof("250 STARTTLS" CRLF) - 1);
-
- if (last < auth) {
- p = conf->starttls_only_capability.data
- + (last - conf->capability.data) + 3;
- *p = '-';
- }
-
- return NGX_CONF_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.h
deleted file mode 100644
index 04ffab60ade..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_smtp_module.h
+++ /dev/null
@@ -1,45 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_MAIL_SMTP_MODULE_H_INCLUDED_
-#define _NGX_MAIL_SMTP_MODULE_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_mail.h>
-#include <ngx_mail_smtp_module.h>
-
-
-typedef struct {
- ngx_msec_t greeting_delay;
-
- size_t client_buffer_size;
-
- ngx_str_t capability;
- ngx_str_t starttls_capability;
- ngx_str_t starttls_only_capability;
-
- ngx_str_t server_name;
- ngx_str_t greeting;
-
- ngx_uint_t auth_methods;
-
- ngx_array_t capabilities;
-} ngx_mail_smtp_srv_conf_t;
-
-
-void ngx_mail_smtp_init_session(ngx_mail_session_t *s, ngx_connection_t *c);
-void ngx_mail_smtp_init_protocol(ngx_event_t *rev);
-void ngx_mail_smtp_auth_state(ngx_event_t *rev);
-ngx_int_t ngx_mail_smtp_parse_command(ngx_mail_session_t *s);
-
-
-extern ngx_module_t ngx_mail_smtp_module;
-
-
-#endif /* _NGX_MAIL_SMTP_MODULE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.c
deleted file mode 100644
index f864d991060..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.c
+++ /dev/null
@@ -1,568 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_mail.h>
-
-
-#define NGX_DEFAULT_CIPHERS "HIGH:!aNULL:!MD5"
-#define NGX_DEFAULT_ECDH_CURVE "prime256v1"
-
-
-static void *ngx_mail_ssl_create_conf(ngx_conf_t *cf);
-static char *ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child);
-
-static char *ngx_mail_ssl_enable(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_mail_ssl_starttls(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_mail_ssl_password_file(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-static char *ngx_mail_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd,
- void *conf);
-
-
-static ngx_conf_enum_t ngx_mail_starttls_state[] = {
- { ngx_string("off"), NGX_MAIL_STARTTLS_OFF },
- { ngx_string("on"), NGX_MAIL_STARTTLS_ON },
- { ngx_string("only"), NGX_MAIL_STARTTLS_ONLY },
- { ngx_null_string, 0 }
-};
-
-
-
-static ngx_conf_bitmask_t ngx_mail_ssl_protocols[] = {
- { ngx_string("SSLv2"), NGX_SSL_SSLv2 },
- { ngx_string("SSLv3"), NGX_SSL_SSLv3 },
- { ngx_string("TLSv1"), NGX_SSL_TLSv1 },
- { ngx_string("TLSv1.1"), NGX_SSL_TLSv1_1 },
- { ngx_string("TLSv1.2"), NGX_SSL_TLSv1_2 },
- { ngx_null_string, 0 }
-};
-
-
-static ngx_command_t ngx_mail_ssl_commands[] = {
-
- { ngx_string("ssl"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
- ngx_mail_ssl_enable,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, enable),
- NULL },
-
- { ngx_string("starttls"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_mail_ssl_starttls,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, starttls),
- ngx_mail_starttls_state },
-
- { ngx_string("ssl_certificate"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, certificate),
- NULL },
-
- { ngx_string("ssl_certificate_key"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, certificate_key),
- NULL },
-
- { ngx_string("ssl_password_file"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_mail_ssl_password_file,
- NGX_MAIL_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("ssl_dhparam"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, dhparam),
- NULL },
-
- { ngx_string("ssl_ecdh_curve"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, ecdh_curve),
- NULL },
-
- { ngx_string("ssl_protocols"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_1MORE,
- ngx_conf_set_bitmask_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, protocols),
- &ngx_mail_ssl_protocols },
-
- { ngx_string("ssl_ciphers"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, ciphers),
- NULL },
-
- { ngx_string("ssl_prefer_server_ciphers"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, prefer_server_ciphers),
- NULL },
-
- { ngx_string("ssl_session_cache"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE12,
- ngx_mail_ssl_session_cache,
- NGX_MAIL_SRV_CONF_OFFSET,
- 0,
- NULL },
-
- { ngx_string("ssl_session_tickets"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, session_tickets),
- NULL },
-
- { ngx_string("ssl_session_ticket_key"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_array_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, session_ticket_keys),
- NULL },
-
- { ngx_string("ssl_session_timeout"),
- NGX_MAIL_MAIN_CONF|NGX_MAIL_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_sec_slot,
- NGX_MAIL_SRV_CONF_OFFSET,
- offsetof(ngx_mail_ssl_conf_t, session_timeout),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_mail_module_t ngx_mail_ssl_module_ctx = {
- NULL, /* protocol */
-
- NULL, /* create main configuration */
- NULL, /* init main configuration */
-
- ngx_mail_ssl_create_conf, /* create server configuration */
- ngx_mail_ssl_merge_conf /* merge server configuration */
-};
-
-
-ngx_module_t ngx_mail_ssl_module = {
- NGX_MODULE_V1,
- &ngx_mail_ssl_module_ctx, /* module context */
- ngx_mail_ssl_commands, /* module directives */
- NGX_MAIL_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- NULL, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static ngx_str_t ngx_mail_ssl_sess_id_ctx = ngx_string("MAIL");
-
-
-static void *
-ngx_mail_ssl_create_conf(ngx_conf_t *cf)
-{
- ngx_mail_ssl_conf_t *scf;
-
- scf = ngx_pcalloc(cf->pool, sizeof(ngx_mail_ssl_conf_t));
- if (scf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc():
- *
- * scf->protocols = 0;
- * scf->certificate = { 0, NULL };
- * scf->certificate_key = { 0, NULL };
- * scf->dhparam = { 0, NULL };
- * scf->ecdh_curve = { 0, NULL };
- * scf->ciphers = { 0, NULL };
- * scf->shm_zone = NULL;
- */
-
- scf->enable = NGX_CONF_UNSET;
- scf->starttls = NGX_CONF_UNSET_UINT;
- scf->passwords = NGX_CONF_UNSET_PTR;
- scf->prefer_server_ciphers = NGX_CONF_UNSET;
- scf->builtin_session_cache = NGX_CONF_UNSET;
- scf->session_timeout = NGX_CONF_UNSET;
- scf->session_tickets = NGX_CONF_UNSET;
- scf->session_ticket_keys = NGX_CONF_UNSET_PTR;
-
- return scf;
-}
-
-
-static char *
-ngx_mail_ssl_merge_conf(ngx_conf_t *cf, void *parent, void *child)
-{
- ngx_mail_ssl_conf_t *prev = parent;
- ngx_mail_ssl_conf_t *conf = child;
-
- char *mode;
- ngx_pool_cleanup_t *cln;
-
- ngx_conf_merge_value(conf->enable, prev->enable, 0);
- ngx_conf_merge_uint_value(conf->starttls, prev->starttls,
- NGX_MAIL_STARTTLS_OFF);
-
- ngx_conf_merge_value(conf->session_timeout,
- prev->session_timeout, 300);
-
- ngx_conf_merge_value(conf->prefer_server_ciphers,
- prev->prefer_server_ciphers, 0);
-
- ngx_conf_merge_bitmask_value(conf->protocols, prev->protocols,
- (NGX_CONF_BITMASK_SET|NGX_SSL_SSLv3|NGX_SSL_TLSv1
- |NGX_SSL_TLSv1_1|NGX_SSL_TLSv1_2));
-
- ngx_conf_merge_str_value(conf->certificate, prev->certificate, "");
- ngx_conf_merge_str_value(conf->certificate_key, prev->certificate_key, "");
-
- ngx_conf_merge_ptr_value(conf->passwords, prev->passwords, NULL);
-
- ngx_conf_merge_str_value(conf->dhparam, prev->dhparam, "");
-
- ngx_conf_merge_str_value(conf->ecdh_curve, prev->ecdh_curve,
- NGX_DEFAULT_ECDH_CURVE);
-
- ngx_conf_merge_str_value(conf->ciphers, prev->ciphers, NGX_DEFAULT_CIPHERS);
-
-
- conf->ssl.log = cf->log;
-
- if (conf->enable) {
- mode = "ssl";
-
- } else if (conf->starttls != NGX_MAIL_STARTTLS_OFF) {
- mode = "starttls";
-
- } else {
- mode = "";
- }
-
- if (conf->file == NULL) {
- conf->file = prev->file;
- conf->line = prev->line;
- }
-
- if (*mode) {
-
- if (conf->certificate.len == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no \"ssl_certificate\" is defined for "
- "the \"%s\" directive in %s:%ui",
- mode, conf->file, conf->line);
- return NGX_CONF_ERROR;
- }
-
- if (conf->certificate_key.len == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no \"ssl_certificate_key\" is defined for "
- "the \"%s\" directive in %s:%ui",
- mode, conf->file, conf->line);
- return NGX_CONF_ERROR;
- }
-
- } else {
-
- if (conf->certificate.len == 0) {
- return NGX_CONF_OK;
- }
-
- if (conf->certificate_key.len == 0) {
- ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
- "no \"ssl_certificate_key\" is defined "
- "for certificate \"%V\"",
- &conf->certificate);
- return NGX_CONF_ERROR;
- }
- }
-
- if (ngx_ssl_create(&conf->ssl, conf->protocols, NULL) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- cln = ngx_pool_cleanup_add(cf->pool, 0);
- if (cln == NULL) {
- return NGX_CONF_ERROR;
- }
-
- cln->handler = ngx_ssl_cleanup_ctx;
- cln->data = &conf->ssl;
-
- if (ngx_ssl_certificate(cf, &conf->ssl, &conf->certificate,
- &conf->certificate_key, conf->passwords)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- if (SSL_CTX_set_cipher_list(conf->ssl.ctx,
- (const char *) conf->ciphers.data)
- == 0)
- {
- ngx_ssl_error(NGX_LOG_EMERG, cf->log, 0,
- "SSL_CTX_set_cipher_list(\"%V\") failed",
- &conf->ciphers);
- return NGX_CONF_ERROR;
- }
-
- if (conf->prefer_server_ciphers) {
- SSL_CTX_set_options(conf->ssl.ctx, SSL_OP_CIPHER_SERVER_PREFERENCE);
- }
-
- SSL_CTX_set_tmp_rsa_callback(conf->ssl.ctx, ngx_ssl_rsa512_key_callback);
-
- if (ngx_ssl_dhparam(cf, &conf->ssl, &conf->dhparam) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- if (ngx_ssl_ecdh_curve(cf, &conf->ssl, &conf->ecdh_curve) != NGX_OK) {
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_value(conf->builtin_session_cache,
- prev->builtin_session_cache, NGX_SSL_NONE_SCACHE);
-
- if (conf->shm_zone == NULL) {
- conf->shm_zone = prev->shm_zone;
- }
-
- if (ngx_ssl_session_cache(&conf->ssl, &ngx_mail_ssl_sess_id_ctx,
- conf->builtin_session_cache,
- conf->shm_zone, conf->session_timeout)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- ngx_conf_merge_value(conf->session_tickets,
- prev->session_tickets, 1);
-
-#ifdef SSL_OP_NO_TICKET
- if (!conf->session_tickets) {
- SSL_CTX_set_options(conf->ssl.ctx, SSL_OP_NO_TICKET);
- }
-#endif
-
- ngx_conf_merge_ptr_value(conf->session_ticket_keys,
- prev->session_ticket_keys, NULL);
-
- if (ngx_ssl_session_ticket_keys(cf, &conf->ssl, conf->session_ticket_keys)
- != NGX_OK)
- {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_mail_ssl_enable(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_mail_ssl_conf_t *scf = conf;
-
- char *rv;
-
- rv = ngx_conf_set_flag_slot(cf, cmd, conf);
-
- if (rv != NGX_CONF_OK) {
- return rv;
- }
-
- if (scf->enable && (ngx_int_t) scf->starttls > NGX_MAIL_STARTTLS_OFF) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "\"starttls\" directive conflicts with \"ssl on\"");
- return NGX_CONF_ERROR;
- }
-
- scf->file = cf->conf_file->file.name.data;
- scf->line = cf->conf_file->line;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_mail_ssl_starttls(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_mail_ssl_conf_t *scf = conf;
-
- char *rv;
-
- rv = ngx_conf_set_enum_slot(cf, cmd, conf);
-
- if (rv != NGX_CONF_OK) {
- return rv;
- }
-
- if (scf->enable == 1 && (ngx_int_t) scf->starttls > NGX_MAIL_STARTTLS_OFF) {
- ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
- "\"ssl\" directive conflicts with \"starttls\"");
- return NGX_CONF_ERROR;
- }
-
- scf->file = cf->conf_file->file.name.data;
- scf->line = cf->conf_file->line;
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_mail_ssl_password_file(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_mail_ssl_conf_t *scf = conf;
-
- ngx_str_t *value;
-
- if (scf->passwords != NGX_CONF_UNSET_PTR) {
- return "is duplicate";
- }
-
- value = cf->args->elts;
-
- scf->passwords = ngx_ssl_read_password_file(cf, &value[1]);
-
- if (scf->passwords == NULL) {
- return NGX_CONF_ERROR;
- }
-
- return NGX_CONF_OK;
-}
-
-
-static char *
-ngx_mail_ssl_session_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
-{
- ngx_mail_ssl_conf_t *scf = conf;
-
- size_t len;
- ngx_str_t *value, name, size;
- ngx_int_t n;
- ngx_uint_t i, j;
-
- value = cf->args->elts;
-
- for (i = 1; i < cf->args->nelts; i++) {
-
- if (ngx_strcmp(value[i].data, "off") == 0) {
- scf->builtin_session_cache = NGX_SSL_NO_SCACHE;
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "none") == 0) {
- scf->builtin_session_cache = NGX_SSL_NONE_SCACHE;
- continue;
- }
-
- if (ngx_strcmp(value[i].data, "builtin") == 0) {
- scf->builtin_session_cache = NGX_SSL_DFLT_BUILTIN_SCACHE;
- continue;
- }
-
- if (value[i].len > sizeof("builtin:") - 1
- && ngx_strncmp(value[i].data, "builtin:", sizeof("builtin:") - 1)
- == 0)
- {
- n = ngx_atoi(value[i].data + sizeof("builtin:") - 1,
- value[i].len - (sizeof("builtin:") - 1));
-
- if (n == NGX_ERROR) {
- goto invalid;
- }
-
- scf->builtin_session_cache = n;
-
- continue;
- }
-
- if (value[i].len > sizeof("shared:") - 1
- && ngx_strncmp(value[i].data, "shared:", sizeof("shared:") - 1)
- == 0)
- {
- len = 0;
-
- for (j = sizeof("shared:") - 1; j < value[i].len; j++) {
- if (value[i].data[j] == ':') {
- break;
- }
-
- len++;
- }
-
- if (len == 0) {
- goto invalid;
- }
-
- name.len = len;
- name.data = value[i].data + sizeof("shared:") - 1;
-
- size.len = value[i].len - j - 1;
- size.data = name.data + len + 1;
-
- n = ngx_parse_size(&size);
-
- if (n == NGX_ERROR) {
- goto invalid;
- }
-
- if (n < (ngx_int_t) (8 * ngx_pagesize)) {
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "session cache \"%V\" is too small",
- &value[i]);
-
- return NGX_CONF_ERROR;
- }
-
- scf->shm_zone = ngx_shared_memory_add(cf, &name, n,
- &ngx_mail_ssl_module);
- if (scf->shm_zone == NULL) {
- return NGX_CONF_ERROR;
- }
-
- scf->shm_zone->init = ngx_ssl_session_cache_init;
-
- continue;
- }
-
- goto invalid;
- }
-
- if (scf->shm_zone && scf->builtin_session_cache == NGX_CONF_UNSET) {
- scf->builtin_session_cache = NGX_SSL_NO_BUILTIN_SCACHE;
- }
-
- return NGX_CONF_OK;
-
-invalid:
-
- ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "invalid session cache \"%V\"", &value[i]);
-
- return NGX_CONF_ERROR;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.h
deleted file mode 100644
index 987d029ef73..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/mail/ngx_mail_ssl_module.h
+++ /dev/null
@@ -1,57 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_MAIL_SSL_H_INCLUDED_
-#define _NGX_MAIL_SSL_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_mail.h>
-
-
-#define NGX_MAIL_STARTTLS_OFF 0
-#define NGX_MAIL_STARTTLS_ON 1
-#define NGX_MAIL_STARTTLS_ONLY 2
-
-
-typedef struct {
- ngx_flag_t enable;
- ngx_flag_t prefer_server_ciphers;
-
- ngx_ssl_t ssl;
-
- ngx_uint_t starttls;
- ngx_uint_t protocols;
-
- ssize_t builtin_session_cache;
-
- time_t session_timeout;
-
- ngx_str_t certificate;
- ngx_str_t certificate_key;
- ngx_str_t dhparam;
- ngx_str_t ecdh_curve;
-
- ngx_str_t ciphers;
-
- ngx_array_t *passwords;
-
- ngx_shm_zone_t *shm_zone;
-
- ngx_flag_t session_tickets;
- ngx_array_t *session_ticket_keys;
-
- u_char *file;
- ngx_uint_t line;
-} ngx_mail_ssl_conf_t;
-
-
-extern ngx_module_t ngx_mail_ssl_module;
-
-
-#endif /* _NGX_MAIL_SSL_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_cpp_test_module.cpp b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_cpp_test_module.cpp
deleted file mode 100644
index 5d2f08d3967..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_cpp_test_module.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-
-// stub module to test header files' C++ compatibility
-
-extern "C" {
- #include <ngx_config.h>
- #include <ngx_core.h>
- #include <ngx_event.h>
- #include <ngx_event_connect.h>
- #include <ngx_event_pipe.h>
-
- #include <ngx_http.h>
-
- #include <ngx_mail.h>
- #include <ngx_mail_pop3_module.h>
- #include <ngx_mail_imap_module.h>
- #include <ngx_mail_smtp_module.h>
-}
-
-// nginx header files should go before other, because they define 64-bit off_t
-// #include <string>
-
-
-void ngx_cpp_test_handler(void *data);
-
-void
-ngx_cpp_test_handler(void *data)
-{
- return;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_google_perftools_module.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_google_perftools_module.c
deleted file mode 100644
index f2f8221b560..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/misc/ngx_google_perftools_module.c
+++ /dev/null
@@ -1,126 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-/*
- * declare Profiler interface here because
- * <google/profiler.h> is C++ header file
- */
-
-int ProfilerStart(u_char* fname);
-void ProfilerStop(void);
-void ProfilerRegisterThread(void);
-
-
-static void *ngx_google_perftools_create_conf(ngx_cycle_t *cycle);
-static ngx_int_t ngx_google_perftools_worker(ngx_cycle_t *cycle);
-
-
-typedef struct {
- ngx_str_t profiles;
-} ngx_google_perftools_conf_t;
-
-
-static ngx_command_t ngx_google_perftools_commands[] = {
-
- { ngx_string("google_perftools_profiles"),
- NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_str_slot,
- 0,
- offsetof(ngx_google_perftools_conf_t, profiles),
- NULL },
-
- ngx_null_command
-};
-
-
-static ngx_core_module_t ngx_google_perftools_module_ctx = {
- ngx_string("google_perftools"),
- ngx_google_perftools_create_conf,
- NULL
-};
-
-
-ngx_module_t ngx_google_perftools_module = {
- NGX_MODULE_V1,
- &ngx_google_perftools_module_ctx, /* module context */
- ngx_google_perftools_commands, /* module directives */
- NGX_CORE_MODULE, /* module type */
- NULL, /* init master */
- NULL, /* init module */
- ngx_google_perftools_worker, /* init process */
- NULL, /* init thread */
- NULL, /* exit thread */
- NULL, /* exit process */
- NULL, /* exit master */
- NGX_MODULE_V1_PADDING
-};
-
-
-static void *
-ngx_google_perftools_create_conf(ngx_cycle_t *cycle)
-{
- ngx_google_perftools_conf_t *gptcf;
-
- gptcf = ngx_pcalloc(cycle->pool, sizeof(ngx_google_perftools_conf_t));
- if (gptcf == NULL) {
- return NULL;
- }
-
- /*
- * set by ngx_pcalloc()
- *
- * gptcf->profiles = { 0, NULL };
- */
-
- return gptcf;
-}
-
-
-static ngx_int_t
-ngx_google_perftools_worker(ngx_cycle_t *cycle)
-{
- u_char *profile;
- ngx_google_perftools_conf_t *gptcf;
-
- gptcf = (ngx_google_perftools_conf_t *)
- ngx_get_conf(cycle->conf_ctx, ngx_google_perftools_module);
-
- if (gptcf->profiles.len == 0) {
- return NGX_OK;
- }
-
- profile = ngx_alloc(gptcf->profiles.len + NGX_INT_T_LEN + 2, cycle->log);
- if (profile == NULL) {
- return NGX_OK;
- }
-
- if (getenv("CPUPROFILE")) {
- /* disable inherited Profiler enabled in master process */
- ProfilerStop();
- }
-
- ngx_sprintf(profile, "%V.%d%Z", &gptcf->profiles, ngx_pid);
-
- if (ProfilerStart(profile)) {
- /* start ITIMER_PROF timer */
- ProfilerRegisterThread();
-
- } else {
- ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_errno,
- "ProfilerStart(%s) failed", profile);
- }
-
- ngx_free(profile);
-
- return NGX_OK;
-}
-
-
-/* ProfilerStop() is called on Profiler destruction */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read.c
deleted file mode 100644
index 7849881730f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-extern int ngx_kqueue;
-
-
-ssize_t
-ngx_aio_read(ngx_connection_t *c, u_char *buf, size_t size)
-{
- int n;
- ngx_event_t *rev;
-
- rev = c->read;
-
- if (!rev->ready) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0, "second aio post");
- return NGX_AGAIN;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "rev->complete: %d", rev->complete);
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "aio size: %d", size);
-
- if (!rev->complete) {
- ngx_memzero(&rev->aiocb, sizeof(struct aiocb));
-
- rev->aiocb.aio_fildes = c->fd;
- rev->aiocb.aio_buf = buf;
- rev->aiocb.aio_nbytes = size;
-
-#if (NGX_HAVE_KQUEUE)
- rev->aiocb.aio_sigevent.sigev_notify_kqueue = ngx_kqueue;
- rev->aiocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
- rev->aiocb.aio_sigevent.sigev_value.sigval_ptr = rev;
-#endif
-
- if (aio_read(&rev->aiocb) == -1) {
- ngx_log_error(NGX_LOG_CRIT, rev->log, ngx_errno,
- "aio_read() failed");
- rev->error = 1;
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "aio_read: #%d OK", c->fd);
-
- rev->active = 1;
- rev->ready = 0;
- }
-
- rev->complete = 0;
-
- n = aio_error(&rev->aiocb);
- if (n == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno, "aio_error() failed");
- rev->error = 1;
- return NGX_ERROR;
- }
-
- if (n != 0) {
- if (n == NGX_EINPROGRESS) {
- if (rev->ready) {
- ngx_log_error(NGX_LOG_ALERT, c->log, n,
- "aio_read() still in progress");
- rev->ready = 0;
- }
- return NGX_AGAIN;
- }
-
- ngx_log_error(NGX_LOG_CRIT, c->log, n, "aio_read() failed");
- rev->error = 1;
- rev->ready = 0;
- return NGX_ERROR;
- }
-
- n = aio_return(&rev->aiocb);
- if (n == -1) {
- ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno,
- "aio_return() failed");
-
- rev->error = 1;
- rev->ready = 0;
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, rev->log, 0,
- "aio_read: #%d %d", c->fd, n);
-
- if (n == 0) {
- rev->eof = 1;
- rev->ready = 0;
- } else {
- rev->ready = 1;
- }
-
- rev->active = 0;
-
- return n;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read_chain.c
deleted file mode 100644
index 8c831b95129..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_read_chain.c
+++ /dev/null
@@ -1,78 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-ssize_t
-ngx_aio_read_chain(ngx_connection_t *c, ngx_chain_t *cl)
-{
- int n;
- u_char *buf, *prev;
- size_t size;
- ssize_t total;
-
- if (c->read->pending_eof) {
- c->read->ready = 0;
- return 0;
- }
-
- total = 0;
-
- while (cl) {
-
- /* we can post the single aio operation only */
-
- if (!c->read->ready) {
- return total ? total : NGX_AGAIN;
- }
-
- buf = cl->buf->last;
- prev = cl->buf->last;
- size = 0;
-
- /* coalesce the neighbouring bufs */
-
- while (cl && prev == cl->buf->last) {
- size += cl->buf->end - cl->buf->last;
- prev = cl->buf->end;
- cl = cl->next;
- }
-
- n = ngx_aio_read(c, buf, size);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "aio_read: %d", n);
-
- if (n == NGX_AGAIN) {
- return total ? total : NGX_AGAIN;
- }
-
- if (n == NGX_ERROR) {
- return NGX_ERROR;
- }
-
- if (n == 0) {
- c->read->pending_eof = 1;
- if (total) {
- c->read->eof = 0;
- c->read->ready = 1;
- }
- return total;
- }
-
- if (n > 0) {
- total += n;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "aio_read total: %d", total);
- }
-
- return total ? total : NGX_AGAIN;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write.c
deleted file mode 100644
index f0d93918e3b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write.c
+++ /dev/null
@@ -1,109 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-extern int ngx_kqueue;
-
-
-ssize_t
-ngx_aio_write(ngx_connection_t *c, u_char *buf, size_t size)
-{
- int n;
- ngx_event_t *wev;
-
- wev = c->write;
-
- if (!wev->ready) {
- return NGX_AGAIN;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, wev->log, 0,
- "aio: wev->complete: %d", wev->complete);
-
- if (!wev->complete) {
- ngx_memzero(&wev->aiocb, sizeof(struct aiocb));
-
- wev->aiocb.aio_fildes = c->fd;
- wev->aiocb.aio_buf = buf;
- wev->aiocb.aio_nbytes = size;
-
-#if (NGX_HAVE_KQUEUE)
- wev->aiocb.aio_sigevent.sigev_notify_kqueue = ngx_kqueue;
- wev->aiocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
- wev->aiocb.aio_sigevent.sigev_value.sigval_ptr = wev;
-#endif
-
- if (aio_write(&wev->aiocb) == -1) {
- ngx_log_error(NGX_LOG_CRIT, wev->log, ngx_errno,
- "aio_write() failed");
- return NGX_ERROR;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, wev->log, 0, "aio_write: OK");
-
- wev->active = 1;
- wev->ready = 0;
- }
-
- wev->complete = 0;
-
- n = aio_error(&wev->aiocb);
- if (n == -1) {
- ngx_log_error(NGX_LOG_CRIT, wev->log, ngx_errno, "aio_error() failed");
- wev->error = 1;
- return NGX_ERROR;
- }
-
- if (n != 0) {
- if (n == NGX_EINPROGRESS) {
- if (wev->ready) {
- ngx_log_error(NGX_LOG_ALERT, wev->log, n,
- "aio_write() still in progress");
- wev->ready = 0;
- }
- return NGX_AGAIN;
- }
-
- ngx_log_error(NGX_LOG_CRIT, wev->log, n, "aio_write() failed");
- wev->error = 1;
- wev->ready = 0;
-
-#if 1
- n = aio_return(&wev->aiocb);
- if (n == -1) {
- ngx_log_error(NGX_LOG_ALERT, wev->log, ngx_errno,
- "aio_return() failed");
- }
-
- ngx_log_error(NGX_LOG_CRIT, wev->log, n, "aio_return() %d", n);
-#endif
-
- return NGX_ERROR;
- }
-
- n = aio_return(&wev->aiocb);
- if (n == -1) {
- ngx_log_error(NGX_LOG_ALERT, wev->log, ngx_errno,
- "aio_return() failed");
-
- wev->error = 1;
- wev->ready = 0;
- return NGX_ERROR;
- }
-
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, wev->log, 0, "aio_write: %d", n);
-
- wev->active = 0;
- wev->ready = 1;
-
- return n;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write_chain.c
deleted file mode 100644
index b0c25085d1f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_aio_write_chain.c
+++ /dev/null
@@ -1,100 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-ngx_chain_t *
-ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
-{
- u_char *buf, *prev;
- off_t send, sent;
- size_t len;
- ssize_t n, size;
- ngx_chain_t *cl;
-
- /* the maximum limit size is the maximum size_t value - the page size */
-
- if (limit == 0 || limit > (off_t) (NGX_MAX_SIZE_T_VALUE - ngx_pagesize)) {
- limit = NGX_MAX_SIZE_T_VALUE - ngx_pagesize;
- }
-
- send = 0;
- sent = 0;
- cl = in;
-
- while (cl) {
-
- if (cl->buf->pos == cl->buf->last) {
- cl = cl->next;
- continue;
- }
-
- /* we can post the single aio operation only */
-
- if (!c->write->ready) {
- return cl;
- }
-
- buf = cl->buf->pos;
- prev = buf;
- len = 0;
-
- /* coalesce the neighbouring bufs */
-
- while (cl && prev == cl->buf->pos && send < limit) {
- if (ngx_buf_special(cl->buf)) {
- continue;
- }
-
- size = cl->buf->last - cl->buf->pos;
-
- if (send + size > limit) {
- size = limit - send;
- }
-
- len += size;
- prev = cl->buf->pos + size;
- send += size;
- cl = cl->next;
- }
-
- n = ngx_aio_write(c, buf, len);
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "aio_write: %z", n);
-
- if (n == NGX_ERROR) {
- return NGX_CHAIN_ERROR;
- }
-
- if (n > 0) {
- sent += n;
- c->sent += n;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "aio_write sent: %O", c->sent);
-
- for (cl = in; cl; cl = cl->next) {
-
- if (sent >= cl->buf->last - cl->buf->pos) {
- sent -= cl->buf->last - cl->buf->pos;
- cl->buf->pos = cl->buf->last;
-
- continue;
- }
-
- cl->buf->pos += sent;
-
- break;
- }
- }
-
- return cl;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.c
deleted file mode 100644
index 5c2f7870256..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.c
+++ /dev/null
@@ -1,90 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-ngx_uint_t ngx_pagesize;
-ngx_uint_t ngx_pagesize_shift;
-ngx_uint_t ngx_cacheline_size;
-
-
-void *
-ngx_alloc(size_t size, ngx_log_t *log)
-{
- void *p;
-
- p = malloc(size);
- if (p == NULL) {
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
- "malloc(%uz) failed", size);
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_ALLOC, log, 0, "malloc: %p:%uz", p, size);
-
- return p;
-}
-
-
-void *
-ngx_calloc(size_t size, ngx_log_t *log)
-{
- void *p;
-
- p = ngx_alloc(size, log);
-
- if (p) {
- ngx_memzero(p, size);
- }
-
- return p;
-}
-
-
-#if (NGX_HAVE_POSIX_MEMALIGN)
-
-void *
-ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
-{
- void *p;
- int err;
-
- err = posix_memalign(&p, alignment, size);
-
- if (err) {
- ngx_log_error(NGX_LOG_EMERG, log, err,
- "posix_memalign(%uz, %uz) failed", alignment, size);
- p = NULL;
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0,
- "posix_memalign: %p:%uz @%uz", p, size, alignment);
-
- return p;
-}
-
-#elif (NGX_HAVE_MEMALIGN)
-
-void *
-ngx_memalign(size_t alignment, size_t size, ngx_log_t *log)
-{
- void *p;
-
- p = memalign(alignment, size);
- if (p == NULL) {
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
- "memalign(%uz, %uz) failed", alignment, size);
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0,
- "memalign: %p:%uz @%uz", p, size, alignment);
-
- return p;
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.h
deleted file mode 100644
index 655db257f41..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_alloc.h
+++ /dev/null
@@ -1,45 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_ALLOC_H_INCLUDED_
-#define _NGX_ALLOC_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-void *ngx_alloc(size_t size, ngx_log_t *log);
-void *ngx_calloc(size_t size, ngx_log_t *log);
-
-#define ngx_free free
-
-
-/*
- * Linux has memalign() or posix_memalign()
- * Solaris has memalign()
- * FreeBSD 7.0 has posix_memalign(), besides, early version's malloc()
- * aligns allocations bigger than page size at the page boundary
- */
-
-#if (NGX_HAVE_POSIX_MEMALIGN || NGX_HAVE_MEMALIGN)
-
-void *ngx_memalign(size_t alignment, size_t size, ngx_log_t *log);
-
-#else
-
-#define ngx_memalign(alignment, size, log) ngx_alloc(size, log)
-
-#endif
-
-
-extern ngx_uint_t ngx_pagesize;
-extern ngx_uint_t ngx_pagesize_shift;
-extern ngx_uint_t ngx_cacheline_size;
-
-
-#endif /* _NGX_ALLOC_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_atomic.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_atomic.h
deleted file mode 100644
index 417cd86ff29..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_atomic.h
+++ /dev/null
@@ -1,313 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_ATOMIC_H_INCLUDED_
-#define _NGX_ATOMIC_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-#if (NGX_HAVE_LIBATOMIC)
-
-#define AO_REQUIRE_CAS
-#include <atomic_ops.h>
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-typedef long ngx_atomic_int_t;
-typedef AO_t ngx_atomic_uint_t;
-typedef volatile ngx_atomic_uint_t ngx_atomic_t;
-
-#if (NGX_PTR_SIZE == 8)
-#define NGX_ATOMIC_T_LEN (sizeof("-9223372036854775808") - 1)
-#else
-#define NGX_ATOMIC_T_LEN (sizeof("-2147483648") - 1)
-#endif
-
-#define ngx_atomic_cmp_set(lock, old, new) \
- AO_compare_and_swap(lock, old, new)
-#define ngx_atomic_fetch_add(value, add) \
- AO_fetch_and_add(value, add)
-#define ngx_memory_barrier() AO_nop()
-#define ngx_cpu_pause()
-
-
-#elif (NGX_DARWIN_ATOMIC)
-
-/*
- * use Darwin 8 atomic(3) and barrier(3) operations
- * optimized at run-time for UP and SMP
- */
-
-#include <libkern/OSAtomic.h>
-
-/* "bool" conflicts with perl's CORE/handy.h */
-#if 0
-#undef bool
-#endif
-
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-#if (NGX_PTR_SIZE == 8)
-
-typedef int64_t ngx_atomic_int_t;
-typedef uint64_t ngx_atomic_uint_t;
-#define NGX_ATOMIC_T_LEN (sizeof("-9223372036854775808") - 1)
-
-#define ngx_atomic_cmp_set(lock, old, new) \
- OSAtomicCompareAndSwap64Barrier(old, new, (int64_t *) lock)
-
-#define ngx_atomic_fetch_add(value, add) \
- (OSAtomicAdd64(add, (int64_t *) value) - add)
-
-#else
-
-typedef int32_t ngx_atomic_int_t;
-typedef uint32_t ngx_atomic_uint_t;
-#define NGX_ATOMIC_T_LEN (sizeof("-2147483648") - 1)
-
-#define ngx_atomic_cmp_set(lock, old, new) \
- OSAtomicCompareAndSwap32Barrier(old, new, (int32_t *) lock)
-
-#define ngx_atomic_fetch_add(value, add) \
- (OSAtomicAdd32(add, (int32_t *) value) - add)
-
-#endif
-
-#define ngx_memory_barrier() OSMemoryBarrier()
-
-#define ngx_cpu_pause()
-
-typedef volatile ngx_atomic_uint_t ngx_atomic_t;
-
-
-#elif (NGX_HAVE_GCC_ATOMIC)
-
-/* GCC 4.1 builtin atomic operations */
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-typedef long ngx_atomic_int_t;
-typedef unsigned long ngx_atomic_uint_t;
-
-#if (NGX_PTR_SIZE == 8)
-#define NGX_ATOMIC_T_LEN (sizeof("-9223372036854775808") - 1)
-#else
-#define NGX_ATOMIC_T_LEN (sizeof("-2147483648") - 1)
-#endif
-
-typedef volatile ngx_atomic_uint_t ngx_atomic_t;
-
-
-#define ngx_atomic_cmp_set(lock, old, set) \
- __sync_bool_compare_and_swap(lock, old, set)
-
-#define ngx_atomic_fetch_add(value, add) \
- __sync_fetch_and_add(value, add)
-
-#define ngx_memory_barrier() __sync_synchronize()
-
-#if ( __i386__ || __i386 || __amd64__ || __amd64 )
-#define ngx_cpu_pause() __asm__ ("pause")
-#else
-#define ngx_cpu_pause()
-#endif
-
-
-#elif ( __i386__ || __i386 )
-
-typedef int32_t ngx_atomic_int_t;
-typedef uint32_t ngx_atomic_uint_t;
-typedef volatile ngx_atomic_uint_t ngx_atomic_t;
-#define NGX_ATOMIC_T_LEN (sizeof("-2147483648") - 1)
-
-
-#if ( __SUNPRO_C )
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-ngx_atomic_uint_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
- ngx_atomic_uint_t set);
-
-ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add);
-
-/*
- * Sun Studio 12 exits with segmentation fault on '__asm ("pause")',
- * so ngx_cpu_pause is declared in src/os/unix/ngx_sunpro_x86.il
- */
-
-void
-ngx_cpu_pause(void);
-
-/* the code in src/os/unix/ngx_sunpro_x86.il */
-
-#define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile")
-
-
-#else /* ( __GNUC__ || __INTEL_COMPILER ) */
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-#include "ngx_gcc_atomic_x86.h"
-
-#endif
-
-
-#elif ( __amd64__ || __amd64 )
-
-typedef int64_t ngx_atomic_int_t;
-typedef uint64_t ngx_atomic_uint_t;
-typedef volatile ngx_atomic_uint_t ngx_atomic_t;
-#define NGX_ATOMIC_T_LEN (sizeof("-9223372036854775808") - 1)
-
-
-#if ( __SUNPRO_C )
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-ngx_atomic_uint_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
- ngx_atomic_uint_t set);
-
-ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add);
-
-/*
- * Sun Studio 12 exits with segmentation fault on '__asm ("pause")',
- * so ngx_cpu_pause is declared in src/os/unix/ngx_sunpro_amd64.il
- */
-
-void
-ngx_cpu_pause(void);
-
-/* the code in src/os/unix/ngx_sunpro_amd64.il */
-
-#define ngx_memory_barrier() __asm (".volatile"); __asm (".nonvolatile")
-
-
-#else /* ( __GNUC__ || __INTEL_COMPILER ) */
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-#include "ngx_gcc_atomic_amd64.h"
-
-#endif
-
-
-#elif ( __sparc__ || __sparc || __sparcv9 )
-
-#if (NGX_PTR_SIZE == 8)
-
-typedef int64_t ngx_atomic_int_t;
-typedef uint64_t ngx_atomic_uint_t;
-#define NGX_ATOMIC_T_LEN (sizeof("-9223372036854775808") - 1)
-
-#else
-
-typedef int32_t ngx_atomic_int_t;
-typedef uint32_t ngx_atomic_uint_t;
-#define NGX_ATOMIC_T_LEN (sizeof("-2147483648") - 1)
-
-#endif
-
-typedef volatile ngx_atomic_uint_t ngx_atomic_t;
-
-
-#if ( __SUNPRO_C )
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-#include "ngx_sunpro_atomic_sparc64.h"
-
-
-#else /* ( __GNUC__ || __INTEL_COMPILER ) */
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-#include "ngx_gcc_atomic_sparc64.h"
-
-#endif
-
-
-#elif ( __powerpc__ || __POWERPC__ )
-
-#define NGX_HAVE_ATOMIC_OPS 1
-
-#if (NGX_PTR_SIZE == 8)
-
-typedef int64_t ngx_atomic_int_t;
-typedef uint64_t ngx_atomic_uint_t;
-#define NGX_ATOMIC_T_LEN (sizeof("-9223372036854775808") - 1)
-
-#else
-
-typedef int32_t ngx_atomic_int_t;
-typedef uint32_t ngx_atomic_uint_t;
-#define NGX_ATOMIC_T_LEN (sizeof("-2147483648") - 1)
-
-#endif
-
-typedef volatile ngx_atomic_uint_t ngx_atomic_t;
-
-
-#include "ngx_gcc_atomic_ppc.h"
-
-#endif
-
-
-#if !(NGX_HAVE_ATOMIC_OPS)
-
-#define NGX_HAVE_ATOMIC_OPS 0
-
-typedef int32_t ngx_atomic_int_t;
-typedef uint32_t ngx_atomic_uint_t;
-typedef volatile ngx_atomic_uint_t ngx_atomic_t;
-#define NGX_ATOMIC_T_LEN (sizeof("-2147483648") - 1)
-
-
-static ngx_inline ngx_atomic_uint_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
- ngx_atomic_uint_t set)
-{
- if (*lock == old) {
- *lock = set;
- return 1;
- }
-
- return 0;
-}
-
-
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
-{
- ngx_atomic_int_t old;
-
- old = *value;
- *value += add;
-
- return old;
-}
-
-#define ngx_memory_barrier()
-#define ngx_cpu_pause()
-
-#endif
-
-
-void ngx_spinlock(ngx_atomic_t *lock, ngx_atomic_int_t value, ngx_uint_t spin);
-
-#define ngx_trylock(lock) (*(lock) == 0 && ngx_atomic_cmp_set(lock, 0, 1))
-#define ngx_unlock(lock) *(lock) = 0
-
-
-#endif /* _NGX_ATOMIC_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.c
deleted file mode 100644
index 1efa0667cb8..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.c
+++ /dev/null
@@ -1,253 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_channel.h>
-
-
-ngx_int_t
-ngx_write_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size,
- ngx_log_t *log)
-{
- ssize_t n;
- ngx_err_t err;
- struct iovec iov[1];
- struct msghdr msg;
-
-#if (NGX_HAVE_MSGHDR_MSG_CONTROL)
-
- union {
- struct cmsghdr cm;
- char space[CMSG_SPACE(sizeof(int))];
- } cmsg;
-
- if (ch->fd == -1) {
- msg.msg_control = NULL;
- msg.msg_controllen = 0;
-
- } else {
- msg.msg_control = (caddr_t) &cmsg;
- msg.msg_controllen = sizeof(cmsg);
-
- ngx_memzero(&cmsg, sizeof(cmsg));
-
- cmsg.cm.cmsg_len = CMSG_LEN(sizeof(int));
- cmsg.cm.cmsg_level = SOL_SOCKET;
- cmsg.cm.cmsg_type = SCM_RIGHTS;
-
- /*
- * We have to use ngx_memcpy() instead of simple
- * *(int *) CMSG_DATA(&cmsg.cm) = ch->fd;
- * because some gcc 4.4 with -O2/3/s optimization issues the warning:
- * dereferencing type-punned pointer will break strict-aliasing rules
- *
- * Fortunately, gcc with -O1 compiles this ngx_memcpy()
- * in the same simple assignment as in the code above
- */
-
- ngx_memcpy(CMSG_DATA(&cmsg.cm), &ch->fd, sizeof(int));
- }
-
- msg.msg_flags = 0;
-
-#else
-
- if (ch->fd == -1) {
- msg.msg_accrights = NULL;
- msg.msg_accrightslen = 0;
-
- } else {
- msg.msg_accrights = (caddr_t) &ch->fd;
- msg.msg_accrightslen = sizeof(int);
- }
-
-#endif
-
- iov[0].iov_base = (char *) ch;
- iov[0].iov_len = size;
-
- msg.msg_name = NULL;
- msg.msg_namelen = 0;
- msg.msg_iov = iov;
- msg.msg_iovlen = 1;
-
- n = sendmsg(s, &msg, 0);
-
- if (n == -1) {
- err = ngx_errno;
- if (err == NGX_EAGAIN) {
- return NGX_AGAIN;
- }
-
- ngx_log_error(NGX_LOG_ALERT, log, err, "sendmsg() failed");
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size, ngx_log_t *log)
-{
- ssize_t n;
- ngx_err_t err;
- struct iovec iov[1];
- struct msghdr msg;
-
-#if (NGX_HAVE_MSGHDR_MSG_CONTROL)
- union {
- struct cmsghdr cm;
- char space[CMSG_SPACE(sizeof(int))];
- } cmsg;
-#else
- int fd;
-#endif
-
- iov[0].iov_base = (char *) ch;
- iov[0].iov_len = size;
-
- msg.msg_name = NULL;
- msg.msg_namelen = 0;
- msg.msg_iov = iov;
- msg.msg_iovlen = 1;
-
-#if (NGX_HAVE_MSGHDR_MSG_CONTROL)
- msg.msg_control = (caddr_t) &cmsg;
- msg.msg_controllen = sizeof(cmsg);
-#else
- msg.msg_accrights = (caddr_t) &fd;
- msg.msg_accrightslen = sizeof(int);
-#endif
-
- n = recvmsg(s, &msg, 0);
-
- if (n == -1) {
- err = ngx_errno;
- if (err == NGX_EAGAIN) {
- return NGX_AGAIN;
- }
-
- ngx_log_error(NGX_LOG_ALERT, log, err, "recvmsg() failed");
- return NGX_ERROR;
- }
-
- if (n == 0) {
- ngx_log_debug0(NGX_LOG_DEBUG_CORE, log, 0, "recvmsg() returned zero");
- return NGX_ERROR;
- }
-
- if ((size_t) n < sizeof(ngx_channel_t)) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "recvmsg() returned not enough data: %z", n);
- return NGX_ERROR;
- }
-
-#if (NGX_HAVE_MSGHDR_MSG_CONTROL)
-
- if (ch->command == NGX_CMD_OPEN_CHANNEL) {
-
- if (cmsg.cm.cmsg_len < (socklen_t) CMSG_LEN(sizeof(int))) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "recvmsg() returned too small ancillary data");
- return NGX_ERROR;
- }
-
- if (cmsg.cm.cmsg_level != SOL_SOCKET || cmsg.cm.cmsg_type != SCM_RIGHTS)
- {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "recvmsg() returned invalid ancillary data "
- "level %d or type %d",
- cmsg.cm.cmsg_level, cmsg.cm.cmsg_type);
- return NGX_ERROR;
- }
-
- /* ch->fd = *(int *) CMSG_DATA(&cmsg.cm); */
-
- ngx_memcpy(&ch->fd, CMSG_DATA(&cmsg.cm), sizeof(int));
- }
-
- if (msg.msg_flags & (MSG_TRUNC|MSG_CTRUNC)) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "recvmsg() truncated data");
- }
-
-#else
-
- if (ch->command == NGX_CMD_OPEN_CHANNEL) {
- if (msg.msg_accrightslen != sizeof(int)) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "recvmsg() returned no ancillary data");
- return NGX_ERROR;
- }
-
- ch->fd = fd;
- }
-
-#endif
-
- return n;
-}
-
-
-ngx_int_t
-ngx_add_channel_event(ngx_cycle_t *cycle, ngx_fd_t fd, ngx_int_t event,
- ngx_event_handler_pt handler)
-{
- ngx_event_t *ev, *rev, *wev;
- ngx_connection_t *c;
-
- c = ngx_get_connection(fd, cycle->log);
-
- if (c == NULL) {
- return NGX_ERROR;
- }
-
- c->pool = cycle->pool;
-
- rev = c->read;
- wev = c->write;
-
- rev->log = cycle->log;
- wev->log = cycle->log;
-
- rev->channel = 1;
- wev->channel = 1;
-
- ev = (event == NGX_READ_EVENT) ? rev : wev;
-
- ev->handler = handler;
-
- if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) {
- if (ngx_add_conn(c) == NGX_ERROR) {
- ngx_free_connection(c);
- return NGX_ERROR;
- }
-
- } else {
- if (ngx_add_event(ev, event, 0) == NGX_ERROR) {
- ngx_free_connection(c);
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
-
-
-void
-ngx_close_channel(ngx_fd_t *fd, ngx_log_t *log)
-{
- if (close(fd[0]) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "close() channel failed");
- }
-
- if (close(fd[1]) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "close() channel failed");
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.h
deleted file mode 100644
index d7a9f6b54c5..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_channel.h
+++ /dev/null
@@ -1,34 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_CHANNEL_H_INCLUDED_
-#define _NGX_CHANNEL_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-typedef struct {
- ngx_uint_t command;
- ngx_pid_t pid;
- ngx_int_t slot;
- ngx_fd_t fd;
-} ngx_channel_t;
-
-
-ngx_int_t ngx_write_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size,
- ngx_log_t *log);
-ngx_int_t ngx_read_channel(ngx_socket_t s, ngx_channel_t *ch, size_t size,
- ngx_log_t *log);
-ngx_int_t ngx_add_channel_event(ngx_cycle_t *cycle, ngx_fd_t fd,
- ngx_int_t event, ngx_event_handler_pt handler);
-void ngx_close_channel(ngx_fd_t *fd, ngx_log_t *log);
-
-
-#endif /* _NGX_CHANNEL_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_daemon.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_daemon.c
deleted file mode 100644
index ab672110838..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_daemon.c
+++ /dev/null
@@ -1,70 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-ngx_int_t
-ngx_daemon(ngx_log_t *log)
-{
- int fd;
-
- switch (fork()) {
- case -1:
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "fork() failed");
- return NGX_ERROR;
-
- case 0:
- break;
-
- default:
- exit(0);
- }
-
- ngx_pid = ngx_getpid();
-
- if (setsid() == -1) {
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "setsid() failed");
- return NGX_ERROR;
- }
-
- umask(0);
-
- fd = open("/dev/null", O_RDWR);
- if (fd == -1) {
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
- "open(\"/dev/null\") failed");
- return NGX_ERROR;
- }
-
- if (dup2(fd, STDIN_FILENO) == -1) {
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "dup2(STDIN) failed");
- return NGX_ERROR;
- }
-
- if (dup2(fd, STDOUT_FILENO) == -1) {
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "dup2(STDOUT) failed");
- return NGX_ERROR;
- }
-
-#if 0
- if (dup2(fd, STDERR_FILENO) == -1) {
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "dup2(STDERR) failed");
- return NGX_ERROR;
- }
-#endif
-
- if (fd > STDERR_FILENO) {
- if (close(fd) == -1) {
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "close() failed");
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin.h
deleted file mode 100644
index 4d01b26ea54..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin.h
+++ /dev/null
@@ -1,23 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_DARWIN_H_INCLUDED_
-#define _NGX_DARWIN_H_INCLUDED_
-
-
-void ngx_debug_init(void);
-ngx_chain_t *ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in,
- off_t limit);
-
-extern int ngx_darwin_kern_osreldate;
-extern int ngx_darwin_hw_ncpu;
-extern u_long ngx_darwin_net_inet_tcp_sendspace;
-
-extern ngx_uint_t ngx_debug_malloc;
-
-
-#endif /* _NGX_DARWIN_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_config.h
deleted file mode 100644
index bbad977cb6c..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_config.h
+++ /dev/null
@@ -1,95 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_DARWIN_CONFIG_H_INCLUDED_
-#define _NGX_DARWIN_CONFIG_H_INCLUDED_
-
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <inttypes.h>
-#include <stdarg.h>
-#include <stddef.h> /* offsetof() */
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <pwd.h>
-#include <grp.h>
-#include <dirent.h>
-#include <glob.h>
-#include <sys/mount.h> /* statfs() */
-
-#include <sys/filio.h> /* FIONBIO */
-#include <sys/ioctl.h>
-#include <sys/uio.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <sys/wait.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-#include <sched.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h> /* TCP_NODELAY */
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <sys/un.h>
-
-#include <sys/sysctl.h>
-#include <xlocale.h>
-
-
-#ifndef IOV_MAX
-#define IOV_MAX 64
-#endif
-
-
-#include <ngx_auto_config.h>
-
-
-#if (NGX_HAVE_POSIX_SEM)
-#include <semaphore.h>
-#endif
-
-
-#if (NGX_HAVE_POLL)
-#include <poll.h>
-#endif
-
-
-#if (NGX_HAVE_KQUEUE)
-#include <sys/event.h>
-#endif
-
-
-#define NGX_LISTEN_BACKLOG -1
-
-
-#ifndef NGX_HAVE_INHERITED_NONBLOCK
-#define NGX_HAVE_INHERITED_NONBLOCK 1
-#endif
-
-
-#ifndef NGX_HAVE_CASELESS_FILESYSTEM
-#define NGX_HAVE_CASELESS_FILESYSTEM 1
-#endif
-
-
-#define NGX_HAVE_OS_SPECIFIC_INIT 1
-#define NGX_HAVE_DEBUG_MALLOC 1
-
-
-extern char **environ;
-
-
-#endif /* _NGX_DARWIN_CONFIG_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_init.c
deleted file mode 100644
index 1bc7520cade..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_init.c
+++ /dev/null
@@ -1,196 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-char ngx_darwin_kern_ostype[16];
-char ngx_darwin_kern_osrelease[128];
-int ngx_darwin_hw_ncpu;
-int ngx_darwin_kern_ipc_somaxconn;
-u_long ngx_darwin_net_inet_tcp_sendspace;
-
-ngx_uint_t ngx_debug_malloc;
-
-
-static ngx_os_io_t ngx_darwin_io = {
- ngx_unix_recv,
- ngx_readv_chain,
- ngx_udp_unix_recv,
- ngx_unix_send,
-#if (NGX_HAVE_SENDFILE)
- ngx_darwin_sendfile_chain,
- NGX_IO_SENDFILE
-#else
- ngx_writev_chain,
- 0
-#endif
-};
-
-
-typedef struct {
- char *name;
- void *value;
- size_t size;
- ngx_uint_t exists;
-} sysctl_t;
-
-
-sysctl_t sysctls[] = {
- { "hw.ncpu",
- &ngx_darwin_hw_ncpu,
- sizeof(ngx_darwin_hw_ncpu), 0 },
-
- { "net.inet.tcp.sendspace",
- &ngx_darwin_net_inet_tcp_sendspace,
- sizeof(ngx_darwin_net_inet_tcp_sendspace), 0 },
-
- { "kern.ipc.somaxconn",
- &ngx_darwin_kern_ipc_somaxconn,
- sizeof(ngx_darwin_kern_ipc_somaxconn), 0 },
-
- { NULL, NULL, 0, 0 }
-};
-
-
-void
-ngx_debug_init(void)
-{
-#if (NGX_DEBUG_MALLOC)
-
- /*
- * MacOSX 10.6, 10.7: MallocScribble fills freed memory with 0x55
- * and fills allocated memory with 0xAA.
- * MacOSX 10.4, 10.5: MallocScribble fills freed memory with 0x55,
- * MallocPreScribble fills allocated memory with 0xAA.
- * MacOSX 10.3: MallocScribble fills freed memory with 0x55,
- * and no way to fill allocated memory.
- */
-
- setenv("MallocScribble", "1", 0);
-
- ngx_debug_malloc = 1;
-
-#else
-
- if (getenv("MallocScribble")) {
- ngx_debug_malloc = 1;
- }
-
-#endif
-}
-
-
-ngx_int_t
-ngx_os_specific_init(ngx_log_t *log)
-{
- size_t size;
- ngx_err_t err;
- ngx_uint_t i;
-
- size = sizeof(ngx_darwin_kern_ostype);
- if (sysctlbyname("kern.ostype", ngx_darwin_kern_ostype, &size, NULL, 0)
- == -1)
- {
- err = ngx_errno;
-
- if (err != NGX_ENOENT) {
-
- ngx_log_error(NGX_LOG_ALERT, log, err,
- "sysctlbyname(kern.ostype) failed");
-
- if (err != NGX_ENOMEM) {
- return NGX_ERROR;
- }
-
- ngx_darwin_kern_ostype[size - 1] = '\0';
- }
- }
-
- size = sizeof(ngx_darwin_kern_osrelease);
- if (sysctlbyname("kern.osrelease", ngx_darwin_kern_osrelease, &size,
- NULL, 0)
- == -1)
- {
- err = ngx_errno;
-
- if (err != NGX_ENOENT) {
-
- ngx_log_error(NGX_LOG_ALERT, log, err,
- "sysctlbyname(kern.osrelease) failed");
-
- if (err != NGX_ENOMEM) {
- return NGX_ERROR;
- }
-
- ngx_darwin_kern_osrelease[size - 1] = '\0';
- }
- }
-
- for (i = 0; sysctls[i].name; i++) {
- size = sysctls[i].size;
-
- if (sysctlbyname(sysctls[i].name, sysctls[i].value, &size, NULL, 0)
- == 0)
- {
- sysctls[i].exists = 1;
- continue;
- }
-
- err = ngx_errno;
-
- if (err == NGX_ENOENT) {
- continue;
- }
-
- ngx_log_error(NGX_LOG_ALERT, log, err,
- "sysctlbyname(%s) failed", sysctls[i].name);
- return NGX_ERROR;
- }
-
- ngx_ncpu = ngx_darwin_hw_ncpu;
-
- if (ngx_darwin_kern_ipc_somaxconn > 32767) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "sysctl kern.ipc.somaxconn must be less than 32768");
- return NGX_ERROR;
- }
-
- ngx_tcp_nodelay_and_tcp_nopush = 1;
-
- ngx_os_io = ngx_darwin_io;
-
- return NGX_OK;
-}
-
-
-void
-ngx_os_specific_status(ngx_log_t *log)
-{
- u_long value;
- ngx_uint_t i;
-
- if (ngx_darwin_kern_ostype[0]) {
- ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
- ngx_darwin_kern_ostype, ngx_darwin_kern_osrelease);
- }
-
- for (i = 0; sysctls[i].name; i++) {
- if (sysctls[i].exists) {
- if (sysctls[i].size == sizeof(long)) {
- value = *(long *) sysctls[i].value;
-
- } else {
- value = *(int *) sysctls[i].value;
- }
-
- ngx_log_error(NGX_LOG_NOTICE, log, 0, "%s: %l",
- sysctls[i].name, value);
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_sendfile_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_sendfile_chain.c
deleted file mode 100644
index dd574e5ac90..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_darwin_sendfile_chain.c
+++ /dev/null
@@ -1,323 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-/*
- * It seems that Darwin 9.4 (Mac OS X 1.5) sendfile() has the same
- * old bug as early FreeBSD sendfile() syscall:
- * http://bugs.freebsd.org/33771
- *
- * Besides sendfile() has another bug: if one calls sendfile()
- * with both a header and a trailer, then sendfile() ignores a file part
- * at all and sends only the header and the trailer together.
- * For this reason we send a trailer only if there is no a header.
- *
- * Although sendfile() allows to pass a header or a trailer,
- * it may send the header or the trailer and a part of the file
- * in different packets. And FreeBSD workaround (TCP_NOPUSH option)
- * does not help.
- */
-
-
-ngx_chain_t *
-ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
-{
- int rc;
- u_char *prev;
- off_t size, send, prev_send, aligned, sent, fprev;
- off_t header_size, file_size;
- ngx_uint_t eintr;
- ngx_err_t err;
- ngx_buf_t *file;
- ngx_array_t header, trailer;
- ngx_event_t *wev;
- ngx_chain_t *cl;
- struct sf_hdtr hdtr;
- struct iovec *iov;
- struct iovec headers[NGX_IOVS_PREALLOCATE];
- struct iovec trailers[NGX_IOVS_PREALLOCATE];
-
- wev = c->write;
-
- if (!wev->ready) {
- return in;
- }
-
-#if (NGX_HAVE_KQUEUE)
-
- if ((ngx_event_flags & NGX_USE_KQUEUE_EVENT) && wev->pending_eof) {
- (void) ngx_connection_error(c, wev->kq_errno,
- "kevent() reported about an closed connection");
- wev->error = 1;
- return NGX_CHAIN_ERROR;
- }
-
-#endif
-
- /* the maximum limit size is the maximum size_t value - the page size */
-
- if (limit == 0 || limit > (off_t) (NGX_MAX_SIZE_T_VALUE - ngx_pagesize)) {
- limit = NGX_MAX_SIZE_T_VALUE - ngx_pagesize;
- }
-
- send = 0;
-
- header.elts = headers;
- header.size = sizeof(struct iovec);
- header.nalloc = NGX_IOVS_PREALLOCATE;
- header.pool = c->pool;
-
- trailer.elts = trailers;
- trailer.size = sizeof(struct iovec);
- trailer.nalloc = NGX_IOVS_PREALLOCATE;
- trailer.pool = c->pool;
-
- for ( ;; ) {
- file = NULL;
- file_size = 0;
- header_size = 0;
- eintr = 0;
- prev_send = send;
-
- header.nelts = 0;
- trailer.nelts = 0;
-
- /* create the header iovec and coalesce the neighbouring bufs */
-
- prev = NULL;
- iov = NULL;
-
- for (cl = in; cl && send < limit; cl = cl->next) {
-
- if (ngx_buf_special(cl->buf)) {
- continue;
- }
-
- if (!ngx_buf_in_memory_only(cl->buf)) {
- break;
- }
-
- size = cl->buf->last - cl->buf->pos;
-
- if (send + size > limit) {
- size = limit - send;
- }
-
- if (prev == cl->buf->pos) {
- iov->iov_len += (size_t) size;
-
- } else {
- if (header.nelts >= IOV_MAX) {
- break;
- }
-
- iov = ngx_array_push(&header);
- if (iov == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- iov->iov_base = (void *) cl->buf->pos;
- iov->iov_len = (size_t) size;
- }
-
- prev = cl->buf->pos + (size_t) size;
- header_size += size;
- send += size;
- }
-
-
- if (cl && cl->buf->in_file && send < limit) {
- file = cl->buf;
-
- /* coalesce the neighbouring file bufs */
-
- do {
- size = cl->buf->file_last - cl->buf->file_pos;
-
- if (send + size > limit) {
- size = limit - send;
-
- aligned = (cl->buf->file_pos + size + ngx_pagesize - 1)
- & ~((off_t) ngx_pagesize - 1);
-
- if (aligned <= cl->buf->file_last) {
- size = aligned - cl->buf->file_pos;
- }
- }
-
- file_size += size;
- send += size;
- fprev = cl->buf->file_pos + size;
- cl = cl->next;
-
- } while (cl
- && cl->buf->in_file
- && send < limit
- && file->file->fd == cl->buf->file->fd
- && fprev == cl->buf->file_pos);
- }
-
- if (file && header.nelts == 0) {
-
- /* create the trailer iovec and coalesce the neighbouring bufs */
-
- prev = NULL;
- iov = NULL;
-
- while (cl && send < limit) {
-
- if (ngx_buf_special(cl->buf)) {
- cl = cl->next;
- continue;
- }
-
- if (!ngx_buf_in_memory_only(cl->buf)) {
- break;
- }
-
- size = cl->buf->last - cl->buf->pos;
-
- if (send + size > limit) {
- size = limit - send;
- }
-
- if (prev == cl->buf->pos) {
- iov->iov_len += (size_t) size;
-
- } else {
- if (trailer.nelts >= IOV_MAX) {
- break;
- }
-
- iov = ngx_array_push(&trailer);
- if (iov == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- iov->iov_base = (void *) cl->buf->pos;
- iov->iov_len = (size_t) size;
- }
-
- prev = cl->buf->pos + (size_t) size;
- send += size;
- cl = cl->next;
- }
- }
-
- if (file) {
-
- /*
- * sendfile() returns EINVAL if sf_hdtr's count is 0,
- * but corresponding pointer is not NULL
- */
-
- hdtr.headers = header.nelts ? (struct iovec *) header.elts: NULL;
- hdtr.hdr_cnt = header.nelts;
- hdtr.trailers = trailer.nelts ? (struct iovec *) trailer.elts: NULL;
- hdtr.trl_cnt = trailer.nelts;
-
- sent = header_size + file_size;
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "sendfile: @%O %O h:%O",
- file->file_pos, sent, header_size);
-
- rc = sendfile(file->file->fd, c->fd, file->file_pos,
- &sent, &hdtr, 0);
-
- if (rc == -1) {
- err = ngx_errno;
-
- switch (err) {
- case NGX_EAGAIN:
- break;
-
- case NGX_EINTR:
- eintr = 1;
- break;
-
- default:
- wev->error = 1;
- (void) ngx_connection_error(c, err, "sendfile() failed");
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, err,
- "sendfile() sent only %O bytes", sent);
- }
-
- if (rc == 0 && sent == 0) {
-
- /*
- * if rc and sent equal to zero, then someone
- * has truncated the file, so the offset became beyond
- * the end of the file
- */
-
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "sendfile() reported that \"%s\" was truncated",
- file->file->name.data);
-
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "sendfile: %d, @%O %O:%O",
- rc, file->file_pos, sent, file_size + header_size);
-
- } else {
- rc = writev(c->fd, header.elts, header.nelts);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "writev: %d of %O", rc, header_size);
-
- if (rc == -1) {
- err = ngx_errno;
-
- switch (err) {
- case NGX_EAGAIN:
- break;
-
- case NGX_EINTR:
- eintr = 1;
- break;
-
- default:
- wev->error = 1;
- ngx_connection_error(c, err, "writev() failed");
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "writev() not ready");
- }
-
- sent = rc > 0 ? rc : 0;
- }
-
- c->sent += sent;
-
- in = ngx_handle_sent_chain(in, sent);
-
- if (eintr) {
- continue;
- }
-
- if (send - prev_send != sent) {
- wev->ready = 0;
- return in;
- }
-
- if (send >= limit || in == NULL) {
- return in;
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.c
deleted file mode 100644
index e787b2377ed..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.c
+++ /dev/null
@@ -1,87 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-/*
- * The strerror() messages are copied because:
- *
- * 1) strerror() and strerror_r() functions are not Async-Signal-Safe,
- * therefore, they cannot be used in signal handlers;
- *
- * 2) a direct sys_errlist[] array may be used instead of these functions,
- * but Linux linker warns about its usage:
- *
- * warning: `sys_errlist' is deprecated; use `strerror' or `strerror_r' instead
- * warning: `sys_nerr' is deprecated; use `strerror' or `strerror_r' instead
- *
- * causing false bug reports.
- */
-
-
-static ngx_str_t *ngx_sys_errlist;
-static ngx_str_t ngx_unknown_error = ngx_string("Unknown error");
-
-
-u_char *
-ngx_strerror(ngx_err_t err, u_char *errstr, size_t size)
-{
- ngx_str_t *msg;
-
- msg = ((ngx_uint_t) err < NGX_SYS_NERR) ? &ngx_sys_errlist[err]:
- &ngx_unknown_error;
- size = ngx_min(size, msg->len);
-
- return ngx_cpymem(errstr, msg->data, size);
-}
-
-
-ngx_int_t
-ngx_strerror_init(void)
-{
- char *msg;
- u_char *p;
- size_t len;
- ngx_err_t err;
-
- /*
- * ngx_strerror() is not ready to work at this stage, therefore,
- * malloc() is used and possible errors are logged using strerror().
- */
-
- len = NGX_SYS_NERR * sizeof(ngx_str_t);
-
- ngx_sys_errlist = malloc(len);
- if (ngx_sys_errlist == NULL) {
- goto failed;
- }
-
- for (err = 0; err < NGX_SYS_NERR; err++) {
- msg = strerror(err);
- len = ngx_strlen(msg);
-
- p = malloc(len);
- if (p == NULL) {
- goto failed;
- }
-
- ngx_memcpy(p, msg, len);
- ngx_sys_errlist[err].len = len;
- ngx_sys_errlist[err].data = p;
- }
-
- return NGX_OK;
-
-failed:
-
- err = errno;
- ngx_log_stderr(0, "malloc(%uz) failed (%d: %s)", len, err, strerror(err));
-
- return NGX_ERROR;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.h
deleted file mode 100644
index 16cafda3107..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_errno.h
+++ /dev/null
@@ -1,78 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_ERRNO_H_INCLUDED_
-#define _NGX_ERRNO_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-typedef int ngx_err_t;
-
-#define NGX_EPERM EPERM
-#define NGX_ENOENT ENOENT
-#define NGX_ENOPATH ENOENT
-#define NGX_ESRCH ESRCH
-#define NGX_EINTR EINTR
-#define NGX_ECHILD ECHILD
-#define NGX_ENOMEM ENOMEM
-#define NGX_EACCES EACCES
-#define NGX_EBUSY EBUSY
-#define NGX_EEXIST EEXIST
-#define NGX_EXDEV EXDEV
-#define NGX_ENOTDIR ENOTDIR
-#define NGX_EISDIR EISDIR
-#define NGX_EINVAL EINVAL
-#define NGX_ENFILE ENFILE
-#define NGX_EMFILE EMFILE
-#define NGX_ENOSPC ENOSPC
-#define NGX_EPIPE EPIPE
-#define NGX_EINPROGRESS EINPROGRESS
-#define NGX_ENOPROTOOPT ENOPROTOOPT
-#define NGX_EOPNOTSUPP EOPNOTSUPP
-#define NGX_EADDRINUSE EADDRINUSE
-#define NGX_ECONNABORTED ECONNABORTED
-#define NGX_ECONNRESET ECONNRESET
-#define NGX_ENOTCONN ENOTCONN
-#define NGX_ETIMEDOUT ETIMEDOUT
-#define NGX_ECONNREFUSED ECONNREFUSED
-#define NGX_ENAMETOOLONG ENAMETOOLONG
-#define NGX_ENETDOWN ENETDOWN
-#define NGX_ENETUNREACH ENETUNREACH
-#define NGX_EHOSTDOWN EHOSTDOWN
-#define NGX_EHOSTUNREACH EHOSTUNREACH
-#define NGX_ENOSYS ENOSYS
-#define NGX_ECANCELED ECANCELED
-#define NGX_EILSEQ EILSEQ
-#define NGX_ENOMOREFILES 0
-#define NGX_ELOOP ELOOP
-#define NGX_EBADF EBADF
-
-#if (NGX_HAVE_OPENAT)
-#define NGX_EMLINK EMLINK
-#endif
-
-#if (__hpux__)
-#define NGX_EAGAIN EWOULDBLOCK
-#else
-#define NGX_EAGAIN EAGAIN
-#endif
-
-
-#define ngx_errno errno
-#define ngx_socket_errno errno
-#define ngx_set_errno(err) errno = err
-#define ngx_set_socket_errno(err) errno = err
-
-
-u_char *ngx_strerror(ngx_err_t err, u_char *errstr, size_t size);
-ngx_int_t ngx_strerror_init(void);
-
-
-#endif /* _NGX_ERRNO_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_file_aio_read.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_file_aio_read.c
deleted file mode 100644
index 0bb383de551..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_file_aio_read.c
+++ /dev/null
@@ -1,208 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-/*
- * FreeBSD file AIO features and quirks:
- *
- * if an asked data are already in VM cache, then aio_error() returns 0,
- * and the data are already copied in buffer;
- *
- * aio_read() preread in VM cache as minimum 16K (probably BKVASIZE);
- * the first AIO preload may be up to 128K;
- *
- * aio_read/aio_error() may return EINPROGRESS for just written data;
- *
- * kqueue EVFILT_AIO filter is level triggered only: an event repeats
- * until aio_return() will be called;
- *
- * aio_cancel() cannot cancel file AIO: it returns AIO_NOTCANCELED always.
- */
-
-
-extern int ngx_kqueue;
-
-
-static ssize_t ngx_file_aio_result(ngx_file_t *file, ngx_event_aio_t *aio,
- ngx_event_t *ev);
-static void ngx_file_aio_event_handler(ngx_event_t *ev);
-
-
-ssize_t
-ngx_file_aio_read(ngx_file_t *file, u_char *buf, size_t size, off_t offset,
- ngx_pool_t *pool)
-{
- int n;
- ngx_event_t *ev;
- ngx_event_aio_t *aio;
-
- if (!ngx_file_aio) {
- return ngx_read_file(file, buf, size, offset);
- }
-
- aio = file->aio;
-
- if (aio == NULL) {
- aio = ngx_pcalloc(pool, sizeof(ngx_event_aio_t));
- if (aio == NULL) {
- return NGX_ERROR;
- }
-
- aio->file = file;
- aio->fd = file->fd;
- aio->event.data = aio;
- aio->event.ready = 1;
- aio->event.log = file->log;
-#if (NGX_HAVE_AIO_SENDFILE)
- aio->last_offset = -1;
-#endif
- file->aio = aio;
- }
-
- ev = &aio->event;
-
- if (!ev->ready) {
- ngx_log_error(NGX_LOG_ALERT, file->log, 0,
- "second aio post for \"%V\"", &file->name);
- return NGX_AGAIN;
- }
-
- ngx_log_debug4(NGX_LOG_DEBUG_CORE, file->log, 0,
- "aio complete:%d @%O:%z %V",
- ev->complete, offset, size, &file->name);
-
- if (ev->complete) {
- ev->complete = 0;
- ngx_set_errno(aio->err);
-
- if (aio->err == 0) {
- return aio->nbytes;
- }
-
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "aio read \"%s\" failed", file->name.data);
-
- return NGX_ERROR;
- }
-
- ngx_memzero(&aio->aiocb, sizeof(struct aiocb));
-
- aio->aiocb.aio_fildes = file->fd;
- aio->aiocb.aio_offset = offset;
- aio->aiocb.aio_buf = buf;
- aio->aiocb.aio_nbytes = size;
-#if (NGX_HAVE_KQUEUE)
- aio->aiocb.aio_sigevent.sigev_notify_kqueue = ngx_kqueue;
- aio->aiocb.aio_sigevent.sigev_notify = SIGEV_KEVENT;
- aio->aiocb.aio_sigevent.sigev_value.sigval_ptr = ev;
-#endif
- ev->handler = ngx_file_aio_event_handler;
-
- n = aio_read(&aio->aiocb);
-
- if (n == -1) {
- n = ngx_errno;
-
- if (n == NGX_EAGAIN) {
- return ngx_read_file(file, buf, size, offset);
- }
-
- ngx_log_error(NGX_LOG_CRIT, file->log, n,
- "aio_read(\"%V\") failed", &file->name);
-
- if (n == NGX_ENOSYS) {
- ngx_file_aio = 0;
- return ngx_read_file(file, buf, size, offset);
- }
-
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, file->log, 0,
- "aio_read: fd:%d %d", file->fd, n);
-
- ev->active = 1;
- ev->ready = 0;
- ev->complete = 0;
-
- return ngx_file_aio_result(aio->file, aio, ev);
-}
-
-
-static ssize_t
-ngx_file_aio_result(ngx_file_t *file, ngx_event_aio_t *aio, ngx_event_t *ev)
-{
- int n;
- ngx_err_t err;
-
- n = aio_error(&aio->aiocb);
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, file->log, 0,
- "aio_error: fd:%d %d", file->fd, n);
-
- if (n == -1) {
- err = ngx_errno;
- aio->err = err;
-
- ngx_log_error(NGX_LOG_ALERT, file->log, err,
- "aio_error(\"%V\") failed", &file->name);
- return NGX_ERROR;
- }
-
- if (n == NGX_EINPROGRESS) {
- if (ev->ready) {
- ev->ready = 0;
- ngx_log_error(NGX_LOG_ALERT, file->log, n,
- "aio_read(\"%V\") still in progress",
- &file->name);
- }
-
- return NGX_AGAIN;
- }
-
- n = aio_return(&aio->aiocb);
-
- if (n == -1) {
- err = ngx_errno;
- aio->err = err;
- ev->ready = 1;
-
- ngx_log_error(NGX_LOG_CRIT, file->log, err,
- "aio_return(\"%V\") failed", &file->name);
- return NGX_ERROR;
- }
-
- aio->err = 0;
- aio->nbytes = n;
- ev->ready = 1;
- ev->active = 0;
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, file->log, 0,
- "aio_return: fd:%d %d", file->fd, n);
-
- return n;
-}
-
-
-static void
-ngx_file_aio_event_handler(ngx_event_t *ev)
-{
- ngx_event_aio_t *aio;
-
- aio = ev->data;
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, ev->log, 0,
- "aio event handler fd:%d %V", aio->fd, &aio->file->name);
-
- if (ngx_file_aio_result(aio->file, aio, ev) != NGX_AGAIN) {
- aio->handler(ev);
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.c
deleted file mode 100644
index c3ae47fdbf6..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.c
+++ /dev/null
@@ -1,564 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-#if (NGX_HAVE_FILE_AIO)
-
-ngx_uint_t ngx_file_aio = 1;
-
-#endif
-
-
-ssize_t
-ngx_read_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset)
-{
- ssize_t n;
-
- ngx_log_debug4(NGX_LOG_DEBUG_CORE, file->log, 0,
- "read: %d, %p, %uz, %O", file->fd, buf, size, offset);
-
-#if (NGX_HAVE_PREAD)
-
- n = pread(file->fd, buf, size, offset);
-
- if (n == -1) {
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "pread() \"%s\" failed", file->name.data);
- return NGX_ERROR;
- }
-
-#else
-
- if (file->sys_offset != offset) {
- if (lseek(file->fd, offset, SEEK_SET) == -1) {
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "lseek() \"%s\" failed", file->name.data);
- return NGX_ERROR;
- }
-
- file->sys_offset = offset;
- }
-
- n = read(file->fd, buf, size);
-
- if (n == -1) {
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "read() \"%s\" failed", file->name.data);
- return NGX_ERROR;
- }
-
- file->sys_offset += n;
-
-#endif
-
- file->offset += n;
-
- return n;
-}
-
-
-ssize_t
-ngx_write_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset)
-{
- ssize_t n, written;
-
- ngx_log_debug4(NGX_LOG_DEBUG_CORE, file->log, 0,
- "write: %d, %p, %uz, %O", file->fd, buf, size, offset);
-
- written = 0;
-
-#if (NGX_HAVE_PWRITE)
-
- for ( ;; ) {
- n = pwrite(file->fd, buf + written, size, offset);
-
- if (n == -1) {
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "pwrite() \"%s\" failed", file->name.data);
- return NGX_ERROR;
- }
-
- file->offset += n;
- written += n;
-
- if ((size_t) n == size) {
- return written;
- }
-
- offset += n;
- size -= n;
- }
-
-#else
-
- if (file->sys_offset != offset) {
- if (lseek(file->fd, offset, SEEK_SET) == -1) {
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "lseek() \"%s\" failed", file->name.data);
- return NGX_ERROR;
- }
-
- file->sys_offset = offset;
- }
-
- for ( ;; ) {
- n = write(file->fd, buf + written, size);
-
- if (n == -1) {
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "write() \"%s\" failed", file->name.data);
- return NGX_ERROR;
- }
-
- file->offset += n;
- written += n;
-
- if ((size_t) n == size) {
- return written;
- }
-
- size -= n;
- }
-#endif
-}
-
-
-ngx_fd_t
-ngx_open_tempfile(u_char *name, ngx_uint_t persistent, ngx_uint_t access)
-{
- ngx_fd_t fd;
-
- fd = open((const char *) name, O_CREAT|O_EXCL|O_RDWR,
- access ? access : 0600);
-
- if (fd != -1 && !persistent) {
- (void) unlink((const char *) name);
- }
-
- return fd;
-}
-
-
-#define NGX_IOVS 8
-
-ssize_t
-ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *cl, off_t offset,
- ngx_pool_t *pool)
-{
- u_char *prev;
- size_t size;
- ssize_t total, n;
- ngx_array_t vec;
- struct iovec *iov, iovs[NGX_IOVS];
-
- /* use pwrite() if there is the only buf in a chain */
-
- if (cl->next == NULL) {
- return ngx_write_file(file, cl->buf->pos,
- (size_t) (cl->buf->last - cl->buf->pos),
- offset);
- }
-
- total = 0;
-
- vec.elts = iovs;
- vec.size = sizeof(struct iovec);
- vec.nalloc = NGX_IOVS;
- vec.pool = pool;
-
- do {
- prev = NULL;
- iov = NULL;
- size = 0;
-
- vec.nelts = 0;
-
- /* create the iovec and coalesce the neighbouring bufs */
-
- while (cl && vec.nelts < IOV_MAX) {
- if (prev == cl->buf->pos) {
- iov->iov_len += cl->buf->last - cl->buf->pos;
-
- } else {
- iov = ngx_array_push(&vec);
- if (iov == NULL) {
- return NGX_ERROR;
- }
-
- iov->iov_base = (void *) cl->buf->pos;
- iov->iov_len = cl->buf->last - cl->buf->pos;
- }
-
- size += cl->buf->last - cl->buf->pos;
- prev = cl->buf->last;
- cl = cl->next;
- }
-
- /* use pwrite() if there is the only iovec buffer */
-
- if (vec.nelts == 1) {
- iov = vec.elts;
-
- n = ngx_write_file(file, (u_char *) iov[0].iov_base,
- iov[0].iov_len, offset);
-
- if (n == NGX_ERROR) {
- return n;
- }
-
- return total + n;
- }
-
- if (file->sys_offset != offset) {
- if (lseek(file->fd, offset, SEEK_SET) == -1) {
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "lseek() \"%s\" failed", file->name.data);
- return NGX_ERROR;
- }
-
- file->sys_offset = offset;
- }
-
- n = writev(file->fd, vec.elts, vec.nelts);
-
- if (n == -1) {
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "writev() \"%s\" failed", file->name.data);
- return NGX_ERROR;
- }
-
- if ((size_t) n != size) {
- ngx_log_error(NGX_LOG_CRIT, file->log, 0,
- "writev() \"%s\" has written only %z of %uz",
- file->name.data, n, size);
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, file->log, 0,
- "writev: %d, %z", file->fd, n);
-
- file->sys_offset += n;
- file->offset += n;
- offset += n;
- total += n;
-
- } while (cl);
-
- return total;
-}
-
-
-ngx_int_t
-ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s)
-{
- struct timeval tv[2];
-
- tv[0].tv_sec = ngx_time();
- tv[0].tv_usec = 0;
- tv[1].tv_sec = s;
- tv[1].tv_usec = 0;
-
- if (utimes((char *) name, tv) != -1) {
- return NGX_OK;
- }
-
- return NGX_ERROR;
-}
-
-
-ngx_int_t
-ngx_create_file_mapping(ngx_file_mapping_t *fm)
-{
- fm->fd = ngx_open_file(fm->name, NGX_FILE_RDWR, NGX_FILE_TRUNCATE,
- NGX_FILE_DEFAULT_ACCESS);
- if (fm->fd == NGX_INVALID_FILE) {
- ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno,
- ngx_open_file_n " \"%s\" failed", fm->name);
- return NGX_ERROR;
- }
-
- if (ftruncate(fm->fd, fm->size) == -1) {
- ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno,
- "ftruncate() \"%s\" failed", fm->name);
- goto failed;
- }
-
- fm->addr = mmap(NULL, fm->size, PROT_READ|PROT_WRITE, MAP_SHARED,
- fm->fd, 0);
- if (fm->addr != MAP_FAILED) {
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno,
- "mmap(%uz) \"%s\" failed", fm->size, fm->name);
-
-failed:
-
- if (ngx_close_file(fm->fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, fm->log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", fm->name);
- }
-
- return NGX_ERROR;
-}
-
-
-void
-ngx_close_file_mapping(ngx_file_mapping_t *fm)
-{
- if (munmap(fm->addr, fm->size) == -1) {
- ngx_log_error(NGX_LOG_CRIT, fm->log, ngx_errno,
- "munmap(%uz) \"%s\" failed", fm->size, fm->name);
- }
-
- if (ngx_close_file(fm->fd) == NGX_FILE_ERROR) {
- ngx_log_error(NGX_LOG_ALERT, fm->log, ngx_errno,
- ngx_close_file_n " \"%s\" failed", fm->name);
- }
-}
-
-
-ngx_int_t
-ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir)
-{
- dir->dir = opendir((const char *) name->data);
-
- if (dir->dir == NULL) {
- return NGX_ERROR;
- }
-
- dir->valid_info = 0;
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_read_dir(ngx_dir_t *dir)
-{
- dir->de = readdir(dir->dir);
-
- if (dir->de) {
-#if (NGX_HAVE_D_TYPE)
- dir->type = dir->de->d_type;
-#else
- dir->type = 0;
-#endif
- return NGX_OK;
- }
-
- return NGX_ERROR;
-}
-
-
-ngx_int_t
-ngx_open_glob(ngx_glob_t *gl)
-{
- int n;
-
- n = glob((char *) gl->pattern, 0, NULL, &gl->pglob);
-
- if (n == 0) {
- return NGX_OK;
- }
-
-#ifdef GLOB_NOMATCH
-
- if (n == GLOB_NOMATCH && gl->test) {
- return NGX_OK;
- }
-
-#endif
-
- return NGX_ERROR;
-}
-
-
-ngx_int_t
-ngx_read_glob(ngx_glob_t *gl, ngx_str_t *name)
-{
- size_t count;
-
-#ifdef GLOB_NOMATCH
- count = (size_t) gl->pglob.gl_pathc;
-#else
- count = (size_t) gl->pglob.gl_matchc;
-#endif
-
- if (gl->n < count) {
-
- name->len = (size_t) ngx_strlen(gl->pglob.gl_pathv[gl->n]);
- name->data = (u_char *) gl->pglob.gl_pathv[gl->n];
- gl->n++;
-
- return NGX_OK;
- }
-
- return NGX_DONE;
-}
-
-
-void
-ngx_close_glob(ngx_glob_t *gl)
-{
- globfree(&gl->pglob);
-}
-
-
-ngx_err_t
-ngx_trylock_fd(ngx_fd_t fd)
-{
- struct flock fl;
-
- ngx_memzero(&fl, sizeof(struct flock));
- fl.l_type = F_WRLCK;
- fl.l_whence = SEEK_SET;
-
- if (fcntl(fd, F_SETLK, &fl) == -1) {
- return ngx_errno;
- }
-
- return 0;
-}
-
-
-ngx_err_t
-ngx_lock_fd(ngx_fd_t fd)
-{
- struct flock fl;
-
- ngx_memzero(&fl, sizeof(struct flock));
- fl.l_type = F_WRLCK;
- fl.l_whence = SEEK_SET;
-
- if (fcntl(fd, F_SETLKW, &fl) == -1) {
- return ngx_errno;
- }
-
- return 0;
-}
-
-
-ngx_err_t
-ngx_unlock_fd(ngx_fd_t fd)
-{
- struct flock fl;
-
- ngx_memzero(&fl, sizeof(struct flock));
- fl.l_type = F_UNLCK;
- fl.l_whence = SEEK_SET;
-
- if (fcntl(fd, F_SETLK, &fl) == -1) {
- return ngx_errno;
- }
-
- return 0;
-}
-
-
-#if (NGX_HAVE_POSIX_FADVISE) && !(NGX_HAVE_F_READAHEAD)
-
-ngx_int_t
-ngx_read_ahead(ngx_fd_t fd, size_t n)
-{
- int err;
-
- err = posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
-
- if (err == 0) {
- return 0;
- }
-
- ngx_set_errno(err);
- return NGX_FILE_ERROR;
-}
-
-#endif
-
-
-#if (NGX_HAVE_O_DIRECT)
-
-ngx_int_t
-ngx_directio_on(ngx_fd_t fd)
-{
- int flags;
-
- flags = fcntl(fd, F_GETFL);
-
- if (flags == -1) {
- return NGX_FILE_ERROR;
- }
-
- return fcntl(fd, F_SETFL, flags | O_DIRECT);
-}
-
-
-ngx_int_t
-ngx_directio_off(ngx_fd_t fd)
-{
- int flags;
-
- flags = fcntl(fd, F_GETFL);
-
- if (flags == -1) {
- return NGX_FILE_ERROR;
- }
-
- return fcntl(fd, F_SETFL, flags & ~O_DIRECT);
-}
-
-#endif
-
-
-#if (NGX_HAVE_STATFS)
-
-size_t
-ngx_fs_bsize(u_char *name)
-{
- struct statfs fs;
-
- if (statfs((char *) name, &fs) == -1) {
- return 512;
- }
-
- if ((fs.f_bsize % 512) != 0) {
- return 512;
- }
-
- return (size_t) fs.f_bsize;
-}
-
-#elif (NGX_HAVE_STATVFS)
-
-size_t
-ngx_fs_bsize(u_char *name)
-{
- struct statvfs fs;
-
- if (statvfs((char *) name, &fs) == -1) {
- return 512;
- }
-
- if ((fs.f_frsize % 512) != 0) {
- return 512;
- }
-
- return (size_t) fs.f_frsize;
-}
-
-#else
-
-size_t
-ngx_fs_bsize(u_char *name)
-{
- return 512;
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.h
deleted file mode 100644
index a78ec961365..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_files.h
+++ /dev/null
@@ -1,386 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_FILES_H_INCLUDED_
-#define _NGX_FILES_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-typedef int ngx_fd_t;
-typedef struct stat ngx_file_info_t;
-typedef ino_t ngx_file_uniq_t;
-
-
-typedef struct {
- u_char *name;
- size_t size;
- void *addr;
- ngx_fd_t fd;
- ngx_log_t *log;
-} ngx_file_mapping_t;
-
-
-typedef struct {
- DIR *dir;
- struct dirent *de;
- struct stat info;
-
- unsigned type:8;
- unsigned valid_info:1;
-} ngx_dir_t;
-
-
-typedef struct {
- size_t n;
- glob_t pglob;
- u_char *pattern;
- ngx_log_t *log;
- ngx_uint_t test;
-} ngx_glob_t;
-
-
-#define NGX_INVALID_FILE -1
-#define NGX_FILE_ERROR -1
-
-
-
-#ifdef __CYGWIN__
-
-#ifndef NGX_HAVE_CASELESS_FILESYSTEM
-#define NGX_HAVE_CASELESS_FILESYSTEM 1
-#endif
-
-#define ngx_open_file(name, mode, create, access) \
- open((const char *) name, mode|create|O_BINARY, access)
-
-#else
-
-#define ngx_open_file(name, mode, create, access) \
- open((const char *) name, mode|create, access)
-
-#endif
-
-#define ngx_open_file_n "open()"
-
-#define NGX_FILE_RDONLY O_RDONLY
-#define NGX_FILE_WRONLY O_WRONLY
-#define NGX_FILE_RDWR O_RDWR
-#define NGX_FILE_CREATE_OR_OPEN O_CREAT
-#define NGX_FILE_OPEN 0
-#define NGX_FILE_TRUNCATE (O_CREAT|O_TRUNC)
-#define NGX_FILE_APPEND (O_WRONLY|O_APPEND)
-#define NGX_FILE_NONBLOCK O_NONBLOCK
-
-#if (NGX_HAVE_OPENAT)
-#define NGX_FILE_NOFOLLOW O_NOFOLLOW
-
-#if defined(O_DIRECTORY)
-#define NGX_FILE_DIRECTORY O_DIRECTORY
-#else
-#define NGX_FILE_DIRECTORY 0
-#endif
-
-#if defined(O_SEARCH)
-#define NGX_FILE_SEARCH (O_SEARCH|NGX_FILE_DIRECTORY)
-
-#elif defined(O_EXEC)
-#define NGX_FILE_SEARCH (O_EXEC|NGX_FILE_DIRECTORY)
-
-#elif (NGX_HAVE_O_PATH)
-#define NGX_FILE_SEARCH (O_PATH|O_RDONLY|NGX_FILE_DIRECTORY)
-
-#else
-#define NGX_FILE_SEARCH (O_RDONLY|NGX_FILE_DIRECTORY)
-#endif
-
-#endif /* NGX_HAVE_OPENAT */
-
-#define NGX_FILE_DEFAULT_ACCESS 0644
-#define NGX_FILE_OWNER_ACCESS 0600
-
-
-#define ngx_close_file close
-#define ngx_close_file_n "close()"
-
-
-#define ngx_delete_file(name) unlink((const char *) name)
-#define ngx_delete_file_n "unlink()"
-
-
-ngx_fd_t ngx_open_tempfile(u_char *name, ngx_uint_t persistent,
- ngx_uint_t access);
-#define ngx_open_tempfile_n "open()"
-
-
-ssize_t ngx_read_file(ngx_file_t *file, u_char *buf, size_t size, off_t offset);
-#if (NGX_HAVE_PREAD)
-#define ngx_read_file_n "pread()"
-#else
-#define ngx_read_file_n "read()"
-#endif
-
-ssize_t ngx_write_file(ngx_file_t *file, u_char *buf, size_t size,
- off_t offset);
-
-ssize_t ngx_write_chain_to_file(ngx_file_t *file, ngx_chain_t *ce,
- off_t offset, ngx_pool_t *pool);
-
-
-#define ngx_read_fd read
-#define ngx_read_fd_n "read()"
-
-/*
- * we use inlined function instead of simple #define
- * because glibc 2.3 sets warn_unused_result attribute for write()
- * and in this case gcc 4.3 ignores (void) cast
- */
-static ngx_inline ssize_t
-ngx_write_fd(ngx_fd_t fd, void *buf, size_t n)
-{
- return write(fd, buf, n);
-}
-
-#define ngx_write_fd_n "write()"
-
-
-#define ngx_write_console ngx_write_fd
-
-
-#define ngx_linefeed(p) *p++ = LF;
-#define NGX_LINEFEED_SIZE 1
-#define NGX_LINEFEED "\x0a"
-
-
-#define ngx_rename_file(o, n) rename((const char *) o, (const char *) n)
-#define ngx_rename_file_n "rename()"
-
-
-#define ngx_change_file_access(n, a) chmod((const char *) n, a)
-#define ngx_change_file_access_n "chmod()"
-
-
-ngx_int_t ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s);
-#define ngx_set_file_time_n "utimes()"
-
-
-#define ngx_file_info(file, sb) stat((const char *) file, sb)
-#define ngx_file_info_n "stat()"
-
-#define ngx_fd_info(fd, sb) fstat(fd, sb)
-#define ngx_fd_info_n "fstat()"
-
-#define ngx_link_info(file, sb) lstat((const char *) file, sb)
-#define ngx_link_info_n "lstat()"
-
-#define ngx_is_dir(sb) (S_ISDIR((sb)->st_mode))
-#define ngx_is_file(sb) (S_ISREG((sb)->st_mode))
-#define ngx_is_link(sb) (S_ISLNK((sb)->st_mode))
-#define ngx_is_exec(sb) (((sb)->st_mode & S_IXUSR) == S_IXUSR)
-#define ngx_file_access(sb) ((sb)->st_mode & 0777)
-#define ngx_file_size(sb) (sb)->st_size
-#define ngx_file_fs_size(sb) ngx_max((sb)->st_size, (sb)->st_blocks * 512)
-#define ngx_file_mtime(sb) (sb)->st_mtime
-#define ngx_file_uniq(sb) (sb)->st_ino
-
-
-ngx_int_t ngx_create_file_mapping(ngx_file_mapping_t *fm);
-void ngx_close_file_mapping(ngx_file_mapping_t *fm);
-
-
-#define ngx_realpath(p, r) (u_char *) realpath((char *) p, (char *) r)
-#define ngx_realpath_n "realpath()"
-#define ngx_getcwd(buf, size) (getcwd((char *) buf, size) != NULL)
-#define ngx_getcwd_n "getcwd()"
-#define ngx_path_separator(c) ((c) == '/')
-
-
-#if defined(PATH_MAX)
-
-#define NGX_HAVE_MAX_PATH 1
-#define NGX_MAX_PATH PATH_MAX
-
-#else
-
-#define NGX_MAX_PATH 4096
-
-#endif
-
-
-#define NGX_DIR_MASK_LEN 0
-
-
-ngx_int_t ngx_open_dir(ngx_str_t *name, ngx_dir_t *dir);
-#define ngx_open_dir_n "opendir()"
-
-
-#define ngx_close_dir(d) closedir((d)->dir)
-#define ngx_close_dir_n "closedir()"
-
-
-ngx_int_t ngx_read_dir(ngx_dir_t *dir);
-#define ngx_read_dir_n "readdir()"
-
-
-#define ngx_create_dir(name, access) mkdir((const char *) name, access)
-#define ngx_create_dir_n "mkdir()"
-
-
-#define ngx_delete_dir(name) rmdir((const char *) name)
-#define ngx_delete_dir_n "rmdir()"
-
-
-#define ngx_dir_access(a) (a | (a & 0444) >> 2)
-
-
-#define ngx_de_name(dir) ((u_char *) (dir)->de->d_name)
-#if (NGX_HAVE_D_NAMLEN)
-#define ngx_de_namelen(dir) (dir)->de->d_namlen
-#else
-#define ngx_de_namelen(dir) ngx_strlen((dir)->de->d_name)
-#endif
-
-static ngx_inline ngx_int_t
-ngx_de_info(u_char *name, ngx_dir_t *dir)
-{
- dir->type = 0;
- return stat((const char *) name, &dir->info);
-}
-
-#define ngx_de_info_n "stat()"
-#define ngx_de_link_info(name, dir) lstat((const char *) name, &(dir)->info)
-#define ngx_de_link_info_n "lstat()"
-
-#if (NGX_HAVE_D_TYPE)
-
-/*
- * some file systems (e.g. XFS on Linux and CD9660 on FreeBSD)
- * do not set dirent.d_type
- */
-
-#define ngx_de_is_dir(dir) \
- (((dir)->type) ? ((dir)->type == DT_DIR) : (S_ISDIR((dir)->info.st_mode)))
-#define ngx_de_is_file(dir) \
- (((dir)->type) ? ((dir)->type == DT_REG) : (S_ISREG((dir)->info.st_mode)))
-#define ngx_de_is_link(dir) \
- (((dir)->type) ? ((dir)->type == DT_LNK) : (S_ISLNK((dir)->info.st_mode)))
-
-#else
-
-#define ngx_de_is_dir(dir) (S_ISDIR((dir)->info.st_mode))
-#define ngx_de_is_file(dir) (S_ISREG((dir)->info.st_mode))
-#define ngx_de_is_link(dir) (S_ISLNK((dir)->info.st_mode))
-
-#endif
-
-#define ngx_de_access(dir) (((dir)->info.st_mode) & 0777)
-#define ngx_de_size(dir) (dir)->info.st_size
-#define ngx_de_fs_size(dir) \
- ngx_max((dir)->info.st_size, (dir)->info.st_blocks * 512)
-#define ngx_de_mtime(dir) (dir)->info.st_mtime
-
-
-ngx_int_t ngx_open_glob(ngx_glob_t *gl);
-#define ngx_open_glob_n "glob()"
-ngx_int_t ngx_read_glob(ngx_glob_t *gl, ngx_str_t *name);
-void ngx_close_glob(ngx_glob_t *gl);
-
-
-ngx_err_t ngx_trylock_fd(ngx_fd_t fd);
-ngx_err_t ngx_lock_fd(ngx_fd_t fd);
-ngx_err_t ngx_unlock_fd(ngx_fd_t fd);
-
-#define ngx_trylock_fd_n "fcntl(F_SETLK, F_WRLCK)"
-#define ngx_lock_fd_n "fcntl(F_SETLKW, F_WRLCK)"
-#define ngx_unlock_fd_n "fcntl(F_SETLK, F_UNLCK)"
-
-
-#if (NGX_HAVE_F_READAHEAD)
-
-#define NGX_HAVE_READ_AHEAD 1
-
-#define ngx_read_ahead(fd, n) fcntl(fd, F_READAHEAD, (int) n)
-#define ngx_read_ahead_n "fcntl(fd, F_READAHEAD)"
-
-#elif (NGX_HAVE_POSIX_FADVISE)
-
-#define NGX_HAVE_READ_AHEAD 1
-
-ngx_int_t ngx_read_ahead(ngx_fd_t fd, size_t n);
-#define ngx_read_ahead_n "posix_fadvise(POSIX_FADV_SEQUENTIAL)"
-
-#else
-
-#define ngx_read_ahead(fd, n) 0
-#define ngx_read_ahead_n "ngx_read_ahead_n"
-
-#endif
-
-
-#if (NGX_HAVE_O_DIRECT)
-
-ngx_int_t ngx_directio_on(ngx_fd_t fd);
-#define ngx_directio_on_n "fcntl(O_DIRECT)"
-
-ngx_int_t ngx_directio_off(ngx_fd_t fd);
-#define ngx_directio_off_n "fcntl(!O_DIRECT)"
-
-#elif (NGX_HAVE_F_NOCACHE)
-
-#define ngx_directio_on(fd) fcntl(fd, F_NOCACHE, 1)
-#define ngx_directio_on_n "fcntl(F_NOCACHE, 1)"
-
-#elif (NGX_HAVE_DIRECTIO)
-
-#define ngx_directio_on(fd) directio(fd, DIRECTIO_ON)
-#define ngx_directio_on_n "directio(DIRECTIO_ON)"
-
-#else
-
-#define ngx_directio_on(fd) 0
-#define ngx_directio_on_n "ngx_directio_on_n"
-
-#endif
-
-size_t ngx_fs_bsize(u_char *name);
-
-
-#if (NGX_HAVE_OPENAT)
-
-#define ngx_openat_file(fd, name, mode, create, access) \
- openat(fd, (const char *) name, mode|create, access)
-
-#define ngx_openat_file_n "openat()"
-
-#define ngx_file_at_info(fd, name, sb, flag) \
- fstatat(fd, (const char *) name, sb, flag)
-
-#define ngx_file_at_info_n "fstatat()"
-
-#define NGX_AT_FDCWD (ngx_fd_t) AT_FDCWD
-
-#endif
-
-
-#define ngx_stderr STDERR_FILENO
-#define ngx_set_stderr(fd) dup2(fd, STDERR_FILENO)
-#define ngx_set_stderr_n "dup2(STDERR_FILENO)"
-
-
-#if (NGX_HAVE_FILE_AIO)
-
-ssize_t ngx_file_aio_read(ngx_file_t *file, u_char *buf, size_t size,
- off_t offset, ngx_pool_t *pool);
-
-extern ngx_uint_t ngx_file_aio;
-
-#endif
-
-
-#endif /* _NGX_FILES_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd.h
deleted file mode 100644
index 4f93da55cd2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd.h
+++ /dev/null
@@ -1,25 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_FREEBSD_H_INCLUDED_
-#define _NGX_FREEBSD_H_INCLUDED_
-
-
-void ngx_debug_init(void);
-ngx_chain_t *ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in,
- off_t limit);
-
-extern int ngx_freebsd_kern_osreldate;
-extern int ngx_freebsd_hw_ncpu;
-extern u_long ngx_freebsd_net_inet_tcp_sendspace;
-
-extern ngx_uint_t ngx_freebsd_sendfile_nbytes_bug;
-extern ngx_uint_t ngx_freebsd_use_tcp_nopush;
-extern ngx_uint_t ngx_debug_malloc;
-
-
-#endif /* _NGX_FREEBSD_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_config.h
deleted file mode 100644
index 92b2928c8b5..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_config.h
+++ /dev/null
@@ -1,127 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_FREEBSD_CONFIG_H_INCLUDED_
-#define _NGX_FREEBSD_CONFIG_H_INCLUDED_
-
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <stdarg.h>
-#include <stddef.h> /* offsetof() */
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <pwd.h>
-#include <grp.h>
-#include <dirent.h>
-#include <glob.h>
-#include <time.h>
-#include <sys/param.h> /* ALIGN() */
-#include <sys/mount.h> /* statfs() */
-
-#include <sys/filio.h> /* FIONBIO */
-#include <sys/uio.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <sys/wait.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-#include <sched.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h> /* TCP_NODELAY, TCP_NOPUSH */
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <sys/un.h>
-
-#include <libutil.h> /* setproctitle() before 4.1 */
-#include <osreldate.h>
-#include <sys/sysctl.h>
-
-
-#if __FreeBSD_version < 400017
-
-/*
- * FreeBSD 3.x has no CMSG_SPACE() and CMSG_LEN() and has the broken CMSG_DATA()
- */
-
-#undef CMSG_SPACE
-#define CMSG_SPACE(l) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l))
-
-#undef CMSG_LEN
-#define CMSG_LEN(l) (ALIGN(sizeof(struct cmsghdr)) + (l))
-
-#undef CMSG_DATA
-#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr)))
-
-#endif
-
-
-#include <ngx_auto_config.h>
-
-
-#if (NGX_HAVE_POSIX_SEM)
-#include <semaphore.h>
-#endif
-
-
-#if (NGX_HAVE_POLL)
-#include <poll.h>
-#endif
-
-
-#if (NGX_HAVE_KQUEUE)
-#include <sys/event.h>
-#endif
-
-
-#if (NGX_HAVE_FILE_AIO || NGX_HAVE_AIO)
-#include <aio.h>
-typedef struct aiocb ngx_aiocb_t;
-#endif
-
-
-#define NGX_LISTEN_BACKLOG -1
-
-
-#ifdef __DragonFly__
-#define NGX_KEEPALIVE_FACTOR 1000
-#endif
-
-
-#if (__FreeBSD_version < 430000 || __FreeBSD_version < 500012)
-
-pid_t rfork_thread(int flags, void *stack, int (*func)(void *arg), void *arg);
-
-#endif
-
-#ifndef IOV_MAX
-#define IOV_MAX 1024
-#endif
-
-
-#ifndef NGX_HAVE_INHERITED_NONBLOCK
-#define NGX_HAVE_INHERITED_NONBLOCK 1
-#endif
-
-
-#define NGX_HAVE_OS_SPECIFIC_INIT 1
-#define NGX_HAVE_DEBUG_MALLOC 1
-
-
-extern char **environ;
-extern char *malloc_options;
-
-
-#endif /* _NGX_FREEBSD_CONFIG_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_init.c
deleted file mode 100644
index c4c12dd741c..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_init.c
+++ /dev/null
@@ -1,260 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-/* FreeBSD 3.0 at least */
-char ngx_freebsd_kern_ostype[16];
-char ngx_freebsd_kern_osrelease[128];
-int ngx_freebsd_kern_osreldate;
-int ngx_freebsd_hw_ncpu;
-int ngx_freebsd_kern_ipc_somaxconn;
-u_long ngx_freebsd_net_inet_tcp_sendspace;
-
-/* FreeBSD 4.9 */
-int ngx_freebsd_machdep_hlt_logical_cpus;
-
-
-ngx_uint_t ngx_freebsd_sendfile_nbytes_bug;
-ngx_uint_t ngx_freebsd_use_tcp_nopush;
-
-ngx_uint_t ngx_debug_malloc;
-
-
-static ngx_os_io_t ngx_freebsd_io = {
- ngx_unix_recv,
- ngx_readv_chain,
- ngx_udp_unix_recv,
- ngx_unix_send,
-#if (NGX_HAVE_SENDFILE)
- ngx_freebsd_sendfile_chain,
- NGX_IO_SENDFILE
-#else
- ngx_writev_chain,
- 0
-#endif
-};
-
-
-typedef struct {
- char *name;
- void *value;
- size_t size;
- ngx_uint_t exists;
-} sysctl_t;
-
-
-sysctl_t sysctls[] = {
- { "hw.ncpu",
- &ngx_freebsd_hw_ncpu,
- sizeof(ngx_freebsd_hw_ncpu), 0 },
-
- { "machdep.hlt_logical_cpus",
- &ngx_freebsd_machdep_hlt_logical_cpus,
- sizeof(ngx_freebsd_machdep_hlt_logical_cpus), 0 },
-
- { "net.inet.tcp.sendspace",
- &ngx_freebsd_net_inet_tcp_sendspace,
- sizeof(ngx_freebsd_net_inet_tcp_sendspace), 0 },
-
- { "kern.ipc.somaxconn",
- &ngx_freebsd_kern_ipc_somaxconn,
- sizeof(ngx_freebsd_kern_ipc_somaxconn), 0 },
-
- { NULL, NULL, 0, 0 }
-};
-
-
-void
-ngx_debug_init(void)
-{
-#if (NGX_DEBUG_MALLOC)
-
-#if __FreeBSD_version >= 500014 && __FreeBSD_version < 1000011
- _malloc_options = "J";
-#elif __FreeBSD_version < 500014
- malloc_options = "J";
-#endif
-
- ngx_debug_malloc = 1;
-
-#else
- char *mo;
-
- mo = getenv("MALLOC_OPTIONS");
-
- if (mo && ngx_strchr(mo, 'J')) {
- ngx_debug_malloc = 1;
- }
-#endif
-}
-
-
-ngx_int_t
-ngx_os_specific_init(ngx_log_t *log)
-{
- int version;
- size_t size;
- ngx_err_t err;
- ngx_uint_t i;
-
- size = sizeof(ngx_freebsd_kern_ostype);
- if (sysctlbyname("kern.ostype",
- ngx_freebsd_kern_ostype, &size, NULL, 0) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "sysctlbyname(kern.ostype) failed");
-
- if (ngx_errno != NGX_ENOMEM) {
- return NGX_ERROR;
- }
-
- ngx_freebsd_kern_ostype[size - 1] = '\0';
- }
-
- size = sizeof(ngx_freebsd_kern_osrelease);
- if (sysctlbyname("kern.osrelease",
- ngx_freebsd_kern_osrelease, &size, NULL, 0) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "sysctlbyname(kern.osrelease) failed");
-
- if (ngx_errno != NGX_ENOMEM) {
- return NGX_ERROR;
- }
-
- ngx_freebsd_kern_osrelease[size - 1] = '\0';
- }
-
-
- size = sizeof(int);
- if (sysctlbyname("kern.osreldate",
- &ngx_freebsd_kern_osreldate, &size, NULL, 0) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "sysctlbyname(kern.osreldate) failed");
- return NGX_ERROR;
- }
-
- version = ngx_freebsd_kern_osreldate;
-
-
-#if (NGX_HAVE_SENDFILE)
-
- /*
- * The determination of the sendfile() "nbytes bug" is complex enough.
- * There are two sendfile() syscalls: a new #393 has no bug while
- * an old #336 has the bug in some versions and has not in others.
- * Besides libc_r wrapper also emulates the bug in some versions.
- * There is no way to say exactly if syscall #336 in FreeBSD circa 4.6
- * has the bug. We use the algorithm that is correct at least for
- * RELEASEs and for syscalls only (not libc_r wrapper).
- *
- * 4.6.1-RELEASE and below have the bug
- * 4.6.2-RELEASE and above have the new syscall
- *
- * We detect the new sendfile() syscall available at the compile time
- * to allow an old binary to run correctly on an updated FreeBSD system.
- */
-
-#if (__FreeBSD__ == 4 && __FreeBSD_version >= 460102) \
- || __FreeBSD_version == 460002 || __FreeBSD_version >= 500039
-
- /* a new syscall without the bug */
-
- ngx_freebsd_sendfile_nbytes_bug = 0;
-
-#else
-
- /* an old syscall that may have the bug */
-
- ngx_freebsd_sendfile_nbytes_bug = 1;
-
-#endif
-
-#endif /* NGX_HAVE_SENDFILE */
-
-
- if ((version < 500000 && version >= 440003) || version >= 500017) {
- ngx_freebsd_use_tcp_nopush = 1;
- }
-
-
- for (i = 0; sysctls[i].name; i++) {
- size = sysctls[i].size;
-
- if (sysctlbyname(sysctls[i].name, sysctls[i].value, &size, NULL, 0)
- == 0)
- {
- sysctls[i].exists = 1;
- continue;
- }
-
- err = ngx_errno;
-
- if (err == NGX_ENOENT) {
- continue;
- }
-
- ngx_log_error(NGX_LOG_ALERT, log, err,
- "sysctlbyname(%s) failed", sysctls[i].name);
- return NGX_ERROR;
- }
-
- if (ngx_freebsd_machdep_hlt_logical_cpus) {
- ngx_ncpu = ngx_freebsd_hw_ncpu / 2;
-
- } else {
- ngx_ncpu = ngx_freebsd_hw_ncpu;
- }
-
- if (version < 600008 && ngx_freebsd_kern_ipc_somaxconn > 32767) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "sysctl kern.ipc.somaxconn must be less than 32768");
- return NGX_ERROR;
- }
-
- ngx_tcp_nodelay_and_tcp_nopush = 1;
-
- ngx_os_io = ngx_freebsd_io;
-
- return NGX_OK;
-}
-
-
-void
-ngx_os_specific_status(ngx_log_t *log)
-{
- u_long value;
- ngx_uint_t i;
-
- ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
- ngx_freebsd_kern_ostype, ngx_freebsd_kern_osrelease);
-
-#ifdef __DragonFly_version
- ngx_log_error(NGX_LOG_NOTICE, log, 0,
- "kern.osreldate: %d, built on %d",
- ngx_freebsd_kern_osreldate, __DragonFly_version);
-#else
- ngx_log_error(NGX_LOG_NOTICE, log, 0,
- "kern.osreldate: %d, built on %d",
- ngx_freebsd_kern_osreldate, __FreeBSD_version);
-#endif
-
- for (i = 0; sysctls[i].name; i++) {
- if (sysctls[i].exists) {
- if (sysctls[i].size == sizeof(long)) {
- value = *(long *) sysctls[i].value;
-
- } else {
- value = *(int *) sysctls[i].value;
- }
-
- ngx_log_error(NGX_LOG_NOTICE, log, 0, "%s: %l",
- sysctls[i].name, value);
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.c
deleted file mode 100644
index e92f9a9fdd7..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.c
+++ /dev/null
@@ -1,756 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-/*
- * The threads implementation uses the rfork(RFPROC|RFTHREAD|RFMEM) syscall
- * to create threads. All threads use the stacks of the same size mmap()ed
- * below the main stack. Thus the current thread id is determined via
- * the stack pointer value.
- *
- * The mutex implementation uses the ngx_atomic_cmp_set() operation
- * to acquire a mutex and the SysV semaphore to wait on a mutex and to wake up
- * the waiting threads. The light mutex does not use semaphore, so after
- * spinning in the lock the thread calls sched_yield(). However the light
- * mutexes are intended to be used with the "trylock" operation only.
- * The SysV semop() is a cheap syscall, particularly if it has little sembuf's
- * and does not use SEM_UNDO.
- *
- * The condition variable implementation uses the signal #64.
- * The signal handler is SIG_IGN so the kill() is a cheap syscall.
- * The thread waits a signal in kevent(). The use of the EVFILT_SIGNAL
- * is safe since FreeBSD 4.10-STABLE.
- *
- * This threads implementation currently works on i386 (486+) and amd64
- * platforms only.
- */
-
-
-char *ngx_freebsd_kern_usrstack;
-size_t ngx_thread_stack_size;
-
-
-static size_t rz_size;
-static size_t usable_stack_size;
-static char *last_stack;
-
-static ngx_uint_t nthreads;
-static ngx_uint_t max_threads;
-
-static ngx_uint_t nkeys;
-static ngx_tid_t *tids; /* the threads tids array */
-void **ngx_tls; /* the threads tls's array */
-
-/* the thread-safe libc errno */
-
-static int errno0; /* the main thread's errno */
-static int *errnos; /* the threads errno's array */
-
-int *
-__error()
-{
- int tid;
-
- tid = ngx_gettid();
-
- return tid ? &errnos[tid - 1] : &errno0;
-}
-
-
-/*
- * __isthreaded enables the spinlocks in some libc functions, i.e. in malloc()
- * and some other places. Nevertheless we protect our malloc()/free() calls
- * by own mutex that is more efficient than the spinlock.
- *
- * _spinlock() is a weak referenced stub in src/lib/libc/gen/_spinlock_stub.c
- * that does nothing.
- */
-
-extern int __isthreaded;
-
-void
-_spinlock(ngx_atomic_t *lock)
-{
- ngx_int_t tries;
-
- tries = 0;
-
- for ( ;; ) {
-
- if (*lock) {
- if (ngx_ncpu > 1 && tries++ < 1000) {
- continue;
- }
-
- sched_yield();
- tries = 0;
-
- } else {
- if (ngx_atomic_cmp_set(lock, 0, 1)) {
- return;
- }
- }
- }
-}
-
-
-/*
- * Before FreeBSD 5.1 _spinunlock() is a simple #define in
- * src/lib/libc/include/spinlock.h that zeroes lock.
- *
- * Since FreeBSD 5.1 _spinunlock() is a weak referenced stub in
- * src/lib/libc/gen/_spinlock_stub.c that does nothing.
- */
-
-#ifndef _spinunlock
-
-void
-_spinunlock(ngx_atomic_t *lock)
-{
- *lock = 0;
-}
-
-#endif
-
-
-ngx_err_t
-ngx_create_thread(ngx_tid_t *tid, ngx_thread_value_t (*func)(void *arg),
- void *arg, ngx_log_t *log)
-{
- ngx_pid_t id;
- ngx_err_t err;
- char *stack, *stack_top;
-
- if (nthreads >= max_threads) {
- ngx_log_error(NGX_LOG_CRIT, log, 0,
- "no more than %ui threads can be created", max_threads);
- return NGX_ERROR;
- }
-
- last_stack -= ngx_thread_stack_size;
-
- stack = mmap(last_stack, usable_stack_size, PROT_READ|PROT_WRITE,
- MAP_STACK, -1, 0);
-
- if (stack == MAP_FAILED) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "mmap(%p:%uz, MAP_STACK) thread stack failed",
- last_stack, usable_stack_size);
- return NGX_ERROR;
- }
-
- if (stack != last_stack) {
- ngx_log_error(NGX_LOG_ALERT, log, 0,
- "stack %p address was changed to %p", last_stack, stack);
- return NGX_ERROR;
- }
-
- stack_top = stack + usable_stack_size;
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, log, 0,
- "thread stack: %p-%p", stack, stack_top);
-
- ngx_set_errno(0);
-
- id = rfork_thread(RFPROC|RFTHREAD|RFMEM, stack_top,
- (ngx_rfork_thread_func_pt) func, arg);
-
- err = ngx_errno;
-
- if (id == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, err, "rfork() failed");
-
- } else {
- *tid = id;
- nthreads = (ngx_freebsd_kern_usrstack - stack_top)
- / ngx_thread_stack_size;
- tids[nthreads] = id;
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "rfork()ed thread: %P", id);
- }
-
- return err;
-}
-
-
-ngx_int_t
-ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle)
-{
- char *red_zone, *zone;
- size_t len;
- ngx_int_t i;
- struct sigaction sa;
-
- max_threads = n + 1;
-
- for (i = 0; i < n; i++) {
- ngx_memzero(&sa, sizeof(struct sigaction));
- sa.sa_handler = SIG_IGN;
- sigemptyset(&sa.sa_mask);
- if (sigaction(NGX_CV_SIGNAL, &sa, NULL) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "sigaction(%d, SIG_IGN) failed", NGX_CV_SIGNAL);
- return NGX_ERROR;
- }
- }
-
- len = sizeof(ngx_freebsd_kern_usrstack);
- if (sysctlbyname("kern.usrstack", &ngx_freebsd_kern_usrstack, &len,
- NULL, 0) == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "sysctlbyname(kern.usrstack) failed");
- return NGX_ERROR;
- }
-
- /* the main thread stack red zone */
- rz_size = ngx_pagesize;
- red_zone = ngx_freebsd_kern_usrstack - (size + rz_size);
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, cycle->log, 0,
- "usrstack: %p red zone: %p",
- ngx_freebsd_kern_usrstack, red_zone);
-
- zone = mmap(red_zone, rz_size, PROT_NONE, MAP_ANON, -1, 0);
- if (zone == MAP_FAILED) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "mmap(%p:%uz, PROT_NONE, MAP_ANON) red zone failed",
- red_zone, rz_size);
- return NGX_ERROR;
- }
-
- if (zone != red_zone) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "red zone %p address was changed to %p", red_zone, zone);
- return NGX_ERROR;
- }
-
- /* create the thread errno' array */
-
- errnos = ngx_calloc(n * sizeof(int), cycle->log);
- if (errnos == NULL) {
- return NGX_ERROR;
- }
-
- /* create the thread tids array */
-
- tids = ngx_calloc((n + 1) * sizeof(ngx_tid_t), cycle->log);
- if (tids == NULL) {
- return NGX_ERROR;
- }
-
- tids[0] = ngx_pid;
-
- /* create the thread tls' array */
-
- ngx_tls = ngx_calloc(NGX_THREAD_KEYS_MAX * (n + 1) * sizeof(void *),
- cycle->log);
- if (ngx_tls == NULL) {
- return NGX_ERROR;
- }
-
- nthreads = 1;
-
- last_stack = zone + rz_size;
- usable_stack_size = size;
- ngx_thread_stack_size = size + rz_size;
-
- /* allow the spinlock in libc malloc() */
- __isthreaded = 1;
-
- ngx_threaded = 1;
-
- return NGX_OK;
-}
-
-
-ngx_tid_t
-ngx_thread_self(void)
-{
- ngx_int_t tid;
-
- tid = ngx_gettid();
-
- if (tids == NULL) {
- return ngx_pid;
- }
-
- return tids[tid];
-}
-
-
-ngx_err_t
-ngx_thread_key_create(ngx_tls_key_t *key)
-{
- if (nkeys >= NGX_THREAD_KEYS_MAX) {
- return NGX_ENOMEM;
- }
-
- *key = nkeys++;
-
- return 0;
-}
-
-
-ngx_err_t
-ngx_thread_set_tls(ngx_tls_key_t key, void *value)
-{
- if (key >= NGX_THREAD_KEYS_MAX) {
- return NGX_EINVAL;
- }
-
- ngx_tls[key * NGX_THREAD_KEYS_MAX + ngx_gettid()] = value;
- return 0;
-}
-
-
-ngx_mutex_t *
-ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags)
-{
- ngx_mutex_t *m;
- union semun op;
-
- m = ngx_alloc(sizeof(ngx_mutex_t), log);
- if (m == NULL) {
- return NULL;
- }
-
- m->lock = 0;
- m->log = log;
-
- if (flags & NGX_MUTEX_LIGHT) {
- m->semid = -1;
- return m;
- }
-
- m->semid = semget(IPC_PRIVATE, 1, SEM_R|SEM_A);
- if (m->semid == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "semget() failed");
- return NULL;
- }
-
- op.val = 0;
-
- if (semctl(m->semid, 0, SETVAL, op) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "semctl(SETVAL) failed");
-
- if (semctl(m->semid, 0, IPC_RMID) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "semctl(IPC_RMID) failed");
- }
-
- return NULL;
- }
-
- return m;
-}
-
-
-void
-ngx_mutex_destroy(ngx_mutex_t *m)
-{
- if (semctl(m->semid, 0, IPC_RMID) == -1) {
- ngx_log_error(NGX_LOG_ALERT, m->log, ngx_errno,
- "semctl(IPC_RMID) failed");
- }
-
- ngx_free((void *) m);
-}
-
-
-ngx_int_t
-ngx_mutex_dolock(ngx_mutex_t *m, ngx_int_t try)
-{
- uint32_t lock, old;
- ngx_uint_t tries;
- struct sembuf op;
-
- if (!ngx_threaded) {
- return NGX_OK;
- }
-
-#if (NGX_DEBUG)
- if (try) {
- ngx_log_debug2(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "try lock mutex %p lock:%XD", m, m->lock);
- } else {
- ngx_log_debug2(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "lock mutex %p lock:%XD", m, m->lock);
- }
-#endif
-
- old = m->lock;
- tries = 0;
-
- for ( ;; ) {
- if (old & NGX_MUTEX_LOCK_BUSY) {
-
- if (try) {
- return NGX_AGAIN;
- }
-
- if (ngx_ncpu > 1 && tries++ < 1000) {
-
- /* the spinlock is used only on the SMP system */
-
- old = m->lock;
- continue;
- }
-
- if (m->semid == -1) {
- sched_yield();
-
- tries = 0;
- old = m->lock;
- continue;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "mutex %p lock:%XD", m, m->lock);
-
- /*
- * The mutex is locked so we increase a number
- * of the threads that are waiting on the mutex
- */
-
- lock = old + 1;
-
- if ((lock & ~NGX_MUTEX_LOCK_BUSY) > nthreads) {
- ngx_log_error(NGX_LOG_ALERT, m->log, ngx_errno,
- "%D threads wait for mutex %p, "
- "while only %ui threads are available",
- lock & ~NGX_MUTEX_LOCK_BUSY, m, nthreads);
- ngx_abort();
- }
-
- if (ngx_atomic_cmp_set(&m->lock, old, lock)) {
-
- ngx_log_debug2(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "wait mutex %p lock:%XD", m, m->lock);
-
- /*
- * The number of the waiting threads has been increased
- * and we would wait on the SysV semaphore.
- * A semaphore should wake up us more efficiently than
- * a simple sched_yield() or usleep().
- */
-
- op.sem_num = 0;
- op.sem_op = -1;
- op.sem_flg = 0;
-
- if (semop(m->semid, &op, 1) == -1) {
- ngx_log_error(NGX_LOG_ALERT, m->log, ngx_errno,
- "semop() failed while waiting on mutex %p", m);
- ngx_abort();
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "mutex waked up %p lock:%XD", m, m->lock);
-
- tries = 0;
- old = m->lock;
- continue;
- }
-
- old = m->lock;
-
- } else {
- lock = old | NGX_MUTEX_LOCK_BUSY;
-
- if (ngx_atomic_cmp_set(&m->lock, old, lock)) {
-
- /* we locked the mutex */
-
- break;
- }
-
- old = m->lock;
- }
-
- if (tries++ > 1000) {
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "mutex %p is contested", m);
-
- /* the mutex is probably contested so we are giving up now */
-
- sched_yield();
-
- tries = 0;
- old = m->lock;
- }
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "mutex %p is locked, lock:%XD", m, m->lock);
-
- return NGX_OK;
-}
-
-
-void
-ngx_mutex_unlock(ngx_mutex_t *m)
-{
- uint32_t lock, old;
- struct sembuf op;
-
- if (!ngx_threaded) {
- return;
- }
-
- old = m->lock;
-
- if (!(old & NGX_MUTEX_LOCK_BUSY)) {
- ngx_log_error(NGX_LOG_ALERT, m->log, 0,
- "trying to unlock the free mutex %p", m);
- ngx_abort();
- }
-
- /* free the mutex */
-
-#if 0
- ngx_log_debug2(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "unlock mutex %p lock:%XD", m, old);
-#endif
-
- for ( ;; ) {
- lock = old & ~NGX_MUTEX_LOCK_BUSY;
-
- if (ngx_atomic_cmp_set(&m->lock, old, lock)) {
- break;
- }
-
- old = m->lock;
- }
-
- if (m->semid == -1) {
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "mutex %p is unlocked", m);
-
- return;
- }
-
- /* check whether we need to wake up a waiting thread */
-
- old = m->lock;
-
- for ( ;; ) {
- if (old & NGX_MUTEX_LOCK_BUSY) {
-
- /* the mutex is just locked by another thread */
-
- break;
- }
-
- if (old == 0) {
- break;
- }
-
- /* there are the waiting threads */
-
- lock = old - 1;
-
- if (ngx_atomic_cmp_set(&m->lock, old, lock)) {
-
- /* wake up the thread that waits on semaphore */
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "wake up mutex %p", m);
-
- op.sem_num = 0;
- op.sem_op = 1;
- op.sem_flg = 0;
-
- if (semop(m->semid, &op, 1) == -1) {
- ngx_log_error(NGX_LOG_ALERT, m->log, ngx_errno,
- "semop() failed while waking up on mutex %p", m);
- ngx_abort();
- }
-
- break;
- }
-
- old = m->lock;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0,
- "mutex %p is unlocked", m);
-
- return;
-}
-
-
-ngx_cond_t *
-ngx_cond_init(ngx_log_t *log)
-{
- ngx_cond_t *cv;
-
- cv = ngx_alloc(sizeof(ngx_cond_t), log);
- if (cv == NULL) {
- return NULL;
- }
-
- cv->signo = NGX_CV_SIGNAL;
- cv->tid = -1;
- cv->log = log;
- cv->kq = -1;
-
- return cv;
-}
-
-
-void
-ngx_cond_destroy(ngx_cond_t *cv)
-{
- if (close(cv->kq) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, ngx_errno,
- "kqueue close() failed");
- }
-
- ngx_free(cv);
-}
-
-
-ngx_int_t
-ngx_cond_wait(ngx_cond_t *cv, ngx_mutex_t *m)
-{
- int n;
- ngx_err_t err;
- struct kevent kev;
- struct timespec ts;
-
- if (cv->kq == -1) {
-
- /*
- * We have to add the EVFILT_SIGNAL filter in the rfork()ed thread.
- * Otherwise the thread would not get a signal event.
- *
- * However, we have not to open the kqueue in the thread,
- * it is simply handy do it together.
- */
-
- cv->kq = kqueue();
- if (cv->kq == -1) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, ngx_errno, "kqueue() failed");
- return NGX_ERROR;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, cv->log, 0,
- "cv kq:%d signo:%d", cv->kq, cv->signo);
-
- kev.ident = cv->signo;
- kev.filter = EVFILT_SIGNAL;
- kev.flags = EV_ADD;
- kev.fflags = 0;
- kev.data = 0;
- kev.udata = NULL;
-
- ts.tv_sec = 0;
- ts.tv_nsec = 0;
-
- if (kevent(cv->kq, &kev, 1, NULL, 0, &ts) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, ngx_errno, "kevent() failed");
- return NGX_ERROR;
- }
-
- cv->tid = ngx_thread_self();
- }
-
- ngx_mutex_unlock(m);
-
- ngx_log_debug3(NGX_LOG_DEBUG_CORE, cv->log, 0,
- "cv %p wait, kq:%d, signo:%d", cv, cv->kq, cv->signo);
-
- for ( ;; ) {
- n = kevent(cv->kq, NULL, 0, &kev, 1, NULL);
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, cv->log, 0,
- "cv %p kevent: %d", cv, n);
-
- if (n == -1) {
- err = ngx_errno;
- ngx_log_error((err == NGX_EINTR) ? NGX_LOG_INFO : NGX_LOG_ALERT,
- cv->log, ngx_errno,
- "kevent() failed while waiting condition variable %p",
- cv);
-
- if (err == NGX_EINTR) {
- break;
- }
-
- return NGX_ERROR;
- }
-
- if (n == 0) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, 0,
- "kevent() returned no events "
- "while waiting condition variable %p",
- cv);
- continue;
- }
-
- if (kev.filter != EVFILT_SIGNAL) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, 0,
- "kevent() returned unexpected events: %d "
- "while waiting condition variable %p",
- kev.filter, cv);
- continue;
- }
-
- if (kev.ident != (uintptr_t) cv->signo) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, 0,
- "kevent() returned unexpected signal: %d ",
- "while waiting condition variable %p",
- kev.ident, cv);
- continue;
- }
-
- break;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cv->log, 0, "cv %p is waked up", cv);
-
- ngx_mutex_lock(m);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_cond_signal(ngx_cond_t *cv)
-{
- ngx_err_t err;
-
- ngx_log_debug3(NGX_LOG_DEBUG_CORE, cv->log, 0,
- "cv %p to signal %P %d",
- cv, cv->tid, cv->signo);
-
- if (cv->tid == -1) {
- return NGX_OK;
- }
-
- if (kill(cv->tid, cv->signo) == -1) {
-
- err = ngx_errno;
-
- ngx_log_error(NGX_LOG_ALERT, cv->log, err,
- "kill() failed while signaling condition variable %p", cv);
-
- if (err == NGX_ESRCH) {
- cv->tid = -1;
- }
-
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cv->log, 0, "cv %p is signaled", cv);
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.h
deleted file mode 100644
index ff160449dad..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_rfork_thread.h
+++ /dev/null
@@ -1,122 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_FREEBSD_RFORK_THREAD_H_INCLUDED_
-#define _NGX_FREEBSD_RFORK_THREAD_H_INCLUDED_
-
-
-#include <sys/ipc.h>
-#include <sys/sem.h>
-#include <sched.h>
-
-typedef pid_t ngx_tid_t;
-
-#define ngx_log_pid ngx_thread_self()
-#define ngx_log_tid 0
-
-#define NGX_TID_T_FMT "%P"
-
-
-#define NGX_MUTEX_LIGHT 1
-
-#define NGX_MUTEX_LOCK_BUSY 0x80000000
-
-typedef volatile struct {
- ngx_atomic_t lock;
- ngx_log_t *log;
- int semid;
-} ngx_mutex_t;
-
-
-#define NGX_CV_SIGNAL 64
-
-typedef struct {
- int signo;
- int kq;
- ngx_tid_t tid;
- ngx_log_t *log;
-} ngx_cond_t;
-
-
-#define ngx_thread_sigmask(how, set, oset) \
- (sigprocmask(how, set, oset) == -1) ? ngx_errno : 0
-
-#define ngx_thread_sigmask_n "sigprocmask()"
-
-#define ngx_thread_join(t, p)
-
-#define ngx_setthrtitle(n) setproctitle(n)
-
-
-extern char *ngx_freebsd_kern_usrstack;
-extern size_t ngx_thread_stack_size;
-
-
-static ngx_inline ngx_int_t
-ngx_gettid(void)
-{
- char *sp;
-
- if (ngx_thread_stack_size == 0) {
- return 0;
- }
-
-#if ( __i386__ )
-
- __asm__ volatile ("mov %%esp, %0" : "=q" (sp));
-
-#elif ( __amd64__ )
-
- __asm__ volatile ("mov %%rsp, %0" : "=q" (sp));
-
-#else
-
-#error "rfork()ed threads are not supported on this platform"
-
-#endif
-
- return (ngx_freebsd_kern_usrstack - sp) / ngx_thread_stack_size;
-}
-
-
-ngx_tid_t ngx_thread_self(void);
-
-
-typedef ngx_uint_t ngx_tls_key_t;
-
-#define NGX_THREAD_KEYS_MAX 16
-
-extern void **ngx_tls;
-
-ngx_err_t ngx_thread_key_create(ngx_tls_key_t *key);
-#define ngx_thread_key_create_n "the tls key creation"
-
-ngx_err_t ngx_thread_set_tls(ngx_tls_key_t key, void *value);
-#define ngx_thread_set_tls_n "the tls key setting"
-
-
-static void *
-ngx_thread_get_tls(ngx_tls_key_t key)
-{
- if (key >= NGX_THREAD_KEYS_MAX) {
- return NULL;
- }
-
- return ngx_tls[key * NGX_THREAD_KEYS_MAX + ngx_gettid()];
-}
-
-
-#define ngx_mutex_trylock(m) ngx_mutex_dolock(m, 1)
-#define ngx_mutex_lock(m) (void) ngx_mutex_dolock(m, 0)
-ngx_int_t ngx_mutex_dolock(ngx_mutex_t *m, ngx_int_t try);
-void ngx_mutex_unlock(ngx_mutex_t *m);
-
-
-typedef int (*ngx_rfork_thread_func_pt)(void *arg);
-
-
-#endif /* _NGX_FREEBSD_RFORK_THREAD_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_sendfile_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_sendfile_chain.c
deleted file mode 100644
index f5d0f3a8aa1..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_freebsd_sendfile_chain.c
+++ /dev/null
@@ -1,393 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-/*
- * Although FreeBSD sendfile() allows to pass a header and a trailer,
- * it cannot send a header with a part of the file in one packet until
- * FreeBSD 5.3. Besides, over the fast ethernet connection sendfile()
- * may send the partially filled packets, i.e. the 8 file pages may be sent
- * as the 11 full 1460-bytes packets, then one incomplete 324-bytes packet,
- * and then again the 11 full 1460-bytes packets.
- *
- * Therefore we use the TCP_NOPUSH option (similar to Linux's TCP_CORK)
- * to postpone the sending - it not only sends a header and the first part of
- * the file in one packet, but also sends the file pages in the full packets.
- *
- * But until FreeBSD 4.5 turning TCP_NOPUSH off does not flush a pending
- * data that less than MSS, so that data may be sent with 5 second delay.
- * So we do not use TCP_NOPUSH on FreeBSD prior to 4.5, although it can be used
- * for non-keepalive HTTP connections.
- */
-
-
-ngx_chain_t *
-ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
-{
- int rc, flags;
- u_char *prev;
- off_t size, send, prev_send, aligned, sent, fprev;
- size_t header_size, file_size;
- ngx_uint_t eintr, eagain;
- ngx_err_t err;
- ngx_buf_t *file;
- ngx_array_t header, trailer;
- ngx_event_t *wev;
- ngx_chain_t *cl;
- struct sf_hdtr hdtr;
- struct iovec *iov;
- struct iovec headers[NGX_IOVS_PREALLOCATE];
- struct iovec trailers[NGX_IOVS_PREALLOCATE];
-
- wev = c->write;
-
- if (!wev->ready) {
- return in;
- }
-
-#if (NGX_HAVE_KQUEUE)
-
- if ((ngx_event_flags & NGX_USE_KQUEUE_EVENT) && wev->pending_eof) {
- (void) ngx_connection_error(c, wev->kq_errno,
- "kevent() reported about an closed connection");
- wev->error = 1;
- return NGX_CHAIN_ERROR;
- }
-
-#endif
-
- /* the maximum limit size is the maximum size_t value - the page size */
-
- if (limit == 0 || limit > (off_t) (NGX_MAX_SIZE_T_VALUE - ngx_pagesize)) {
- limit = NGX_MAX_SIZE_T_VALUE - ngx_pagesize;
- }
-
- send = 0;
- eagain = 0;
- flags = 0;
-
- header.elts = headers;
- header.size = sizeof(struct iovec);
- header.nalloc = NGX_IOVS_PREALLOCATE;
- header.pool = c->pool;
-
- trailer.elts = trailers;
- trailer.size = sizeof(struct iovec);
- trailer.nalloc = NGX_IOVS_PREALLOCATE;
- trailer.pool = c->pool;
-
- for ( ;; ) {
- file = NULL;
- file_size = 0;
- header_size = 0;
- eintr = 0;
- prev_send = send;
-
- header.nelts = 0;
- trailer.nelts = 0;
-
- /* create the header iovec and coalesce the neighbouring bufs */
-
- prev = NULL;
- iov = NULL;
-
- for (cl = in; cl && send < limit; cl = cl->next) {
-
- if (ngx_buf_special(cl->buf)) {
- continue;
- }
-
- if (!ngx_buf_in_memory_only(cl->buf)) {
- break;
- }
-
- size = cl->buf->last - cl->buf->pos;
-
- if (send + size > limit) {
- size = limit - send;
- }
-
- if (prev == cl->buf->pos) {
- iov->iov_len += (size_t) size;
-
- } else {
- if (header.nelts >= IOV_MAX){
- break;
- }
-
- iov = ngx_array_push(&header);
- if (iov == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- iov->iov_base = (void *) cl->buf->pos;
- iov->iov_len = (size_t) size;
- }
-
- prev = cl->buf->pos + (size_t) size;
- header_size += (size_t) size;
- send += size;
- }
-
-
- if (cl && cl->buf->in_file && send < limit) {
- file = cl->buf;
-
- /* coalesce the neighbouring file bufs */
-
- do {
- size = cl->buf->file_last - cl->buf->file_pos;
-
- if (send + size > limit) {
- size = limit - send;
-
- aligned = (cl->buf->file_pos + size + ngx_pagesize - 1)
- & ~((off_t) ngx_pagesize - 1);
-
- if (aligned <= cl->buf->file_last) {
- size = aligned - cl->buf->file_pos;
- }
- }
-
- file_size += (size_t) size;
- send += size;
- fprev = cl->buf->file_pos + size;
- cl = cl->next;
-
- } while (cl
- && cl->buf->in_file
- && send < limit
- && file->file->fd == cl->buf->file->fd
- && fprev == cl->buf->file_pos);
- }
-
-
- if (file) {
-
- /* create the trailer iovec and coalesce the neighbouring bufs */
-
- prev = NULL;
- iov = NULL;
-
- while (cl && send < limit) {
-
- if (ngx_buf_special(cl->buf)) {
- cl = cl->next;
- continue;
- }
-
- if (!ngx_buf_in_memory_only(cl->buf)) {
- break;
- }
-
- size = cl->buf->last - cl->buf->pos;
-
- if (send + size > limit) {
- size = limit - send;
- }
-
- if (prev == cl->buf->pos) {
- iov->iov_len += (size_t) size;
-
- } else {
- if (trailer.nelts >= IOV_MAX){
- break;
- }
-
- iov = ngx_array_push(&trailer);
- if (iov == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- iov->iov_base = (void *) cl->buf->pos;
- iov->iov_len = (size_t) size;
- }
-
- prev = cl->buf->pos + (size_t) size;
- send += size;
- cl = cl->next;
- }
- }
-
- if (file) {
-
- if (ngx_freebsd_use_tcp_nopush
- && c->tcp_nopush == NGX_TCP_NOPUSH_UNSET)
- {
- if (ngx_tcp_nopush(c->fd) == NGX_ERROR) {
- err = ngx_socket_errno;
-
- /*
- * there is a tiny chance to be interrupted, however,
- * we continue a processing without the TCP_NOPUSH
- */
-
- if (err != NGX_EINTR) {
- wev->error = 1;
- (void) ngx_connection_error(c, err,
- ngx_tcp_nopush_n " failed");
- return NGX_CHAIN_ERROR;
- }
-
- } else {
- c->tcp_nopush = NGX_TCP_NOPUSH_SET;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "tcp_nopush");
- }
- }
-
- /*
- * sendfile() does unneeded work if sf_hdtr's count is 0,
- * but corresponding pointer is not NULL
- */
-
- hdtr.headers = header.nelts ? (struct iovec *) header.elts: NULL;
- hdtr.hdr_cnt = header.nelts;
- hdtr.trailers = trailer.nelts ? (struct iovec *) trailer.elts: NULL;
- hdtr.trl_cnt = trailer.nelts;
-
- /*
- * the "nbytes bug" of the old sendfile() syscall:
- * http://bugs.freebsd.org/33771
- */
-
- if (!ngx_freebsd_sendfile_nbytes_bug) {
- header_size = 0;
- }
-
- sent = 0;
-
-#if (NGX_HAVE_AIO_SENDFILE)
- flags = c->aio_sendfile ? SF_NODISKIO : 0;
-#endif
-
- rc = sendfile(file->file->fd, c->fd, file->file_pos,
- file_size + header_size, &hdtr, &sent, flags);
-
- if (rc == -1) {
- err = ngx_errno;
-
- switch (err) {
- case NGX_EAGAIN:
- eagain = 1;
- break;
-
- case NGX_EINTR:
- eintr = 1;
- break;
-
-#if (NGX_HAVE_AIO_SENDFILE)
- case NGX_EBUSY:
- c->busy_sendfile = file;
- break;
-#endif
-
- default:
- wev->error = 1;
- (void) ngx_connection_error(c, err, "sendfile() failed");
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, err,
- "sendfile() sent only %O bytes", sent);
-
- /*
- * sendfile() in FreeBSD 3.x-4.x may return value >= 0
- * on success, although only 0 is documented
- */
-
- } else if (rc >= 0 && sent == 0) {
-
- /*
- * if rc is OK and sent equal to zero, then someone
- * has truncated the file, so the offset became beyond
- * the end of the file
- */
-
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "sendfile() reported that \"%s\" was truncated at %O",
- file->file->name.data, file->file_pos);
-
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "sendfile: %d, @%O %O:%uz",
- rc, file->file_pos, sent, file_size + header_size);
-
- } else {
- rc = writev(c->fd, header.elts, header.nelts);
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "writev: %d of %uz", rc, header_size);
-
- if (rc == -1) {
- err = ngx_errno;
-
- switch (err) {
- case NGX_EAGAIN:
- break;
-
- case NGX_EINTR:
- eintr = 1;
- break;
-
- default:
- wev->error = 1;
- ngx_connection_error(c, err, "writev() failed");
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "writev() not ready");
- }
-
- sent = rc > 0 ? rc : 0;
- }
-
- c->sent += sent;
-
- in = ngx_handle_sent_chain(in, sent);
-
-#if (NGX_HAVE_AIO_SENDFILE)
- if (c->busy_sendfile) {
- return in;
- }
-#endif
-
- if (eagain) {
-
- /*
- * sendfile() may return EAGAIN, even if it has sent a whole file
- * part, it indicates that the successive sendfile() call would
- * return EAGAIN right away and would not send anything.
- * We use it as a hint.
- */
-
- wev->ready = 0;
- return in;
- }
-
- if (eintr) {
- continue;
- }
-
- if (send - prev_send != sent) {
- wev->ready = 0;
- return in;
- }
-
- if (send >= limit || in == NULL) {
- return in;
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_amd64.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_amd64.h
deleted file mode 100644
index 159a2974270..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_amd64.h
+++ /dev/null
@@ -1,82 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#if (NGX_SMP)
-#define NGX_SMP_LOCK "lock;"
-#else
-#define NGX_SMP_LOCK
-#endif
-
-
-/*
- * "cmpxchgq r, [m]":
- *
- * if (rax == [m]) {
- * zf = 1;
- * [m] = r;
- * } else {
- * zf = 0;
- * rax = [m];
- * }
- *
- *
- * The "r" is any register, %rax (%r0) - %r16.
- * The "=a" and "a" are the %rax register.
- * Although we can return result in any register, we use "a" because it is
- * used in cmpxchgq anyway. The result is actually in %al but not in $rax,
- * however as the code is inlined gcc can test %al as well as %rax.
- *
- * The "cc" means that flags were changed.
- */
-
-static ngx_inline ngx_atomic_uint_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
- ngx_atomic_uint_t set)
-{
- u_char res;
-
- __asm__ volatile (
-
- NGX_SMP_LOCK
- " cmpxchgq %3, %1; "
- " sete %0; "
-
- : "=a" (res) : "m" (*lock), "a" (old), "r" (set) : "cc", "memory");
-
- return res;
-}
-
-
-/*
- * "xaddq r, [m]":
- *
- * temp = [m];
- * [m] += r;
- * r = temp;
- *
- *
- * The "+r" is any register, %rax (%r0) - %r16.
- * The "cc" means that flags were changed.
- */
-
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
-{
- __asm__ volatile (
-
- NGX_SMP_LOCK
- " xaddq %0, %1; "
-
- : "+r" (add) : "m" (*value) : "cc", "memory");
-
- return add;
-}
-
-
-#define ngx_memory_barrier() __asm__ volatile ("" ::: "memory")
-
-#define ngx_cpu_pause() __asm__ ("pause")
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_ppc.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_ppc.h
deleted file mode 100644
index 45afc4b9eac..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_ppc.h
+++ /dev/null
@@ -1,155 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-/*
- * The ppc assembler treats ";" as comment, so we have to use "\n".
- * The minus in "bne-" is a hint for the branch prediction unit that
- * this branch is unlikely to be taken.
- * The "1b" means the nearest backward label "1" and the "1f" means
- * the nearest forward label "1".
- *
- * The "b" means that the base registers can be used only, i.e.
- * any register except r0. The r0 register always has a zero value and
- * could not be used in "addi r0, r0, 1".
- * The "=&b" means that no input registers can be used.
- *
- * "sync" read and write barriers
- * "isync" read barrier, is faster than "sync"
- * "eieio" write barrier, is faster than "sync"
- * "lwsync" write barrier, is faster than "eieio" on ppc64
- */
-
-#if (NGX_PTR_SIZE == 8)
-
-static ngx_inline ngx_atomic_uint_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
- ngx_atomic_uint_t set)
-{
- ngx_atomic_uint_t res, temp;
-
- __asm__ volatile (
-
- " li %0, 0 \n" /* preset "0" to "res" */
- " lwsync \n" /* write barrier */
- "1: \n"
- " ldarx %1, 0, %2 \n" /* load from [lock] into "temp" */
- /* and store reservation */
- " cmpd %1, %3 \n" /* compare "temp" and "old" */
- " bne- 2f \n" /* not equal */
- " stdcx. %4, 0, %2 \n" /* store "set" into [lock] if reservation */
- /* is not cleared */
- " bne- 1b \n" /* the reservation was cleared */
- " isync \n" /* read barrier */
- " li %0, 1 \n" /* set "1" to "res" */
- "2: \n"
-
- : "=&b" (res), "=&b" (temp)
- : "b" (lock), "b" (old), "b" (set)
- : "cc", "memory");
-
- return res;
-}
-
-
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
-{
- ngx_atomic_uint_t res, temp;
-
- __asm__ volatile (
-
- " lwsync \n" /* write barrier */
- "1: ldarx %0, 0, %2 \n" /* load from [value] into "res" */
- /* and store reservation */
- " add %1, %0, %3 \n" /* "res" + "add" store in "temp" */
- " stdcx. %1, 0, %2 \n" /* store "temp" into [value] if reservation */
- /* is not cleared */
- " bne- 1b \n" /* try again if reservation was cleared */
- " isync \n" /* read barrier */
-
- : "=&b" (res), "=&b" (temp)
- : "b" (value), "b" (add)
- : "cc", "memory");
-
- return res;
-}
-
-
-#if (NGX_SMP)
-#define ngx_memory_barrier() \
- __asm__ volatile ("isync \n lwsync \n" ::: "memory")
-#else
-#define ngx_memory_barrier() __asm__ volatile ("" ::: "memory")
-#endif
-
-#else
-
-static ngx_inline ngx_atomic_uint_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
- ngx_atomic_uint_t set)
-{
- ngx_atomic_uint_t res, temp;
-
- __asm__ volatile (
-
- " li %0, 0 \n" /* preset "0" to "res" */
- " eieio \n" /* write barrier */
- "1: \n"
- " lwarx %1, 0, %2 \n" /* load from [lock] into "temp" */
- /* and store reservation */
- " cmpw %1, %3 \n" /* compare "temp" and "old" */
- " bne- 2f \n" /* not equal */
- " stwcx. %4, 0, %2 \n" /* store "set" into [lock] if reservation */
- /* is not cleared */
- " bne- 1b \n" /* the reservation was cleared */
- " isync \n" /* read barrier */
- " li %0, 1 \n" /* set "1" to "res" */
- "2: \n"
-
- : "=&b" (res), "=&b" (temp)
- : "b" (lock), "b" (old), "b" (set)
- : "cc", "memory");
-
- return res;
-}
-
-
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
-{
- ngx_atomic_uint_t res, temp;
-
- __asm__ volatile (
-
- " eieio \n" /* write barrier */
- "1: lwarx %0, 0, %2 \n" /* load from [value] into "res" */
- /* and store reservation */
- " add %1, %0, %3 \n" /* "res" + "add" store in "temp" */
- " stwcx. %1, 0, %2 \n" /* store "temp" into [value] if reservation */
- /* is not cleared */
- " bne- 1b \n" /* try again if reservation was cleared */
- " isync \n" /* read barrier */
-
- : "=&b" (res), "=&b" (temp)
- : "b" (value), "b" (add)
- : "cc", "memory");
-
- return res;
-}
-
-
-#if (NGX_SMP)
-#define ngx_memory_barrier() \
- __asm__ volatile ("isync \n eieio \n" ::: "memory")
-#else
-#define ngx_memory_barrier() __asm__ volatile ("" ::: "memory")
-#endif
-
-#endif
-
-
-#define ngx_cpu_pause()
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_sparc64.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_sparc64.h
deleted file mode 100644
index a84db354482..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_sparc64.h
+++ /dev/null
@@ -1,82 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-/*
- * "casa [r1] 0x80, r2, r0" and
- * "casxa [r1] 0x80, r2, r0" do the following:
- *
- * if ([r1] == r2) {
- * swap(r0, [r1]);
- * } else {
- * r0 = [r1];
- * }
- *
- * so "r0 == r2" means that the operation was successful.
- *
- *
- * The "r" means the general register.
- * The "+r" means the general register used for both input and output.
- */
-
-
-#if (NGX_PTR_SIZE == 4)
-#define NGX_CASA "casa"
-#else
-#define NGX_CASA "casxa"
-#endif
-
-
-static ngx_inline ngx_atomic_uint_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
- ngx_atomic_uint_t set)
-{
- __asm__ volatile (
-
- NGX_CASA " [%1] 0x80, %2, %0"
-
- : "+r" (set) : "r" (lock), "r" (old) : "memory");
-
- return (set == old);
-}
-
-
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
-{
- ngx_atomic_uint_t old, res;
-
- old = *value;
-
- for ( ;; ) {
-
- res = old + add;
-
- __asm__ volatile (
-
- NGX_CASA " [%1] 0x80, %2, %0"
-
- : "+r" (res) : "r" (value), "r" (old) : "memory");
-
- if (res == old) {
- return res;
- }
-
- old = res;
- }
-}
-
-
-#if (NGX_SMP)
-#define ngx_memory_barrier() \
- __asm__ volatile ( \
- "membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad" \
- ::: "memory")
-#else
-#define ngx_memory_barrier() __asm__ volatile ("" ::: "memory")
-#endif
-
-#define ngx_cpu_pause()
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_x86.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_x86.h
deleted file mode 100644
index 54e01aebf0b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_gcc_atomic_x86.h
+++ /dev/null
@@ -1,127 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#if (NGX_SMP)
-#define NGX_SMP_LOCK "lock;"
-#else
-#define NGX_SMP_LOCK
-#endif
-
-
-/*
- * "cmpxchgl r, [m]":
- *
- * if (eax == [m]) {
- * zf = 1;
- * [m] = r;
- * } else {
- * zf = 0;
- * eax = [m];
- * }
- *
- *
- * The "r" means the general register.
- * The "=a" and "a" are the %eax register.
- * Although we can return result in any register, we use "a" because it is
- * used in cmpxchgl anyway. The result is actually in %al but not in %eax,
- * however, as the code is inlined gcc can test %al as well as %eax,
- * and icc adds "movzbl %al, %eax" by itself.
- *
- * The "cc" means that flags were changed.
- */
-
-static ngx_inline ngx_atomic_uint_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
- ngx_atomic_uint_t set)
-{
- u_char res;
-
- __asm__ volatile (
-
- NGX_SMP_LOCK
- " cmpxchgl %3, %1; "
- " sete %0; "
-
- : "=a" (res) : "m" (*lock), "a" (old), "r" (set) : "cc", "memory");
-
- return res;
-}
-
-
-/*
- * "xaddl r, [m]":
- *
- * temp = [m];
- * [m] += r;
- * r = temp;
- *
- *
- * The "+r" means the general register.
- * The "cc" means that flags were changed.
- */
-
-
-#if !(( __GNUC__ == 2 && __GNUC_MINOR__ <= 7 ) || ( __INTEL_COMPILER >= 800 ))
-
-/*
- * icc 8.1 and 9.0 compile broken code with -march=pentium4 option:
- * ngx_atomic_fetch_add() always return the input "add" value,
- * so we use the gcc 2.7 version.
- *
- * icc 8.1 and 9.0 with -march=pentiumpro option or icc 7.1 compile
- * correct code.
- */
-
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
-{
- __asm__ volatile (
-
- NGX_SMP_LOCK
- " xaddl %0, %1; "
-
- : "+r" (add) : "m" (*value) : "cc", "memory");
-
- return add;
-}
-
-
-#else
-
-/*
- * gcc 2.7 does not support "+r", so we have to use the fixed
- * %eax ("=a" and "a") and this adds two superfluous instructions in the end
- * of code, something like this: "mov %eax, %edx / mov %edx, %eax".
- */
-
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
-{
- ngx_atomic_uint_t old;
-
- __asm__ volatile (
-
- NGX_SMP_LOCK
- " xaddl %2, %1; "
-
- : "=a" (old) : "m" (*value), "a" (add) : "cc", "memory");
-
- return old;
-}
-
-#endif
-
-
-/*
- * on x86 the write operations go in a program order, so we need only
- * to disable the gcc reorder optimizations
- */
-
-#define ngx_memory_barrier() __asm__ volatile ("" ::: "memory")
-
-/* old "as" does not support "pause" opcode */
-#define ngx_cpu_pause() __asm__ (".byte 0xf3, 0x90")
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux.h
deleted file mode 100644
index 1b8bdac51a4..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux.h
+++ /dev/null
@@ -1,18 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_LINUX_H_INCLUDED_
-#define _NGX_LINUX_H_INCLUDED_
-
-
-ngx_chain_t *ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in,
- off_t limit);
-
-extern int ngx_linux_rtsig_max;
-
-
-#endif /* _NGX_LINUX_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_aio_read.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_aio_read.c
deleted file mode 100644
index 8273c13f960..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_aio_read.c
+++ /dev/null
@@ -1,137 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-extern int ngx_eventfd;
-extern aio_context_t ngx_aio_ctx;
-
-
-static void ngx_file_aio_event_handler(ngx_event_t *ev);
-
-
-static int
-io_submit(aio_context_t ctx, long n, struct iocb **paiocb)
-{
- return syscall(SYS_io_submit, ctx, n, paiocb);
-}
-
-
-ssize_t
-ngx_file_aio_read(ngx_file_t *file, u_char *buf, size_t size, off_t offset,
- ngx_pool_t *pool)
-{
- ngx_err_t err;
- struct iocb *piocb[1];
- ngx_event_t *ev;
- ngx_event_aio_t *aio;
-
- if (!ngx_file_aio) {
- return ngx_read_file(file, buf, size, offset);
- }
-
- aio = file->aio;
-
- if (aio == NULL) {
- aio = ngx_pcalloc(pool, sizeof(ngx_event_aio_t));
- if (aio == NULL) {
- return NGX_ERROR;
- }
-
- aio->file = file;
- aio->fd = file->fd;
- aio->event.data = aio;
- aio->event.ready = 1;
- aio->event.log = file->log;
- file->aio = aio;
- }
-
- ev = &aio->event;
-
- if (!ev->ready) {
- ngx_log_error(NGX_LOG_ALERT, file->log, 0,
- "second aio post for \"%V\"", &file->name);
- return NGX_AGAIN;
- }
-
- ngx_log_debug4(NGX_LOG_DEBUG_CORE, file->log, 0,
- "aio complete:%d @%O:%z %V",
- ev->complete, offset, size, &file->name);
-
- if (ev->complete) {
- ev->active = 0;
- ev->complete = 0;
-
- if (aio->res >= 0) {
- ngx_set_errno(0);
- return aio->res;
- }
-
- ngx_set_errno(-aio->res);
-
- ngx_log_error(NGX_LOG_CRIT, file->log, ngx_errno,
- "aio read \"%s\" failed", file->name.data);
-
- return NGX_ERROR;
- }
-
- ngx_memzero(&aio->aiocb, sizeof(struct iocb));
-
- aio->aiocb.aio_data = (uint64_t) (uintptr_t) ev;
- aio->aiocb.aio_lio_opcode = IOCB_CMD_PREAD;
- aio->aiocb.aio_fildes = file->fd;
- aio->aiocb.aio_buf = (uint64_t) (uintptr_t) buf;
- aio->aiocb.aio_nbytes = size;
- aio->aiocb.aio_offset = offset;
- aio->aiocb.aio_flags = IOCB_FLAG_RESFD;
- aio->aiocb.aio_resfd = ngx_eventfd;
-
- ev->handler = ngx_file_aio_event_handler;
-
- piocb[0] = &aio->aiocb;
-
- if (io_submit(ngx_aio_ctx, 1, piocb) == 1) {
- ev->active = 1;
- ev->ready = 0;
- ev->complete = 0;
-
- return NGX_AGAIN;
- }
-
- err = ngx_errno;
-
- if (err == NGX_EAGAIN) {
- return ngx_read_file(file, buf, size, offset);
- }
-
- ngx_log_error(NGX_LOG_CRIT, file->log, err,
- "io_submit(\"%V\") failed", &file->name);
-
- if (err == NGX_ENOSYS) {
- ngx_file_aio = 0;
- return ngx_read_file(file, buf, size, offset);
- }
-
- return NGX_ERROR;
-}
-
-
-static void
-ngx_file_aio_event_handler(ngx_event_t *ev)
-{
- ngx_event_aio_t *aio;
-
- aio = ev->data;
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, ev->log, 0,
- "aio event handler fd:%d %V", aio->fd, &aio->file->name);
-
- aio->handler(ev);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_config.h
deleted file mode 100644
index c6c02c93e5f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_config.h
+++ /dev/null
@@ -1,127 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_LINUX_CONFIG_H_INCLUDED_
-#define _NGX_LINUX_CONFIG_H_INCLUDED_
-
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE /* pread(), pwrite(), gethostname() */
-#endif
-
-#define _FILE_OFFSET_BITS 64
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <stdarg.h>
-#include <stddef.h> /* offsetof() */
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <pwd.h>
-#include <grp.h>
-#include <dirent.h>
-#include <glob.h>
-#include <sys/vfs.h> /* statfs() */
-
-#include <sys/uio.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <sys/wait.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-#include <sched.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h> /* TCP_NODELAY, TCP_CORK */
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <sys/un.h>
-
-#include <time.h> /* tzset() */
-#include <malloc.h> /* memalign() */
-#include <limits.h> /* IOV_MAX */
-#include <sys/ioctl.h>
-#include <crypt.h>
-#include <sys/utsname.h> /* uname() */
-
-
-#include <ngx_auto_config.h>
-
-
-#if (NGX_HAVE_POSIX_SEM)
-#include <semaphore.h>
-#endif
-
-
-#if (NGX_HAVE_SYS_PRCTL_H)
-#include <sys/prctl.h>
-#endif
-
-
-#if (NGX_HAVE_SENDFILE64)
-#include <sys/sendfile.h>
-#else
-extern ssize_t sendfile(int s, int fd, int32_t *offset, size_t size);
-#define NGX_SENDFILE_LIMIT 0x80000000
-#endif
-
-
-#if (NGX_HAVE_POLL)
-#include <poll.h>
-#endif
-
-
-#if (NGX_HAVE_RTSIG)
-#include <poll.h>
-#include <sys/sysctl.h>
-#endif
-
-
-#if (NGX_HAVE_EPOLL)
-#include <sys/epoll.h>
-#endif
-
-
-#if (NGX_HAVE_FILE_AIO)
-#if (NGX_HAVE_SYS_EVENTFD_H)
-#include <sys/eventfd.h>
-#endif
-#include <sys/syscall.h>
-#include <linux/aio_abi.h>
-typedef struct iocb ngx_aiocb_t;
-#endif
-
-
-#define NGX_LISTEN_BACKLOG 511
-
-
-#ifndef NGX_HAVE_SO_SNDLOWAT
-/* setsockopt(SO_SNDLOWAT) returns ENOPROTOOPT */
-#define NGX_HAVE_SO_SNDLOWAT 0
-#endif
-
-
-#ifndef NGX_HAVE_INHERITED_NONBLOCK
-#define NGX_HAVE_INHERITED_NONBLOCK 0
-#endif
-
-
-#define NGX_HAVE_OS_SPECIFIC_INIT 1
-#define ngx_debug_init()
-
-
-extern char **environ;
-
-
-#endif /* _NGX_LINUX_CONFIG_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_init.c
deleted file mode 100644
index b910380d7ce..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_init.c
+++ /dev/null
@@ -1,91 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-u_char ngx_linux_kern_ostype[50];
-u_char ngx_linux_kern_osrelease[50];
-
-int ngx_linux_rtsig_max;
-
-
-static ngx_os_io_t ngx_linux_io = {
- ngx_unix_recv,
- ngx_readv_chain,
- ngx_udp_unix_recv,
- ngx_unix_send,
-#if (NGX_HAVE_SENDFILE)
- ngx_linux_sendfile_chain,
- NGX_IO_SENDFILE
-#else
- ngx_writev_chain,
- 0
-#endif
-};
-
-
-ngx_int_t
-ngx_os_specific_init(ngx_log_t *log)
-{
- struct utsname u;
-
- if (uname(&u) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "uname() failed");
- return NGX_ERROR;
- }
-
- (void) ngx_cpystrn(ngx_linux_kern_ostype, (u_char *) u.sysname,
- sizeof(ngx_linux_kern_ostype));
-
- (void) ngx_cpystrn(ngx_linux_kern_osrelease, (u_char *) u.release,
- sizeof(ngx_linux_kern_osrelease));
-
-#if (NGX_HAVE_RTSIG)
- {
- int name[2];
- size_t len;
- ngx_err_t err;
-
- name[0] = CTL_KERN;
- name[1] = KERN_RTSIGMAX;
- len = sizeof(ngx_linux_rtsig_max);
-
- if (sysctl(name, 2, &ngx_linux_rtsig_max, &len, NULL, 0) == -1) {
- err = ngx_errno;
-
- if (err != NGX_ENOTDIR && err != NGX_ENOSYS) {
- ngx_log_error(NGX_LOG_ALERT, log, err,
- "sysctl(KERN_RTSIGMAX) failed");
-
- return NGX_ERROR;
- }
-
- ngx_linux_rtsig_max = 0;
- }
-
- }
-#endif
-
- ngx_os_io = ngx_linux_io;
-
- return NGX_OK;
-}
-
-
-void
-ngx_os_specific_status(ngx_log_t *log)
-{
- ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
- ngx_linux_kern_ostype, ngx_linux_kern_osrelease);
-
-#if (NGX_HAVE_RTSIG)
- ngx_log_error(NGX_LOG_NOTICE, log, 0, "sysctl(KERN_RTSIGMAX): %d",
- ngx_linux_rtsig_max);
-#endif
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_sendfile_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_sendfile_chain.c
deleted file mode 100644
index 1060852a0cd..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_linux_sendfile_chain.c
+++ /dev/null
@@ -1,331 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-/*
- * On Linux up to 2.4.21 sendfile() (syscall #187) works with 32-bit
- * offsets only, and the including <sys/sendfile.h> breaks the compiling,
- * if off_t is 64 bit wide. So we use own sendfile() definition, where offset
- * parameter is int32_t, and use sendfile() for the file parts below 2G only,
- * see src/os/unix/ngx_linux_config.h
- *
- * Linux 2.4.21 has the new sendfile64() syscall #239.
- *
- * On Linux up to 2.6.16 sendfile() does not allow to pass the count parameter
- * more than 2G-1 bytes even on 64-bit platforms: it returns EINVAL,
- * so we limit it to 2G-1 bytes.
- */
-
-#define NGX_SENDFILE_MAXSIZE 2147483647L
-
-
-ngx_chain_t *
-ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
-{
- int rc, tcp_nodelay;
- off_t size, send, prev_send, aligned, sent, fprev;
- u_char *prev;
- size_t file_size;
- ngx_err_t err;
- ngx_buf_t *file;
- ngx_uint_t eintr;
- ngx_array_t header;
- ngx_event_t *wev;
- ngx_chain_t *cl;
- struct iovec *iov, headers[NGX_IOVS_PREALLOCATE];
-#if (NGX_HAVE_SENDFILE64)
- off_t offset;
-#else
- int32_t offset;
-#endif
-
- wev = c->write;
-
- if (!wev->ready) {
- return in;
- }
-
-
- /* the maximum limit size is 2G-1 - the page size */
-
- if (limit == 0 || limit > (off_t) (NGX_SENDFILE_MAXSIZE - ngx_pagesize)) {
- limit = NGX_SENDFILE_MAXSIZE - ngx_pagesize;
- }
-
-
- send = 0;
-
- header.elts = headers;
- header.size = sizeof(struct iovec);
- header.nalloc = NGX_IOVS_PREALLOCATE;
- header.pool = c->pool;
-
- for ( ;; ) {
- file = NULL;
- file_size = 0;
- eintr = 0;
- prev_send = send;
-
- header.nelts = 0;
-
- prev = NULL;
- iov = NULL;
-
- /* create the iovec and coalesce the neighbouring bufs */
-
- for (cl = in; cl && send < limit; cl = cl->next) {
-
- if (ngx_buf_special(cl->buf)) {
- continue;
- }
-
-#if 1
- if (!ngx_buf_in_memory(cl->buf) && !cl->buf->in_file) {
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "zero size buf in sendfile "
- "t:%d r:%d f:%d %p %p-%p %p %O-%O",
- cl->buf->temporary,
- cl->buf->recycled,
- cl->buf->in_file,
- cl->buf->start,
- cl->buf->pos,
- cl->buf->last,
- cl->buf->file,
- cl->buf->file_pos,
- cl->buf->file_last);
-
- ngx_debug_point();
-
- return NGX_CHAIN_ERROR;
- }
-#endif
-
- if (!ngx_buf_in_memory_only(cl->buf)) {
- break;
- }
-
- size = cl->buf->last - cl->buf->pos;
-
- if (send + size > limit) {
- size = limit - send;
- }
-
- if (prev == cl->buf->pos) {
- iov->iov_len += (size_t) size;
-
- } else {
- if (header.nelts >= IOV_MAX) {
- break;
- }
-
- iov = ngx_array_push(&header);
- if (iov == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- iov->iov_base = (void *) cl->buf->pos;
- iov->iov_len = (size_t) size;
- }
-
- prev = cl->buf->pos + (size_t) size;
- send += size;
- }
-
- /* set TCP_CORK if there is a header before a file */
-
- if (c->tcp_nopush == NGX_TCP_NOPUSH_UNSET
- && header.nelts != 0
- && cl
- && cl->buf->in_file)
- {
- /* the TCP_CORK and TCP_NODELAY are mutually exclusive */
-
- if (c->tcp_nodelay == NGX_TCP_NODELAY_SET) {
-
- tcp_nodelay = 0;
-
- if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
- (const void *) &tcp_nodelay, sizeof(int)) == -1)
- {
- err = ngx_socket_errno;
-
- /*
- * there is a tiny chance to be interrupted, however,
- * we continue a processing with the TCP_NODELAY
- * and without the TCP_CORK
- */
-
- if (err != NGX_EINTR) {
- wev->error = 1;
- ngx_connection_error(c, err,
- "setsockopt(TCP_NODELAY) failed");
- return NGX_CHAIN_ERROR;
- }
-
- } else {
- c->tcp_nodelay = NGX_TCP_NODELAY_UNSET;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "no tcp_nodelay");
- }
- }
-
- if (c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) {
-
- if (ngx_tcp_nopush(c->fd) == NGX_ERROR) {
- err = ngx_socket_errno;
-
- /*
- * there is a tiny chance to be interrupted, however,
- * we continue a processing without the TCP_CORK
- */
-
- if (err != NGX_EINTR) {
- wev->error = 1;
- ngx_connection_error(c, err,
- ngx_tcp_nopush_n " failed");
- return NGX_CHAIN_ERROR;
- }
-
- } else {
- c->tcp_nopush = NGX_TCP_NOPUSH_SET;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "tcp_nopush");
- }
- }
- }
-
- /* get the file buf */
-
- if (header.nelts == 0 && cl && cl->buf->in_file && send < limit) {
- file = cl->buf;
-
- /* coalesce the neighbouring file bufs */
-
- do {
- size = cl->buf->file_last - cl->buf->file_pos;
-
- if (send + size > limit) {
- size = limit - send;
-
- aligned = (cl->buf->file_pos + size + ngx_pagesize - 1)
- & ~((off_t) ngx_pagesize - 1);
-
- if (aligned <= cl->buf->file_last) {
- size = aligned - cl->buf->file_pos;
- }
- }
-
- file_size += (size_t) size;
- send += size;
- fprev = cl->buf->file_pos + size;
- cl = cl->next;
-
- } while (cl
- && cl->buf->in_file
- && send < limit
- && file->file->fd == cl->buf->file->fd
- && fprev == cl->buf->file_pos);
- }
-
- if (file) {
-#if 1
- if (file_size == 0) {
- ngx_debug_point();
- return NGX_CHAIN_ERROR;
- }
-#endif
-#if (NGX_HAVE_SENDFILE64)
- offset = file->file_pos;
-#else
- offset = (int32_t) file->file_pos;
-#endif
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "sendfile: @%O %uz", file->file_pos, file_size);
-
- rc = sendfile(c->fd, file->file->fd, &offset, file_size);
-
- if (rc == -1) {
- err = ngx_errno;
-
- switch (err) {
- case NGX_EAGAIN:
- break;
-
- case NGX_EINTR:
- eintr = 1;
- break;
-
- default:
- wev->error = 1;
- ngx_connection_error(c, err, "sendfile() failed");
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "sendfile() is not ready");
- }
-
- sent = rc > 0 ? rc : 0;
-
- ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "sendfile: %d, @%O %O:%uz",
- rc, file->file_pos, sent, file_size);
-
- } else {
- rc = writev(c->fd, header.elts, header.nelts);
-
- if (rc == -1) {
- err = ngx_errno;
-
- switch (err) {
- case NGX_EAGAIN:
- break;
-
- case NGX_EINTR:
- eintr = 1;
- break;
-
- default:
- wev->error = 1;
- ngx_connection_error(c, err, "writev() failed");
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "writev() not ready");
- }
-
- sent = rc > 0 ? rc : 0;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %O", sent);
- }
-
- c->sent += sent;
-
- in = ngx_handle_sent_chain(in, sent);
-
- if (eintr) {
- continue;
- }
-
- if (send - prev_send != sent) {
- wev->ready = 0;
- return in;
- }
-
- if (send >= limit || in == NULL) {
- return in;
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_os.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_os.h
deleted file mode 100644
index 1033d88251e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_os.h
+++ /dev/null
@@ -1,90 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_OS_H_INCLUDED_
-#define _NGX_OS_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-#define NGX_IO_SENDFILE 1
-
-
-typedef ssize_t (*ngx_recv_pt)(ngx_connection_t *c, u_char *buf, size_t size);
-typedef ssize_t (*ngx_recv_chain_pt)(ngx_connection_t *c, ngx_chain_t *in);
-typedef ssize_t (*ngx_send_pt)(ngx_connection_t *c, u_char *buf, size_t size);
-typedef ngx_chain_t *(*ngx_send_chain_pt)(ngx_connection_t *c, ngx_chain_t *in,
- off_t limit);
-
-typedef struct {
- ngx_recv_pt recv;
- ngx_recv_chain_pt recv_chain;
- ngx_recv_pt udp_recv;
- ngx_send_pt send;
- ngx_send_chain_pt send_chain;
- ngx_uint_t flags;
-} ngx_os_io_t;
-
-
-ngx_int_t ngx_os_init(ngx_log_t *log);
-void ngx_os_status(ngx_log_t *log);
-ngx_int_t ngx_os_specific_init(ngx_log_t *log);
-void ngx_os_specific_status(ngx_log_t *log);
-ngx_int_t ngx_daemon(ngx_log_t *log);
-ngx_int_t ngx_os_signal_process(ngx_cycle_t *cycle, char *sig, ngx_int_t pid);
-
-
-ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size);
-ssize_t ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *entry);
-ssize_t ngx_udp_unix_recv(ngx_connection_t *c, u_char *buf, size_t size);
-ssize_t ngx_unix_send(ngx_connection_t *c, u_char *buf, size_t size);
-ngx_chain_t *ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in,
- off_t limit);
-
-#if (NGX_HAVE_AIO)
-ssize_t ngx_aio_read(ngx_connection_t *c, u_char *buf, size_t size);
-ssize_t ngx_aio_read_chain(ngx_connection_t *c, ngx_chain_t *cl);
-ssize_t ngx_aio_write(ngx_connection_t *c, u_char *buf, size_t size);
-ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in,
- off_t limit);
-#endif
-
-
-#if (IOV_MAX > 64)
-#define NGX_IOVS_PREALLOCATE 64
-#else
-#define NGX_IOVS_PREALLOCATE IOV_MAX
-#endif
-
-
-extern ngx_os_io_t ngx_os_io;
-extern ngx_int_t ngx_ncpu;
-extern ngx_int_t ngx_max_sockets;
-extern ngx_uint_t ngx_inherited_nonblocking;
-extern ngx_uint_t ngx_tcp_nodelay_and_tcp_nopush;
-
-
-#if (NGX_FREEBSD)
-#include <ngx_freebsd.h>
-
-
-#elif (NGX_LINUX)
-#include <ngx_linux.h>
-
-
-#elif (NGX_SOLARIS)
-#include <ngx_solaris.h>
-
-
-#elif (NGX_DARWIN)
-#include <ngx_darwin.h>
-#endif
-
-
-#endif /* _NGX_OS_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_config.h
deleted file mode 100644
index d725659dfac..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_config.h
+++ /dev/null
@@ -1,158 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_POSIX_CONFIG_H_INCLUDED_
-#define _NGX_POSIX_CONFIG_H_INCLUDED_
-
-
-#if (NGX_HPUX)
-#define _XOPEN_SOURCE
-#define _XOPEN_SOURCE_EXTENDED 1
-#define _HPUX_ALT_XOPEN_SOCKET_API
-#endif
-
-
-#if (NGX_TRU64)
-#define _REENTRANT
-#endif
-
-
-#ifdef __CYGWIN__
-#define timezonevar /* timezone is variable */
-#define NGX_BROKEN_SCM_RIGHTS 1
-#endif
-
-
-#include <sys/types.h>
-#include <sys/time.h>
-#if (NGX_HAVE_UNISTD_H)
-#include <unistd.h>
-#endif
-#if (NGX_HAVE_INTTYPES_H)
-#include <inttypes.h>
-#endif
-#include <stdarg.h>
-#include <stddef.h> /* offsetof() */
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <pwd.h>
-#include <grp.h>
-#include <dirent.h>
-#include <glob.h>
-#include <time.h>
-#if (NGX_HAVE_SYS_PARAM_H)
-#include <sys/param.h> /* statfs() */
-#endif
-#if (NGX_HAVE_SYS_MOUNT_H)
-#include <sys/mount.h> /* statfs() */
-#endif
-#if (NGX_HAVE_SYS_STATVFS_H)
-#include <sys/statvfs.h> /* statvfs() */
-#endif
-
-#if (NGX_HAVE_SYS_FILIO_H)
-#include <sys/filio.h> /* FIONBIO */
-#endif
-#include <sys/ioctl.h> /* FIONBIO */
-
-#include <sys/uio.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <sys/wait.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-#include <sched.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h> /* TCP_NODELAY */
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <sys/un.h>
-
-#if (NGX_HAVE_LIMITS_H)
-#include <limits.h> /* IOV_MAX */
-#endif
-
-#ifdef __CYGWIN__
-#include <malloc.h> /* memalign() */
-#endif
-
-#if (NGX_HAVE_CRYPT_H)
-#include <crypt.h>
-#endif
-
-
-#ifndef IOV_MAX
-#define IOV_MAX 16
-#endif
-
-
-#include <ngx_auto_config.h>
-
-
-#if (NGX_HAVE_POSIX_SEM)
-#include <semaphore.h>
-#endif
-
-
-#if (NGX_HAVE_POLL)
-#include <poll.h>
-#endif
-
-
-#if (NGX_HAVE_KQUEUE)
-#include <sys/event.h>
-#endif
-
-
-#if (NGX_HAVE_DEVPOLL)
-#include <sys/ioctl.h>
-#include <sys/devpoll.h>
-#endif
-
-
-#if (NGX_HAVE_FILE_AIO)
-#include <aio.h>
-typedef struct aiocb ngx_aiocb_t;
-#endif
-
-
-#define NGX_LISTEN_BACKLOG 511
-
-#define ngx_debug_init()
-
-
-#if (__FreeBSD__) && (__FreeBSD_version < 400017)
-
-#include <sys/param.h> /* ALIGN() */
-
-/*
- * FreeBSD 3.x has no CMSG_SPACE() and CMSG_LEN() and has the broken CMSG_DATA()
- */
-
-#undef CMSG_SPACE
-#define CMSG_SPACE(l) (ALIGN(sizeof(struct cmsghdr)) + ALIGN(l))
-
-#undef CMSG_LEN
-#define CMSG_LEN(l) (ALIGN(sizeof(struct cmsghdr)) + (l))
-
-#undef CMSG_DATA
-#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + ALIGN(sizeof(struct cmsghdr)))
-
-#endif
-
-
-extern char **environ;
-
-
-#endif /* _NGX_POSIX_CONFIG_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_init.c
deleted file mode 100644
index bf3a310aa3b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_posix_init.c
+++ /dev/null
@@ -1,130 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <nginx.h>
-
-
-ngx_int_t ngx_ncpu;
-ngx_int_t ngx_max_sockets;
-ngx_uint_t ngx_inherited_nonblocking;
-ngx_uint_t ngx_tcp_nodelay_and_tcp_nopush;
-
-
-struct rlimit rlmt;
-
-
-ngx_os_io_t ngx_os_io = {
- ngx_unix_recv,
- ngx_readv_chain,
- ngx_udp_unix_recv,
- ngx_unix_send,
- ngx_writev_chain,
- 0
-};
-
-
-ngx_int_t
-ngx_os_init(ngx_log_t *log)
-{
- ngx_uint_t n;
-
-#if (NGX_HAVE_OS_SPECIFIC_INIT)
- if (ngx_os_specific_init(log) != NGX_OK) {
- return NGX_ERROR;
- }
-#endif
-
- if (ngx_init_setproctitle(log) != NGX_OK) {
- return NGX_ERROR;
- }
-
- ngx_pagesize = getpagesize();
- ngx_cacheline_size = NGX_CPU_CACHE_LINE;
-
- for (n = ngx_pagesize; n >>= 1; ngx_pagesize_shift++) { /* void */ }
-
-#if (NGX_HAVE_SC_NPROCESSORS_ONLN)
- if (ngx_ncpu == 0) {
- ngx_ncpu = sysconf(_SC_NPROCESSORS_ONLN);
- }
-#endif
-
- if (ngx_ncpu < 1) {
- ngx_ncpu = 1;
- }
-
- ngx_cpuinfo();
-
- if (getrlimit(RLIMIT_NOFILE, &rlmt) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, errno,
- "getrlimit(RLIMIT_NOFILE) failed)");
- return NGX_ERROR;
- }
-
- ngx_max_sockets = (ngx_int_t) rlmt.rlim_cur;
-
-#if (NGX_HAVE_INHERITED_NONBLOCK || NGX_HAVE_ACCEPT4)
- ngx_inherited_nonblocking = 1;
-#else
- ngx_inherited_nonblocking = 0;
-#endif
-
- srandom(ngx_time());
-
- return NGX_OK;
-}
-
-
-void
-ngx_os_status(ngx_log_t *log)
-{
- ngx_log_error(NGX_LOG_NOTICE, log, 0, NGINX_VER_BUILD);
-
-#ifdef NGX_COMPILER
- ngx_log_error(NGX_LOG_NOTICE, log, 0, "built by " NGX_COMPILER);
-#endif
-
-#if (NGX_HAVE_OS_SPECIFIC_INIT)
- ngx_os_specific_status(log);
-#endif
-
- ngx_log_error(NGX_LOG_NOTICE, log, 0,
- "getrlimit(RLIMIT_NOFILE): %r:%r",
- rlmt.rlim_cur, rlmt.rlim_max);
-}
-
-
-#if 0
-
-ngx_int_t
-ngx_posix_post_conf_init(ngx_log_t *log)
-{
- ngx_fd_t pp[2];
-
- if (pipe(pp) == -1) {
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "pipe() failed");
- return NGX_ERROR;
- }
-
- if (dup2(pp[1], STDERR_FILENO) == -1) {
- ngx_log_error(NGX_LOG_EMERG, log, errno, "dup2(STDERR) failed");
- return NGX_ERROR;
- }
-
- if (pp[1] > STDERR_FILENO) {
- if (close(pp[1]) == -1) {
- ngx_log_error(NGX_LOG_EMERG, log, errno, "close() failed");
- return NGX_ERROR;
- }
- }
-
- return NGX_OK;
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.c
deleted file mode 100644
index 6f3f38556ab..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.c
+++ /dev/null
@@ -1,630 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_channel.h>
-
-
-typedef struct {
- int signo;
- char *signame;
- char *name;
- void (*handler)(int signo);
-} ngx_signal_t;
-
-
-
-static void ngx_execute_proc(ngx_cycle_t *cycle, void *data);
-static void ngx_signal_handler(int signo);
-static void ngx_process_get_status(void);
-static void ngx_unlock_mutexes(ngx_pid_t pid);
-
-
-int ngx_argc;
-char **ngx_argv;
-char **ngx_os_argv;
-
-ngx_int_t ngx_process_slot;
-ngx_socket_t ngx_channel;
-ngx_int_t ngx_last_process;
-ngx_process_t ngx_processes[NGX_MAX_PROCESSES];
-
-
-ngx_signal_t signals[] = {
- { ngx_signal_value(NGX_RECONFIGURE_SIGNAL),
- "SIG" ngx_value(NGX_RECONFIGURE_SIGNAL),
- "reload",
- ngx_signal_handler },
-
- { ngx_signal_value(NGX_REOPEN_SIGNAL),
- "SIG" ngx_value(NGX_REOPEN_SIGNAL),
- "reopen",
- ngx_signal_handler },
-
- { ngx_signal_value(NGX_NOACCEPT_SIGNAL),
- "SIG" ngx_value(NGX_NOACCEPT_SIGNAL),
- "",
- ngx_signal_handler },
-
- { ngx_signal_value(NGX_TERMINATE_SIGNAL),
- "SIG" ngx_value(NGX_TERMINATE_SIGNAL),
- "stop",
- ngx_signal_handler },
-
- { ngx_signal_value(NGX_SHUTDOWN_SIGNAL),
- "SIG" ngx_value(NGX_SHUTDOWN_SIGNAL),
- "quit",
- ngx_signal_handler },
-
- { ngx_signal_value(NGX_CHANGEBIN_SIGNAL),
- "SIG" ngx_value(NGX_CHANGEBIN_SIGNAL),
- "",
- ngx_signal_handler },
-
- { SIGALRM, "SIGALRM", "", ngx_signal_handler },
-
- { SIGINT, "SIGINT", "", ngx_signal_handler },
-
- { SIGIO, "SIGIO", "", ngx_signal_handler },
-
- { SIGCHLD, "SIGCHLD", "", ngx_signal_handler },
-
- { SIGSYS, "SIGSYS, SIG_IGN", "", SIG_IGN },
-
- { SIGPIPE, "SIGPIPE, SIG_IGN", "", SIG_IGN },
-
- { 0, NULL, "", NULL }
-};
-
-
-ngx_pid_t
-ngx_spawn_process(ngx_cycle_t *cycle, ngx_spawn_proc_pt proc, void *data,
- char *name, ngx_int_t respawn)
-{
- u_long on;
- ngx_pid_t pid;
- ngx_int_t s;
-
- if (respawn >= 0) {
- s = respawn;
-
- } else {
- for (s = 0; s < ngx_last_process; s++) {
- if (ngx_processes[s].pid == -1) {
- break;
- }
- }
-
- if (s == NGX_MAX_PROCESSES) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "no more than %d processes can be spawned",
- NGX_MAX_PROCESSES);
- return NGX_INVALID_PID;
- }
- }
-
-
- if (respawn != NGX_PROCESS_DETACHED) {
-
- /* Solaris 9 still has no AF_LOCAL */
-
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, ngx_processes[s].channel) == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "socketpair() failed while spawning \"%s\"", name);
- return NGX_INVALID_PID;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, cycle->log, 0,
- "channel %d:%d",
- ngx_processes[s].channel[0],
- ngx_processes[s].channel[1]);
-
- if (ngx_nonblocking(ngx_processes[s].channel[0]) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- ngx_nonblocking_n " failed while spawning \"%s\"",
- name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
- }
-
- if (ngx_nonblocking(ngx_processes[s].channel[1]) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- ngx_nonblocking_n " failed while spawning \"%s\"",
- name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
- }
-
- on = 1;
- if (ioctl(ngx_processes[s].channel[0], FIOASYNC, &on) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "ioctl(FIOASYNC) failed while spawning \"%s\"", name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
- }
-
- if (fcntl(ngx_processes[s].channel[0], F_SETOWN, ngx_pid) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "fcntl(F_SETOWN) failed while spawning \"%s\"", name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
- }
-
- if (fcntl(ngx_processes[s].channel[0], F_SETFD, FD_CLOEXEC) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "fcntl(FD_CLOEXEC) failed while spawning \"%s\"",
- name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
- }
-
- if (fcntl(ngx_processes[s].channel[1], F_SETFD, FD_CLOEXEC) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "fcntl(FD_CLOEXEC) failed while spawning \"%s\"",
- name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
- }
-
- ngx_channel = ngx_processes[s].channel[1];
-
- } else {
- ngx_processes[s].channel[0] = -1;
- ngx_processes[s].channel[1] = -1;
- }
-
- ngx_process_slot = s;
-
-
- pid = fork();
-
- switch (pid) {
-
- case -1:
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "fork() failed while spawning \"%s\"", name);
- ngx_close_channel(ngx_processes[s].channel, cycle->log);
- return NGX_INVALID_PID;
-
- case 0:
- ngx_pid = ngx_getpid();
- proc(cycle, data);
- break;
-
- default:
- break;
- }
-
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "start %s %P", name, pid);
-
- ngx_processes[s].pid = pid;
- ngx_processes[s].exited = 0;
-
- if (respawn >= 0) {
- return pid;
- }
-
- ngx_processes[s].proc = proc;
- ngx_processes[s].data = data;
- ngx_processes[s].name = name;
- ngx_processes[s].exiting = 0;
-
- switch (respawn) {
-
- case NGX_PROCESS_NORESPAWN:
- ngx_processes[s].respawn = 0;
- ngx_processes[s].just_spawn = 0;
- ngx_processes[s].detached = 0;
- break;
-
- case NGX_PROCESS_JUST_SPAWN:
- ngx_processes[s].respawn = 0;
- ngx_processes[s].just_spawn = 1;
- ngx_processes[s].detached = 0;
- break;
-
- case NGX_PROCESS_RESPAWN:
- ngx_processes[s].respawn = 1;
- ngx_processes[s].just_spawn = 0;
- ngx_processes[s].detached = 0;
- break;
-
- case NGX_PROCESS_JUST_RESPAWN:
- ngx_processes[s].respawn = 1;
- ngx_processes[s].just_spawn = 1;
- ngx_processes[s].detached = 0;
- break;
-
- case NGX_PROCESS_DETACHED:
- ngx_processes[s].respawn = 0;
- ngx_processes[s].just_spawn = 0;
- ngx_processes[s].detached = 1;
- break;
- }
-
- if (s == ngx_last_process) {
- ngx_last_process++;
- }
-
- return pid;
-}
-
-
-ngx_pid_t
-ngx_execute(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx)
-{
- return ngx_spawn_process(cycle, ngx_execute_proc, ctx, ctx->name,
- NGX_PROCESS_DETACHED);
-}
-
-
-static void
-ngx_execute_proc(ngx_cycle_t *cycle, void *data)
-{
- ngx_exec_ctx_t *ctx = data;
-
- if (execve(ctx->path, ctx->argv, ctx->envp) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "execve() failed while executing %s \"%s\"",
- ctx->name, ctx->path);
- }
-
- exit(1);
-}
-
-
-ngx_int_t
-ngx_init_signals(ngx_log_t *log)
-{
- ngx_signal_t *sig;
- struct sigaction sa;
-
- for (sig = signals; sig->signo != 0; sig++) {
- ngx_memzero(&sa, sizeof(struct sigaction));
- sa.sa_handler = sig->handler;
- sigemptyset(&sa.sa_mask);
- if (sigaction(sig->signo, &sa, NULL) == -1) {
-#if (NGX_VALGRIND)
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "sigaction(%s) failed, ignored", sig->signame);
-#else
- ngx_log_error(NGX_LOG_EMERG, log, ngx_errno,
- "sigaction(%s) failed", sig->signame);
- return NGX_ERROR;
-#endif
- }
- }
-
- return NGX_OK;
-}
-
-
-void
-ngx_signal_handler(int signo)
-{
- char *action;
- ngx_int_t ignore;
- ngx_err_t err;
- ngx_signal_t *sig;
-
- ignore = 0;
-
- err = ngx_errno;
-
- for (sig = signals; sig->signo != 0; sig++) {
- if (sig->signo == signo) {
- break;
- }
- }
-
- ngx_time_sigsafe_update();
-
- action = "";
-
- switch (ngx_process) {
-
- case NGX_PROCESS_MASTER:
- case NGX_PROCESS_SINGLE:
- switch (signo) {
-
- case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
- ngx_quit = 1;
- action = ", shutting down";
- break;
-
- case ngx_signal_value(NGX_TERMINATE_SIGNAL):
- case SIGINT:
- ngx_terminate = 1;
- action = ", exiting";
- break;
-
- case ngx_signal_value(NGX_NOACCEPT_SIGNAL):
- if (ngx_daemonized) {
- ngx_noaccept = 1;
- action = ", stop accepting connections";
- }
- break;
-
- case ngx_signal_value(NGX_RECONFIGURE_SIGNAL):
- ngx_reconfigure = 1;
- action = ", reconfiguring";
- break;
-
- case ngx_signal_value(NGX_REOPEN_SIGNAL):
- ngx_reopen = 1;
- action = ", reopening logs";
- break;
-
- case ngx_signal_value(NGX_CHANGEBIN_SIGNAL):
- if (getppid() > 1 || ngx_new_binary > 0) {
-
- /*
- * Ignore the signal in the new binary if its parent is
- * not the init process, i.e. the old binary's process
- * is still running. Or ignore the signal in the old binary's
- * process if the new binary's process is already running.
- */
-
- action = ", ignoring";
- ignore = 1;
- break;
- }
-
- ngx_change_binary = 1;
- action = ", changing binary";
- break;
-
- case SIGALRM:
- ngx_sigalrm = 1;
- break;
-
- case SIGIO:
- ngx_sigio = 1;
- break;
-
- case SIGCHLD:
- ngx_reap = 1;
- break;
- }
-
- break;
-
- case NGX_PROCESS_WORKER:
- case NGX_PROCESS_HELPER:
- switch (signo) {
-
- case ngx_signal_value(NGX_NOACCEPT_SIGNAL):
- if (!ngx_daemonized) {
- break;
- }
- ngx_debug_quit = 1;
- case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
- ngx_quit = 1;
- action = ", shutting down";
- break;
-
- case ngx_signal_value(NGX_TERMINATE_SIGNAL):
- case SIGINT:
- ngx_terminate = 1;
- action = ", exiting";
- break;
-
- case ngx_signal_value(NGX_REOPEN_SIGNAL):
- ngx_reopen = 1;
- action = ", reopening logs";
- break;
-
- case ngx_signal_value(NGX_RECONFIGURE_SIGNAL):
- case ngx_signal_value(NGX_CHANGEBIN_SIGNAL):
- case SIGIO:
- action = ", ignoring";
- break;
- }
-
- break;
- }
-
- ngx_log_error(NGX_LOG_NOTICE, ngx_cycle->log, 0,
- "signal %d (%s) received%s", signo, sig->signame, action);
-
- if (ignore) {
- ngx_log_error(NGX_LOG_CRIT, ngx_cycle->log, 0,
- "the changing binary signal is ignored: "
- "you should shutdown or terminate "
- "before either old or new binary's process");
- }
-
- if (signo == SIGCHLD) {
- ngx_process_get_status();
- }
-
- ngx_set_errno(err);
-}
-
-
-static void
-ngx_process_get_status(void)
-{
- int status;
- char *process;
- ngx_pid_t pid;
- ngx_err_t err;
- ngx_int_t i;
- ngx_uint_t one;
-
- one = 0;
-
- for ( ;; ) {
- pid = waitpid(-1, &status, WNOHANG);
-
- if (pid == 0) {
- return;
- }
-
- if (pid == -1) {
- err = ngx_errno;
-
- if (err == NGX_EINTR) {
- continue;
- }
-
- if (err == NGX_ECHILD && one) {
- return;
- }
-
- /*
- * Solaris always calls the signal handler for each exited process
- * despite waitpid() may be already called for this process.
- *
- * When several processes exit at the same time FreeBSD may
- * erroneously call the signal handler for exited process
- * despite waitpid() may be already called for this process.
- */
-
- if (err == NGX_ECHILD) {
- ngx_log_error(NGX_LOG_INFO, ngx_cycle->log, err,
- "waitpid() failed");
- return;
- }
-
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, err,
- "waitpid() failed");
- return;
- }
-
-
- one = 1;
- process = "unknown process";
-
- for (i = 0; i < ngx_last_process; i++) {
- if (ngx_processes[i].pid == pid) {
- ngx_processes[i].status = status;
- ngx_processes[i].exited = 1;
- process = ngx_processes[i].name;
- break;
- }
- }
-
- if (WTERMSIG(status)) {
-#ifdef WCOREDUMP
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
- "%s %P exited on signal %d%s",
- process, pid, WTERMSIG(status),
- WCOREDUMP(status) ? " (core dumped)" : "");
-#else
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
- "%s %P exited on signal %d",
- process, pid, WTERMSIG(status));
-#endif
-
- } else {
- ngx_log_error(NGX_LOG_NOTICE, ngx_cycle->log, 0,
- "%s %P exited with code %d",
- process, pid, WEXITSTATUS(status));
- }
-
- if (WEXITSTATUS(status) == 2 && ngx_processes[i].respawn) {
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
- "%s %P exited with fatal code %d "
- "and cannot be respawned",
- process, pid, WEXITSTATUS(status));
- ngx_processes[i].respawn = 0;
- }
-
- ngx_unlock_mutexes(pid);
- }
-}
-
-
-static void
-ngx_unlock_mutexes(ngx_pid_t pid)
-{
- ngx_uint_t i;
- ngx_shm_zone_t *shm_zone;
- ngx_list_part_t *part;
- ngx_slab_pool_t *sp;
-
- /*
- * unlock the accept mutex if the abnormally exited process
- * held it
- */
-
- if (ngx_accept_mutex_ptr) {
- (void) ngx_shmtx_force_unlock(&ngx_accept_mutex, pid);
- }
-
- /*
- * unlock shared memory mutexes if held by the abnormally exited
- * process
- */
-
- part = (ngx_list_part_t *) &ngx_cycle->shared_memory.part;
- shm_zone = part->elts;
-
- for (i = 0; /* void */ ; i++) {
-
- if (i >= part->nelts) {
- if (part->next == NULL) {
- break;
- }
- part = part->next;
- shm_zone = part->elts;
- i = 0;
- }
-
- sp = (ngx_slab_pool_t *) shm_zone[i].shm.addr;
-
- if (ngx_shmtx_force_unlock(&sp->mutex, pid)) {
- ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,
- "shared memory zone \"%V\" was locked by %P",
- &shm_zone[i].shm.name, pid);
- }
- }
-}
-
-
-void
-ngx_debug_point(void)
-{
- ngx_core_conf_t *ccf;
-
- ccf = (ngx_core_conf_t *) ngx_get_conf(ngx_cycle->conf_ctx,
- ngx_core_module);
-
- switch (ccf->debug_points) {
-
- case NGX_DEBUG_POINTS_STOP:
- raise(SIGSTOP);
- break;
-
- case NGX_DEBUG_POINTS_ABORT:
- ngx_abort();
- }
-}
-
-
-ngx_int_t
-ngx_os_signal_process(ngx_cycle_t *cycle, char *name, ngx_int_t pid)
-{
- ngx_signal_t *sig;
-
- for (sig = signals; sig->signo != 0; sig++) {
- if (ngx_strcmp(name, sig->name) == 0) {
- if (kill(pid, sig->signo) != -1) {
- return 0;
- }
-
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "kill(%P, %d) failed", pid, sig->signo);
- }
- }
-
- return 1;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.h
deleted file mode 100644
index 7b5e8c0c25e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process.h
+++ /dev/null
@@ -1,88 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_PROCESS_H_INCLUDED_
-#define _NGX_PROCESS_H_INCLUDED_
-
-
-#include <ngx_setaffinity.h>
-#include <ngx_setproctitle.h>
-
-
-typedef pid_t ngx_pid_t;
-
-#define NGX_INVALID_PID -1
-
-typedef void (*ngx_spawn_proc_pt) (ngx_cycle_t *cycle, void *data);
-
-typedef struct {
- ngx_pid_t pid;
- int status;
- ngx_socket_t channel[2];
-
- ngx_spawn_proc_pt proc;
- void *data;
- char *name;
-
- unsigned respawn:1;
- unsigned just_spawn:1;
- unsigned detached:1;
- unsigned exiting:1;
- unsigned exited:1;
-} ngx_process_t;
-
-
-typedef struct {
- char *path;
- char *name;
- char *const *argv;
- char *const *envp;
-} ngx_exec_ctx_t;
-
-
-#define NGX_MAX_PROCESSES 1024
-
-#define NGX_PROCESS_NORESPAWN -1
-#define NGX_PROCESS_JUST_SPAWN -2
-#define NGX_PROCESS_RESPAWN -3
-#define NGX_PROCESS_JUST_RESPAWN -4
-#define NGX_PROCESS_DETACHED -5
-
-
-#define ngx_getpid getpid
-
-#ifndef ngx_log_pid
-#define ngx_log_pid ngx_pid
-#endif
-
-
-ngx_pid_t ngx_spawn_process(ngx_cycle_t *cycle,
- ngx_spawn_proc_pt proc, void *data, char *name, ngx_int_t respawn);
-ngx_pid_t ngx_execute(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx);
-ngx_int_t ngx_init_signals(ngx_log_t *log);
-void ngx_debug_point(void);
-
-
-#if (NGX_HAVE_SCHED_YIELD)
-#define ngx_sched_yield() sched_yield()
-#else
-#define ngx_sched_yield() usleep(1)
-#endif
-
-
-extern int ngx_argc;
-extern char **ngx_argv;
-extern char **ngx_os_argv;
-
-extern ngx_pid_t ngx_pid;
-extern ngx_socket_t ngx_channel;
-extern ngx_int_t ngx_process_slot;
-extern ngx_int_t ngx_last_process;
-extern ngx_process_t ngx_processes[NGX_MAX_PROCESSES];
-
-
-#endif /* _NGX_PROCESS_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.c
deleted file mode 100644
index 6c84ba8bd89..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.c
+++ /dev/null
@@ -1,1412 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-#include <ngx_channel.h>
-
-
-static void ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n,
- ngx_int_t type);
-static void ngx_start_cache_manager_processes(ngx_cycle_t *cycle,
- ngx_uint_t respawn);
-static void ngx_pass_open_channel(ngx_cycle_t *cycle, ngx_channel_t *ch);
-static void ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo);
-static ngx_uint_t ngx_reap_children(ngx_cycle_t *cycle);
-static void ngx_master_process_exit(ngx_cycle_t *cycle);
-static void ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data);
-static void ngx_worker_process_init(ngx_cycle_t *cycle, ngx_int_t worker);
-static void ngx_worker_process_exit(ngx_cycle_t *cycle);
-static void ngx_channel_handler(ngx_event_t *ev);
-#if (NGX_THREADS)
-static void ngx_wakeup_worker_threads(ngx_cycle_t *cycle);
-static ngx_thread_value_t ngx_worker_thread_cycle(void *data);
-#endif
-static void ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data);
-static void ngx_cache_manager_process_handler(ngx_event_t *ev);
-static void ngx_cache_loader_process_handler(ngx_event_t *ev);
-
-
-ngx_uint_t ngx_process;
-ngx_pid_t ngx_pid;
-ngx_uint_t ngx_threaded;
-
-sig_atomic_t ngx_reap;
-sig_atomic_t ngx_sigio;
-sig_atomic_t ngx_sigalrm;
-sig_atomic_t ngx_terminate;
-sig_atomic_t ngx_quit;
-sig_atomic_t ngx_debug_quit;
-ngx_uint_t ngx_exiting;
-sig_atomic_t ngx_reconfigure;
-sig_atomic_t ngx_reopen;
-
-sig_atomic_t ngx_change_binary;
-ngx_pid_t ngx_new_binary;
-ngx_uint_t ngx_inherited;
-ngx_uint_t ngx_daemonized;
-
-sig_atomic_t ngx_noaccept;
-ngx_uint_t ngx_noaccepting;
-ngx_uint_t ngx_restart;
-
-
-#if (NGX_THREADS)
-volatile ngx_thread_t ngx_threads[NGX_MAX_THREADS];
-ngx_int_t ngx_threads_n;
-#endif
-
-
-static u_char master_process[] = "master process";
-
-
-static ngx_cache_manager_ctx_t ngx_cache_manager_ctx = {
- ngx_cache_manager_process_handler, "cache manager process", 0
-};
-
-static ngx_cache_manager_ctx_t ngx_cache_loader_ctx = {
- ngx_cache_loader_process_handler, "cache loader process", 60000
-};
-
-
-static ngx_cycle_t ngx_exit_cycle;
-static ngx_log_t ngx_exit_log;
-static ngx_open_file_t ngx_exit_log_file;
-
-
-void
-ngx_master_process_cycle(ngx_cycle_t *cycle)
-{
- char *title;
- u_char *p;
- size_t size;
- ngx_int_t i;
- ngx_uint_t n, sigio;
- sigset_t set;
- struct itimerval itv;
- ngx_uint_t live;
- ngx_msec_t delay;
- ngx_listening_t *ls;
- ngx_core_conf_t *ccf;
-
- sigemptyset(&set);
- sigaddset(&set, SIGCHLD);
- sigaddset(&set, SIGALRM);
- sigaddset(&set, SIGIO);
- sigaddset(&set, SIGINT);
- sigaddset(&set, ngx_signal_value(NGX_RECONFIGURE_SIGNAL));
- sigaddset(&set, ngx_signal_value(NGX_REOPEN_SIGNAL));
- sigaddset(&set, ngx_signal_value(NGX_NOACCEPT_SIGNAL));
- sigaddset(&set, ngx_signal_value(NGX_TERMINATE_SIGNAL));
- sigaddset(&set, ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
- sigaddset(&set, ngx_signal_value(NGX_CHANGEBIN_SIGNAL));
-
- if (sigprocmask(SIG_BLOCK, &set, NULL) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "sigprocmask() failed");
- }
-
- sigemptyset(&set);
-
-
- size = sizeof(master_process);
-
- for (i = 0; i < ngx_argc; i++) {
- size += ngx_strlen(ngx_argv[i]) + 1;
- }
-
- title = ngx_pnalloc(cycle->pool, size);
- if (title == NULL) {
- /* fatal */
- exit(2);
- }
-
- p = ngx_cpymem(title, master_process, sizeof(master_process) - 1);
- for (i = 0; i < ngx_argc; i++) {
- *p++ = ' ';
- p = ngx_cpystrn(p, (u_char *) ngx_argv[i], size);
- }
-
- ngx_setproctitle(title);
-
-
- ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
-
- ngx_start_worker_processes(cycle, ccf->worker_processes,
- NGX_PROCESS_RESPAWN);
- ngx_start_cache_manager_processes(cycle, 0);
-
- ngx_new_binary = 0;
- delay = 0;
- sigio = 0;
- live = 1;
-
- for ( ;; ) {
- if (delay) {
- if (ngx_sigalrm) {
- sigio = 0;
- delay *= 2;
- ngx_sigalrm = 0;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "termination cycle: %d", delay);
-
- itv.it_interval.tv_sec = 0;
- itv.it_interval.tv_usec = 0;
- itv.it_value.tv_sec = delay / 1000;
- itv.it_value.tv_usec = (delay % 1000 ) * 1000;
-
- if (setitimer(ITIMER_REAL, &itv, NULL) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "setitimer() failed");
- }
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "sigsuspend");
-
- sigsuspend(&set);
-
- ngx_time_update();
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "wake up, sigio %i", sigio);
-
- if (ngx_reap) {
- ngx_reap = 0;
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "reap children");
-
- live = ngx_reap_children(cycle);
- }
-
- if (!live && (ngx_terminate || ngx_quit)) {
- ngx_master_process_exit(cycle);
- }
-
- if (ngx_terminate) {
- if (delay == 0) {
- delay = 50;
- }
-
- if (sigio) {
- sigio--;
- continue;
- }
-
- sigio = ccf->worker_processes + 2 /* cache processes */;
-
- if (delay > 1000) {
- ngx_signal_worker_processes(cycle, SIGKILL);
- } else {
- ngx_signal_worker_processes(cycle,
- ngx_signal_value(NGX_TERMINATE_SIGNAL));
- }
-
- continue;
- }
-
- if (ngx_quit) {
- ngx_signal_worker_processes(cycle,
- ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
-
- ls = cycle->listening.elts;
- for (n = 0; n < cycle->listening.nelts; n++) {
- if (ngx_close_socket(ls[n].fd) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno,
- ngx_close_socket_n " %V failed",
- &ls[n].addr_text);
- }
- }
- cycle->listening.nelts = 0;
-
- continue;
- }
-
- if (ngx_reconfigure) {
- ngx_reconfigure = 0;
-
- if (ngx_new_binary) {
- ngx_start_worker_processes(cycle, ccf->worker_processes,
- NGX_PROCESS_RESPAWN);
- ngx_start_cache_manager_processes(cycle, 0);
- ngx_noaccepting = 0;
-
- continue;
- }
-
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reconfiguring");
-
- cycle = ngx_init_cycle(cycle);
- if (cycle == NULL) {
- cycle = (ngx_cycle_t *) ngx_cycle;
- continue;
- }
-
- ngx_cycle = cycle;
- ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx,
- ngx_core_module);
- ngx_start_worker_processes(cycle, ccf->worker_processes,
- NGX_PROCESS_JUST_RESPAWN);
- ngx_start_cache_manager_processes(cycle, 1);
-
- /* allow new processes to start */
- ngx_msleep(100);
-
- live = 1;
- ngx_signal_worker_processes(cycle,
- ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
- }
-
- if (ngx_restart) {
- ngx_restart = 0;
- ngx_start_worker_processes(cycle, ccf->worker_processes,
- NGX_PROCESS_RESPAWN);
- ngx_start_cache_manager_processes(cycle, 0);
- live = 1;
- }
-
- if (ngx_reopen) {
- ngx_reopen = 0;
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reopening logs");
- ngx_reopen_files(cycle, ccf->user);
- ngx_signal_worker_processes(cycle,
- ngx_signal_value(NGX_REOPEN_SIGNAL));
- }
-
- if (ngx_change_binary) {
- ngx_change_binary = 0;
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "changing binary");
- ngx_new_binary = ngx_exec_new_binary(cycle, ngx_argv);
- }
-
- if (ngx_noaccept) {
- ngx_noaccept = 0;
- ngx_noaccepting = 1;
- ngx_signal_worker_processes(cycle,
- ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
- }
- }
-}
-
-
-void
-ngx_single_process_cycle(ngx_cycle_t *cycle)
-{
- ngx_uint_t i;
-
- if (ngx_set_environment(cycle, NULL) == NULL) {
- /* fatal */
- exit(2);
- }
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->init_process) {
- if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) {
- /* fatal */
- exit(2);
- }
- }
- }
-
- for ( ;; ) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "worker cycle");
-
- ngx_process_events_and_timers(cycle);
-
- if (ngx_terminate || ngx_quit) {
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->exit_process) {
- ngx_modules[i]->exit_process(cycle);
- }
- }
-
- ngx_master_process_exit(cycle);
- }
-
- if (ngx_reconfigure) {
- ngx_reconfigure = 0;
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reconfiguring");
-
- cycle = ngx_init_cycle(cycle);
- if (cycle == NULL) {
- cycle = (ngx_cycle_t *) ngx_cycle;
- continue;
- }
-
- ngx_cycle = cycle;
- }
-
- if (ngx_reopen) {
- ngx_reopen = 0;
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reopening logs");
- ngx_reopen_files(cycle, (ngx_uid_t) -1);
- }
- }
-}
-
-
-static void
-ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n, ngx_int_t type)
-{
- ngx_int_t i;
- ngx_channel_t ch;
-
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "start worker processes");
-
- ngx_memzero(&ch, sizeof(ngx_channel_t));
-
- ch.command = NGX_CMD_OPEN_CHANNEL;
-
- for (i = 0; i < n; i++) {
-
- ngx_spawn_process(cycle, ngx_worker_process_cycle,
- (void *) (intptr_t) i, "worker process", type);
-
- ch.pid = ngx_processes[ngx_process_slot].pid;
- ch.slot = ngx_process_slot;
- ch.fd = ngx_processes[ngx_process_slot].channel[0];
-
- ngx_pass_open_channel(cycle, &ch);
- }
-}
-
-
-static void
-ngx_start_cache_manager_processes(ngx_cycle_t *cycle, ngx_uint_t respawn)
-{
- ngx_uint_t i, manager, loader;
- ngx_path_t **path;
- ngx_channel_t ch;
-
- manager = 0;
- loader = 0;
-
- path = ngx_cycle->paths.elts;
- for (i = 0; i < ngx_cycle->paths.nelts; i++) {
-
- if (path[i]->manager) {
- manager = 1;
- }
-
- if (path[i]->loader) {
- loader = 1;
- }
- }
-
- if (manager == 0) {
- return;
- }
-
- ngx_spawn_process(cycle, ngx_cache_manager_process_cycle,
- &ngx_cache_manager_ctx, "cache manager process",
- respawn ? NGX_PROCESS_JUST_RESPAWN : NGX_PROCESS_RESPAWN);
-
- ngx_memzero(&ch, sizeof(ngx_channel_t));
-
- ch.command = NGX_CMD_OPEN_CHANNEL;
- ch.pid = ngx_processes[ngx_process_slot].pid;
- ch.slot = ngx_process_slot;
- ch.fd = ngx_processes[ngx_process_slot].channel[0];
-
- ngx_pass_open_channel(cycle, &ch);
-
- if (loader == 0) {
- return;
- }
-
- ngx_spawn_process(cycle, ngx_cache_manager_process_cycle,
- &ngx_cache_loader_ctx, "cache loader process",
- respawn ? NGX_PROCESS_JUST_SPAWN : NGX_PROCESS_NORESPAWN);
-
- ch.command = NGX_CMD_OPEN_CHANNEL;
- ch.pid = ngx_processes[ngx_process_slot].pid;
- ch.slot = ngx_process_slot;
- ch.fd = ngx_processes[ngx_process_slot].channel[0];
-
- ngx_pass_open_channel(cycle, &ch);
-}
-
-
-static void
-ngx_pass_open_channel(ngx_cycle_t *cycle, ngx_channel_t *ch)
-{
- ngx_int_t i;
-
- for (i = 0; i < ngx_last_process; i++) {
-
- if (i == ngx_process_slot
- || ngx_processes[i].pid == -1
- || ngx_processes[i].channel[0] == -1)
- {
- continue;
- }
-
- ngx_log_debug6(NGX_LOG_DEBUG_CORE, cycle->log, 0,
- "pass channel s:%d pid:%P fd:%d to s:%i pid:%P fd:%d",
- ch->slot, ch->pid, ch->fd,
- i, ngx_processes[i].pid,
- ngx_processes[i].channel[0]);
-
- /* TODO: NGX_AGAIN */
-
- ngx_write_channel(ngx_processes[i].channel[0],
- ch, sizeof(ngx_channel_t), cycle->log);
- }
-}
-
-
-static void
-ngx_signal_worker_processes(ngx_cycle_t *cycle, int signo)
-{
- ngx_int_t i;
- ngx_err_t err;
- ngx_channel_t ch;
-
- ngx_memzero(&ch, sizeof(ngx_channel_t));
-
-#if (NGX_BROKEN_SCM_RIGHTS)
-
- ch.command = 0;
-
-#else
-
- switch (signo) {
-
- case ngx_signal_value(NGX_SHUTDOWN_SIGNAL):
- ch.command = NGX_CMD_QUIT;
- break;
-
- case ngx_signal_value(NGX_TERMINATE_SIGNAL):
- ch.command = NGX_CMD_TERMINATE;
- break;
-
- case ngx_signal_value(NGX_REOPEN_SIGNAL):
- ch.command = NGX_CMD_REOPEN;
- break;
-
- default:
- ch.command = 0;
- }
-
-#endif
-
- ch.fd = -1;
-
-
- for (i = 0; i < ngx_last_process; i++) {
-
- ngx_log_debug7(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "child: %d %P e:%d t:%d d:%d r:%d j:%d",
- i,
- ngx_processes[i].pid,
- ngx_processes[i].exiting,
- ngx_processes[i].exited,
- ngx_processes[i].detached,
- ngx_processes[i].respawn,
- ngx_processes[i].just_spawn);
-
- if (ngx_processes[i].detached || ngx_processes[i].pid == -1) {
- continue;
- }
-
- if (ngx_processes[i].just_spawn) {
- ngx_processes[i].just_spawn = 0;
- continue;
- }
-
- if (ngx_processes[i].exiting
- && signo == ngx_signal_value(NGX_SHUTDOWN_SIGNAL))
- {
- continue;
- }
-
- if (ch.command) {
- if (ngx_write_channel(ngx_processes[i].channel[0],
- &ch, sizeof(ngx_channel_t), cycle->log)
- == NGX_OK)
- {
- if (signo != ngx_signal_value(NGX_REOPEN_SIGNAL)) {
- ngx_processes[i].exiting = 1;
- }
-
- continue;
- }
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_CORE, cycle->log, 0,
- "kill (%P, %d)", ngx_processes[i].pid, signo);
-
- if (kill(ngx_processes[i].pid, signo) == -1) {
- err = ngx_errno;
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- "kill(%P, %d) failed", ngx_processes[i].pid, signo);
-
- if (err == NGX_ESRCH) {
- ngx_processes[i].exited = 1;
- ngx_processes[i].exiting = 0;
- ngx_reap = 1;
- }
-
- continue;
- }
-
- if (signo != ngx_signal_value(NGX_REOPEN_SIGNAL)) {
- ngx_processes[i].exiting = 1;
- }
- }
-}
-
-
-static ngx_uint_t
-ngx_reap_children(ngx_cycle_t *cycle)
-{
- ngx_int_t i, n;
- ngx_uint_t live;
- ngx_channel_t ch;
- ngx_core_conf_t *ccf;
-
- ngx_memzero(&ch, sizeof(ngx_channel_t));
-
- ch.command = NGX_CMD_CLOSE_CHANNEL;
- ch.fd = -1;
-
- live = 0;
- for (i = 0; i < ngx_last_process; i++) {
-
- ngx_log_debug7(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
- "child: %d %P e:%d t:%d d:%d r:%d j:%d",
- i,
- ngx_processes[i].pid,
- ngx_processes[i].exiting,
- ngx_processes[i].exited,
- ngx_processes[i].detached,
- ngx_processes[i].respawn,
- ngx_processes[i].just_spawn);
-
- if (ngx_processes[i].pid == -1) {
- continue;
- }
-
- if (ngx_processes[i].exited) {
-
- if (!ngx_processes[i].detached) {
- ngx_close_channel(ngx_processes[i].channel, cycle->log);
-
- ngx_processes[i].channel[0] = -1;
- ngx_processes[i].channel[1] = -1;
-
- ch.pid = ngx_processes[i].pid;
- ch.slot = i;
-
- for (n = 0; n < ngx_last_process; n++) {
- if (ngx_processes[n].exited
- || ngx_processes[n].pid == -1
- || ngx_processes[n].channel[0] == -1)
- {
- continue;
- }
-
- ngx_log_debug3(NGX_LOG_DEBUG_CORE, cycle->log, 0,
- "pass close channel s:%i pid:%P to:%P",
- ch.slot, ch.pid, ngx_processes[n].pid);
-
- /* TODO: NGX_AGAIN */
-
- ngx_write_channel(ngx_processes[n].channel[0],
- &ch, sizeof(ngx_channel_t), cycle->log);
- }
- }
-
- if (ngx_processes[i].respawn
- && !ngx_processes[i].exiting
- && !ngx_terminate
- && !ngx_quit)
- {
- if (ngx_spawn_process(cycle, ngx_processes[i].proc,
- ngx_processes[i].data,
- ngx_processes[i].name, i)
- == NGX_INVALID_PID)
- {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "could not respawn %s",
- ngx_processes[i].name);
- continue;
- }
-
-
- ch.command = NGX_CMD_OPEN_CHANNEL;
- ch.pid = ngx_processes[ngx_process_slot].pid;
- ch.slot = ngx_process_slot;
- ch.fd = ngx_processes[ngx_process_slot].channel[0];
-
- ngx_pass_open_channel(cycle, &ch);
-
- live = 1;
-
- continue;
- }
-
- if (ngx_processes[i].pid == ngx_new_binary) {
-
- ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx,
- ngx_core_module);
-
- if (ngx_rename_file((char *) ccf->oldpid.data,
- (char *) ccf->pid.data)
- == NGX_FILE_ERROR)
- {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- ngx_rename_file_n " %s back to %s failed "
- "after the new binary process \"%s\" exited",
- ccf->oldpid.data, ccf->pid.data, ngx_argv[0]);
- }
-
- ngx_new_binary = 0;
- if (ngx_noaccepting) {
- ngx_restart = 1;
- ngx_noaccepting = 0;
- }
- }
-
- if (i == ngx_last_process - 1) {
- ngx_last_process--;
-
- } else {
- ngx_processes[i].pid = -1;
- }
-
- } else if (ngx_processes[i].exiting || !ngx_processes[i].detached) {
- live = 1;
- }
- }
-
- return live;
-}
-
-
-static void
-ngx_master_process_exit(ngx_cycle_t *cycle)
-{
- ngx_uint_t i;
-
- ngx_delete_pidfile(cycle);
-
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exit");
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->exit_master) {
- ngx_modules[i]->exit_master(cycle);
- }
- }
-
- ngx_close_listening_sockets(cycle);
-
- /*
- * Copy ngx_cycle->log related data to the special static exit cycle,
- * log, and log file structures enough to allow a signal handler to log.
- * The handler may be called when standard ngx_cycle->log allocated from
- * ngx_cycle->pool is already destroyed.
- */
-
-
- ngx_exit_log = *ngx_log_get_file_log(ngx_cycle->log);
-
- ngx_exit_log_file.fd = ngx_exit_log.file->fd;
- ngx_exit_log.file = &ngx_exit_log_file;
- ngx_exit_log.next = NULL;
- ngx_exit_log.writer = NULL;
-
- ngx_exit_cycle.log = &ngx_exit_log;
- ngx_exit_cycle.files = ngx_cycle->files;
- ngx_exit_cycle.files_n = ngx_cycle->files_n;
- ngx_cycle = &ngx_exit_cycle;
-
- ngx_destroy_pool(cycle->pool);
-
- exit(0);
-}
-
-
-static void
-ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data)
-{
- ngx_int_t worker = (intptr_t) data;
-
- ngx_uint_t i;
- ngx_connection_t *c;
-
- ngx_process = NGX_PROCESS_WORKER;
-
- ngx_worker_process_init(cycle, worker);
-
- ngx_setproctitle("worker process");
-
-#if (NGX_THREADS)
- {
- ngx_int_t n;
- ngx_err_t err;
- ngx_core_conf_t *ccf;
-
- ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
-
- if (ngx_threads_n) {
- if (ngx_init_threads(ngx_threads_n, ccf->thread_stack_size, cycle)
- == NGX_ERROR)
- {
- /* fatal */
- exit(2);
- }
-
- err = ngx_thread_key_create(&ngx_core_tls_key);
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- ngx_thread_key_create_n " failed");
- /* fatal */
- exit(2);
- }
-
- for (n = 0; n < ngx_threads_n; n++) {
-
- ngx_threads[n].cv = ngx_cond_init(cycle->log);
-
- if (ngx_threads[n].cv == NULL) {
- /* fatal */
- exit(2);
- }
-
- if (ngx_create_thread((ngx_tid_t *) &ngx_threads[n].tid,
- ngx_worker_thread_cycle,
- (void *) &ngx_threads[n], cycle->log)
- != 0)
- {
- /* fatal */
- exit(2);
- }
- }
- }
- }
-#endif
-
- for ( ;; ) {
-
- if (ngx_exiting) {
-
- c = cycle->connections;
-
- for (i = 0; i < cycle->connection_n; i++) {
-
- /* THREAD: lock */
-
- if (c[i].fd != -1 && c[i].idle) {
- c[i].close = 1;
- c[i].read->handler(c[i].read);
- }
- }
-
- if (ngx_event_timer_rbtree.root == ngx_event_timer_rbtree.sentinel)
- {
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
-
- ngx_worker_process_exit(cycle);
- }
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "worker cycle");
-
- ngx_process_events_and_timers(cycle);
-
- if (ngx_terminate) {
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
-
- ngx_worker_process_exit(cycle);
- }
-
- if (ngx_quit) {
- ngx_quit = 0;
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0,
- "gracefully shutting down");
- ngx_setproctitle("worker process is shutting down");
-
- if (!ngx_exiting) {
- ngx_close_listening_sockets(cycle);
- ngx_exiting = 1;
- }
- }
-
- if (ngx_reopen) {
- ngx_reopen = 0;
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reopening logs");
- ngx_reopen_files(cycle, -1);
- }
- }
-}
-
-
-static void
-ngx_worker_process_init(ngx_cycle_t *cycle, ngx_int_t worker)
-{
- sigset_t set;
- uint64_t cpu_affinity;
- ngx_int_t n;
- ngx_uint_t i;
- struct rlimit rlmt;
- ngx_core_conf_t *ccf;
- ngx_listening_t *ls;
-
- if (ngx_set_environment(cycle, NULL) == NULL) {
- /* fatal */
- exit(2);
- }
-
- ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
-
- if (worker >= 0 && ccf->priority != 0) {
- if (setpriority(PRIO_PROCESS, 0, ccf->priority) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "setpriority(%d) failed", ccf->priority);
- }
- }
-
- if (ccf->rlimit_nofile != NGX_CONF_UNSET) {
- rlmt.rlim_cur = (rlim_t) ccf->rlimit_nofile;
- rlmt.rlim_max = (rlim_t) ccf->rlimit_nofile;
-
- if (setrlimit(RLIMIT_NOFILE, &rlmt) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "setrlimit(RLIMIT_NOFILE, %i) failed",
- ccf->rlimit_nofile);
- }
- }
-
- if (ccf->rlimit_core != NGX_CONF_UNSET) {
- rlmt.rlim_cur = (rlim_t) ccf->rlimit_core;
- rlmt.rlim_max = (rlim_t) ccf->rlimit_core;
-
- if (setrlimit(RLIMIT_CORE, &rlmt) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "setrlimit(RLIMIT_CORE, %O) failed",
- ccf->rlimit_core);
- }
- }
-
-#ifdef RLIMIT_SIGPENDING
- if (ccf->rlimit_sigpending != NGX_CONF_UNSET) {
- rlmt.rlim_cur = (rlim_t) ccf->rlimit_sigpending;
- rlmt.rlim_max = (rlim_t) ccf->rlimit_sigpending;
-
- if (setrlimit(RLIMIT_SIGPENDING, &rlmt) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "setrlimit(RLIMIT_SIGPENDING, %i) failed",
- ccf->rlimit_sigpending);
- }
- }
-#endif
-
- if (geteuid() == 0) {
- if (setgid(ccf->group) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "setgid(%d) failed", ccf->group);
- /* fatal */
- exit(2);
- }
-
- if (initgroups(ccf->username, ccf->group) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "initgroups(%s, %d) failed",
- ccf->username, ccf->group);
- }
-
- if (setuid(ccf->user) == -1) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
- "setuid(%d) failed", ccf->user);
- /* fatal */
- exit(2);
- }
- }
-
- if (worker >= 0) {
- cpu_affinity = ngx_get_cpu_affinity(worker);
-
- if (cpu_affinity) {
- ngx_setaffinity(cpu_affinity, cycle->log);
- }
- }
-
-#if (NGX_HAVE_PR_SET_DUMPABLE)
-
- /* allow coredump after setuid() in Linux 2.4.x */
-
- if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "prctl(PR_SET_DUMPABLE) failed");
- }
-
-#endif
-
- if (ccf->working_directory.len) {
- if (chdir((char *) ccf->working_directory.data) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "chdir(\"%s\") failed", ccf->working_directory.data);
- /* fatal */
- exit(2);
- }
- }
-
- sigemptyset(&set);
-
- if (sigprocmask(SIG_SETMASK, &set, NULL) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "sigprocmask() failed");
- }
-
- srandom((ngx_pid << 16) ^ ngx_time());
-
- /*
- * disable deleting previous events for the listening sockets because
- * in the worker processes there are no events at all at this point
- */
- ls = cycle->listening.elts;
- for (i = 0; i < cycle->listening.nelts; i++) {
- ls[i].previous = NULL;
- }
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->init_process) {
- if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) {
- /* fatal */
- exit(2);
- }
- }
- }
-
- for (n = 0; n < ngx_last_process; n++) {
-
- if (ngx_processes[n].pid == -1) {
- continue;
- }
-
- if (n == ngx_process_slot) {
- continue;
- }
-
- if (ngx_processes[n].channel[1] == -1) {
- continue;
- }
-
- if (close(ngx_processes[n].channel[1]) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "close() channel failed");
- }
- }
-
- if (close(ngx_processes[ngx_process_slot].channel[0]) == -1) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
- "close() channel failed");
- }
-
-#if 0
- ngx_last_process = 0;
-#endif
-
- if (ngx_add_channel_event(cycle, ngx_channel, NGX_READ_EVENT,
- ngx_channel_handler)
- == NGX_ERROR)
- {
- /* fatal */
- exit(2);
- }
-}
-
-
-static void
-ngx_worker_process_exit(ngx_cycle_t *cycle)
-{
- ngx_uint_t i;
- ngx_connection_t *c;
-
-#if (NGX_THREADS)
- ngx_terminate = 1;
-
- ngx_wakeup_worker_threads(cycle);
-#endif
-
- for (i = 0; ngx_modules[i]; i++) {
- if (ngx_modules[i]->exit_process) {
- ngx_modules[i]->exit_process(cycle);
- }
- }
-
- if (ngx_exiting) {
- c = cycle->connections;
- for (i = 0; i < cycle->connection_n; i++) {
- if (c[i].fd != -1
- && c[i].read
- && !c[i].read->accept
- && !c[i].read->channel
- && !c[i].read->resolver)
- {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0,
- "*%uA open socket #%d left in connection %ui",
- c[i].number, c[i].fd, i);
- ngx_debug_quit = 1;
- }
- }
-
- if (ngx_debug_quit) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, "aborting");
- ngx_debug_point();
- }
- }
-
- /*
- * Copy ngx_cycle->log related data to the special static exit cycle,
- * log, and log file structures enough to allow a signal handler to log.
- * The handler may be called when standard ngx_cycle->log allocated from
- * ngx_cycle->pool is already destroyed.
- */
-
- ngx_exit_log = *ngx_log_get_file_log(ngx_cycle->log);
-
- ngx_exit_log_file.fd = ngx_exit_log.file->fd;
- ngx_exit_log.file = &ngx_exit_log_file;
- ngx_exit_log.next = NULL;
- ngx_exit_log.writer = NULL;
-
- ngx_exit_cycle.log = &ngx_exit_log;
- ngx_exit_cycle.files = ngx_cycle->files;
- ngx_exit_cycle.files_n = ngx_cycle->files_n;
- ngx_cycle = &ngx_exit_cycle;
-
- ngx_destroy_pool(cycle->pool);
-
- ngx_log_error(NGX_LOG_NOTICE, ngx_cycle->log, 0, "exit");
-
- exit(0);
-}
-
-
-static void
-ngx_channel_handler(ngx_event_t *ev)
-{
- ngx_int_t n;
- ngx_channel_t ch;
- ngx_connection_t *c;
-
- if (ev->timedout) {
- ev->timedout = 0;
- return;
- }
-
- c = ev->data;
-
- ngx_log_debug0(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel handler");
-
- for ( ;; ) {
-
- n = ngx_read_channel(c->fd, &ch, sizeof(ngx_channel_t), ev->log);
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0, "channel: %i", n);
-
- if (n == NGX_ERROR) {
-
- if (ngx_event_flags & NGX_USE_EPOLL_EVENT) {
- ngx_del_conn(c, 0);
- }
-
- ngx_close_connection(c);
- return;
- }
-
- if (ngx_event_flags & NGX_USE_EVENTPORT_EVENT) {
- if (ngx_add_event(ev, NGX_READ_EVENT, 0) == NGX_ERROR) {
- return;
- }
- }
-
- if (n == NGX_AGAIN) {
- return;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, ev->log, 0,
- "channel command: %d", ch.command);
-
- switch (ch.command) {
-
- case NGX_CMD_QUIT:
- ngx_quit = 1;
- break;
-
- case NGX_CMD_TERMINATE:
- ngx_terminate = 1;
- break;
-
- case NGX_CMD_REOPEN:
- ngx_reopen = 1;
- break;
-
- case NGX_CMD_OPEN_CHANNEL:
-
- ngx_log_debug3(NGX_LOG_DEBUG_CORE, ev->log, 0,
- "get channel s:%i pid:%P fd:%d",
- ch.slot, ch.pid, ch.fd);
-
- ngx_processes[ch.slot].pid = ch.pid;
- ngx_processes[ch.slot].channel[0] = ch.fd;
- break;
-
- case NGX_CMD_CLOSE_CHANNEL:
-
- ngx_log_debug4(NGX_LOG_DEBUG_CORE, ev->log, 0,
- "close channel s:%i pid:%P our:%P fd:%d",
- ch.slot, ch.pid, ngx_processes[ch.slot].pid,
- ngx_processes[ch.slot].channel[0]);
-
- if (close(ngx_processes[ch.slot].channel[0]) == -1) {
- ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_errno,
- "close() channel failed");
- }
-
- ngx_processes[ch.slot].channel[0] = -1;
- break;
- }
- }
-}
-
-
-#if (NGX_THREADS)
-
-static void
-ngx_wakeup_worker_threads(ngx_cycle_t *cycle)
-{
- ngx_int_t i;
- ngx_uint_t live;
-
- for ( ;; ) {
-
- live = 0;
-
- for (i = 0; i < ngx_threads_n; i++) {
- if (ngx_threads[i].state < NGX_THREAD_EXIT) {
- if (ngx_cond_signal(ngx_threads[i].cv) == NGX_ERROR) {
- ngx_threads[i].state = NGX_THREAD_DONE;
-
- } else {
- live = 1;
- }
- }
-
- if (ngx_threads[i].state == NGX_THREAD_EXIT) {
- ngx_thread_join(ngx_threads[i].tid, NULL);
- ngx_threads[i].state = NGX_THREAD_DONE;
- }
- }
-
- if (live == 0) {
- ngx_log_debug0(NGX_LOG_DEBUG_CORE, cycle->log, 0,
- "all worker threads are joined");
-
- /* STUB */
- ngx_done_events(cycle);
- ngx_mutex_destroy(ngx_event_timer_mutex);
-
- return;
- }
-
- ngx_sched_yield();
- }
-}
-
-
-static ngx_thread_value_t
-ngx_worker_thread_cycle(void *data)
-{
- ngx_thread_t *thr = data;
-
- sigset_t set;
- ngx_err_t err;
- ngx_core_tls_t *tls;
- ngx_cycle_t *cycle;
-
- cycle = (ngx_cycle_t *) ngx_cycle;
-
- sigemptyset(&set);
- sigaddset(&set, ngx_signal_value(NGX_RECONFIGURE_SIGNAL));
- sigaddset(&set, ngx_signal_value(NGX_REOPEN_SIGNAL));
- sigaddset(&set, ngx_signal_value(NGX_CHANGEBIN_SIGNAL));
-
- err = ngx_thread_sigmask(SIG_BLOCK, &set, NULL);
- if (err) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- ngx_thread_sigmask_n " failed");
- return (ngx_thread_value_t) 1;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cycle->log, 0,
- "thread " NGX_TID_T_FMT " started", ngx_thread_self());
-
- ngx_setthrtitle("worker thread");
-
- tls = ngx_calloc(sizeof(ngx_core_tls_t), cycle->log);
- if (tls == NULL) {
- return (ngx_thread_value_t) 1;
- }
-
- err = ngx_thread_set_tls(ngx_core_tls_key, tls);
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- ngx_thread_set_tls_n " failed");
- return (ngx_thread_value_t) 1;
- }
-
- for ( ;; ) {
- thr->state = NGX_THREAD_FREE;
-
-#if 0
- if (ngx_cond_wait(thr->cv, ngx_posted_events_mutex) == NGX_ERROR) {
- return (ngx_thread_value_t) 1;
- }
-#endif
-
- if (ngx_terminate) {
- thr->state = NGX_THREAD_EXIT;
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cycle->log, 0,
- "thread " NGX_TID_T_FMT " is done",
- ngx_thread_self());
-
- return (ngx_thread_value_t) 0;
- }
-
- thr->state = NGX_THREAD_BUSY;
-
-#if 0
- if (ngx_event_thread_process_posted(cycle) == NGX_ERROR) {
- return (ngx_thread_value_t) 1;
- }
-
- if (ngx_event_thread_process_posted(cycle) == NGX_ERROR) {
- return (ngx_thread_value_t) 1;
- }
-#endif
-
- if (ngx_process_changes) {
- if (ngx_process_changes(cycle, 1) == NGX_ERROR) {
- return (ngx_thread_value_t) 1;
- }
- }
- }
-}
-
-#endif
-
-
-static void
-ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data)
-{
- ngx_cache_manager_ctx_t *ctx = data;
-
- void *ident[4];
- ngx_event_t ev;
-
- /*
- * Set correct process type since closing listening Unix domain socket
- * in a master process also removes the Unix domain socket file.
- */
- ngx_process = NGX_PROCESS_HELPER;
-
- ngx_close_listening_sockets(cycle);
-
- /* Set a moderate number of connections for a helper process. */
- cycle->connection_n = 512;
-
- ngx_worker_process_init(cycle, -1);
-
- ngx_memzero(&ev, sizeof(ngx_event_t));
- ev.handler = ctx->handler;
- ev.data = ident;
- ev.log = cycle->log;
- ident[3] = (void *) -1;
-
- ngx_use_accept_mutex = 0;
-
- ngx_setproctitle(ctx->name);
-
- ngx_add_timer(&ev, ctx->delay);
-
- for ( ;; ) {
-
- if (ngx_terminate || ngx_quit) {
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
- exit(0);
- }
-
- if (ngx_reopen) {
- ngx_reopen = 0;
- ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "reopening logs");
- ngx_reopen_files(cycle, -1);
- }
-
- ngx_process_events_and_timers(cycle);
- }
-}
-
-
-static void
-ngx_cache_manager_process_handler(ngx_event_t *ev)
-{
- time_t next, n;
- ngx_uint_t i;
- ngx_path_t **path;
-
- next = 60 * 60;
-
- path = ngx_cycle->paths.elts;
- for (i = 0; i < ngx_cycle->paths.nelts; i++) {
-
- if (path[i]->manager) {
- n = path[i]->manager(path[i]->data);
-
- next = (n <= next) ? n : next;
-
- ngx_time_update();
- }
- }
-
- if (next == 0) {
- next = 1;
- }
-
- ngx_add_timer(ev, next * 1000);
-}
-
-
-static void
-ngx_cache_loader_process_handler(ngx_event_t *ev)
-{
- ngx_uint_t i;
- ngx_path_t **path;
- ngx_cycle_t *cycle;
-
- cycle = (ngx_cycle_t *) ngx_cycle;
-
- path = cycle->paths.elts;
- for (i = 0; i < cycle->paths.nelts; i++) {
-
- if (ngx_terminate || ngx_quit) {
- break;
- }
-
- if (path[i]->loader) {
- path[i]->loader(path[i]->data);
- ngx_time_update();
- }
- }
-
- exit(0);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.h
deleted file mode 100644
index 94747b85d55..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_process_cycle.h
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_PROCESS_CYCLE_H_INCLUDED_
-#define _NGX_PROCESS_CYCLE_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-#define NGX_CMD_OPEN_CHANNEL 1
-#define NGX_CMD_CLOSE_CHANNEL 2
-#define NGX_CMD_QUIT 3
-#define NGX_CMD_TERMINATE 4
-#define NGX_CMD_REOPEN 5
-
-
-#define NGX_PROCESS_SINGLE 0
-#define NGX_PROCESS_MASTER 1
-#define NGX_PROCESS_SIGNALLER 2
-#define NGX_PROCESS_WORKER 3
-#define NGX_PROCESS_HELPER 4
-
-
-typedef struct {
- ngx_event_handler_pt handler;
- char *name;
- ngx_msec_t delay;
-} ngx_cache_manager_ctx_t;
-
-
-void ngx_master_process_cycle(ngx_cycle_t *cycle);
-void ngx_single_process_cycle(ngx_cycle_t *cycle);
-
-
-extern ngx_uint_t ngx_process;
-extern ngx_pid_t ngx_pid;
-extern ngx_pid_t ngx_new_binary;
-extern ngx_uint_t ngx_inherited;
-extern ngx_uint_t ngx_daemonized;
-extern ngx_uint_t ngx_threaded;
-extern ngx_uint_t ngx_exiting;
-
-extern sig_atomic_t ngx_reap;
-extern sig_atomic_t ngx_sigio;
-extern sig_atomic_t ngx_sigalrm;
-extern sig_atomic_t ngx_quit;
-extern sig_atomic_t ngx_debug_quit;
-extern sig_atomic_t ngx_terminate;
-extern sig_atomic_t ngx_noaccept;
-extern sig_atomic_t ngx_reconfigure;
-extern sig_atomic_t ngx_reopen;
-extern sig_atomic_t ngx_change_binary;
-
-
-#endif /* _NGX_PROCESS_CYCLE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_pthread_thread.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_pthread_thread.c
deleted file mode 100644
index 1cf31c3bc2b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_pthread_thread.c
+++ /dev/null
@@ -1,278 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-static ngx_uint_t nthreads;
-static ngx_uint_t max_threads;
-
-
-static pthread_attr_t thr_attr;
-
-
-ngx_err_t
-ngx_create_thread(ngx_tid_t *tid, ngx_thread_value_t (*func)(void *arg),
- void *arg, ngx_log_t *log)
-{
- int err;
-
- if (nthreads >= max_threads) {
- ngx_log_error(NGX_LOG_CRIT, log, 0,
- "no more than %ui threads can be created", max_threads);
- return NGX_ERROR;
- }
-
- err = pthread_create(tid, &thr_attr, func, arg);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, log, err, "pthread_create() failed");
- return err;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0,
- "thread is created: " NGX_TID_T_FMT, *tid);
-
- nthreads++;
-
- return err;
-}
-
-
-ngx_int_t
-ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle)
-{
- int err;
-
- max_threads = n;
-
- err = pthread_attr_init(&thr_attr);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- "pthread_attr_init() failed");
- return NGX_ERROR;
- }
-
- err = pthread_attr_setstacksize(&thr_attr, size);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
- "pthread_attr_setstacksize() failed");
- return NGX_ERROR;
- }
-
- ngx_threaded = 1;
-
- return NGX_OK;
-}
-
-
-ngx_mutex_t *
-ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags)
-{
- int err;
- ngx_mutex_t *m;
-
- m = ngx_alloc(sizeof(ngx_mutex_t), log);
- if (m == NULL) {
- return NULL;
- }
-
- m->log = log;
-
- err = pthread_mutex_init(&m->mutex, NULL);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, m->log, err,
- "pthread_mutex_init() failed");
- return NULL;
- }
-
- return m;
-}
-
-
-void
-ngx_mutex_destroy(ngx_mutex_t *m)
-{
- int err;
-
- err = pthread_mutex_destroy(&m->mutex);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, m->log, err,
- "pthread_mutex_destroy(%p) failed", m);
- }
-
- ngx_free(m);
-}
-
-
-void
-ngx_mutex_lock(ngx_mutex_t *m)
-{
- int err;
-
- if (!ngx_threaded) {
- return;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0, "lock mutex %p", m);
-
- err = pthread_mutex_lock(&m->mutex);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, m->log, err,
- "pthread_mutex_lock(%p) failed", m);
- ngx_abort();
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0, "mutex %p is locked", m);
-
- return;
-}
-
-
-ngx_int_t
-ngx_mutex_trylock(ngx_mutex_t *m)
-{
- int err;
-
- if (!ngx_threaded) {
- return NGX_OK;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0, "try lock mutex %p", m);
-
- err = pthread_mutex_trylock(&m->mutex);
-
- if (err == NGX_EBUSY) {
- return NGX_AGAIN;
- }
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, m->log, err,
- "pthread_mutex_trylock(%p) failed", m);
- ngx_abort();
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0, "mutex %p is locked", m);
-
- return NGX_OK;
-}
-
-
-void
-ngx_mutex_unlock(ngx_mutex_t *m)
-{
- int err;
-
- if (!ngx_threaded) {
- return;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0, "unlock mutex %p", m);
-
- err = pthread_mutex_unlock(&m->mutex);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, m->log, err,
- "pthread_mutex_unlock(%p) failed", m);
- ngx_abort();
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0, "mutex %p is unlocked", m);
-
- return;
-}
-
-
-ngx_cond_t *
-ngx_cond_init(ngx_log_t *log)
-{
- int err;
- ngx_cond_t *cv;
-
- cv = ngx_alloc(sizeof(ngx_cond_t), log);
- if (cv == NULL) {
- return NULL;
- }
-
- cv->log = log;
-
- err = pthread_cond_init(&cv->cond, NULL);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, err,
- "pthread_cond_init() failed");
- return NULL;
- }
-
- return cv;
-}
-
-
-void
-ngx_cond_destroy(ngx_cond_t *cv)
-{
- int err;
-
- err = pthread_cond_destroy(&cv->cond);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, err,
- "pthread_cond_destroy(%p) failed", cv);
- }
-
- ngx_free(cv);
-}
-
-
-ngx_int_t
-ngx_cond_wait(ngx_cond_t *cv, ngx_mutex_t *m)
-{
- int err;
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cv->log, 0, "cv %p wait", cv);
-
- err = pthread_cond_wait(&cv->cond, &m->mutex);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, err,
- "pthread_cond_wait(%p) failed", cv);
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cv->log, 0, "cv %p is waked up", cv);
-
- ngx_log_debug1(NGX_LOG_DEBUG_MUTEX, m->log, 0, "mutex %p is locked", m);
-
- return NGX_OK;
-}
-
-
-ngx_int_t
-ngx_cond_signal(ngx_cond_t *cv)
-{
- int err;
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cv->log, 0, "cv %p to signal", cv);
-
- err = pthread_cond_signal(&cv->cond);
-
- if (err != 0) {
- ngx_log_error(NGX_LOG_ALERT, cv->log, err,
- "pthread_cond_signal(%p) failed", cv);
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, cv->log, 0, "cv %p is signaled", cv);
-
- return NGX_OK;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_readv_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_readv_chain.c
deleted file mode 100644
index 3cba80cccc6..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_readv_chain.c
+++ /dev/null
@@ -1,174 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-ssize_t
-ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
-{
- u_char *prev;
- ssize_t n, size;
- ngx_err_t err;
- ngx_array_t vec;
- ngx_event_t *rev;
- struct iovec *iov, iovs[NGX_IOVS_PREALLOCATE];
-
- rev = c->read;
-
-#if (NGX_HAVE_KQUEUE)
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "readv: eof:%d, avail:%d, err:%d",
- rev->pending_eof, rev->available, rev->kq_errno);
-
- if (rev->available == 0) {
- if (rev->pending_eof) {
- rev->ready = 0;
- rev->eof = 1;
-
- ngx_log_error(NGX_LOG_INFO, c->log, rev->kq_errno,
- "kevent() reported about an closed connection");
-
- if (rev->kq_errno) {
- rev->error = 1;
- ngx_set_socket_errno(rev->kq_errno);
- return NGX_ERROR;
- }
-
- return 0;
-
- } else {
- return NGX_AGAIN;
- }
- }
- }
-
-#endif
-
- prev = NULL;
- iov = NULL;
- size = 0;
-
- vec.elts = iovs;
- vec.nelts = 0;
- vec.size = sizeof(struct iovec);
- vec.nalloc = NGX_IOVS_PREALLOCATE;
- vec.pool = c->pool;
-
- /* coalesce the neighbouring bufs */
-
- while (chain) {
- if (prev == chain->buf->last) {
- iov->iov_len += chain->buf->end - chain->buf->last;
-
- } else {
- if (vec.nelts >= IOV_MAX) {
- break;
- }
-
- iov = ngx_array_push(&vec);
- if (iov == NULL) {
- return NGX_ERROR;
- }
-
- iov->iov_base = (void *) chain->buf->last;
- iov->iov_len = chain->buf->end - chain->buf->last;
- }
-
- size += chain->buf->end - chain->buf->last;
- prev = chain->buf->end;
- chain = chain->next;
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "readv: %d, last:%d", vec.nelts, iov->iov_len);
-
- do {
- n = readv(c->fd, (struct iovec *) vec.elts, vec.nelts);
-
- if (n >= 0) {
-
-#if (NGX_HAVE_KQUEUE)
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- rev->available -= n;
-
- /*
- * rev->available may be negative here because some additional
- * bytes may be received between kevent() and recv()
- */
-
- if (rev->available <= 0) {
- if (!rev->pending_eof) {
- rev->ready = 0;
- }
-
- if (rev->available < 0) {
- rev->available = 0;
- }
- }
-
- if (n == 0) {
-
- /*
- * on FreeBSD recv() may return 0 on closed socket
- * even if kqueue reported about available data
- */
-
-#if 0
- ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "readv() returned 0 while kevent() reported "
- "%d available bytes", rev->available);
-#endif
-
- rev->ready = 0;
- rev->eof = 1;
- rev->available = 0;
- }
-
- return n;
- }
-
-#endif /* NGX_HAVE_KQUEUE */
-
- if (n < size && !(ngx_event_flags & NGX_USE_GREEDY_EVENT)) {
- rev->ready = 0;
- }
-
- if (n == 0) {
- rev->eof = 1;
- }
-
- return n;
- }
-
- err = ngx_socket_errno;
-
- if (err == NGX_EAGAIN || err == NGX_EINTR) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "readv() not ready");
- n = NGX_AGAIN;
-
- } else {
- n = ngx_connection_error(c, err, "readv() failed");
- break;
- }
-
- } while (err == NGX_EINTR);
-
- rev->ready = 0;
-
- if (n == NGX_ERROR) {
- c->read->error = 1;
- }
-
- return n;
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_recv.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_recv.c
deleted file mode 100644
index 86675dfdd8f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_recv.c
+++ /dev/null
@@ -1,183 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#if (NGX_HAVE_KQUEUE)
-
-ssize_t
-ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
-{
- ssize_t n;
- ngx_err_t err;
- ngx_event_t *rev;
-
- rev = c->read;
-
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "recv: eof:%d, avail:%d, err:%d",
- rev->pending_eof, rev->available, rev->kq_errno);
-
- if (rev->available == 0) {
- if (rev->pending_eof) {
- rev->ready = 0;
- rev->eof = 1;
-
- if (rev->kq_errno) {
- rev->error = 1;
- ngx_set_socket_errno(rev->kq_errno);
-
- return ngx_connection_error(c, rev->kq_errno,
- "kevent() reported about an closed connection");
- }
-
- return 0;
-
- } else {
- rev->ready = 0;
- return NGX_AGAIN;
- }
- }
- }
-
- do {
- n = recv(c->fd, buf, size, 0);
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "recv: fd:%d %d of %d", c->fd, n, size);
-
- if (n >= 0) {
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- rev->available -= n;
-
- /*
- * rev->available may be negative here because some additional
- * bytes may be received between kevent() and recv()
- */
-
- if (rev->available <= 0) {
- if (!rev->pending_eof) {
- rev->ready = 0;
- }
-
- if (rev->available < 0) {
- rev->available = 0;
- }
- }
-
- if (n == 0) {
-
- /*
- * on FreeBSD recv() may return 0 on closed socket
- * even if kqueue reported about available data
- */
-
- rev->ready = 0;
- rev->eof = 1;
- rev->available = 0;
- }
-
- return n;
- }
-
- if ((size_t) n < size
- && !(ngx_event_flags & NGX_USE_GREEDY_EVENT))
- {
- rev->ready = 0;
- }
-
- if (n == 0) {
- rev->eof = 1;
- }
-
- return n;
- }
-
- err = ngx_socket_errno;
-
- if (err == NGX_EAGAIN || err == NGX_EINTR) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "recv() not ready");
- n = NGX_AGAIN;
-
- } else {
- n = ngx_connection_error(c, err, "recv() failed");
- break;
- }
-
- } while (err == NGX_EINTR);
-
- rev->ready = 0;
-
- if (n == NGX_ERROR) {
- rev->error = 1;
- }
-
- return n;
-}
-
-#else /* ! NGX_HAVE_KQUEUE */
-
-ssize_t
-ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
-{
- ssize_t n;
- ngx_err_t err;
- ngx_event_t *rev;
-
- rev = c->read;
-
- do {
- n = recv(c->fd, buf, size, 0);
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "recv: fd:%d %d of %d", c->fd, n, size);
-
- if (n == 0) {
- rev->ready = 0;
- rev->eof = 1;
- return n;
-
- } else if (n > 0) {
-
- if ((size_t) n < size
- && !(ngx_event_flags & NGX_USE_GREEDY_EVENT))
- {
- rev->ready = 0;
- }
-
- return n;
- }
-
- err = ngx_socket_errno;
-
- if (err == NGX_EAGAIN || err == NGX_EINTR) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "recv() not ready");
- n = NGX_AGAIN;
-
- } else {
- n = ngx_connection_error(c, err, "recv() failed");
- break;
- }
-
- } while (err == NGX_EINTR);
-
- rev->ready = 0;
-
- if (n == NGX_ERROR) {
- rev->error = 1;
- }
-
- return n;
-}
-
-#endif /* NGX_HAVE_KQUEUE */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_send.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_send.c
deleted file mode 100644
index 80995ab3a50..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_send.c
+++ /dev/null
@@ -1,73 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-ssize_t
-ngx_unix_send(ngx_connection_t *c, u_char *buf, size_t size)
-{
- ssize_t n;
- ngx_err_t err;
- ngx_event_t *wev;
-
- wev = c->write;
-
-#if (NGX_HAVE_KQUEUE)
-
- if ((ngx_event_flags & NGX_USE_KQUEUE_EVENT) && wev->pending_eof) {
- (void) ngx_connection_error(c, wev->kq_errno,
- "kevent() reported about an closed connection");
- wev->error = 1;
- return NGX_ERROR;
- }
-
-#endif
-
- for ( ;; ) {
- n = send(c->fd, buf, size, 0);
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "send: fd:%d %d of %d", c->fd, n, size);
-
- if (n > 0) {
- if (n < (ssize_t) size) {
- wev->ready = 0;
- }
-
- c->sent += n;
-
- return n;
- }
-
- err = ngx_socket_errno;
-
- if (n == 0) {
- ngx_log_error(NGX_LOG_ALERT, c->log, err, "send() returned zero");
- wev->ready = 0;
- return n;
- }
-
- if (err == NGX_EAGAIN || err == NGX_EINTR) {
- wev->ready = 0;
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "send() not ready");
-
- if (err == NGX_EAGAIN) {
- return NGX_AGAIN;
- }
-
- } else {
- wev->error = 1;
- (void) ngx_connection_error(c, err, "send() failed");
- return NGX_ERROR;
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.c
deleted file mode 100644
index 8f6cf35948a..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.c
+++ /dev/null
@@ -1,69 +0,0 @@
-
-/*
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-#if (NGX_HAVE_CPUSET_SETAFFINITY)
-
-#include <sys/cpuset.h>
-
-void
-ngx_setaffinity(uint64_t cpu_affinity, ngx_log_t *log)
-{
- cpuset_t mask;
- ngx_uint_t i;
-
- ngx_log_error(NGX_LOG_NOTICE, log, 0,
- "cpuset_setaffinity(0x%08Xl)", cpu_affinity);
-
- CPU_ZERO(&mask);
- i = 0;
- do {
- if (cpu_affinity & 1) {
- CPU_SET(i, &mask);
- }
- i++;
- cpu_affinity >>= 1;
- } while (cpu_affinity);
-
- if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1,
- sizeof(cpuset_t), &mask) == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "cpuset_setaffinity() failed");
- }
-}
-
-#elif (NGX_HAVE_SCHED_SETAFFINITY)
-
-void
-ngx_setaffinity(uint64_t cpu_affinity, ngx_log_t *log)
-{
- cpu_set_t mask;
- ngx_uint_t i;
-
- ngx_log_error(NGX_LOG_NOTICE, log, 0,
- "sched_setaffinity(0x%08Xl)", cpu_affinity);
-
- CPU_ZERO(&mask);
- i = 0;
- do {
- if (cpu_affinity & 1) {
- CPU_SET(i, &mask);
- }
- i++;
- cpu_affinity >>= 1;
- } while (cpu_affinity);
-
- if (sched_setaffinity(0, sizeof(cpu_set_t), &mask) == -1) {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "sched_setaffinity() failed");
- }
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.h
deleted file mode 100644
index 33f5835dee6..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setaffinity.h
+++ /dev/null
@@ -1,23 +0,0 @@
-
-/*
- * Copyright (C) Nginx, Inc.
- */
-
-#ifndef _NGX_SETAFFINITY_H_INCLUDED_
-#define _NGX_SETAFFINITY_H_INCLUDED_
-
-
-#if (NGX_HAVE_SCHED_SETAFFINITY || NGX_HAVE_CPUSET_SETAFFINITY)
-
-#define NGX_HAVE_CPU_AFFINITY 1
-
-void ngx_setaffinity(uint64_t cpu_affinity, ngx_log_t *log);
-
-#else
-
-#define ngx_setaffinity(cpu_affinity, log)
-
-#endif
-
-
-#endif /* _NGX_SETAFFINITY_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.c
deleted file mode 100644
index 91afa519142..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.c
+++ /dev/null
@@ -1,135 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-#if (NGX_SETPROCTITLE_USES_ENV)
-
-/*
- * To change the process title in Linux and Solaris we have to set argv[1]
- * to NULL and to copy the title to the same place where the argv[0] points to.
- * However, argv[0] may be too small to hold a new title. Fortunately, Linux
- * and Solaris store argv[] and environ[] one after another. So we should
- * ensure that is the continuous memory and then we allocate the new memory
- * for environ[] and copy it. After this we could use the memory starting
- * from argv[0] for our process title.
- *
- * The Solaris's standard /bin/ps does not show the changed process title.
- * You have to use "/usr/ucb/ps -w" instead. Besides, the UCB ps does not
- * show a new title if its length less than the origin command line length.
- * To avoid it we append to a new title the origin command line in the
- * parenthesis.
- */
-
-extern char **environ;
-
-static char *ngx_os_argv_last;
-
-ngx_int_t
-ngx_init_setproctitle(ngx_log_t *log)
-{
- u_char *p;
- size_t size;
- ngx_uint_t i;
-
- size = 0;
-
- for (i = 0; environ[i]; i++) {
- size += ngx_strlen(environ[i]) + 1;
- }
-
- p = ngx_alloc(size, log);
- if (p == NULL) {
- return NGX_ERROR;
- }
-
- ngx_os_argv_last = ngx_os_argv[0];
-
- for (i = 0; ngx_os_argv[i]; i++) {
- if (ngx_os_argv_last == ngx_os_argv[i]) {
- ngx_os_argv_last = ngx_os_argv[i] + ngx_strlen(ngx_os_argv[i]) + 1;
- }
- }
-
- for (i = 0; environ[i]; i++) {
- if (ngx_os_argv_last == environ[i]) {
-
- size = ngx_strlen(environ[i]) + 1;
- ngx_os_argv_last = environ[i] + size;
-
- ngx_cpystrn(p, (u_char *) environ[i], size);
- environ[i] = (char *) p;
- p += size;
- }
- }
-
- ngx_os_argv_last--;
-
- return NGX_OK;
-}
-
-
-void
-ngx_setproctitle(char *title)
-{
- u_char *p;
-
-#if (NGX_SOLARIS)
-
- ngx_int_t i;
- size_t size;
-
-#endif
-
- ngx_os_argv[1] = NULL;
-
- p = ngx_cpystrn((u_char *) ngx_os_argv[0], (u_char *) "nginx: ",
- ngx_os_argv_last - ngx_os_argv[0]);
-
- p = ngx_cpystrn(p, (u_char *) title, ngx_os_argv_last - (char *) p);
-
-#if (NGX_SOLARIS)
-
- size = 0;
-
- for (i = 0; i < ngx_argc; i++) {
- size += ngx_strlen(ngx_argv[i]) + 1;
- }
-
- if (size > (size_t) ((char *) p - ngx_os_argv[0])) {
-
- /*
- * ngx_setproctitle() is too rare operation so we use
- * the non-optimized copies
- */
-
- p = ngx_cpystrn(p, (u_char *) " (", ngx_os_argv_last - (char *) p);
-
- for (i = 0; i < ngx_argc; i++) {
- p = ngx_cpystrn(p, (u_char *) ngx_argv[i],
- ngx_os_argv_last - (char *) p);
- p = ngx_cpystrn(p, (u_char *) " ", ngx_os_argv_last - (char *) p);
- }
-
- if (*(p - 1) == ' ') {
- *(p - 1) = ')';
- }
- }
-
-#endif
-
- if (ngx_os_argv_last - (char *) p) {
- ngx_memset(p, NGX_SETPROCTITLE_PAD, ngx_os_argv_last - (char *) p);
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, ngx_cycle->log, 0,
- "setproctitle: \"%s\"", ngx_os_argv[0]);
-}
-
-#endif /* NGX_SETPROCTITLE_USES_ENV */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.h
deleted file mode 100644
index c3636628bb7..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_setproctitle.h
+++ /dev/null
@@ -1,52 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_SETPROCTITLE_H_INCLUDED_
-#define _NGX_SETPROCTITLE_H_INCLUDED_
-
-
-#if (NGX_HAVE_SETPROCTITLE)
-
-/* FreeBSD, NetBSD, OpenBSD */
-
-#define ngx_init_setproctitle(log) NGX_OK
-#define ngx_setproctitle(title) setproctitle("%s", title)
-
-
-#else /* !NGX_HAVE_SETPROCTITLE */
-
-#if !defined NGX_SETPROCTITLE_USES_ENV
-
-#if (NGX_SOLARIS)
-
-#define NGX_SETPROCTITLE_USES_ENV 1
-#define NGX_SETPROCTITLE_PAD ' '
-
-ngx_int_t ngx_init_setproctitle(ngx_log_t *log);
-void ngx_setproctitle(char *title);
-
-#elif (NGX_LINUX) || (NGX_DARWIN)
-
-#define NGX_SETPROCTITLE_USES_ENV 1
-#define NGX_SETPROCTITLE_PAD '\0'
-
-ngx_int_t ngx_init_setproctitle(ngx_log_t *log);
-void ngx_setproctitle(char *title);
-
-#else
-
-#define ngx_init_setproctitle(log) NGX_OK
-#define ngx_setproctitle(title)
-
-#endif /* OSes */
-
-#endif /* NGX_SETPROCTITLE_USES_ENV */
-
-#endif /* NGX_HAVE_SETPROCTITLE */
-
-
-#endif /* _NGX_SETPROCTITLE_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.c
deleted file mode 100644
index 3ec7cbf1fd3..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.c
+++ /dev/null
@@ -1,126 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-#if (NGX_HAVE_MAP_ANON)
-
-ngx_int_t
-ngx_shm_alloc(ngx_shm_t *shm)
-{
- shm->addr = (u_char *) mmap(NULL, shm->size,
- PROT_READ|PROT_WRITE,
- MAP_ANON|MAP_SHARED, -1, 0);
-
- if (shm->addr == MAP_FAILED) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
- "mmap(MAP_ANON|MAP_SHARED, %uz) failed", shm->size);
- return NGX_ERROR;
- }
-
- return NGX_OK;
-}
-
-
-void
-ngx_shm_free(ngx_shm_t *shm)
-{
- if (munmap((void *) shm->addr, shm->size) == -1) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
- "munmap(%p, %uz) failed", shm->addr, shm->size);
- }
-}
-
-#elif (NGX_HAVE_MAP_DEVZERO)
-
-ngx_int_t
-ngx_shm_alloc(ngx_shm_t *shm)
-{
- ngx_fd_t fd;
-
- fd = open("/dev/zero", O_RDWR);
-
- if (fd == -1) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
- "open(\"/dev/zero\") failed");
- return NGX_ERROR;
- }
-
- shm->addr = (u_char *) mmap(NULL, shm->size, PROT_READ|PROT_WRITE,
- MAP_SHARED, fd, 0);
-
- if (shm->addr == MAP_FAILED) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
- "mmap(/dev/zero, MAP_SHARED, %uz) failed", shm->size);
- }
-
- if (close(fd) == -1) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
- "close(\"/dev/zero\") failed");
- }
-
- return (shm->addr == MAP_FAILED) ? NGX_ERROR : NGX_OK;
-}
-
-
-void
-ngx_shm_free(ngx_shm_t *shm)
-{
- if (munmap((void *) shm->addr, shm->size) == -1) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
- "munmap(%p, %uz) failed", shm->addr, shm->size);
- }
-}
-
-#elif (NGX_HAVE_SYSVSHM)
-
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
-
-ngx_int_t
-ngx_shm_alloc(ngx_shm_t *shm)
-{
- int id;
-
- id = shmget(IPC_PRIVATE, shm->size, (SHM_R|SHM_W|IPC_CREAT));
-
- if (id == -1) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
- "shmget(%uz) failed", shm->size);
- return NGX_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_CORE, shm->log, 0, "shmget id: %d", id);
-
- shm->addr = shmat(id, NULL, 0);
-
- if (shm->addr == (void *) -1) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno, "shmat() failed");
- }
-
- if (shmctl(id, IPC_RMID, NULL) == -1) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
- "shmctl(IPC_RMID) failed");
- }
-
- return (shm->addr == (void *) -1) ? NGX_ERROR : NGX_OK;
-}
-
-
-void
-ngx_shm_free(ngx_shm_t *shm)
-{
- if (shmdt(shm->addr) == -1) {
- ngx_log_error(NGX_LOG_ALERT, shm->log, ngx_errno,
- "shmdt(%p) failed", shm->addr);
- }
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.h
deleted file mode 100644
index 566a7d3300b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_shmem.h
+++ /dev/null
@@ -1,29 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_SHMEM_H_INCLUDED_
-#define _NGX_SHMEM_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-typedef struct {
- u_char *addr;
- size_t size;
- ngx_str_t name;
- ngx_log_t *log;
- ngx_uint_t exists; /* unsigned exists:1; */
-} ngx_shm_t;
-
-
-ngx_int_t ngx_shm_alloc(ngx_shm_t *shm);
-void ngx_shm_free(ngx_shm_t *shm);
-
-
-#endif /* _NGX_SHMEM_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.c
deleted file mode 100644
index 3978f655c04..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.c
+++ /dev/null
@@ -1,116 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-/*
- * ioctl(FIONBIO) sets a non-blocking mode with the single syscall
- * while fcntl(F_SETFL, O_NONBLOCK) needs to learn the current state
- * using fcntl(F_GETFL).
- *
- * ioctl() and fcntl() are syscalls at least in FreeBSD 2.x, Linux 2.2
- * and Solaris 7.
- *
- * ioctl() in Linux 2.4 and 2.6 uses BKL, however, fcntl(F_SETFL) uses it too.
- */
-
-
-#if (NGX_HAVE_FIONBIO)
-
-int
-ngx_nonblocking(ngx_socket_t s)
-{
- int nb;
-
- nb = 1;
-
- return ioctl(s, FIONBIO, &nb);
-}
-
-
-int
-ngx_blocking(ngx_socket_t s)
-{
- int nb;
-
- nb = 0;
-
- return ioctl(s, FIONBIO, &nb);
-}
-
-#endif
-
-
-#if (NGX_FREEBSD)
-
-int
-ngx_tcp_nopush(ngx_socket_t s)
-{
- int tcp_nopush;
-
- tcp_nopush = 1;
-
- return setsockopt(s, IPPROTO_TCP, TCP_NOPUSH,
- (const void *) &tcp_nopush, sizeof(int));
-}
-
-
-int
-ngx_tcp_push(ngx_socket_t s)
-{
- int tcp_nopush;
-
- tcp_nopush = 0;
-
- return setsockopt(s, IPPROTO_TCP, TCP_NOPUSH,
- (const void *) &tcp_nopush, sizeof(int));
-}
-
-#elif (NGX_LINUX)
-
-
-int
-ngx_tcp_nopush(ngx_socket_t s)
-{
- int cork;
-
- cork = 1;
-
- return setsockopt(s, IPPROTO_TCP, TCP_CORK,
- (const void *) &cork, sizeof(int));
-}
-
-
-int
-ngx_tcp_push(ngx_socket_t s)
-{
- int cork;
-
- cork = 0;
-
- return setsockopt(s, IPPROTO_TCP, TCP_CORK,
- (const void *) &cork, sizeof(int));
-}
-
-#else
-
-int
-ngx_tcp_nopush(ngx_socket_t s)
-{
- return 0;
-}
-
-
-int
-ngx_tcp_push(ngx_socket_t s)
-{
- return 0;
-}
-
-#endif
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.h
deleted file mode 100644
index fcc51533568..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_socket.h
+++ /dev/null
@@ -1,64 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_SOCKET_H_INCLUDED_
-#define _NGX_SOCKET_H_INCLUDED_
-
-
-#include <ngx_config.h>
-
-
-#define NGX_WRITE_SHUTDOWN SHUT_WR
-
-typedef int ngx_socket_t;
-
-#define ngx_socket socket
-#define ngx_socket_n "socket()"
-
-
-#if (NGX_HAVE_FIONBIO)
-
-int ngx_nonblocking(ngx_socket_t s);
-int ngx_blocking(ngx_socket_t s);
-
-#define ngx_nonblocking_n "ioctl(FIONBIO)"
-#define ngx_blocking_n "ioctl(!FIONBIO)"
-
-#else
-
-#define ngx_nonblocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) | O_NONBLOCK)
-#define ngx_nonblocking_n "fcntl(O_NONBLOCK)"
-
-#define ngx_blocking(s) fcntl(s, F_SETFL, fcntl(s, F_GETFL) & ~O_NONBLOCK)
-#define ngx_blocking_n "fcntl(!O_NONBLOCK)"
-
-#endif
-
-int ngx_tcp_nopush(ngx_socket_t s);
-int ngx_tcp_push(ngx_socket_t s);
-
-#if (NGX_LINUX)
-
-#define ngx_tcp_nopush_n "setsockopt(TCP_CORK)"
-#define ngx_tcp_push_n "setsockopt(!TCP_CORK)"
-
-#else
-
-#define ngx_tcp_nopush_n "setsockopt(TCP_NOPUSH)"
-#define ngx_tcp_push_n "setsockopt(!TCP_NOPUSH)"
-
-#endif
-
-
-#define ngx_shutdown_socket shutdown
-#define ngx_shutdown_socket_n "shutdown()"
-
-#define ngx_close_socket close
-#define ngx_close_socket_n "close() socket"
-
-
-#endif /* _NGX_SOCKET_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris.h
deleted file mode 100644
index 7b167d830ab..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris.h
+++ /dev/null
@@ -1,16 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_SOLARIS_H_INCLUDED_
-#define _NGX_SOLARIS_H_INCLUDED_
-
-
-ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in,
- off_t limit);
-
-
-#endif /* _NGX_SOLARIS_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_config.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_config.h
deleted file mode 100644
index ddfd984577e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_config.h
+++ /dev/null
@@ -1,110 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_SOLARIS_CONFIG_H_INCLUDED_
-#define _NGX_SOLARIS_CONFIG_H_INCLUDED_
-
-
-#ifndef _REENTRANT
-#define _REENTRANT
-#endif
-
-#define _FILE_OFFSET_BITS 64 /* must be before <sys/types.h> */
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <stdarg.h>
-#include <stddef.h> /* offsetof() */
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <errno.h>
-#include <string.h>
-#include <signal.h>
-#include <pwd.h>
-#include <grp.h>
-#include <dirent.h>
-#include <glob.h>
-#include <time.h>
-#include <sys/statvfs.h> /* statvfs() */
-
-#include <sys/filio.h> /* FIONBIO */
-#include <sys/uio.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include <sys/wait.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-#include <sched.h>
-
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netinet/tcp.h> /* TCP_NODELAY */
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <sys/un.h>
-
-#include <sys/systeminfo.h>
-#include <limits.h> /* IOV_MAX */
-#include <inttypes.h>
-#include <crypt.h>
-
-#define NGX_ALIGNMENT _MAX_ALIGNMENT
-
-#include <ngx_auto_config.h>
-
-
-#if (NGX_HAVE_POSIX_SEM)
-#include <semaphore.h>
-#endif
-
-
-#if (NGX_HAVE_POLL)
-#include <poll.h>
-#endif
-
-
-#if (NGX_HAVE_DEVPOLL)
-#include <sys/ioctl.h>
-#include <sys/devpoll.h>
-#endif
-
-
-#if (NGX_HAVE_EVENTPORT)
-#include <port.h>
-#endif
-
-
-#if (NGX_HAVE_SENDFILE)
-#include <sys/sendfile.h>
-#endif
-
-
-#define NGX_LISTEN_BACKLOG 511
-
-
-#ifndef NGX_HAVE_INHERITED_NONBLOCK
-#define NGX_HAVE_INHERITED_NONBLOCK 1
-#endif
-
-
-#ifndef NGX_HAVE_SO_SNDLOWAT
-/* setsockopt(SO_SNDLOWAT) returns ENOPROTOOPT */
-#define NGX_HAVE_SO_SNDLOWAT 0
-#endif
-
-
-#define NGX_HAVE_OS_SPECIFIC_INIT 1
-#define ngx_debug_init()
-
-
-extern char **environ;
-
-
-#endif /* _NGX_SOLARIS_CONFIG_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_init.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_init.c
deleted file mode 100644
index f2f3600dab1..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_init.c
+++ /dev/null
@@ -1,75 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-char ngx_solaris_sysname[20];
-char ngx_solaris_release[10];
-char ngx_solaris_version[50];
-
-
-static ngx_os_io_t ngx_solaris_io = {
- ngx_unix_recv,
- ngx_readv_chain,
- ngx_udp_unix_recv,
- ngx_unix_send,
-#if (NGX_HAVE_SENDFILE)
- ngx_solaris_sendfilev_chain,
- NGX_IO_SENDFILE
-#else
- ngx_writev_chain,
- 0
-#endif
-};
-
-
-ngx_int_t
-ngx_os_specific_init(ngx_log_t *log)
-{
- if (sysinfo(SI_SYSNAME, ngx_solaris_sysname, sizeof(ngx_solaris_sysname))
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "sysinfo(SI_SYSNAME) failed");
- return NGX_ERROR;
- }
-
- if (sysinfo(SI_RELEASE, ngx_solaris_release, sizeof(ngx_solaris_release))
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "sysinfo(SI_RELEASE) failed");
- return NGX_ERROR;
- }
-
- if (sysinfo(SI_VERSION, ngx_solaris_version, sizeof(ngx_solaris_version))
- == -1)
- {
- ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
- "sysinfo(SI_SYSNAME) failed");
- return NGX_ERROR;
- }
-
-
- ngx_os_io = ngx_solaris_io;
-
- return NGX_OK;
-}
-
-
-void
-ngx_os_specific_status(ngx_log_t *log)
-{
-
- ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
- ngx_solaris_sysname, ngx_solaris_release);
-
- ngx_log_error(NGX_LOG_NOTICE, log, 0, "version: %s",
- ngx_solaris_version);
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_sendfilev_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_sendfilev_chain.c
deleted file mode 100644
index ba328c810da..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_solaris_sendfilev_chain.c
+++ /dev/null
@@ -1,215 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#if (NGX_TEST_BUILD_SOLARIS_SENDFILEV)
-
-/* Solaris declarations */
-
-typedef struct sendfilevec {
- int sfv_fd;
- u_int sfv_flag;
- off_t sfv_off;
- size_t sfv_len;
-} sendfilevec_t;
-
-#define SFV_FD_SELF -2
-
-static ssize_t sendfilev(int fd, const struct sendfilevec *vec,
- int sfvcnt, size_t *xferred)
-{
- return -1;
-}
-
-ngx_chain_t *ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in,
- off_t limit);
-
-#endif
-
-
-#define NGX_SENDFILEVECS NGX_IOVS_PREALLOCATE
-
-
-ngx_chain_t *
-ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
-{
- int fd;
- u_char *prev;
- off_t size, send, prev_send, aligned, fprev;
- size_t sent;
- ssize_t n;
- ngx_int_t eintr;
- ngx_err_t err;
- sendfilevec_t *sfv, sfvs[NGX_SENDFILEVECS];
- ngx_array_t vec;
- ngx_event_t *wev;
- ngx_chain_t *cl;
-
- wev = c->write;
-
- if (!wev->ready) {
- return in;
- }
-
- if (!c->sendfile) {
- return ngx_writev_chain(c, in, limit);
- }
-
-
- /* the maximum limit size is the maximum size_t value - the page size */
-
- if (limit == 0 || limit > (off_t) (NGX_MAX_SIZE_T_VALUE - ngx_pagesize)) {
- limit = NGX_MAX_SIZE_T_VALUE - ngx_pagesize;
- }
-
-
- send = 0;
-
- vec.elts = sfvs;
- vec.size = sizeof(sendfilevec_t);
- vec.nalloc = NGX_SENDFILEVECS;
- vec.pool = c->pool;
-
- for ( ;; ) {
- fd = SFV_FD_SELF;
- prev = NULL;
- fprev = 0;
- sfv = NULL;
- eintr = 0;
- sent = 0;
- prev_send = send;
-
- vec.nelts = 0;
-
- /* create the sendfilevec and coalesce the neighbouring bufs */
-
- for (cl = in; cl && send < limit; cl = cl->next) {
-
- if (ngx_buf_special(cl->buf)) {
- continue;
- }
-
- if (ngx_buf_in_memory_only(cl->buf)) {
- fd = SFV_FD_SELF;
-
- size = cl->buf->last - cl->buf->pos;
-
- if (send + size > limit) {
- size = limit - send;
- }
-
- if (prev == cl->buf->pos) {
- sfv->sfv_len += (size_t) size;
-
- } else {
- if (vec.nelts >= IOV_MAX) {
- break;
- }
-
- sfv = ngx_array_push(&vec);
- if (sfv == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- sfv->sfv_fd = SFV_FD_SELF;
- sfv->sfv_flag = 0;
- sfv->sfv_off = (off_t) (uintptr_t) cl->buf->pos;
- sfv->sfv_len = (size_t) size;
- }
-
- prev = cl->buf->pos + (size_t) size;
- send += size;
-
- } else {
- prev = NULL;
-
- size = cl->buf->file_last - cl->buf->file_pos;
-
- if (send + size > limit) {
- size = limit - send;
-
- aligned = (cl->buf->file_pos + size + ngx_pagesize - 1)
- & ~((off_t) ngx_pagesize - 1);
-
- if (aligned <= cl->buf->file_last) {
- size = aligned - cl->buf->file_pos;
- }
- }
-
- if (fd == cl->buf->file->fd && fprev == cl->buf->file_pos) {
- sfv->sfv_len += (size_t) size;
-
- } else {
- if (vec.nelts >= IOV_MAX) {
- break;
- }
-
- sfv = ngx_array_push(&vec);
- if (sfv == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- fd = cl->buf->file->fd;
- sfv->sfv_fd = fd;
- sfv->sfv_flag = 0;
- sfv->sfv_off = cl->buf->file_pos;
- sfv->sfv_len = (size_t) size;
- }
-
- fprev = cl->buf->file_pos + size;
- send += size;
- }
- }
-
- n = sendfilev(c->fd, vec.elts, vec.nelts, &sent);
-
- if (n == -1) {
- err = ngx_errno;
-
- switch (err) {
- case NGX_EAGAIN:
- break;
-
- case NGX_EINTR:
- eintr = 1;
- break;
-
- default:
- wev->error = 1;
- ngx_connection_error(c, err, "sendfilev() failed");
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, err,
- "sendfilev() sent only %uz bytes", sent);
- }
-
- ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "sendfilev: %z %z", n, sent);
-
- c->sent += sent;
-
- in = ngx_handle_sent_chain(in, sent);
-
- if (eintr) {
- continue;
- }
-
- if (send - prev_send != (off_t) sent) {
- wev->ready = 0;
- return in;
- }
-
- if (send >= limit || in == NULL) {
- return in;
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_amd64.il b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_amd64.il
deleted file mode 100644
index dc454b20b2f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_amd64.il
+++ /dev/null
@@ -1,43 +0,0 @@
-/
-/ Copyright (C) Igor Sysoev
-/ Copyright (C) Nginx, Inc.
-/
-
-/ ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
-/ ngx_atomic_uint_t old, ngx_atomic_uint_t set);
-/
-/ the arguments are passed in %rdi, %rsi, %rdx
-/ the result is returned in the %rax
-
- .inline ngx_atomic_cmp_set,0
- movq %rsi, %rax
- lock
- cmpxchgq %rdx, (%rdi)
- setz %al
- movzbq %al, %rax
- .end
-
-
-/ ngx_atomic_int_t ngx_atomic_fetch_add(ngx_atomic_t *value,
-/ ngx_atomic_int_t add);
-/
-/ the arguments are passed in %rdi, %rsi
-/ the result is returned in the %rax
-
- .inline ngx_atomic_fetch_add,0
- movq %rsi, %rax
- lock
- xaddq %rax, (%rdi)
- .end
-
-
-/ ngx_cpu_pause()
-/
-/ the "rep; nop" is used instead of "pause" to avoid the "[ PAUSE ]" hardware
-/ capability added by linker because Solaris/amd64 does not know about it:
-/
-/ ld.so.1: nginx: fatal: hardware capability unsupported: 0x2000 [ PAUSE ]
-
- .inline ngx_cpu_pause,0
- rep; nop
- .end
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_atomic_sparc64.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_atomic_sparc64.h
deleted file mode 100644
index 5f280553c9e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_atomic_sparc64.h
+++ /dev/null
@@ -1,61 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#if (NGX_PTR_SIZE == 4)
-#define NGX_CASA ngx_casa
-#else
-#define NGX_CASA ngx_casxa
-#endif
-
-
-ngx_atomic_uint_t
-ngx_casa(ngx_atomic_uint_t set, ngx_atomic_uint_t old, ngx_atomic_t *lock);
-
-ngx_atomic_uint_t
-ngx_casxa(ngx_atomic_uint_t set, ngx_atomic_uint_t old, ngx_atomic_t *lock);
-
-/* the code in src/os/unix/ngx_sunpro_sparc64.il */
-
-
-static ngx_inline ngx_atomic_uint_t
-ngx_atomic_cmp_set(ngx_atomic_t *lock, ngx_atomic_uint_t old,
- ngx_atomic_uint_t set)
-{
- set = NGX_CASA(set, old, lock);
-
- return (set == old);
-}
-
-
-static ngx_inline ngx_atomic_int_t
-ngx_atomic_fetch_add(ngx_atomic_t *value, ngx_atomic_int_t add)
-{
- ngx_atomic_uint_t old, res;
-
- old = *value;
-
- for ( ;; ) {
-
- res = old + add;
-
- res = NGX_CASA(res, old, value);
-
- if (res == old) {
- return res;
- }
-
- old = res;
- }
-}
-
-
-#define ngx_memory_barrier() \
- __asm (".volatile"); \
- __asm ("membar #LoadLoad | #LoadStore | #StoreStore | #StoreLoad"); \
- __asm (".nonvolatile")
-
-#define ngx_cpu_pause()
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_sparc64.il b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_sparc64.il
deleted file mode 100644
index bdeef612507..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_sparc64.il
+++ /dev/null
@@ -1,36 +0,0 @@
-/
-/ Copyright (C) Igor Sysoev
-/ Copyright (C) Nginx, Inc.
-/
-
-
-/ "casa [%o2] 0x80, %o1, %o0" and
-/ "casxa [%o2] 0x80, %o1, %o0" do the following:
-/
-/ if ([%o2] == %o1) {
-/ swap(%o0, [%o2]);
-/ } else {
-/ %o0 = [%o2];
-/ }
-
-
-/ ngx_atomic_uint_t ngx_casa(ngx_atomic_uint_t set, ngx_atomic_uint_t old,
-/ ngx_atomic_t *lock);
-/
-/ the arguments are passed in the %o0, %o1, %o2
-/ the result is returned in the %o0
-
- .inline ngx_casa,0
- casa [%o2] 0x80, %o1, %o0
- .end
-
-
-/ ngx_atomic_uint_t ngx_casxa(ngx_atomic_uint_t set, ngx_atomic_uint_t old,
-/ ngx_atomic_t *lock);
-/
-/ the arguments are passed in the %o0, %o1, %o2
-/ the result is returned in the %o0
-
- .inline ngx_casxa,0
- casxa [%o2] 0x80, %o1, %o0
- .end
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_x86.il b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_x86.il
deleted file mode 100644
index fd1cc00492e..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_sunpro_x86.il
+++ /dev/null
@@ -1,44 +0,0 @@
-/
-/ Copyright (C) Igor Sysoev
-/ Copyright (C) Nginx, Inc.
-/
-
-/ ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
-/ ngx_atomic_uint_t old, ngx_atomic_uint_t set);
-/
-/ the arguments are passed on stack (%esp), 4(%esp), 8(%esp)
-
- .inline ngx_atomic_cmp_set,0
- movl (%esp), %ecx
- movl 4(%esp), %eax
- movl 8(%esp), %edx
- lock
- cmpxchgl %edx, (%ecx)
- setz %al
- movzbl %al, %eax
- .end
-
-
-/ ngx_atomic_int_t ngx_atomic_fetch_add(ngx_atomic_t *value,
-/ ngx_atomic_int_t add);
-/
-/ the arguments are passed on stack (%esp), 4(%esp)
-
- .inline ngx_atomic_fetch_add,0
- movl (%esp), %ecx
- movl 4(%esp), %eax
- lock
- xaddl %eax, (%ecx)
- .end
-
-
-/ ngx_cpu_pause()
-/
-/ the "rep; nop" is used instead of "pause" to avoid the "[ PAUSE ]" hardware
-/ capability added by linker because Solaris/i386 does not know about it:
-/
-/ ld.so.1: nginx: fatal: hardware capability unsupported: 0x2000 [ PAUSE ]
-
- .inline ngx_cpu_pause,0
- rep; nop
- .end
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_thread.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_thread.h
deleted file mode 100644
index 49c5d5656a7..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_thread.h
+++ /dev/null
@@ -1,128 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_THREAD_H_INCLUDED_
-#define _NGX_THREAD_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-#if (NGX_THREADS)
-
-#define NGX_MAX_THREADS 128
-
-#if (NGX_USE_RFORK)
-#include <ngx_freebsd_rfork_thread.h>
-
-
-#else /* use pthreads */
-
-#include <pthread.h>
-
-typedef pthread_t ngx_tid_t;
-
-#define ngx_thread_self() pthread_self()
-#define ngx_log_tid (int) ngx_thread_self()
-
-#if (NGX_FREEBSD) && !(NGX_LINUXTHREADS)
-#define NGX_TID_T_FMT "%p"
-#else
-#define NGX_TID_T_FMT "%d"
-#endif
-
-
-typedef pthread_key_t ngx_tls_key_t;
-
-#define ngx_thread_key_create(key) pthread_key_create(key, NULL)
-#define ngx_thread_key_create_n "pthread_key_create()"
-#define ngx_thread_set_tls pthread_setspecific
-#define ngx_thread_set_tls_n "pthread_setspecific()"
-#define ngx_thread_get_tls pthread_getspecific
-
-
-#define NGX_MUTEX_LIGHT 0
-
-typedef struct {
- pthread_mutex_t mutex;
- ngx_log_t *log;
-} ngx_mutex_t;
-
-typedef struct {
- pthread_cond_t cond;
- ngx_log_t *log;
-} ngx_cond_t;
-
-#define ngx_thread_sigmask pthread_sigmask
-#define ngx_thread_sigmask_n "pthread_sigmask()"
-
-#define ngx_thread_join(t, p) pthread_join(t, p)
-
-#define ngx_setthrtitle(n)
-
-
-
-ngx_int_t ngx_mutex_trylock(ngx_mutex_t *m);
-void ngx_mutex_lock(ngx_mutex_t *m);
-void ngx_mutex_unlock(ngx_mutex_t *m);
-
-#endif
-
-
-#define ngx_thread_volatile volatile
-
-
-typedef struct {
- ngx_tid_t tid;
- ngx_cond_t *cv;
- ngx_uint_t state;
-} ngx_thread_t;
-
-#define NGX_THREAD_FREE 1
-#define NGX_THREAD_BUSY 2
-#define NGX_THREAD_EXIT 3
-#define NGX_THREAD_DONE 4
-
-extern ngx_int_t ngx_threads_n;
-extern volatile ngx_thread_t ngx_threads[NGX_MAX_THREADS];
-
-
-typedef void * ngx_thread_value_t;
-
-ngx_int_t ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle);
-ngx_err_t ngx_create_thread(ngx_tid_t *tid,
- ngx_thread_value_t (*func)(void *arg), void *arg, ngx_log_t *log);
-
-ngx_mutex_t *ngx_mutex_init(ngx_log_t *log, ngx_uint_t flags);
-void ngx_mutex_destroy(ngx_mutex_t *m);
-
-
-ngx_cond_t *ngx_cond_init(ngx_log_t *log);
-void ngx_cond_destroy(ngx_cond_t *cv);
-ngx_int_t ngx_cond_wait(ngx_cond_t *cv, ngx_mutex_t *m);
-ngx_int_t ngx_cond_signal(ngx_cond_t *cv);
-
-
-#else /* !NGX_THREADS */
-
-#define ngx_thread_volatile
-
-#define ngx_log_tid 0
-#define NGX_TID_T_FMT "%d"
-
-#define ngx_mutex_trylock(m) NGX_OK
-#define ngx_mutex_lock(m)
-#define ngx_mutex_unlock(m)
-
-#define ngx_cond_signal(cv)
-
-#define ngx_thread_main() 1
-
-#endif
-
-
-#endif /* _NGX_THREAD_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.c
deleted file mode 100644
index cc760b2eb01..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.c
+++ /dev/null
@@ -1,104 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-/*
- * FreeBSD does not test /etc/localtime change, however, we can workaround it
- * by calling tzset() with TZ and then without TZ to update timezone.
- * The trick should work since FreeBSD 2.1.0.
- *
- * Linux does not test /etc/localtime change in localtime(),
- * but may stat("/etc/localtime") several times in every strftime(),
- * therefore we use it to update timezone.
- *
- * Solaris does not test /etc/TIMEZONE change too and no workaround available.
- */
-
-void
-ngx_timezone_update(void)
-{
-#if (NGX_FREEBSD)
-
- if (getenv("TZ")) {
- return;
- }
-
- putenv("TZ=UTC");
-
- tzset();
-
- unsetenv("TZ");
-
- tzset();
-
-#elif (NGX_LINUX)
- time_t s;
- struct tm *t;
- char buf[4];
-
- s = time(0);
-
- t = localtime(&s);
-
- strftime(buf, 4, "%H", t);
-
-#endif
-}
-
-
-void
-ngx_localtime(time_t s, ngx_tm_t *tm)
-{
-#if (NGX_HAVE_LOCALTIME_R)
- (void) localtime_r(&s, tm);
-
-#else
- ngx_tm_t *t;
-
- t = localtime(&s);
- *tm = *t;
-
-#endif
-
- tm->ngx_tm_mon++;
- tm->ngx_tm_year += 1900;
-}
-
-
-void
-ngx_libc_localtime(time_t s, struct tm *tm)
-{
-#if (NGX_HAVE_LOCALTIME_R)
- (void) localtime_r(&s, tm);
-
-#else
- struct tm *t;
-
- t = localtime(&s);
- *tm = *t;
-
-#endif
-}
-
-
-void
-ngx_libc_gmtime(time_t s, struct tm *tm)
-{
-#if (NGX_HAVE_LOCALTIME_R)
- (void) gmtime_r(&s, tm);
-
-#else
- struct tm *t;
-
- t = gmtime(&s);
- *tm = *t;
-
-#endif
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.h
deleted file mode 100644
index c128c9aa043..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_time.h
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_TIME_H_INCLUDED_
-#define _NGX_TIME_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-typedef ngx_rbtree_key_t ngx_msec_t;
-typedef ngx_rbtree_key_int_t ngx_msec_int_t;
-
-typedef struct tm ngx_tm_t;
-
-#define ngx_tm_sec tm_sec
-#define ngx_tm_min tm_min
-#define ngx_tm_hour tm_hour
-#define ngx_tm_mday tm_mday
-#define ngx_tm_mon tm_mon
-#define ngx_tm_year tm_year
-#define ngx_tm_wday tm_wday
-#define ngx_tm_isdst tm_isdst
-
-#define ngx_tm_sec_t int
-#define ngx_tm_min_t int
-#define ngx_tm_hour_t int
-#define ngx_tm_mday_t int
-#define ngx_tm_mon_t int
-#define ngx_tm_year_t int
-#define ngx_tm_wday_t int
-
-
-#if (NGX_HAVE_GMTOFF)
-#define ngx_tm_gmtoff tm_gmtoff
-#define ngx_tm_zone tm_zone
-#endif
-
-
-#if (NGX_SOLARIS)
-
-#define ngx_timezone(isdst) (- (isdst ? altzone : timezone) / 60)
-
-#else
-
-#define ngx_timezone(isdst) (- (isdst ? timezone + 3600 : timezone) / 60)
-
-#endif
-
-
-void ngx_timezone_update(void);
-void ngx_localtime(time_t s, ngx_tm_t *tm);
-void ngx_libc_localtime(time_t s, struct tm *tm);
-void ngx_libc_gmtime(time_t s, struct tm *tm);
-
-#define ngx_gettimeofday(tp) (void) gettimeofday(tp, NULL);
-#define ngx_msleep(ms) (void) usleep(ms * 1000)
-#define ngx_sleep(s) (void) sleep(s)
-
-
-#endif /* _NGX_TIME_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_udp_recv.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_udp_recv.c
deleted file mode 100644
index 1c807a08bb2..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_udp_recv.c
+++ /dev/null
@@ -1,115 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-#if (NGX_HAVE_KQUEUE)
-
-ssize_t
-ngx_udp_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
-{
- ssize_t n;
- ngx_err_t err;
- ngx_event_t *rev;
-
- rev = c->read;
-
- do {
- n = recv(c->fd, buf, size, 0);
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "recv: fd:%d %d of %d", c->fd, n, size);
-
- if (n >= 0) {
- if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {
- rev->available -= n;
-
- /*
- * rev->available may be negative here because some additional
- * bytes may be received between kevent() and recv()
- */
-
- if (rev->available <= 0) {
- rev->ready = 0;
- rev->available = 0;
- }
- }
-
- return n;
- }
-
- err = ngx_socket_errno;
-
- if (err == NGX_EAGAIN || err == NGX_EINTR) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "recv() not ready");
- n = NGX_AGAIN;
-
- } else {
- n = ngx_connection_error(c, err, "recv() failed");
- break;
- }
-
- } while (err == NGX_EINTR);
-
- rev->ready = 0;
-
- if (n == NGX_ERROR) {
- rev->error = 1;
- }
-
- return n;
-}
-
-#else /* ! NGX_HAVE_KQUEUE */
-
-ssize_t
-ngx_udp_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
-{
- ssize_t n;
- ngx_err_t err;
- ngx_event_t *rev;
-
- rev = c->read;
-
- do {
- n = recv(c->fd, buf, size, 0);
-
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0,
- "recv: fd:%d %d of %d", c->fd, n, size);
-
- if (n >= 0) {
- return n;
- }
-
- err = ngx_socket_errno;
-
- if (err == NGX_EAGAIN || err == NGX_EINTR) {
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "recv() not ready");
- n = NGX_AGAIN;
-
- } else {
- n = ngx_connection_error(c, err, "recv() failed");
- break;
- }
-
- } while (err == NGX_EINTR);
-
- rev->ready = 0;
-
- if (n == NGX_ERROR) {
- rev->error = 1;
- }
-
- return n;
-}
-
-#endif /* NGX_HAVE_KQUEUE */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.c
deleted file mode 100644
index 7a71203cb8f..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.c
+++ /dev/null
@@ -1,108 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-/*
- * Solaris has thread-safe crypt()
- * Linux has crypt_r(); "struct crypt_data" is more than 128K
- * FreeBSD needs the mutex to protect crypt()
- *
- * TODO:
- * ngx_crypt_init() to init mutex
- */
-
-
-#if (NGX_CRYPT)
-
-#if (NGX_HAVE_GNU_CRYPT_R)
-
-ngx_int_t
-ngx_libc_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
-{
- char *value;
- size_t len;
- struct crypt_data cd;
-
- cd.initialized = 0;
- /* work around the glibc bug */
- cd.current_salt[0] = ~salt[0];
-
- value = crypt_r((char *) key, (char *) salt, &cd);
-
- if (value) {
- len = ngx_strlen(value) + 1;
-
- *encrypted = ngx_pnalloc(pool, len);
- if (*encrypted == NULL) {
- return NGX_ERROR;
- }
-
- ngx_memcpy(*encrypted, value, len);
- return NGX_OK;
- }
-
- ngx_log_error(NGX_LOG_CRIT, pool->log, ngx_errno, "crypt_r() failed");
-
- return NGX_ERROR;
-}
-
-#else
-
-ngx_int_t
-ngx_libc_crypt(ngx_pool_t *pool, u_char *key, u_char *salt, u_char **encrypted)
-{
- char *value;
- size_t len;
- ngx_err_t err;
-
-#if (NGX_THREADS && NGX_NONREENTRANT_CRYPT)
-
- /* crypt() is a time consuming function, so we only try to lock */
-
- if (ngx_mutex_trylock(ngx_crypt_mutex) != NGX_OK) {
- return NGX_AGAIN;
- }
-
-#endif
-
- value = crypt((char *) key, (char *) salt);
-
- if (value) {
- len = ngx_strlen(value) + 1;
-
- *encrypted = ngx_pnalloc(pool, len);
- if (*encrypted == NULL) {
-#if (NGX_THREADS && NGX_NONREENTRANT_CRYPT)
- ngx_mutex_unlock(ngx_crypt_mutex);
-#endif
- return NGX_ERROR;
- }
-
- ngx_memcpy(*encrypted, value, len);
-#if (NGX_THREADS && NGX_NONREENTRANT_CRYPT)
- ngx_mutex_unlock(ngx_crypt_mutex);
-#endif
- return NGX_OK;
- }
-
- err = ngx_errno;
-
-#if (NGX_THREADS && NGX_NONREENTRANT_CRYPT)
- ngx_mutex_unlock(ngx_crypt_mutex);
-#endif
-
- ngx_log_error(NGX_LOG_CRIT, pool->log, err, "crypt() failed");
-
- return NGX_ERROR;
-}
-
-#endif
-
-#endif /* NGX_CRYPT */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.h b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.h
deleted file mode 100644
index 6e82204f4d1..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_user.h
+++ /dev/null
@@ -1,24 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#ifndef _NGX_USER_H_INCLUDED_
-#define _NGX_USER_H_INCLUDED_
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-
-
-typedef uid_t ngx_uid_t;
-typedef gid_t ngx_gid_t;
-
-
-ngx_int_t ngx_libc_crypt(ngx_pool_t *pool, u_char *key, u_char *salt,
- u_char **encrypted);
-
-
-#endif /* _NGX_USER_H_INCLUDED_ */
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_writev_chain.c b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_writev_chain.c
deleted file mode 100644
index 95af2da7a34..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/ngx_writev_chain.c
+++ /dev/null
@@ -1,149 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <ngx_config.h>
-#include <ngx_core.h>
-#include <ngx_event.h>
-
-
-ngx_chain_t *
-ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
-{
- u_char *prev;
- ssize_t n, size, sent;
- off_t send, prev_send;
- ngx_uint_t eintr;
- ngx_err_t err;
- ngx_array_t vec;
- ngx_chain_t *cl;
- ngx_event_t *wev;
- struct iovec *iov, iovs[NGX_IOVS_PREALLOCATE];
-
- wev = c->write;
-
- if (!wev->ready) {
- return in;
- }
-
-#if (NGX_HAVE_KQUEUE)
-
- if ((ngx_event_flags & NGX_USE_KQUEUE_EVENT) && wev->pending_eof) {
- (void) ngx_connection_error(c, wev->kq_errno,
- "kevent() reported about an closed connection");
- wev->error = 1;
- return NGX_CHAIN_ERROR;
- }
-
-#endif
-
- /* the maximum limit size is the maximum size_t value - the page size */
-
- if (limit == 0 || limit > (off_t) (NGX_MAX_SIZE_T_VALUE - ngx_pagesize)) {
- limit = NGX_MAX_SIZE_T_VALUE - ngx_pagesize;
- }
-
- send = 0;
-
- vec.elts = iovs;
- vec.size = sizeof(struct iovec);
- vec.nalloc = NGX_IOVS_PREALLOCATE;
- vec.pool = c->pool;
-
- for ( ;; ) {
- prev = NULL;
- iov = NULL;
- eintr = 0;
- prev_send = send;
-
- vec.nelts = 0;
-
- /* create the iovec and coalesce the neighbouring bufs */
-
- for (cl = in; cl && send < limit; cl = cl->next) {
-
- if (ngx_buf_special(cl->buf)) {
- continue;
- }
-
-#if 1
- if (!ngx_buf_in_memory(cl->buf)) {
- ngx_debug_point();
- }
-#endif
-
- size = cl->buf->last - cl->buf->pos;
-
- if (send + size > limit) {
- size = (ssize_t) (limit - send);
- }
-
- if (prev == cl->buf->pos) {
- iov->iov_len += size;
-
- } else {
- if (vec.nelts >= IOV_MAX) {
- break;
- }
-
- iov = ngx_array_push(&vec);
- if (iov == NULL) {
- return NGX_CHAIN_ERROR;
- }
-
- iov->iov_base = (void *) cl->buf->pos;
- iov->iov_len = size;
- }
-
- prev = cl->buf->pos + size;
- send += size;
- }
-
- n = writev(c->fd, vec.elts, vec.nelts);
-
- if (n == -1) {
- err = ngx_errno;
-
- switch (err) {
- case NGX_EAGAIN:
- break;
-
- case NGX_EINTR:
- eintr = 1;
- break;
-
- default:
- wev->error = 1;
- (void) ngx_connection_error(c, err, "writev() failed");
- return NGX_CHAIN_ERROR;
- }
-
- ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err,
- "writev() not ready");
- }
-
- sent = n > 0 ? n : 0;
-
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "writev: %z", sent);
-
- c->sent += sent;
-
- in = ngx_handle_sent_chain(in, sent);
-
- if (eintr) {
- continue;
- }
-
- if (send - prev_send != sent) {
- wev->ready = 0;
- return in;
- }
-
- if (send >= limit || in == NULL) {
- return in;
- }
- }
-}
diff --git a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/rfork_thread.S b/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/rfork_thread.S
deleted file mode 100644
index e570349f93b..00000000000
--- a/storage/mroonga/vendor/groonga/vendor/nginx-1.7.6/src/os/unix/rfork_thread.S
+++ /dev/null
@@ -1,73 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) Nginx, Inc.
- */
-
-
-#include <sys/syscall.h>
-#include <machine/asm.h>
-
-/*
- * rfork_thread(3) - rfork_thread(flags, stack, func, arg);
- */
-
-#define KERNCALL int $0x80
-
-ENTRY(rfork_thread)
- push %ebp
- mov %esp, %ebp
- push %esi
-
- mov 12(%ebp), %esi # the thread stack address
-
- sub $4, %esi
- mov 20(%ebp), %eax # the thread argument
- mov %eax, (%esi)
-
- sub $4, %esi
- mov 16(%ebp), %eax # the thread start address
- mov %eax, (%esi)
-
- push 8(%ebp) # rfork(2) flags
- push $0
- mov $SYS_rfork, %eax
- KERNCALL
- jc error
-
- cmp $0, %edx
- jne child
-
-parent:
- add $8, %esp
- pop %esi
- leave
- ret
-
-child:
- mov %esi, %esp
- pop %eax
- call *%eax # call a thread start address ...
- add $4, %esp
-
- push %eax
- push $0
- mov $SYS_exit, %eax # ... and exit(2) after a thread would return
- KERNCALL
-
-error:
- add $8, %esp
- pop %esi
- leave
- PIC_PROLOGUE
-
- /* libc's cerror: jmp PIC_PLT(HIDENAME(cerror)) */
-
- push %eax
- call PIC_PLT(CNAME(__error))
- pop %ecx
- PIC_EPILOGUE
- mov %ecx, (%eax)
- mov $-1, %eax
- mov $-1, %edx
- ret